1 2006-10-04 Martin Baulig <martin@ximian.com>
3 * generic.cs (GenericMethod): Don't make this abstract.
4 (Constraints.Clone): Added dummy implementation.
6 2006-10-04 Raja R Harinath <harinath@gmail.com>
9 * namespace.cs (LookForAnyGenericType): Avoid nullref on
10 'declspaces'. Avoid allocating arrays willy-nilly.
13 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
14 cases out of the switch.
16 2006-09-28 Marek Safar <marek.safar@seznam.cz>
18 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
19 message when non-generic type is used with the type arguments.
20 * expression.cs: Updated.
22 2006-09-28 Raja R Harinath <rharinath@novell.com>
25 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
26 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
27 Change semantics slightly. Don't insist on having only one
28 temporary EmptyExpression -- just throttle the creation of new ones.
31 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
32 non-interfaces too. If no methods are found, don't try to create
35 2006-09-28 Marek Safar <marek.safar@seznam.cz>
37 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
40 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
41 us produce better error message.
43 2006-09-27 Marek Safar <marek.safar@seznam.cz>
45 * expression.cs (Binary.ResolveOperator): Warn about a side effect
48 * report.cs: A new warning added.
50 2006-09-27 Martin Baulig <martin@ximian.com>
53 (InternalErrorException): Added overloaded ctor taking a params array.
55 2006-09-26 Marek Safar <marek.safar@seznam.cz>
57 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
58 Fixed the cases when same error was reported twice.
60 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
61 now report symbol information.
63 2006-09-25 Martin Baulig <martin@ximian.com>
65 * class.cs: Completely unified with the gmcs version.
67 2006-09-25 Martin Baulig <martin@ximian.com>
69 * typemanager.cs (TypeManager.IsNullableType): New public function.
70 (TypeManager.IsNullableTypeOf): Likewise.
71 (TypeManager.IsNullableValueType): Likewise.
73 * class.cs (MethodCore): Added the `GenericMethod' argument from
74 gmcs and also unified all classes derived from `MethodCore' with gmcs.
76 2006-09-24 Raja R Harinath <harinath@gmail.com>
78 * convert.cs: Unify with gmcs version.
80 2006-09-24 Marek Safar <marek.safar@seznam.cz>
82 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
85 * report.cs: New warning.
87 2006-09-24 Marek Safar <marek.safar@seznam.cz>
89 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
90 for anonymous block with out argument.
92 2006-09-24 Marek Safar <marek.safar@seznam.cz>
94 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
95 not used private events only.
97 2006-09-23 Marek Safar <marek.safar@seznam.cz>
99 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
101 * const.cs (Const.Define): Check for constant type.
102 (Const.IsConstantTypeValid): Looks for valid constant types.
104 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
106 * ecore.cs (EmptyConstantCast): New common class for all constant based
109 * expression.cs (Is.DoResolve): Handle null constant especially.
110 (New.DoResolve): Check for new void().
111 (MemberAccess.DoResolve): Cope with all kind of nulls.
113 * literal.cs (NullConstant): Uses EmptyConstantCast.
114 (NullDefault): Based on EmptyConstantCast.
115 (NullLiteral): Uses EmptyConstantCast.
117 * statement.cs (Block.ResolveMeta): Check for constant type.
119 2006-09-22 Martin Baulig <martin@ximian.com>
121 * delegate.cs, attribute.cs: Merged with the gmcs versions.
123 2006-09-22 Raja R Harinath <rharinath@novell.com>
125 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
129 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
130 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
133 2006-09-22 Martin Baulig <martin@ximian.com>
135 * ecore.cs: Merged with the gmcs version.
137 * generic.cs (ConstructedType): New dummy class.
138 (TypeArguments): Don't make this abstract.
141 (TypeManager.IsGenericTypeDefinition): New method.
142 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
144 2006-09-22 Raja R Harinath <rharinath@novell.com>
146 * expression.cs (ComposedCast): Check for arrays of TypedReference
147 before creating the type, not after.
149 2006-09-21 Marek Safar <marek.safar@seznam.cz>
151 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
154 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
155 when constant must be implicitly convertible.
157 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
159 * ecore.cs (NullCast): Derives from NullConstant.
161 * expression.cs (Is.DoResolve): Removed useless variables.
162 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
163 (New.Constantify): Add enum support.
164 (MemberAccess.DoResolve): Add warning when accessing null constant or
167 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
170 * literal.cs (NullConstant): New abstract class with common
171 functionality for all null specializations.
172 (NullDefault): Represents default(X) when result can be
174 (NullLiteral): Updated.
176 * report.cs: Add new warning.
178 2006-09-21 Martin Baulig <martin@ximian.com>
180 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
182 2006-09-21 Martin Baulig <martin@ximian.com>
184 * generic.cs (GenericConstraints): New dummy class.
185 (Constraints): Likewise.
186 (TypeParameter): Likewise.
187 (TypeParameterName): Likewise.
188 (GenericMethod): Likewise.
190 * typemanager.cs (TypeManager.GetGenericArguments): New method.
192 * decl.cs: Merged with the gmcs version.
194 2006-09-21 Raja R Harinath <rharinath@novell.com>
196 * generic.cs (TypeParameter): Implement IMemberContainer.
197 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
199 * rootcontext.cs: Unify with gmcs version.
201 * report.cs: Unify with gmcs version.
202 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
203 from gmcs/generics.cs.
204 * generics.cs (TypeParameter): New dummy class.
206 * support.cs: Unify with gmcs version.
208 2006-09-20 Raja R Harinath <rharinath@novell.com>
210 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
211 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
213 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
214 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
215 * mcs.exe.sources: Add generic.cs.
217 * codegen.cs: Unify with gmcs version.
219 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
220 (EmitContext): Add GenericDeclContainer implementation.
221 * decl.cs (MemberCore, DeclSpace): Likewise.
222 * namespace.cs: Remove #ifdef GMCS_SOURCE.
224 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
225 MCS TypeManager has a corresponding dummy method.
227 2006-09-19 Martin Baulig <martin@ximian.com>
229 * expression.cs: Completely merged with the gmcs version.
231 2006-09-19 Martin Baulig <martin@ximian.com>
233 * expression.cs (Invocation): Merged with the gmcs version.
234 (ArrayAccess.GetStoreOpcode): Likewise.
236 2006-09-19 Martin Baulig <martin@ximian.com>
239 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
240 (TypeManager.IsGenericMethodDefinition): Likewise.
242 2006-09-19 Martin Baulig <martin@ximian.com>
245 (TypeManager.IsEqual): Moved the gmcs implementation here.
246 (TypeManager.DropGenericTypeArguments): Likewise.
247 (TypeManager.DropGenericMethodArguments): Likewise.
248 (TypeManager.GetTypeArguments): Moved here from gmcs.
249 (TypeManager.HasGenericArguments): Likewise.
251 2006-09-19 Martin Baulig <martin@ximian.com>
253 * expression.cs (Binary): Merged with the gmcs version.
255 2006-09-19 Martin Baulig <martin@ximian.com>
257 * expression.cs (Probe, As, Is): Merged with the gmcs version.
259 2006-09-19 Martin Baulig <martin@ximian.com>
261 * typemanager.cs: Merged with the gmcs version.
263 2006-09-16 Raja R Harinath <rharinath@novell.com>
265 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
266 * driver.cs: Likewise.
268 2006-09-16 Marek Safar <marek.safar@seznam.cz>
271 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
272 only if parent type is class.
273 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
276 2006-09-15 Marek Safar <marek.safar@seznam.cz>
279 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
281 * typemanager.cs(CSharpName): Converts NullType to null.
283 2006-09-15 Martin Baulig <martin@ximian.com>
286 (TypeManager.GetMethodName): Added mcs implementation.
287 (TypeManager.IsEqual): Likewise.
290 (SimpleName.RemoveGenericArity): Added dummy implementation.
292 * pending.cs: Merged with the gmcs version.
294 2006-09-15 Martin Baulig <martin@ximian.com>
296 * statement.cs: Merge with the gmcs version.
298 2006-09-15 Martin Baulig <martin@ximian.com>
300 * statement.cs (Switch): Merge with the gmcs implementation
301 (without nullables), which is newer.
303 2006-09-15 Martin Baulig <martin@ximian.com>
305 * statement.cs (Block.Variables): Make this public.
306 (ToplevelBlock.Parameters): Make this a property.
307 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
309 2006-09-15 Martin Baulig <martin@ximian.com>
311 * namespace.cs: Merge with the gmcs version.
313 2006-09-15 Martin Baulig <martin@ximian.com>
315 * decl.cs (MemberName): Minor code cleanups.
317 2006-09-15 Martin Baulig <martin@ximian.com>
319 * parameter.cs: Merge with the gmcs version.
321 2006-09-15 Martin Baulig <martin@ximian.com>
323 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
326 2006-09-15 Martin Baulig <martin@ximian.com>
328 * flowanalysis.cs: Merged from GMCS; added the generics code into
329 a `GMCS_SOURCE' conditional so we can share this file.
331 2006-09-08 Martin Baulig <martin@ximian.com>
333 * typemanager.cs (TypeManager.interlocked_type): New public field.
334 (TypeManager.int_interlocked_compare-exchange): New public field.
335 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
336 enumerator types here and call InitGenericCoreTypes().
337 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
338 after calling InitEnumUnderlyingTypes().
341 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
342 `classes_second_stage'.
344 2006-09-14 Marek Safar <marek.safar@seznam.cz>
346 * assign.cs, ecore.cs, expression.cs: Share error message text.
347 * class.cs (FieldMember.Define): Check for varible of static type.
348 * driver.cs (LoadAssembly): Uses error output for errors.
349 * statement.cs: Updated.
351 2006-09-08 Marek Safar <marek.safar@seznam.cz>
353 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
356 2006-09-07 Martin Baulig <martin@ximian.com>
359 (MainDriver): Revert r62663 from Marek; see #70506 for details.
361 2006-08-29 Miguel de Icaza <miguel@novell.com>
363 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
365 2006-08-17 Miguel de Icaza <miguel@novell.com>
367 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
368 #52019 and #79064, the use of the \uXXXX sequence in source code
369 to represent unicode characters.
371 2006-08-15 Marek Safar <marek.safar@seznam.cz>
373 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
375 * class.cs, ecore.cs, statement.cs: Merged to one error message.
377 2006-08-13 Miguel de Icaza <miguel@novell.com>
379 * assign.cs: Catch attempts to assign to a method groups in += and
382 2006-08-13 Marek Safar <marek.safar@seznam.cz>
385 * cs-parser.jay: Don't destroy current array type by typeof of array's.
387 2006-08-12 Marek Safar <marek.safar@seznam.cz>
389 * class.cs (Method.Define): Issue a warning when generic method looks like
391 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
394 2006-08-09 Marek Safar <marek.safar@seznam.cz>
396 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
398 * decl.cs (MemberCache.FindMembers): When container is interface we need to
399 search all base interfaces as a member can be ambiguous.
400 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
401 Constructor member type filter.
402 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
403 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
404 reporting for returned memberinfos.
405 * report.cs: Updated.
406 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
407 version to work on all runtimes.
408 (TypeManager.RealMemberLookup): Removed members filtering.
410 2006-08-08 Raja R Harinath <rharinath@novell.com>
412 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
413 (PropertyExpr.EmitAssign): Likewise.
414 * expression.cs (Indirection.EmitAssign): Likewise.
415 (LocalVariableReference.EmitAssign): Likewise.
416 (ParameterReference.EmitAssign): Likewise.
417 (Invocation.EmitArguments): Likewise.
418 (ArrayAccess.EmitAssign): Likewise.
419 (IndexerAccess.EmitAssign): Likewise.
420 (This.EmitAssign): Likewise.
421 (ConditionalLogicalOperator.Emit): Likewise.
424 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
425 instead of ArrayList. If the hashtable has a LocalBuilder, don't
426 leave it in after returning it.
427 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
429 2006-08-06 Marek Safar <marek.safar@seznam.cz>
431 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
434 2006-08-03 Raja R Harinath <rharinath@novell.com>
436 Fix cs0146-3.cs and cs0146-4.cs.
437 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
438 enclosing types don't depend on the current type.
440 2006-08-02 Raja R Harinath <rharinath@novell.com>
443 * class.cs (TypeContainer.DoDefineMembers): Use
444 FindBaseMemberWithSameName on Parent, since we're interested in
445 whether we hide inherited members or not.
446 (FindBaseMemberWithSameName): Make slightly more robust.
448 Fix the non-generic testcase from #77396
449 * decl.cs (DeclSpace.DeclContainer): Remove override.
451 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
452 declspaces for doppelgangers too.
453 (UsingEntry): Implement IResolveContext.
454 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
455 'this' as the resolve context.
456 (LocalAliasEntry): Likewise.
458 Implement parts of #77403
459 * roottypes.cs (RootDeclSpace): New. Used to represent the
460 toplevel declaration space. Each namespace declaration introduces
461 a "partial" root declaretion space.
462 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
463 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
464 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
465 from 'current_namespace.SlaveDeclSpace'.
466 (namespace_declaration): Likewise.
467 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
468 check. It can't happen now.
469 * decl.cs (DeclSpace.LookupType): Likewise.
470 * driver.cs (MainDriver): Sanity check.
472 2006-08-01 Raja R Harinath <rharinath@novell.com>
474 * decl.cs (DeclSpace.FindNestedType): Remove.
475 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
476 LookupTypeContainer to get the container of the nested type.
477 * class.cs (TypeContainer.FindNestedType): Make non-override.
479 2006-07-31 Raja R Harinath <rharinath@novell.com>
481 * decl.cs (DeclSpace.PartialContainer): Move field from ...
482 * class.cs (TypeContainer.PartialContainer): ... here.
483 (TypeContainer.AddBasesForPart): New helper.
484 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
486 * cs-parser.jay (current_class): Convert to DeclSpace.
487 (struct_declaration, interface_declaration, class_declaration):
488 Use AddBasesForPart instead of .Bases directly.
489 * const.cs, iterators.cs: Update to changes.
491 2006-07-28 Raja R Harinath <rharinath@novell.com>
493 * class.cs (TypeContainer.AddMemberType): Rename from
495 (TypeContainer.AddMember): Rename from AddToMemberContainer.
496 (AddTypeContainer): New. Combine AddClassOrStruct and
498 (AddPartial): Update. Add 'is_partial' argument.
499 * roottypes.cs: Update to changes.
500 * cs-parser.jay (push_current_class): New helper for handling
501 current_container and current_class.
502 (struct_declaration, interface_declaration, class_declaration):
505 2006-07-26 Raja R Harinath <rharinath@novell.com>
507 * roottypes.cs: Rename from tree.cs.
509 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
510 * tree.cs (Tree, ITreeDump): Remove types.
511 * rootcontext.cs (tree, Tree): Remove fields.
512 (root, ToplevelTypes): New.
513 * *.cs: Update to rename.
515 * tree.cs (Tree.RecordDecl): Remove.
516 (RootTypes.AddToTypeContainer): Record the toplevel type in its
518 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
520 2006-07-23 Raja R Harinath <harinath@gmail.com>
522 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
523 DoFlowAnalysis and OmitStructFlowAnalysis here.
524 (ec.With): Rename from WithUnsafe and generalize.
525 (ec.WithCheckState): Remove. All users can be handled by 'With'.
526 (ec.WithFlowAnalyis): New.
527 * ecore.cs, expression.cs, statement.cs: Update.
529 2006-07-22 Raja R Harinath <harinath@gmail.com>
531 * statement.cs (Block.ResolveMeta): Simplify slightly.
533 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
534 multiple boolean fields. Convert InUnsafe, constant_check_state,
535 check_state to flags.
536 (CheckState, ConstantCheckState): Update.
537 (InUnsafe): New read-only property.
538 (FlagsHandle): Rename from CheckStateHandle and convert to handle
540 (WithUnsafe): New helper similar to WithCheckState.
541 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
542 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
544 2006-07-21 Raja R Harinath <rharinath@novell.com>
546 Make comparisons use the same IL irrespective of whether they're
547 in a 'checked' or 'unchecked' context: one of the issues in #78899
548 * codegen.cs (EmitContext.CheckState): Make read-only property.
549 (EmitContext.ConstantCheckState): Likewise.
550 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
551 helper that implement a save/restore stack for CheckState
552 values. This is the only way to change check-state.
553 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
554 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
555 (CheckedExpr.EmitBranchable): New forwarding method.
556 (UnCheckedExpr): Likewise.
557 * statement.cs (Block.ResolveMeta): Use WithCheckState.
558 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
559 (Checked.Resolve, checked.DoEmit): Likewise.
561 2006-07-20 Miguel de Icaza <miguel@novell.com>
563 * anonymous.cs: Cache the resolved anonymous delegate, and return
564 this so that the ResolveTopBlock is only triggered once, not
567 Currently we trigger ResolvetopBlock twice due to a first pass of
568 argument check compatibility, and a second pass that does the
571 2006-07-15 Marek Safar <marek.safar@seznam.cz>
573 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
575 * rootcontext.cs (Reset): Add helper_classes.
577 2006-07-15 Marek Safar <marek.safar@seznam.cz>
580 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
583 2006-07-13 Miguel de Icaza <miguel@novell.com>
585 * statement.cs (Lock): Handle expressions of type
586 TypeManager.null_type specially. Fixes #78770
588 2006-07-08 Marek Safar <marek.safar@seznam.cz>
590 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
593 2006-07-08 Marek Safar <marek.safar@seznam.cz>
595 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
596 for accessors as well.
597 * ecore.cs (EventExpr): Add AccessorTable.
599 2006-07-01 Marek Safar <marek.safar@seznam.cz>
602 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
603 for CS0122 where appropriate.
604 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
606 (Filter): Assembly can be null in the case of top level attributes.
608 2006-06-25 Marek Safar <marek.safar@seznam.cz>
612 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
613 is done at global level.
615 2006-06-24 Marek Safar <marek.safar@seznam.cz>
617 A fix for #77002, Implemented TypeForwarder support.
619 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
620 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
621 * typemanager.cs (): Add type_forwarder_attr_type.
623 2006-06-24 Marek Safar <marek.safar@seznam.cz>
625 * report.cs: Add CS0469 warning.
627 2006-06-21 Martin Baulig <martin@ximian.com>
629 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
630 the `try'-block, so we also report CS0016 etc. there.
632 2006-06-21 Martin Baulig <martin@ximian.com>
635 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
637 2006-06-21 Martin Baulig <martin@ximian.com>
639 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
640 also report CS1686 for parameters.
642 2006-06-21 Martin Baulig <martin@ximian.com>
644 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
645 instead of an error if the value is not implicitly convertible to
646 the switch types; fixes #77964.
648 2006-06-21 Raja R Harinath <rharinath@novell.com>
651 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
652 FieldBuilder is null.
655 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
656 'left' and 'right' before error-checking.
658 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
660 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
662 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
663 (FieldExpr.DoResolve): likewise.
664 (PropertyExpr.InstanceResolve): likewise.
665 (EventExpr.InstanceResolve): likewise.
667 2006-06-04 Marek Safar <marek.safar@seznam.cz>
669 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
670 attribute applicable tests for attribute argument.
672 2006-06-02 Raja R Harinath <rharinath@novell.com>
675 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
676 (Binary.OverloadResolve_PredefinedIntegral): New.
677 (Binary.OverloadResolve_PredefinedFloating): New.
678 (Binary.OverloadResolve_PredefinedString): New.
679 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
680 Follow the standard more closely, and treat numeric promotions in
681 terms of overload resolution.
682 (Binary.CheckShiftArguments): Simplify.
684 2006-06-01 Raja R Harinath <rharinath@novell.com>
686 * flowanalysis.cs (MyBitVector): Simplify representation.
687 (MyBitVector.Clone): Avoid allocating BitArray.
688 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
689 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
690 (*): Update. Change all references to MyBitVector.And and
691 MyBitVector.Or to &= and |=.
693 2006-05-29 Raja R Harinath <rharinath@novell.com>
696 * cs-parser.jay (formal_parameter_list): Extend the pattern below
697 to param arguments too.
699 2006-05-26 Miguel de Icaza <miguel@novell.com>
701 * cs-parser.jay: Catch another parsing form for arglist being
702 followed by other arguments. Fixes #78313.
704 2006-05-24 Raja R Harinath <rharinath@novell.com>
706 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
707 checking of out parameters to ...
708 (FlowBranchingToplevel.Merge): ... here.
709 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
710 set, propagate the origin upward, and only complain if there was
712 (FlowBranchingException.AddContinueOrigin): Likewise.
713 (FlowBranchingException.AddReturnOrigin): Likewise.
714 (FlowBranchingException.AddGotoOrigin): Likewise.
716 2006-05-23 Raja R Harinath <rharinath@novell.com>
718 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
719 unreachable, skip it.
720 (FlowBranchingException.Merge): Always propagate jumps, even if
721 the finally block renders subsequent code unreachable.
723 2006-05-18 Raja R Harinath <rharinath@novell.com>
726 * statement.cs (Goto.Resolve): Move responsibility for resolving
727 'goto' to FlowBranching.AddGotoOrigin.
728 (Goto.SetResolvedTarget): New. Callback to set the
729 LabeledStatement that's the target of the goto.
730 (Goto.DoEmit): Use Leave instead of Br when crossing an
731 unwind-protect boundary.
732 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
733 LookupLabel and adjust to new semantics.
734 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
735 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
736 Goto.SetResolvedTarget to update target.
737 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
738 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
739 AddBreakOrigin & co. Delay propagation until ...
740 (FlowBranchingException.Merge): ... this.
742 * statement.cs (Block.Resolve): Always depend on flow-branching to
743 determine unreachability. Kill workaround that originally emitted
744 only one statement after an "unreachable" label (see infloop in
747 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
748 This is still "wrong", but anything better would probably need a
749 multi-pass algorithm.
750 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
751 usage vector. Force current usage vector to be reachable, to
752 optimistically signify backward jumps.
753 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
755 (FlowBranchingLabeled.Merge): New. If no backward jump was
756 detected, return the original salted-away usage vector instead,
757 updated with appropriate changes. Print unreachable warning if
759 * statement.cs (Block.Resolve): Don't print unreachable warning on
762 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
764 * driver.cs: Pass filename without path to AssemblyBuilder's
765 AddResourceFile. Fixes bug #78407.
767 2006-05-17 Raja R Harinath <rharinath@novell.com>
769 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
770 * flowanalysis.cs (FlowBranchingLabeled): ... here.
771 (FlowBranching.MergeChild): Overwrite
772 reachability information from Labeled branchings too.
774 2006-05-16 Raja R Harinath <rharinath@novell.com>
776 * statement.cs (Goto.Resolve): Merge jump origins here ...
777 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
779 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
780 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
781 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
782 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
784 * statement.cs (Goto.Resolve): ... not here.
785 (Goto.Emit): Remove CS1632 check.
787 2006-05-14 Marek Safar <marek.safar@seznam.cz>
789 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
792 2006-05-11 Raja R Harinath <rharinath@novell.com>
794 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
795 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
796 (FlowBranchingException.Label): Likewise.
798 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
800 (MyBitVector.Or): Use it to avoid losing information (Count).
801 (FlowBranching.MergeOrigins): Likewise.
803 * flowanalysis.cs (UsageVector.IsDirty): Remove.
804 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
805 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
806 (UsageVector.ToString): Simplify.
807 (UsageVector.MergeSiblings): Move here from ...
808 (FlowBranching.Merge): ... here.
809 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
812 2006-05-10 Raja R Harinath <rharinath@novell.com>
814 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
815 null bitvector is treated as all-true.
817 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
818 (MyBitVector): Rationalize invariants. 'vector != null' implies
819 that we have our own copy of the bitvector. Otherwise,
820 'InheritsFrom == null' implies all inherited bits are true.
822 2006-05-09 Marek Safar <marek.safar@seznam.cz>
824 * statement.cs (LocalInfo): Add IsConstant.
825 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
826 local variable for constants.
828 2006-05-09 Raja R Harinath <rharinath@novell.com>
830 * flowanalysis.cs (MyBitVector.Empty): New.
831 (MyBitVector): Don't allow InheritedFrom to be null.
832 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
833 (UsageVector, FlowBranching): Update to changes.
835 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
836 recursion. The 'Parent == null' condition isn't sufficient for
838 (FlowBranching.AddBreakOrigin): Likewise.
839 (FlowBranching.AddContinueOrigin): Likewise.
840 (FlowBranching.AddReturnOrigin): Likewise.
841 (FlowBranching.StealFinallyClauses): Likewise.
842 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
843 (FlowBranching.CheckOutParameters): Likewise.
844 (FlowBranchingToplevel): Terminate all the above recursions here.
845 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
846 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
848 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
850 (FlowBranchingToplevel): New. Empty for now.
851 (FlowBranching.MergeTopBlock): Update.
852 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
853 branching for the anonymous delegate.
854 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
856 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
857 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
858 information at the start of the merge. Reorganize.
860 2006-05-07 Marek Safar <marek.safar@seznam.cz>
862 * class.cs (MethodData.Define): Method cannot implement interface accessor.
864 2006-05-07 Marek Safar <marek.safar@seznam.cz>
866 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
867 to newly introduced ctor.
869 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
870 message to one place.
871 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
874 2006-05-07 Marek Safar <marek.safar@seznam.cz>
876 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
878 * ecore.cs (Expression.ResolveAsConstant): Updated.
880 * statement.cs (ResolveMeta): Updated.
882 2006-05-06 Marek Safar <marek.safar@seznam.cz>
884 * cs-parser.jay: __arglist cannot be used in initializer.
886 2006-05-06 Marek Safar <marek.safar@seznam.cz>
889 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
892 2006-05-05 Raja R Harinath <rharinath@novell.com>
894 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
895 (LabeledStatement): Add 'name' parameter.
896 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
897 (Block.AddLabel): Update to changes.
898 * cs-parser.jay (labeled_statement): Likewise.
900 * flowanalysis.cs (BranchingType.Labeled): New.
901 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
902 (FlowBranchingLabeled): New. Does nothing for now, but will
903 eventually handle 'goto' flows.
904 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
905 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
906 that's terminated ...
907 (Block.Resolve): ... here.
909 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
910 (UsageVector.MergeFinallyOrigins): Likewise.
911 (FlowBranching.InTryOrCatch): Likewise.
912 (FlowBranching.AddFinallyVector): Likewise.
913 (FlowBranchingException): Update to changes.
916 * statement.cs (Return.Resolve): Move error checking to ...
917 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
918 (FlowBranchingException): Handle return origins like break and
920 (FlowBranching.UsageVector.CheckOutParameters): Remove.
922 2006-05-04 Marek Safar <marek.safar@seznam.cz>
925 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
928 2006-05-04 Marek Safar <marek.safar@seznam.cz>
931 * class.cs (MethodData.Define): Do public accessor check only when method
932 implements an interface.
934 2006-05-04 Raja R Harinath <rharinath@novell.com>
936 Remove special handling of 'break'
937 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
938 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
939 (UsageVector.Break): Remove.
940 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
942 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
944 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
945 UsageVector.Breaks (). Don't set NeedsReturnLabel.
947 2006-05-03 Marek Safar <marek.safar@seznam.cz>
950 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
951 be the interface member.
953 2006-05-03 Marek Safar <marek.safar@seznam.cz>
956 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
957 for emitting small (int) values.
959 2006-05-03 Raja R Harinath <rharinath@novell.com>
962 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
963 control-flow passes through the 'finally' after merging-in all the
964 control-flows from 'try' and the 'catch' clauses.
966 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
967 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
968 always true at the only non-recursive entry point.
969 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
970 FlowBranchingBreakable.
971 (FlowBranchingLoop): Remove.
972 * statement.cs (Return.DoResolve): Update to changes.
975 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
976 (FlowBranching.CreateBranching): Handle it: create a
977 FlowBranchingContinuable.
978 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
979 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
980 except that it handles the 'continue' command.
981 (FlowBranching.UsageVector.MergeOrigins): Rename from
983 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
984 except that it overrides AddContinueOrigin.
985 (FlowBranchingException): Override AddContinueOrigin, similar to
987 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
988 Create a new branching around the embedded statement.
989 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
990 control flow after the embedded statement.
991 (Continue.Resolve): Move all error checking to AddContinueOrigin.
993 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
994 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
995 FlowBranchingBreakable.
996 (FlowBranchingSwitch): Remove.
999 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1000 error reporting to ...
1001 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1002 Rename from 'AddBreakVector'. Add new location argument. Return
1003 a bool indicating whether the 'break' crosses an unwind-protect.
1004 (FlowBranchingException.AddBreakOrigin): Add.
1005 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1006 flowbranching after updating with the effects of the 'finally'
1008 (FlowBranchingBreakable): New common base class for
1009 FlowBranchingLoop and FlowBranchingSwitch.
1011 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1013 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1015 2006-05-02 Raja R Harinath <rharinath@novell.com>
1017 * statement.cs (Do.Resolve): If the loop is infinite, set the
1019 (While.Resolve, For.Resolve): Set a barrier after the embedded
1020 statement. There's no direct control flow that goes from the end
1021 of the embedded statement to the end of the loop.
1022 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1023 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1024 above ensure that the reachability is correctly computed.
1026 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1027 (UsageVector.MergeBreakOrigins): If the current path is
1028 unreachable, treat it as if all parameters/locals are initialized.
1029 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1030 infinite loops before merging-in break origins.
1032 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1033 (Reachability.Reachable): Split part into ...
1034 (Reachability.Unreachable): ... this. Simplify.
1035 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1037 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1038 (Reachability.SetThrowsSometimes): Likewise.
1039 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1040 TriState.Always, use corresponding property.
1041 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1042 (Block.Resolve): Likewise. Remove some redundant checks.
1044 2006-05-02 Raja R Harinath <harinath@gmail.com>
1046 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1047 (Reachability.Meet): Don't bother checking AlwaysThrows --
1048 barrier is always set.
1049 (FlowBranchingBlock.Merge): Likewise.
1051 2006-05-01 Raja R Harinath <harinath@gmail.com>
1053 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1054 checks for unreachable.
1056 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1059 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1061 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1062 whether field is really assigned.
1064 2006-04-30 Raja R Harinath <harinath@gmail.com>
1066 * flowanalysis.cs (Reachability): Make 4-argument constructor
1068 (Reachability.Meet): Rename from 'And'. Remove static variant.
1069 (Reachability.Always): Rename from the highly misleading
1070 'Reachability.Never'.
1071 (FlowBranching.Merge): Update to changes. Mark an impossible
1072 situation with a 'throw'.
1073 (*): Update to changes.
1075 2006-04-29 Raja R Harinath <harinath@gmail.com>
1077 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1079 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1080 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1081 (*): Update to changes.
1082 * statement.cs: Update to changes.
1084 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1087 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1089 2006-04-28 Raja R Harinath <harinath@gmail.com>
1091 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1094 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1095 argument to two arguments: an usage-vector and a bool. Move call
1096 to FlowBranching.Merge () ...
1097 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1099 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1100 handling of loop and switch reachability to ...
1101 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1103 2006-04-27 Raja R Harinath <harinath@gmail.com>
1105 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1106 handling to FlowBranchingLoop.InLoop.
1107 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1109 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1112 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1113 anonymous method is allowed from AnonymousContainer here.
1115 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1117 2006-04-24 Raja R Harinath <rharinath@novell.com>
1120 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1122 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1125 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1126 (DoubleConstant.Reduce): Ditto.
1128 2006-04-23 Raja R Harinath <rharinath@novell.com>
1130 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1131 Remove 'lvalue_right_side' argument. Move parts to ...
1132 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1133 (LocalVariable.DoResolveLValue): ... these.
1135 2006-04-21 Raja R Harinath <rharinath@novell.com>
1138 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1139 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1140 (LocalVariableReference.DoResolveBase): Use it to implement new
1142 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1143 (Argument.Resolve): Simplify. Move CS1510 check ...
1144 * ecore.cs (Expression.ResolveLValue): ... here.
1145 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1146 (PropertyExpr.DoResolveLValue): Likewise.
1147 (FieldExpr.Report_AssignToReadonly): Likewise.
1148 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1149 LValueMemberAccess or LValueMemberOutAccess on instance depending
1151 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1152 DoResolve as appropriate.
1154 2006-04-20 Raja R Harinath <rharinath@novell.com>
1157 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1158 implicit conversions on 'out' and 'ref' arguments.
1160 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1161 improve clarity. Remove dead code.
1164 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1165 (Catch.Resolve): Resolve VarBlock if it exists.
1167 2006-04-19 Miguel de Icaza <miguel@novell.com>
1169 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1170 twice, this was some residual code, the enumerator was emitted
1171 properly in the two branche of if later.
1173 2006-04-19 Raja R Harinath <rharinath@novell.com>
1175 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1176 cast is never an lvalue.
1177 (Cast.DoResolve, Cast.ResolveRest): Combine.
1178 (Argument.Emit): Simplify slightly. Move 'Expr is
1179 IMemoryLocation' check ...
1180 (Argument.Resolve): ... here.
1181 (Argument.Error_LValueRequired): Remove. Inline into only user.
1183 Simplifications. Fix cs0191-2.cs
1184 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1185 CS1649 and CS1651 to ...
1186 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1187 the actual selection of the error code and message to a lookup
1188 table. Add a dummy return value to simplify callsites.
1189 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1190 readonly fields of other instances of the same type. Move CS0197
1192 * expression.cs (Argument.Resolve): ... here. Simplify code.
1193 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1194 resolution of an out or ref argument. The code simplification
1195 above uses this invariant.
1197 2006-04-18 Raja R Harinath <rharinath@novell.com>
1199 Possibly fix #77752. Fix cs1690-[4-7].cs.
1200 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1201 CheckMarshallByRefAccess. Drop parameter.
1202 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1204 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1206 * report.cs (AllWarnings): Add CS1690.
1207 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1209 (LocalVariableReference.DoResolveBase): Update.
1211 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1213 * class.cs (MethodOrOperator): Moved common parts from method class.
1214 detect obsolete attributes.
1215 (Method.Define): Simplified as it reuses code from base.
1216 (Constructor.ValidAttributeTargets): Fixed issue found during
1218 (Destructor.ValidAttributeTargets): Fixed issue found during
1220 (Operator): Finished refactoring set off by #78020. Operator class is now
1221 ordinary method class.
1223 * anonymous.cs: Updated.
1225 * decl.cs (DeclSpace): Add IsGeneric
1227 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1229 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1231 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1233 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1234 detect obsolete attributes.
1235 (Method.CreateEmitContext): Moved to MethodOrOperator.
1237 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1240 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1241 customized exception to make crash detection easier.
1242 (MethodOrOperator): Started to work on new base class for methods and
1244 (Method): Derives from MethodOrOperator.
1245 (Constructor.Emit): Emits its own attributes.
1246 (AbstractPropertyEventMethod.Emit): Ditto.
1247 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1249 (Operator.Emit): It's temporary more tricky than should be.
1251 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1253 * report.cs (InternalErrorException): Add ctor with inner exception.
1255 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1258 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1261 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1264 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1267 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1269 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1270 attribute is present and Guid not.
1271 (Interface.ApplyAttributeBuilder): Ditto.
1273 * attribute.cs: Add error message.
1275 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1279 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1280 sources (it's composite) so hold them in extra array as they are used in
1281 Emit phase only. It worked in the previous versions by mistake.
1282 (Attribute.Emit): Emit attribute for more owners when exist.
1284 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1285 it has now different behaviour.
1287 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1289 * constant.cs (Constant.IsDefaultInitializer): New method.
1291 * class.cs: Updated.
1293 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1294 re-initialize default values. It saves KBs almost for every assembly.
1295 Thanks Zoltan for the idea.
1296 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1297 (ArrayCreation.DoResolve): Resolve only once.
1298 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1299 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1301 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1303 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1306 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1308 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1309 in an embedded statement too.
1311 2006-04-01 Raja R Harinath <rharinath@novell.com>
1314 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1316 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1320 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1323 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1325 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1327 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1330 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1331 LocalTemporary change.
1333 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1335 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1336 initializers optimization.
1337 (ClassOrStruct.TypeAttr): Moved from modifiers.
1338 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1339 (FieldBase.ResolveInitializer): Resolves initializer.
1340 (FieldBase.HasDefaultInitializer): New property.
1342 * cs-parser.jay: Removed message.
1344 * expression.cs (CompilerGeneratedThis): New specialization.
1346 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1348 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1350 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1352 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1354 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1355 be now EnumConstants only.
1357 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1359 * attribute.cs, driver.cs: Reset more caches.
1361 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1363 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1365 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1367 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1368 for easier reuse. Updated all overrides.
1369 (IntegralConstant): New base class for all integral constants.
1370 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1371 of the constant range, report custom error.
1372 (UIntConstant.Reduce): Fixed uint conversion.
1374 * ecore.cs, literal.cs: Reduce updates.
1376 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1380 * class.cs (Constructor.Define): Removed extra if for default ctors.
1381 A patch from Atsushi Enomoto.
1383 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1385 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1386 GetAttributableValue.
1388 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1391 * convert.cs (ImplicitConversionRequired): Error message moved to
1394 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1395 automatic implicit conversion of an output value.
1396 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1398 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1400 (TypeOf.GetAttributableValue): Add extra handling for object type.
1402 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1403 special error message.
1405 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1407 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1409 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1410 compatible with MS runtime.
1412 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1414 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1415 attribute arguments here.
1417 * class.cs (Indexer.Define): The check was moved to attribute class.
1419 2006-03-22 Marek Safar <marek.safar@seznam.cz>
1421 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1422 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1425 2006-03-22 Raja R Harinath <rharinath@novell.com>
1427 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1428 mcs to keep code differences small.
1429 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1430 * typemanager.cs (parameter_default_value_attribute_type): New.
1431 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1434 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1436 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1438 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1440 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1442 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1445 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1447 * doc-bootstrap.cs : fix build.
1449 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1451 * expression.cs (StringConcat.Append): Issue a warning when empty string
1454 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1456 * assign.cs (CompoundAssign.ResolveSource): Removed.
1458 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1461 * class.cs (TypeContainer.FindMethods): Removed.
1462 (TypeContainer.CheckMemberUsage): Made static.
1464 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1466 * constant.cs (CheckRange): Removed unused type argument.
1467 (CheckUnsigned): Removed unused type argument.
1469 * cs-parser.jay: Updated after MemberAccess clean up.
1470 Uses Length for empty string test.
1472 * cs-tokenizer.cs: Uses Length for empty string test.
1473 (IsCastToken): Made static.
1474 (is_hex): Made static.
1475 (real_type_suffix): Made static.
1477 * decl.cs (SetupCache): Made static.
1478 (OnGenerateDocComment): Removed unused ds argument.
1480 * delegate.cs (VerifyDelegate): Removed unused argument.
1482 * doc.cs: Uses Length for empty string test.
1484 * driver.cs: Uses Length for empty string test.
1486 * enum.cs (IsValidEnumType): Made static
1488 * expression.cs (EnumLiftUp): Removed unused argument.
1489 (ResolveMethodGroup): Ditto.
1490 (BetterConversion): Ditto.
1491 (GetVarargsTypes): Ditto.
1492 (UpdateIndices): Ditto.
1493 (ValidateInitializers): Ditto.
1494 (MemberAccess.ctor): Ditto.
1495 (GetIndexersForType): Ditto.
1497 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1499 * iterators.cs: Updated after MemberAccess clean up.
1501 * location.cs: Uses Length for empty string test.
1503 * namespace.cs: Uses Length for empty string test.
1505 * report.cs (CheckWarningCode): Made static.
1507 * statement.cs (LabeledStatement): Removed unused argument.
1509 * typemanager.cs (FilterNone): Removed.
1511 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1513 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1516 * class.cs: Updated.
1518 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1520 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1522 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1526 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1527 reporting, it's more tricky than I thought.
1529 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1533 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1535 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1536 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1537 Add more error reporting; Fixed issue with params.
1539 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1541 * cs-parser.jay: AnonymousMethod requires host container.
1543 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1545 2006-03-18 Raja R Harinath <harinath@gmail.com>
1547 * class.cs: Change 'TypeContainer ds' constructor argument to
1548 'DeclSpace parent'. Some classes were missed below due to
1549 different naming convention.
1551 * class.cs (MemberCore.Parent): Delete. This makes the
1552 ParentContainer changes below enforceable by the compiler.
1554 Treat pointers to enclosing declaration space as 'DeclSpace', not
1556 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1557 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1559 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1561 (Block.AddThisVariable): Likewise.
1562 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1563 (AbstractPropertyEventMethod.Emit): Likewise.
1564 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1565 (GetMethod.Define, SetMethod.Define): Likewise.
1566 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1567 (DelegateMethod.EmitMethod): Likewise.
1569 Fix regression test-partial-13.cs.
1570 Rationalize use of PartialContainer. Ensure that the partial
1571 class semantics can be tied to type-correctness, i.e., any
1572 violation will cause a compile error.
1573 * class.cs, const.cs: Access all fields that belong to class
1574 TypeContainer via ParentContainer. Arguments of EmitContexts and
1575 Resolve()-like functions still use 'Parent'.
1577 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1578 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1579 (PropertyMethod.CheckModifiers): Remove unused argument.
1580 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1583 2006-03-17 Raja R Harinath <harinath@gmail.com>
1585 Make semantics of PartialContainer simpler.
1586 * decl.cs (DeclSpace.IsPartial): Remove.
1587 * class.cs (TypeContainer.IsPartial): Likewise.
1588 (TypeContainer..ctor): Set PartialContainer to point to self.
1589 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1590 (TypeContainer.FindNestedType): Likewise.
1591 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1593 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1595 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1597 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1599 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1602 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1604 * class.cs (Operator.Define): An error for base conversion was not
1607 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1609 * iterator.cs : yield break is allowed in try statement which has
1610 catch clauses. Fixed bug #77767.
1612 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1614 A fix for #77593, #77574.
1616 * class.cs (MethodCore.CheckBase): Another if for operator.
1618 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1620 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1623 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1624 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1627 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1630 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1631 Updated after another emitcontext usage was clean up. It should help us to
1632 synchronize with gmcs easier.
1634 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1638 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1639 (Event.Define): ditto
1640 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1642 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1643 Removed redundant code and set NewSlot for Invoke method too.
1645 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1646 (Parameters.MergeGenerated): New method. Use this method when you merge
1647 compiler generated argument with user arguments.
1649 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1651 * attribute.cs (ResolveAsTypeTerminal): Removed.
1653 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1654 specialization for predefined types; 30% speed up.
1655 Finally placed obsolete check to right place.
1656 (Expression.ResolveType): Removed.
1658 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1659 Updated after ResolveType was removed.
1661 * expression.cs (Cast.ctor): Check void cast.
1662 (Binary.ResolveAsTypeTerminal): Is never type.
1663 (Conditional.ResolveAsTypeTerminal): Is never type.
1665 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1667 2006-03-01 Raja R Harinath <rharinath@novell.com>
1670 * expression.cs (ParameterReference.DoResolveBase): Change return
1672 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1676 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1679 * typemanager.cs (GetFullNameSignature): Don't nullref on
1680 protected accessors.
1682 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1684 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1685 these two separated members to simplify the code.
1686 (Attribute.Resolve): Refactored to use new fields and methods.
1687 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1688 implemented obsolete attribute checking.
1689 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1690 implemented obsolete checking again. It look line never ending quest ;-)
1691 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1693 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1695 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1697 *class.cs (Property.Define): Add RegisterProperty call.
1699 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1700 argument groups (only 2).
1702 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1703 encoding expression to arguments.
1704 (Expression.ExprClassToResolveFlags): Just turned to property.
1706 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1707 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1708 optimized as well as implemented support for zero-length attributes.
1710 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1711 Add caching of PropertyInfo's.
1713 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1715 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1716 error multiple times.
1718 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1720 New partial class implementation.
1721 A fix for #77027, #77029, #77403
1723 * attribute.cs (Attributable): Made attributes protected.
1725 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1726 the replacements of ClassPart and PartialContainer.
1727 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1728 (TypeContainer.AddInterface): Ditto.
1729 (TypeContainer.AddPartial): The main method for partial classes. It checks
1730 for errors and merges ModFlags and attributes. At the end class is added to
1732 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1734 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1735 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1736 from the rest of partial classes.
1737 (TypeContainer.GetClassBases): Simplified.
1738 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1740 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1741 (TypeContainer.HasExplicitLayout): Uses Flags now.
1742 (PartialContainer): Removed.
1743 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1744 (StaticClass): Was merged with Class.
1745 (Class.GetClassBases): class and static class bases are verified here.
1746 (Class.TypeAttr): Added static attributes when class is static.
1747 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1748 (MemberBase): In some cases we need to call parent container for partial
1749 class. It should be eliminated but it's not easy now.
1751 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1753 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1754 partial classed to accumulate class comments.
1755 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1757 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1759 * driver.cs (MainDriver): Tree.GetDecl was removed.
1761 * modifiers.cs (Modifiers): Add partial modifier.
1763 * tree.cs (Tree.decl): Removed.
1764 (RootTypes): Started to use this class more often for root types
1767 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1771 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1772 external interface does not have an attribute.
1774 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1776 Another prerequisites for new partial classs implementation.
1778 * attribute.cs (Attribute.Equal): Implemented.
1779 (Attribute.Emit): Changed as attributes can be applied more than twice.
1780 (Attributes.Emit): Check for duplicate attributes here.
1782 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1783 as a parameter, clean-up.
1785 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1789 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1790 contains obsolete attribute check which can in some cases look for base
1791 type of current class which is not initialized yet.
1792 (TypeContainer.BaseType): Replacement of ptype.
1794 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1796 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1798 First of prerequisites for new partial classs implemention.
1800 * attribute.cs (Attributable): Extended by ResolveContext;
1801 Attributes finally have correct context for resolving in all cases.
1802 (AttachTo): Attribute owner is assigned here.
1804 * codegen.cs (IResolveContext): Introduce new interface to hold
1805 all information needed in resolving phase.
1806 (EmitContext): Implements IResolveContext; more clean-up needed here.
1808 * decl.cs (MemberCore): Implemented IResolveContext.
1810 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1811 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1812 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1813 Refactored to use new IResolveContext instead of EmitContext; cleanup
1815 2006-02-06 Miguel de Icaza <miguel@novell.com>
1817 * codegen.cs (EmitScopeInitFromBlock): check here the
1818 capture_context, there is no need to make two calls to the
1821 * anonymous.cs: Add some debugging messages that might help me
1822 track other instances of this problem in the future (the
1823 regression of test 467).
1825 * cs-parser.jay: track the variable block, as we need to initalize
1826 any captured variables declared in this block for the "catch"
1827 portion of the "Try" statement.
1829 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1830 scope initialization for captured variables.
1832 Also, move the emit for the variables after the block location has
1835 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1837 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1839 2006-02-02 Miguel de Icaza <miguel@novell.com>
1841 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1842 commit yesterday, the initialization for the roots is necessary.
1843 What is not necessary is the scope activation.
1845 2006-02-02 Raja R Harinath <rharinath@novell.com>
1847 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1848 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1850 (Argument.Resolve): Remove CS0206 checks.
1852 2006-02-01 Miguel de Icaza <miguel@novell.com>
1854 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1855 scopes for all the roots, the scopes will now be emitted when the
1856 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1858 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1859 code. This reduces a lot of existing cruft.
1861 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1862 that the ScopeInfo is generated as we enter the scope, not at the
1863 time of use, which is what we used to do before.
1865 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1866 every time a Block is about to be emitted if we have a
1869 2006-02-01 Raja R Harinath <rharinath@novell.com>
1871 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1873 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1875 * typemanager.cs (cons_param_array_attribute): Make private.
1876 (Reset): Set it to null.
1877 (InitCoreHelpers): Don't initialize it.
1878 (ConsParamArrayAttribute): New. Initialize it as needed.
1879 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1881 2006-01-31 Miguel de Icaza <miguel@novell.com>
1883 * expression.cs: There might be errors reported during the
1884 selection of applicable methods. If there are errors, do not
1885 continue execution as it will lead the compiler to crash.
1887 2006-01-30 Miguel de Icaza <miguel@novell.com>
1889 * expression.cs: Member access is not allowed on anonymous
1890 methods. Fixes #77402.
1892 2006-01-30 Raja R Harinath <rharinath@novell.com>
1895 * cs-parser.jay (VariableDeclaration): Don't set
1896 current_array_type to null.
1897 (field_declaration, event_declaration, declaration_statement):
1898 Set it to null here.
1900 2006-01-28 Raja R Harinath <harinath@gmail.com>
1902 * typemanager.cs (GenericParameterPosition): New.
1905 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1907 * doc.cs : To process "include" elements, first we should create
1908 another list than XmlNodeList, because it could result in node
1909 removal, which could result in that the XmlNodeList gives up
1912 (Also made code identical to gmcs again.)
1914 2006-01-25 Miguel de Icaza <miguel@novell.com>
1916 * ecore.cs: Introduce an error report that we were not catching
1917 before, if not silent, we must report the error. Gonzalo ran into
1920 2006-01-23 Miguel de Icaza <miguel@novell.com>
1922 A fix for bug: #76957
1924 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1925 ComputeMethodHost before creating the method, this is a new
1928 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1929 that this method references (RegisterScope). The actual scope
1930 where the method is hosted is computed with the ComputeMethodHost
1931 before we create the method.
1933 Moved the Deepest routine here.
1935 (AnonymousContainer.ComputeMethodHost): New routine used to
1936 compute the proper ScopeInfo that will host the anonymous method.
1938 (ScopeInfo): Deal with multiple roots. The problem was that we
1939 did not have a unique root where all ScopeInfos could be hanged
1940 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1943 Remove AdjustMethodScope which is now computed at the end. Remove
1944 LinkScope which did a partial link, instead link all ScopeInfos
1945 before code generation from the new "LinkScopes" routine.
1947 Simplify all the Add* routines as they no longer need to maintain
1948 the tree, they just need to record that they are using variables
1951 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1952 routines to produce the forest of ScopeInfo trees.
1954 * class.cs (TypeContainer.AppendMethod): This is just like
1955 AddMethod, but ensures that an interface implementation method
1956 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1957 methods, but at the end.
1959 We use this functionality to ensure that the generated MoveNext
1960 method in the iterator class is resolved/emitted before the
1961 enumerator methods created.
1963 This is required because the MoveNext method computes the right
1964 ScopeInfo for the method. And the other methods will eventually
1965 need to resolve and fetch information computed from the anonymous
1968 2006-01-21 Raja R Harinath <harinath@gmail.com>
1969 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1972 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1974 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1975 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1977 2006-01-18 Raja R Harinath <rharinath@novell.com>
1979 Fix #76656, cs0231-2.cs.
1980 * cs-parser.jay (formal_parameter_list): Make error case catch
1982 (parenthesized_expression_0): Add CS1026 check.
1983 (invocation_expression): Remove unused { $$ = lexer.Location }.
1985 2006-01-17 Raja R Harinath <rharinath@novell.com>
1988 * cs-parser.jay (statement_expression): Don't list out the
1989 individual statement-expressions. Convert syntax error into
1992 2006-01-16 Raja R Harinath <rharinath@novell.com>
1995 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1996 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1997 CheckIntermediateModification.
1998 (FieldExpr.DoResolve): Add new two-argument version that
1999 allows us to resolve the InstanceExpression as an lvalue.
2000 The one-argument variant is now just a wrapper.
2001 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2002 Resolve the lhs as an lvalue if the it has a value type.
2003 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2004 from Assign.DoResolve.
2005 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2006 resolved as an lvalue.
2007 (PropertyExpr.DoResolve): Update.
2008 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2009 has a value type. Move CS1612 check here from
2010 CheckIntermediateModification.
2011 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2012 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2013 'right_side' of a ResolveLValue on an 'out' argument.
2014 (EmptyExpression.LValueMemberAccess): New. Used as the
2015 'right_side' of a propagated ResolveLValue on a value type.
2016 (LocalVariableReference.DoResolveBase): Recognize
2017 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2019 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2020 EmptyExpression.Null.
2022 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2024 * typemanager.cs : added IsGenericParameter(). In mcs it always
2026 * doc.cs : for generic parameters, use GenericParameterPosition,
2029 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2031 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2033 2006-01-12 Miguel de Icaza <miguel@novell.com>
2035 This fixes the problem where we used ldfld instead of ldflda to
2036 load the "THIS" pointer on captured parameters, when THIS is a
2037 value type. See bug #77205.
2039 * iterators.cs (CapturedThisReference.Emit): Pass false to
2040 EmitThis (we do not need the address).
2042 * codegen.cs (EmitThis): it needs to know whether we need the
2043 address of `this' or not. This is used by value types.
2045 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2046 every other call passes false.
2048 2006-01-12 Raja R Harinath <rharinath@novell.com>
2051 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2053 * expression.cs (Invocation.OverloadResolve): Update.
2054 (Invocation.DoResolve): Avoid double resolution of invocation.
2056 2006-01-11 Raja R Harinath <rharinath@novell.com>
2059 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2060 unary negation of floating point types as 0-expr; negation cannot
2061 overflow in floating point types.
2064 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2065 on operands of 'void' type.
2068 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2069 and ExclusiveOr for boolean constants too.
2071 2006-01-09 Raja R Harinath <rharinath@novell.com>
2074 * expression.cs (Invocation.OverloadResolve): Replace reflected
2075 override methods with their base virtual methods, rather than
2077 * typemanager.cs (TypeManager.GetOverride): New.
2079 2006-01-05 Jb Evain <jbevain@gmail.com>
2081 * class.cs (Property.Define, Indexer.Define): do not tag the
2082 properties as SpecialName | RTSpecialName.
2084 2006-01-04 Miguel de Icaza <miguel@novell.com>
2086 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2087 doing a low-level comparission of parameter types. It was lacking
2088 a check for __argslist.
2090 2005-12-30 Miguel de Icaza <miguel@novell.com>
2092 * expression.cs (ParameterReference.DoResolveBase): Allow
2093 reference parameters if they are local to this block.
2095 This allows the ref and out parameters of a delegate to be used in
2096 an anonymous method, for example:
2098 delegate void set (out int x);
2100 set s = delegate (out int x){
2104 This is used by functionality introduced late in the C# language.
2106 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2107 method that take ref and out parameters.
2109 Fixes #77119 which was a late change in the spec.
2111 2005-12-23 Miguel de Icaza <miguel@novell.com>
2113 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2114 parent if its the same scope. Fixes #77060.
2116 2005-12-21 Miguel de Icaza <miguel@novell.com>
2118 * driver.cs: Report the case of no source files and no -out:
2121 2005-12-20 Raja R Harinath <rharinath@novell.com>
2124 * expression.cs (ComposedCast.GetSignatureForError): Define.
2126 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2130 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2131 ListDictionary, to contain the ExternAliasEntry entries (in
2132 addition to the NamespaceEntry.aliases hashtable). This field is
2133 shared between the original entry and its doppelganger (bodyless
2135 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2136 extern_aliases field.
2137 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2138 lookup in extern_aliases.
2140 2005-12-16 Raja R Harinath <rharinath@novell.com>
2143 * class.cs (TypeContainer.Mark_HasEquals): New.
2144 (TypeContainer.Mark_HasGetHashCode): New.
2145 (ClassPart): Override them.
2146 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2149 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2150 'parent' argument to the base constructor.
2152 Remove all mention of TypeContainer from decl.cs.
2153 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2154 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2155 (DeclSpace.DeclSpace): Likewise.
2156 (DeclSpace.DefineMembers): Remove unused argument.
2157 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2158 debugging check -- we don't care if the debug code throws an
2159 InvalidCastException instead of an InternalErrorException.
2160 * class.cs (TypeContainer.DefineMembers): Update to changes.
2161 (TypeContainer.DoDefineMembers): Likewise.
2162 (TypeContainer.GetMethods): Likewise.
2163 (PropertyMember.Define): Likewise.
2164 (MemberBase.Parent): New property that forwards to
2165 MemberCore.Parent, but ensures that we get a TypeContainer.
2166 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2167 (RootContext.PopulateTypes): Likewise. Remove special case code
2168 for !RootContext.StdLib: DefineMembers is idempotent.
2170 2005-12-14 Miguel de Icaza <miguel@novell.com>
2172 * convert.cs (ExplicitConversionCore): Check the return value from
2173 ExplicitConversionCore which can return null on failure. Fixes #76914
2175 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2177 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2179 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2181 * doc.cs : The search for referenced namespace was insufficient to
2182 get global one as it used to do. Fixed bug #76965.
2184 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2186 * doc.cs : check name in cref in the last phase that whether it is
2189 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2191 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2194 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2196 * doc.cs : so it turned out that we cannot skip override check for
2197 interface members. Fixed bug #76954.
2199 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2201 * cs-tokenizer.cs : fixed bug #75984:
2202 - #warning and #error should not be handled when the source line
2204 - #line is not checked strictly when the source line is disabled.
2205 - #define and #undef is on the other hand checked strictly at any
2208 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2210 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2213 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2215 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2217 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2219 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2220 (FieldBase.Initializer): Initializer is now optional.
2221 (EventField.Define): Only event field can have initializer.
2223 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2225 * const.cs (Const): Reuse initializer.
2227 * cs-parser.jay: Updated after FieldBase changes.
2228 Added current_array_type to simplify array initializers.
2230 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2232 * expression.cs, iterators.cs: Updated.
2234 * namespace.cs (NamespaceEntry): Made UsingFound private.
2236 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2238 * parameterCollection.cs: Obsolete, removed.
2239 * parser.cs: Obsolete, removed.
2241 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2244 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2246 * enum.cs (Enum.Define): Set obsolete context here.
2248 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2251 - FindDocumentedMember() now expects 1) paramList as null
2252 when "we don't have to check the number of parameters" and
2253 2) Type.EmptyTypes when "there is no arguments".
2254 - Introduced FoundMember struct to hold the exact type which was
2255 used to find the documented member (the above change broke
2256 test-xml-044; it might be better just to use DeclaringType than
2257 what MS does, like this change does, but it depends on usage.)
2259 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2261 * doc.cs : documented member might be from DeclaringType for nested
2262 types. Fixed bug #76782.
2264 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2266 * anonymous.cs: Have the param code handle leaving copies on the
2267 stack etc. Allows anonymous params to take part in the assignment
2268 code (++, +=, etc). Fixes bug #76550
2270 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2271 it down to the anon code.
2273 * iterators.cs: Use dummy var here
2275 * codegen.cs: Handle new vars
2277 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2280 * class.cs (MethodData.Define): Set proper Obsolete context.
2282 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2284 (FieldExpr.DoResolve): Ditto.
2286 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2289 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2290 parent is not obsolete.
2292 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2294 * doc.cs : (FindDocumentedMember) find parameterless members first
2295 and get CS0419 in the early stage. Fixed first case of bug #76727.
2297 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2300 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2301 no error was reported.
2303 *expression.cs (Binary.DoResolve): left can be null.
2305 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2308 * class.cs (MethodData.Emit): Parameters should be labeled first.
2310 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2313 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2315 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2317 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2319 * class.cs (MethodCore): Parameter clean up.
2320 (IMethodData): Added ParameterInfo.
2321 (MethodData): Parameter clean up.
2322 (Indexer.Define): Parameter clean up.
2334 * typemanager.cs: Parameter clean up.
2336 * delegate.cs (Define): Get rid of duplicated code.
2338 * expression.cs (ParameterReference): Removed useless parameters
2340 (Invocation): Ditto.
2342 * parameter.cs (ParamsParameter): New class, params specialization.
2343 (ArglistParameter): Attemp to separate arglist.
2344 (Parameter): Refactored to be reusable and faster.
2345 (Parameter.Modifier): Made understandable.
2346 (Parameters): Changed to be used as a class for `this' assembly
2347 parameters. Refactored to use new specialized classes.
2349 * support.cs (ParameterData): Added Types property.
2350 (InternalParameters): Deleted.
2352 2005-08-20 Martin Baulig <martin@ximian.com>
2354 Merging this patch from GMCS to fix #75867.
2356 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2357 scope if we don't already have it.
2359 2005-11-17 Martin Baulig <martin@ximian.com>
2362 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2363 inherit the scope from our parent. Fixes #76653.
2365 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2367 * doc.cs : the previous patch does not actually fix the bug.
2368 PropertyInfo override check is now implemented and really fixed it.
2369 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2371 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2373 * doc.cs : apply "override filter" also to properties.
2376 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2378 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2379 no need to check overrides. For classes, omit those results from
2380 interfaces since they must exist in the class. Fixed bug #76726.
2382 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2384 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2385 with different parameters. Fixed the second problem in #76685.
2387 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2389 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2390 get expected 'protected' access in CheckValidFamilyAccess()).
2393 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2395 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2396 Fixed bug #76705. CS1569 was incorrectly commented out.
2398 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2400 * doc.cs : use Invocation.IsOverride() to do real override check.
2401 * expression.cs : made Invocation.IsOverride() internal.
2403 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2405 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2406 TypeBuilder.FindMembers() and filter overriden base members out.
2409 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2411 * doc.cs : ref/out parameters are represented as '@' (instead of
2412 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2414 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2416 * doc.cs : when there was no '.' in cref to methods in doc comment,
2417 then parameters were missing in the output. Fixed bug #76691.
2419 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2421 * driver.cs : don't output docs when there is an error.
2424 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2427 Now it should detect indexers. Fixed primary concern in bug #76685.
2428 Fixed CS0419 message to not show the identical member signature in
2431 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2433 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2434 instead of Type.FindMembers() since it does not handle events.
2437 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2439 * codegen.cs: Fixed typo (speficied -> specified).
2441 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2444 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2446 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2448 * attribute.cs: Changed error message.
2450 * cs-tokenizer.cs: One more check.
2452 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2454 * statement.cs (Block.Resolve): Ignore empty statement.
2456 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2458 * report.cs: Made error/warning methods more strict to avoid
2461 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2462 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2463 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2464 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2466 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2468 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2469 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2471 * class.cs (TypeContainer.IsComImport): New property.
2472 (Constructor.Define): Create proper ctor for ComImport types.
2474 * expression.cs (New.CheckComImport): Fixed.
2476 2005-11-07 Miguel de Icaza <miguel@novell.com>
2478 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2479 that a parameter has been captured does not mean that we do not
2480 have to do the rest of the processing. This fixes the second part
2481 of #76592. If there was another anonymous method capturing
2482 values in the past, the Scope would never be set for the second
2483 method that captured the same parameter.
2485 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2486 properly manipulate the stack. Second part of fix for #76592.
2488 * expression.cs (New): Add support for invoking "new" on
2489 interfaces that have been flagged with the ComImport attribute and
2490 the CoClass. Fixes #76637
2492 * statement.cs (Try.DoEmit): When a variable is captured, do not
2493 try to emit the vi.LocalBuilder variable as it has been captured.
2494 Create a temporary variable and store the results on the
2495 FieldBuilder. Fixes #76642
2497 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2499 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2501 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2503 * expression.cs (Binary.DoResolve): Added && optimalization.
2505 * typemanager.cs (AddUserType): Removed useless argument.
2507 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2509 * statement.cs (Block.variables): Uses ListDictionary.
2511 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2514 * class.cs (PartialContainer.EmitType): Customized to emit
2515 security attributes.
2516 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2517 for partial classes.
2519 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2522 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2523 access has to be fixed.
2525 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2527 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2530 * ecore.cs (NullCast.Reduce): Implemented.
2532 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2535 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2537 (Foreach.Resolve): Catch null properly.
2539 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2541 * cs-tokenizer.cs: Warning text fix.
2543 * driver.cs: AllWarningNumbers exposed on public interface.
2545 * report.cs (): Reviewed warning numbers.
2546 (IsValidWarning): Use binary search.
2548 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2550 * driver.cs: Implemeted resource visibility.
2551 (Resources): New class for code sharing between /res: and
2554 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2557 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2560 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2563 * ecore.cs (NullCast): Child is contant only.
2565 * literal.cs (NullLiteral.Reduce): null can be converted to any
2568 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2570 * driver.cs: Use Encoding.Default as default code page instead
2573 2005-10-27 Raja R Harinath <rharinath@novell.com>
2576 * expression.cs (Invocation.Error_InvalidArguments): Handle
2577 __arglist parameters.
2578 (Invocation.VerifyArgumentsCompat): Likewise.
2579 * support.cs (ReflectionParameters.GetSignatureForError): Print
2580 __arglist parameters.
2581 (InternalParamters.GetSignatureForError): Likewise.
2582 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2584 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2586 * attribute.cs (GetPropertyValue): Made public.
2588 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2590 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2592 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2595 * driver.cs: Reflect method name change.
2597 * statement.cs (Try.Resolve): Warn when try has both general
2600 * typemanager.cs: runtime_compatibility_attr_type new predefined
2603 2005-10-26 Raja R Harinath <harinath@gmail.com>
2606 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2607 treat it as an empty parameter list.
2609 2005-10-26 Raja R Harinath <rharinath@novell.com>
2612 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2613 ResolveAsTypeStep silent.
2614 * statement.cs (Block.AddConstant): Mark block as used.
2615 (Block.ResolveMeta): Avoid piling on error messages
2616 if a constant initializer resolution fails.
2618 2005-10-25 Raja R Harinath <rharinath@novell.com>
2620 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2622 (NamespaceEntry.VerifyAllUsing): New.
2623 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2624 behaviour. Delegates actual resolution of alias to ...
2625 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2626 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2628 * driver.cs (Driver.MainDriver): Update.
2630 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2631 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2633 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2635 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2636 RootNamespace.DefineNamespacesForAll.
2638 2005-10-24 Raja R Harinath <harinath@gmail.com>
2640 * typemanager.cs (assemblies, external_aliases, modules)
2641 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2642 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2643 overhead. Move resposibility ...
2644 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2645 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2647 2005-10-23 Raja R Harinath <harinath@gmail.com>
2649 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2650 cached_namespaces. Improve usage.
2651 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2652 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2653 Move from GlobalRootNamespace and simplify.
2654 (RootNamespace.Global): Make instance variable.
2655 (RootNamespace.RootNamespace): Add "alias name" parameter.
2656 (GlobalRootNamespace): Simplify drastically.
2657 (Namespace.Lookup): Don't use GetNamespace.
2658 * typemanager.cs (GetRootNamespace): Rename from
2659 ComputeNamespaceForAlias.
2660 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2662 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2664 * anonymous.cs (AnonymousContainer): Don't crash when container
2667 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2669 * expression.cs (Binary.DoResolve): Warn when comparing same
2672 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2675 * expression.cs (Binary.DoResolve): It looks like there are no
2676 convetsion rules in enum context.
2678 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2680 Add support for extern alias qualifiers.
2681 * typemanager.cs: Move some LookupTypeReflection code
2682 to namespace.cs, to have cleaner code. Added some methods
2683 to help us keep track of the extern aliased references.
2684 * driver.cs: Add suport for extern alias assemblies on command
2685 line and check for their warnings/errors. Also keep track of the
2686 extern aliased assemblies.
2687 * namespace.cs: Move the global functionality of Namespace
2688 to GlobalRootNamespace/RootNamespace. Now the global namespace
2689 is GlobalRootNamespace.Globa. Also the code moved from
2690 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2691 Finally added LocalAliasEntry (AliasEntry before) and
2692 ExternAliasEntry, to handle alias statements.
2693 * cs-parser.jay: Add support in the grammar for extern alias
2695 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2696 Update callings to Namespace (now in GlobalRootNamespace).
2698 2005-10-18 Raja R Harinath <rharinath@novell.com>
2701 * class.cs (TypeContainer.DefineType): Move updating of
2702 topological sort earlier in the code.
2703 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2705 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2708 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2710 * constant.cs (Constant.TryReduce): Moved from Cast class.
2711 (Reduce): Made little bit more OO and fixed missing conversions.
2713 * ecore.cs (Reduce): Implemented.
2714 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2716 * literal.cs (Reduce): Implemented.
2718 * class.cs: Reverted Miguel's wrong commit.
2720 2005-10-14 Miguel de Icaza <miguel@novell.com>
2722 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2724 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2726 * cs-parser.jay, expression.cs : CS0214 was missing error location
2727 for constants. Fixed bug #76404.
2729 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2732 * convert.cs (ExplicitConversionCore): Fixed object->enum
2735 2005-10-10 Raja R Harinath <rharinath@novell.com>
2737 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2739 (PropertyExpr.EmitCall): Likewise.
2740 * expression.cs (Invocation.EmitArguments): Handle case where
2742 (Invocation.EmitCall): Avoid allocating temporary variable if
2743 there are no arguments.
2745 2005-10-07 Raja R Harinath <rharinath@novell.com>
2748 * convert.cs (ImplicitConversionStandard): Move conversion of
2749 void* to arbitrary pointer types ...
2750 (ExplicitConversionStandard): .. here.
2751 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2752 error to always print typenames.
2754 2005-10-07 Raja R Harinath <rharinath@novell.com>
2756 * convert.cs (GetConversionOperator): Rename from
2757 GetConversionOperators. Move operator selection code from ...
2758 (UserDefinedConversion): ... here.
2760 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2762 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2765 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2767 * assign.cs (Assign.DoResolve): Error method changed.
2769 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2771 * const.cs (ResolveValue): Reset in_transit immediately.
2773 * constant.cs: Error method changed.
2775 * convert.cs: Removed useless location parameter.
2776 (ExplicitNumericConversion): Don't do double enum check.
2777 (ExplicitConversionCore): Renamed from ExplicitConversion.
2778 (ExplicitUnsafe): Extracted from ExplicitConversion.
2779 (ExplicitConversion): Uses for error reporting.
2781 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2783 (ResolveBoolean): Uses common error method.
2784 (CastToDecimal): Get rid of ec.
2785 (CastFromDecimal): Optimized.
2786 (ConvCast): Get rid of ec.
2788 * enum.cs (ResolveValue): Reset in_transit immediately.
2789 (Emit): Return after first error.
2791 * expression.cs: Convert changes.
2793 * literal.cs: Error method changed.
2795 * statement.cs: Error method changed.
2797 2005-10-03 Raja R Harinath <rharinath@novell.com>
2799 * support.cs (SeekableStreamReader.Position): Don't error out when
2800 the requested position is just beyond the end of the current
2803 2005-09-28 Raja R Harinath <rharinath@novell.com>
2805 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2806 try to keep in sync with the byte count of the underlying Stream.
2807 However, this limits us to a window size of 2048 characters: i.e.,
2808 the maximum lookahead of our lexer/parser can be 2048 characters.
2810 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2813 * driver.cs: Fix compilation files with full root path.
2815 2005-09-25 Miguel de Icaza <miguel@novell.com>
2817 * report.cs (SymbolRelatedToPreviousError): Format the output so
2818 it does not use an open parenthesis that is never closed.
2820 * driver.cs: Follow coding guidelines
2822 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2825 * const.cs (Const.ResolveValue): Check for assigning non-null
2826 value to reference type.
2828 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2830 * anonymous.cs: Implemented ExprClassName.
2832 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2835 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2838 * class.cs (StaticClass.DefineContainerMembers): Report protected
2841 * codegen.cs: if(ed) PRODUCTION.
2843 * convert.cs (Error_CannotImplicitConversion): Better error
2846 * cs-parser.jay: More error checks.
2848 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2850 * driver.cs (CSCParseOption): Enabled wrong option check.
2852 * ecore.cs (Expression.ExprClassName): Turned to property.
2853 (MemberExpr.CheckIntermediateModification): For checking boxed
2854 value types modification.
2856 * statement.cs (Fixed.Resolve): Expression type must be
2857 convertible to fixed type.
2858 (CollectionForeach.GetEnumeratorFilter,TryType):
2859 Small refactoring for easier error checking.
2861 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2863 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2866 * class.cs (GeneratedBaseInitializer): New class for customization
2867 compiler generated initializers.
2868 (MemberBase.DoDefine): Check Obsolete attribute here.
2869 (FieldMember.DoDefine): Ditto.
2871 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2874 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2875 (MemberCore.GetObsoleteAttribute): Removed argument.
2876 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2877 (MemberCore.CheckObsoleteType): New helper.
2881 * statement.cs: Updates after MemberCore changes.
2883 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2884 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2886 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2887 obsolete attribute for compiler construct.
2888 (As.DoResolve): Cache result.
2890 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2892 2005-09-26 Raja R Harinath <rharinath@novell.com>
2895 * expression.cs (This.VerifyFixed): In a value type T, the type of
2896 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2897 value type R, 'this' is treated as a value parameter.
2899 2005-09-22 Miguel de Icaza <miguel@novell.com>
2901 * statement.cs (Lock): Use the TemporaryVariable class instead of
2902 manually using local variables as those do not work when variables
2905 * ecore.cs: Moved the TemporaryVariable class from being a nested
2906 class inside Foreach to be a public class that can be employed in
2909 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2911 * cs-parser.jay: interface_accessors replaced by
2912 accessor_declarations.
2914 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2917 * statement.cs (GotoCase.Resolve): Convert null constant to
2919 (SwitchLabel.ResolveAndReduce): Ditto.
2920 (SwitchLabel.NullStringCase): Custom null stamp.
2921 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2923 typemanager.cs (CSharpSignature): Don't skip first argument
2926 2005-09-18 Miguel de Icaza <miguel@novell.com>
2928 * driver.cs: Set InEmacs based on the environment variable EMACS.
2930 * location.cs (InEmacs): in this mode, do not report column
2931 location as it confuses Emacs.
2933 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2935 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2936 expression.cs, iterators.cs, literal.cs: Store constants and
2939 * class.cs (MemberBase.ShortName): Pass location.
2941 * cs-parser.jay: Some location fixes.
2943 * ecore.cs (Expression.Location): Made virtual.
2945 2005-09-05 Miguel de Icaza <miguel@novell.com>
2947 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2948 if the underlying types are the same, otherwise we need to produce
2949 code that will do the proper cast.
2951 This was exposed by Marek's constant rewrite which produced
2952 invalid code for the call site:
2955 void Method (X v) {}
2959 This fixes test-49.cs
2961 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2963 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2964 Type/Object should be allowed as well. Fixed bug #75968.
2966 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2968 * expression.cs : (Binary.DoResolve): when one is enum constant and
2969 another is constant 0, then return enum one *as enum type*.
2972 2005-09-02 Raja R Harinath <rharinath@novell.com>
2974 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2978 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2979 flow-branching for LocalVariableReferences in case we were invoked
2980 from a MemberAccess.
2981 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2983 (LocalVariableReference.DoResolveBase): ... this.
2984 (MemberAccess.Resolve): Do the check that was disabled during
2987 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2990 (PartialContainer.Create): check abstract/sealed/static strictly
2991 but abstract/sealed can exist only at one side. Fixed bug #75883.
2993 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2996 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2997 specified, don't default to UnmanagedType.I4.
2999 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3001 * expression.cs : conditional operator should check possibly
3002 incorrect assign expression. Fixed bug #75946.
3004 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3006 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3007 Reverting the change. gmcs is much complex than mcs on this matter.
3009 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3011 * cs-tokenizer.cs : To read another token ahead of the actual
3012 consumption, use new SavedToken and cache token instead of moving
3013 back the stream with SeekableStreamReader (it seemed problematic).
3015 driver.cs : Thus use StreamReader directly.
3016 * support.cs : Thus removed SeekableStreamReader.
3018 2005-08-30 Raja R Harinath <rharinath@novell.com>
3021 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3022 (ScopeInfo.EmitScopeType): Use it to construct field names from
3023 names of captured locals.
3026 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3027 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3028 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3029 (ExplicitConversion): Remove enum cases already handled by
3030 implicit conversion. Move implicit conversion check to the beginning.
3031 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3032 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3033 Don't treat System.Enum as a struct.
3035 2005-08-30 Jb Evain <jbevain@gmail.com>
3037 * attribute.cs: handles as expression in parameters.
3039 2005-08-30 Raja R Harinath <rharinath@novell.com>
3042 * class.cs (TypeContainer.VerifyClsName): Don't use a
3043 PartialContainer when verifying CLS compliance.
3044 (AbstractPropertyEventMethod): Set Parent here, ...
3045 (PropertyMethod): ... not here.
3047 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3049 * attribute.cs : escaped attribute name should not be allowed to be
3050 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3052 2005-08-29 Raja R Harinath <rharinath@novell.com>
3055 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3056 when converting a long constant to unsigned long.
3057 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3058 detect where IsApplicable and VerifyArgumentsCompat disagree.
3060 2005-08-29 Raja R Harinath <rharinath@novell.com>
3061 and Carlos Alberto Cortez <carlos@unixmexico.org>
3064 * class.cs (TypeContainer.CanElideInitializer): New helper.
3065 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3066 can safely emitting the initializer of a field.
3068 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3070 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3071 allowed inside a switch (without loop). Fixed bug #75433.
3073 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3075 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3076 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3078 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3080 * driver.cs : kinda reverting the default encoding changes (not exact
3081 revert since I noticed that "codepage:reset" might not work fine).
3083 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3085 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3086 Location. Now getter and setter store location correctly.
3087 (errors/cs0111-12.cs now reports the expected location.)
3089 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3091 * driver.cs : Use default encoding on the environment.
3092 Removed (now that) extra parameter for SeekableStreamReader.
3093 * support.cs : (SeekableStreamReader) third .ctor() argument for
3094 StreamReader is not required (always true). preamble size could
3095 be acquired in simpler and safe way.
3097 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3099 * cs-parser.jay: report CS0642 at warning level 3
3100 and report CS0642 for an if else statement also
3101 fixes bug #74745. Patch by John Luke (and a bit
3103 Removed extra CS0642 warning check for "while",
3105 * statement.cs: In Block.Resolve(), CS0642 check
3106 is reimplemented to check a sequence of an empty
3107 statement and a block.
3109 Both fix bug #66777.
3111 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3113 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3114 detection until I fix it.
3116 * cs-tokenizer.cs: Changed error message.
3118 * cs-parser.jay: Fixed 2 error locations.
3120 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3121 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3124 * enum.cs (GetSignatureForError): Fixed.
3126 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3130 * typemanager.cs (RegisterProperty): Removed.
3132 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3134 2005-08-24 Raja R Harinath <rharinath@novell.com>
3137 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3138 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3140 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3142 * expression.cs : tiny fix is required for not warning positive ulong.
3145 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3147 * expression.cs : add CS0652 check for constant and integral
3148 expression. Fixed bug #53974.
3150 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3152 * expression.cs : in DoNumericPromotions(), check if there is implicit
3153 conversion overload for string (to check CS0034). Fixed bug #52492.
3155 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3157 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3159 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3161 * ecore.cs : report location when it is *not* Null.
3163 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3169 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3170 correctly. Fixed bug #75721.
3172 2005-08-23 Raja R Harinath <rharinath@novell.com>
3174 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3175 loop that performs 'min (pos, char_count)'.
3178 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3179 converted value in Operator.OnesComplement.
3181 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3183 * anonymous.cs: If the anon method is pulled into a helper class,
3184 it needs to be `internal' not `private'. Fixes runtime behavior on
3187 2005-08-20 Martin Baulig <martin@ximian.com>
3189 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3190 scope if we don't already have it.
3192 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3193 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3196 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3199 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3202 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3204 The big constants rewrite
3205 Fix #75746, #75685 and more
3206 As a side effect saved 1MB for MWF ;-)
3208 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3209 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3210 enum based for corlib compilation.
3212 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3215 * class.cs (FixedField.Define): Use ResolveAsConstant.
3217 * const.cs (IConstant): Interface constants and enums.
3218 (Const.ResolveValue): New method for constant resolvning.
3219 (ExternalConstant): Constants from imported assemblies.
3221 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3222 conversion; like enums.
3223 (Constant.ToType): Converts this constant to different type.
3224 (Constant.Increment): Adds 1.
3226 * convert.cs (ImplicitConversionRequired): Simplified.
3228 * cs-parser.jay: Create EnumMember directly.
3230 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3232 * doc.cs (GenerateEnumDocComment): Removed.
3234 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3235 (ConvertIntLiteral): Removed.
3236 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3238 * enum.cs (EnumMember): Implement IConstant.
3239 (Enum.IsValidEnumConstant): Removed.
3240 (Enum.GetNextDefaultValue): Removed.
3241 (Enum.FindMembers): Updated.
3242 (Enum.GenerateDocComment): Iterate enum members.
3244 * expression.cs (Cast.TryReduce): Handle enums correctly.
3245 (New.Constantify): Made public.
3246 (MemberAccess.DoResolve): Removed contant specific if(s).
3248 * literal.cs (NullLiteral): Implement new abstract methods.
3250 * statement.cs (GotoCase.Resolve): Use new constant methods.
3251 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3253 * typemanager.cs (LookupEnum): Removed.
3254 (IsEnumType): Fixed to work with corlib.
3255 (RegisterConstant): Removed.
3256 (LookupConstant): Removed.
3257 (GetConstant): Changed to work with IConstant.
3259 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3261 * location.cs : Fixed overflown (>255) column number.
3263 2005-08-03 Raja R Harinath <rharinath@novell.com>
3265 First cut of the qualified-alias-member feature.
3266 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3268 * cs-parser.jay (DOUBLE_COLON): New token.
3269 (namespace_or_type_name): Add rule for recognizing
3270 qualified-alias-members.
3271 (primary_expression): Likewise.
3272 (element_access): Allow QualifiedAliasMember as a possible
3273 type-bearing expression.
3274 (local_variable_type, local_variable_pointer_type): Likewise.
3275 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3276 aliases in the current and enclosing namespace declarations.
3277 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3278 * decl.cs (MemberName.is_double_colon): New.
3279 (MemberName.MemberName): Add new constructor for alias-member.
3280 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3281 * expression.cs (QualifiedAliasMember): New expression type.
3283 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3285 * location.cs : it borked when no argument was specified.
3287 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3289 * location.cs : tiny ToString() format fix.
3291 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3293 * statement.cs : oops, it was missing.
3295 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3297 A set of fixes for precise line/column location.
3300 "token" field now holds a file/line "delta", a line number offset
3301 from the segment, and a column number. See also:
3302 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3303 December/009508.html
3304 Removed static IsNull. Use instance IsNull property instead.
3306 For some tokens it stores Location. For Identifier it stores
3307 LocatedToken which is a pair of string name and location.
3308 Column numbers are adjusted only at getChar().
3310 Use Location.ToString() for reporting (it now contains column).
3312 Largely modified to use LocatedToken instead of
3313 string (IDENTIFIER), and to acquire Location from some tokens.
3314 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3315 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3317 Now MemberName holds Location. DeclSpace.ctor() receives Location
3318 as a parameter. Removed extra parameters to all derived classes.
3319 Replaced Location.IsNull() with instance property.
3320 * assign.cs, expression.cs :
3321 Added .ctor() overload that omits Location.
3323 Added "nameEscaped" flag that indicates the identifier was escaped
3324 in the source file. This fixes bug #57047.
3326 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3328 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3329 New method, looking for lo-case imported cls type.
3331 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3334 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3336 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3338 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3340 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3342 Optimized to save 3.5 MB for SWF compilation.
3344 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3346 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3347 (PartialContainer.Create): Moved logic AddToContainer.
3348 (PartialContainer.MarkForDuplicationCheck): Shares name.
3350 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3353 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3355 (Namespace.GetSignatureForError): New method.
3357 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3358 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3360 2005-08-01 Raja R Harinath <rharinath@novell.com>
3363 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3364 member lookup rather than qualifier_type, since qualifier_type can
3367 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3369 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3372 2005-07-31 Miguel de Icaza <miguel@novell.com>
3374 * statement.cs: Copy the local exception into the exception
3375 captured local. Fixes 75674
3377 2005-07-31 Raja R Harinath <harinath@gmail.com>
3380 * expression.cs (Invocation.OverloadResolve): Don't report error
3381 CS1501 if error CS1502 has been reported.
3382 (New.DoResolve): Delegate CS1501 reporting to
3383 Invocation.OverloadResolve.
3386 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3387 invariant-meaning-in-block property in an enclosing block if
3390 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3392 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3393 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3394 (Switch.CheckSwitch): Just save 50kb for SWF.
3396 2005-07-27 Martin Baulig <martin@ximian.com>
3398 * anonymous.cs (CaptureContext.AddField): Added
3399 `AnonymousContainer am' argument; compute its toplevel scope if
3400 it's not already computed. Fixes #75649.
3402 2005-07-26 Raja R Harinath <rharinath@novell.com>
3405 * class.cs (Constructor.Emit): Reset block to null if the block
3408 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3410 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3412 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3414 * class.cs (MethodData.Define): Check whether accessor implementing
3415 interface is public.
3417 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3419 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3422 * namespace.cs (LookupType): Moved same type check to...
3424 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3427 2005-07-21 Raja R Harinath <rharinath@novell.com>
3429 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3430 already found a typebuilder.
3431 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3432 MemberNames, not strings.
3434 * const.cs (Error_ExpressionMustBeConst):
3435 Rename from Error_EpressionMustBeConst.
3436 * const.cs, class.cs, statement.cd: Update.
3438 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3442 * const.cs (Const.LookupConstantValue): Report missing contant expression
3444 (Error_EpressionMustBeConstant): Only one error method.
3446 * class.cs, statement.c: Updated.
3448 2005-07-20 Raja R Harinath <rharinath@novell.com>
3450 * statement.cs (Block.Flags): Add back HasVarargs.
3451 (Block.flags): Make protected.
3452 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3454 * typemanager.cs (types, typecontainers, user_types): Remove.
3455 (UserTypes, TypeContainers): Likewise.
3456 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3457 (CleanUp, Reset): Update.
3458 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3459 (GetNestedType): Use Type.GetNestedType.
3460 (CoreLookupType): Take two arguments, the namespace and the
3461 basename of the type. Update to use the Namespace.Lookup
3463 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3464 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3465 string concatenation and substring matches.
3466 * class.cs, enum.cs, delegate.cs: Update to changes.
3468 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3470 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3471 Expression and made virtual.
3473 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3474 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3476 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3478 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3481 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3484 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3487 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3488 AssemblyCultureAttribute is not used on executable.
3491 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3493 2005-07-16 Raja R Harinath <rharinath@novell.com>
3496 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3497 New. Reports CS0252/CS0253.
3498 Mostly taken from preliminary patch by Duncak Mak.
3499 (Binary.DoResolveOperator): Store results of operator lookup.
3500 Use them to detect if we need to warn about unintended reference
3503 2005-07-15 Raja R Harinath <rharinath@novell.com>
3506 * namespace.cs (Namespace.Lookup): Add back location parameter.
3507 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3508 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3510 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3511 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3512 (Namespace.LookupType): ... this.
3513 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3515 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3516 purported to handle pointers.
3517 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3520 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3522 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3525 2005-07-15 Raja R Harinath <rharinath@novell.com>
3527 * namespace.cs (Namespace.Lookup): Drop location parameter.
3528 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3529 (NamespaceEntry.Lookup): ... this.
3530 (NamespaceEntry.Error_AmbiguousTypeReference):
3531 Move here from DeclSpace.
3532 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3534 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3535 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3536 Move to NamespaceEntry.
3537 * delegate.cs, expression.cs: Update to changes.
3539 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3541 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3542 CheckAttributeType and refactored.
3543 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3544 ResolveAsTypeTerminal error handling.
3545 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3547 (GetSignatureForError): Print errors in same way.
3550 * codegen.cs: Reflect attribute GetSignatureForError change.
3553 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3555 * namespace.cs (UsingEntry): Refactored to make fields private.
3558 statement.cs: Error_UnexpectedKind has extra parameter.
3560 2005-07-14 Raja R Harinath <rharinath@novell.com>
3562 * ecore.cs (IAlias): Remove.
3563 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3564 that implement the interface.
3565 * namespace.cs (Namespace): Likewise.
3566 (Namespace.declspaces): Renamed from 'defined_names'.
3567 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3568 DeclSpace instead of an IAlias.
3569 * tree.cs (Tree.AddDecl): Update.
3571 2005-07-12 Raja R Harinath <rharinath@novell.com>
3573 * statement.cs (Block.Flags); Remove HasVarargs.
3574 (Block.HasVarargs): Move to ToplevelBlock.
3575 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3576 (Block.Variables): Make protected. Initialize variable hashtable
3578 (Block.AddVariable): Update.
3579 (Block.Resolve): Update to changes.
3580 (ToplevelBlock.HasVarargs): New boolean.
3581 (ToplevelBlock.ThisVariable): Move here from Block.
3582 (ToplevelBlock.AddThisVariable): Likewise.
3583 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3584 * expression.cs (This.ResolveBase): Update to changes.
3585 (ArglistAccess.DoResolve): Likewise.
3587 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3590 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3592 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3593 not used and not used & assigned.
3594 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3596 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3599 * expression.cs (Is.DoResolve): null is never provided type.
3601 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3604 * cs-parser.jay: Less strict event error rule to catch more errors.
3606 2005-07-08 Martin Baulig <martin@ximian.com>
3608 Fix test-iter-10.cs - distinguish whether we `yield' in a property
3609 gettter (allowed) or setter (not allowed).
3611 * class.cs (Accessor): Implement IIteratorContainer.
3612 (Accessor.Yields): New public field.
3613 (PropertyBase.PropertyMethod.Define): Handle iterators on a
3617 (get_accessor_declaration, set_accessor_declaration): Set the
3618 `yields' flag on the accessor, not the property.
3619 (property_declaration): Do the iterators check on a per-accessor
3620 basis and not for the whole property.
3622 2005-07-08 Martin Baulig <martin@ximian.com>
3624 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3625 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3627 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3630 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3631 (ExtractSecurityPermissionSet): Cope with self referencing security
3632 attributes properly.
3634 * driver.cs (SetOutputFile): Made public property OutputFile.
3636 2005-07-07 Raja R Harinath <rharinath@novell.com>
3639 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3640 has_nonstatic_fields. Make into a FieldBase pointer.
3641 (TypeContainer.AddField): Add CS0282 check.
3642 (TypeContainer.EmitType): Update.
3644 2005-07-06 Miguel de Icaza <miguel@novell.com>
3646 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3647 compare if they start with __.
3649 2005-07-06 Raja R Harinath <rharinath@novell.com>
3651 * statement.cs (Switch.SwitchGoverningType): Only look at
3652 UserCasts that don't need implicit standard conversions to one of
3653 the allowed switch types (Fixes test-322.cs).
3654 (LocalInfo.Resolve): Re-enable sanity-test.
3656 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3658 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3660 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3662 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3664 2005-07-06 Raja R Harinath <rharinath@novell.com>
3667 * ecore.cs (SimpleName.GetSignatureForError): Add.
3668 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3669 (MemberAccess.GetSignatureForError): Add.
3671 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3673 The big error and warning messages review.
3703 * typemanager.cs: Updated.
3705 * class.cs: (MethodCore.SetYields): Moved here to share.
3706 (PropertyMethod.Define): Moved iterator setup here.
3708 * iterators.cs: Add orig_method to have full access to parent
3711 2005-07-05 Raja R Harinath <rharinath@novell.com>
3713 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3714 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3715 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3716 variable of struct type.
3717 * expression.cs (Unary.ResolveOperator): Update to change.
3718 (Indirection.VerifyFixed): Likewise.
3719 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3720 (ParameterReference.VerifyFixed): Value parameters are fixed.
3721 (This.VerifyFixed): Treat 'this' as a value parameter.
3722 * statement.cs (LocalInfo.IsFixed): Remove.
3724 2005-07-01 Martin Baulig <martin@ximian.com>
3726 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3727 `ec.EmitThis ()' to get the correct scope.
3729 2005-07-01 Martin Baulig <martin@ximian.com>
3731 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3732 instance is a ParameterReference; fixes #75299.
3734 2005-07-01 Martin Baulig <martin@ximian.com>
3736 Reverted Marek's latest patch (r46725):
3737 - it contains structural changes which are neither mentioned in
3738 the ChangeLog nor explained anywhere; for example the additional
3739 argument of EmitContext's and Iterator's .ctor's and the
3740 TypeContainer.DefineMembers() change.
3741 - structural changes like this should go in in seperate patches
3742 and not be hidden in a huge patch which just seems to affect
3743 warnings and errors.
3744 a big and hard to understand patch.
3745 - it breaks iterators and causes regressions, for instance in
3748 2005-06-30 Raja R Harinath <rharinath@novell.com>
3751 * expression.cs (Indexers.map): Remove.
3752 (Indexers.Append): Filter out inaccessible setters and getters.
3753 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3756 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3758 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3759 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3760 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3761 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3763 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3766 * class.cs (FieldBase.GetInitializerExpression): One more field
3769 2005-06-28 Miguel de Icaza <miguel@novell.com>
3771 * pending.cs: Do not define a proxy if the base method is virtual,
3772 it will be picked up by the runtime (bug 75270).
3774 2005-06-08 Martin Baulig <martin@ximian.com>
3776 The big Iterators rewrite :-)
3778 * iterators.cs: Rewrite this to use the anonymous methods framework.
3780 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3781 before the TypeContainers; see 2test-21.cs.
3784 (TypeContainer.DefineType): Don't create a new EmitContext if we
3785 already have one (this only happens if we're an Iterator).
3786 (TypeContainer.Define): Also call Define() on all our iterators.
3787 (Method.CreateEmitContext): Added support for iterators.
3790 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3791 (AnonymousContainer.CreateMethodHost): Moved here from
3792 AnonymousMethod and made abstract.
3793 (AnonymousContainer.CreateScopeType): New abstract method.
3794 (AnonymousContainer.IsIterator): New public property.
3795 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3796 get the ScopeTypeBuilder rather than manually defining it here.
3797 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3800 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3801 before RootContext.DefineTypes().
3803 * codegen.cs (EmitContext.RemapToProxy): Removed.
3804 (EmitContext.CurrentAnonymousMethod): Changed type from
3805 AnonymousMethod -> AnonymousContainer.
3806 (EmitContext.ResolveTopBlock): Protect from being called twice.
3807 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3808 (EmitContext.EmitThis): Removed the iterators hacks; use the
3809 anonymous methods framework for that.
3812 (ToplevelBlock.Container): Make this a property, not a field.
3813 (ToplevelBlock.ReParent): New public method; move the
3814 ToplevelBlock into a new container.
3815 (Foreach.TemporaryVariable): Simplify.
3817 2005-06-05 Martin Baulig <martin@ximian.com>
3819 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3820 (Block.AddTemporaryVariable): New public method; creates a new
3821 `LocalInfo' for a temporary variable.
3822 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3824 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3825 non-iterator variables.
3827 2005-06-05 Martin Baulig <martin@ximian.com>
3829 * statement.cs (Foreach.TemporaryVariable): Create the
3830 LocalBuilder in the Emit phase and not in Resolve since in some
3831 situations, we don't have an ILGenerator during Resolve; see
3832 2test-19.cs for an example.
3834 2005-06-04 Martin Baulig <martin@ximian.com>
3836 **** Merged r45395 from GCS ****
3838 The big Foreach rewrite - Part II.
3840 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3841 with `PropertyInfo ienumerator_getcurrent'.
3843 * codegen.cs (VariableStorage): Removed.
3846 (Foreach): Derive from Statement, not ExceptionStatement.
3847 (Foreach.CollectionForeach): New nested class. Moved all the code
3848 dealing with collection foreach here.
3849 (Foreach.ForeachHelperMethods): Removed.
3850 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3852 2005-05-23 Martin Baulig <martin@ximian.com>
3854 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3855 don't need to. Fix #75014.
3857 2005-05-20 Martin Baulig <martin@ximian.com>
3859 Merged r44808 from GMCS.
3861 * class.cs (TypeContainer.CircularDepException): Removed.
3862 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3863 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3864 (CS0146) and interface (CS0529) dependencies here.
3866 2005-06-21 Raja R Harinath <rharinath@novell.com>
3868 * expression.cs (Invocation.EmitCall): Fix initialization
3869 'this_call' to reflect current behaviour. Fix indentation.
3871 * convert.cs (FindMostEncompassedType): Add two trivial special
3872 cases (number_of_types == 0 || number_of_types == 1).
3873 (FindMostEncompasingType): Likewise.
3875 2005-06-17 Raja R Harinath <rharinath@novell.com>
3877 Some cleanups preparing for the fix of #75283.
3878 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3880 (EventExpr.InstanceResolve): Likewise.
3881 (EventExpr.DoResolve): Remove redundant checks.
3883 2005-06-10 Duncan Mak <duncan@novell.com>
3885 * cs-tokenizer.cs (process_directives): New flag for controlling
3886 the processing of preprocessor directives.
3887 (x_token): After seeing a '#', return Token.NONE instead of going
3888 to handle_preprocessing_directive() when not processing
3889 directives. This avoids unnecessary processing during the token peek in
3894 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3895 the existing error reporting methods instead of Report.Error.
3897 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3898 after Raja's rewrite.
3900 2005-06-08 Miguel de Icaza <miguel@novell.com>
3902 * class.cs: Small fix.
3904 2005-06-08 Raja R Harinath <rharinath@novell.com>
3907 * class.cs (GetPartialBases): Fix return value check of
3910 2005-06-07 Raja R Harinath <rharinath@novell.com>
3912 Ensure that partial classes are registered in their enclosing
3913 namespace. Initial part of fix of #75160.
3914 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3915 Register declspace with namespace here, not in
3916 DeclSpace.RecordDecl.
3917 * cs-parser.jay: Pass namespace to RecordDecl.
3918 * class.cs (PartialContainer.Create): Likewise.
3919 (ClassPart.DefineType): New sanity-check. Throws an exception if
3921 * decl.cs (Declspace.RecordDecl): Remove.
3922 * namespace.cs (NamespaceEntry.DefineName): Remove.
3924 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3926 * rootcontext.cs: Reset TargetExt as well.
3928 2005-06-03 Raja R Harinath <rharinath@novell.com>
3930 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3933 2005-06-02 Raja R Harinath <rharinath@novell.com>
3935 Fix #75080, cs0119.cs.
3936 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3938 (Expression.Resolve): ... this. Use it. Remove bogus code
3939 allowing ExprClass.Type and ExprClass.Namespace for
3940 ResolveFlags.VariableOrValue.
3941 (Expression.Resolve) [1-argument variant]: Change default resolve
3942 flags based on language version.
3943 (Expression.Error_UnexpectedKind): Use a simple string array
3944 rather than an ArrayList.
3945 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3947 (TypeOfVoid.DoResolve): Likewise.
3948 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3949 flags argument -- it always has the same value.
3951 2005-05-31 Raja R Harinath <rharinath@novell.com>
3954 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3955 Use it in the error message.
3956 * assign.cs, expression.cs, statement.cs: Update.
3958 2005-05-30 Raja R Harinath <rharinath@novell.com>
3961 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3962 the "almostMatchedMember" case too.
3963 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3964 that failed the accessibility checks to 'almost_match'.
3966 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3968 * attribute.cs: Use internal MethodBuilder methods to set
3969 ExactSpelling and SetLastError on PInvoke methods, instead
3970 of passing them via charset. Fixes #75060.
3972 2005-05-27 Raja R Harinath <rharinath@novell.com>
3974 * parameter.cs (Parameter): Remove TODO comment.
3975 (Parameter.DefineParameter): Remove Location parameter.
3976 (Parameters.LabelParameters): Likewise.
3977 * class.cs (Constructor.Emit): Update to change.
3978 (MethodData.Emit): Likewise.
3979 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3980 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3982 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3985 Removed Parameters.Location and added Parameter.Location instead.
3986 Removed Location parameter from Emit() and GetSignature().
3993 Modified all related calls.
3995 2005-05-26 Raja R Harinath <rharinath@novell.com>
3997 Improve user-defined conversion handling.
3998 * convert.cs (GetConversionOperators): Rewrite. Return only the
3999 applicable operators.
4000 (AddConversionOperators): New. Helper for GetConversionOperators.
4001 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4002 there is only one most encompassed/encompassing type.
4003 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4004 "applicable operator" handling.
4005 (UserConversion): Move cache here from GetConversionOperators.
4006 Directly cache the chosen operator, rather than the whole
4008 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4009 case. Allow conversion of decimal to sbyte and byte too.
4010 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4011 New static methods. Used to avoid allocating EmptyExpressions in
4014 2005-05-24 Duncan Mak <duncan@novell.com>
4016 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4017 another class, used in Convert.ExplicitNumericConversion.
4018 (CastToDecimal): New class, similar to above, but casts to
4019 System.Decimal, used in Convert.ImplicitNumericConversion and also
4020 in explicit convesion from double/float to decimal.
4022 * convert.cs (ImplicitNumericConversion): Handle implicit
4023 conversions to System.Decimal.
4024 (ExplicitNumericConversion): handle explicit conversions to
4029 2005-05-20 Miguel de Icaza <miguel@novell.com>
4031 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4032 know the type at this stage, just break through. Fixes #75008
4034 2005-05-19 Martin Baulig <martin@ximian.com>
4037 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4038 to disable error reporting.
4040 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4041 here since we don't want to report an error; see the new test-336.cs.
4043 2005-05-19 Raja R Harinath <rharinath@novell.com>
4045 * statement.cs (ToplevelBlock.GetParameterReference)
4046 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4047 Move here from class Block.
4048 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4049 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4051 2005-05-18 Martin Baulig <martin@ximian.com>
4056 (FlowBranching.Reachability): Add non-static public And() and Or()
4058 (FlowBranchingSwitch): New class; do the `break_origins' thing
4059 like in FlowBranchingLoop.
4060 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4061 reachability, not just locals and parameters.
4062 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4063 switch; MergeBreakOrigins() now takes care of that.
4065 2005-05-18 Martin Baulig <martin@ximian.com>
4067 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4068 a loop and may leave it, reset the barrier; fixes #74974.
4070 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4072 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4075 * cs-parser.jay: Catch more lexical errors.
4077 * report.cs: Add one more Error method.
4080 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4082 2005-05-17 Martin Baulig <martin@ximian.com>
4084 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4087 2005-05-16 Raja R Harinath <rharinath@novell.com>
4089 Fix test-382.cs. Emit values of decimal constants.
4090 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4092 (TypeContainer.AddField): ... this.
4093 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4094 with initializers to include 'Const's.
4095 (ClassPart.RegisterFieldForInitialization): Forward to
4097 * const.cs (Const.Const): Pass initializer to base class.
4098 (Const.Define): In case of decimal constants, register them for
4099 initialization in a static constructor.
4101 2005-05-14 Martin Baulig <martin@ximian.com>
4103 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4104 do not call ResolveUnreachable() on unreachable statements in
4105 here, see the comment in the source code.
4107 2005-05-13 Raja R Harinath <rharinath@novell.com>
4110 * expression.cs (BinaryResolveOperator): If one of the operands of
4111 an equality comparison is 'null' and the other is a pointer type,
4112 convert the null to a NullPointer.
4113 * convert.cs (ImplicitReferenceConversion): If the expression is a
4114 NullLiteral and the target type is a pointer type, return a
4115 NullPointer instead.
4116 (ImplicitConversionStandard): Likewise.
4118 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4120 * cs-parser.jay: Set readonly context based on special constructs.
4122 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4123 readonly variable error handling.
4125 * rootcontext.cs (EmitCode): Don't verify members when error
4128 * statement.cs (LocalInfo): Add reaodnly context information.
4129 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4131 2005-05-13 Raja R Harinath <rharinath@novell.com>
4133 * statement.cs (Block.Resolve): Revert change below. Modify fix
4134 for #74041 to initialize 'resolved' to false only for explicit
4135 blocks. Fixes #74873.
4137 2005-05-12 Raja R Harinath <harinath@gmail.com>
4140 * typemanager.cs (unmanaged_enclosing_types): New.
4141 (IsUnmanagedType): Avoid infloops by using
4142 'unmanaged_enclosing_types' to talk with recursive invocations.
4144 2005-05-13 Martin Baulig <martin@ximian.com>
4146 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4147 instance variable, not a local. Fix #74873.
4148 (Block.ResolveUnreachable): Set it to true here.
4150 2005-05-11 Duncan Mak <duncan@novell.com>
4152 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4153 continuing to process for 'arg'.
4154 (handle_preprocessing_directive): Check the argument of the #endif
4155 directive and report error CS1025 if there are any trailing
4158 According to the C# spec, having even whitespace after the #endif
4159 directive is illegal; however, because we call arg.TrimEnd ()
4160 beforehand, we have the same behavior as csc, allowing whitespace
4161 after the directive.
4165 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4169 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4170 (Constructor.GetObsoleteAttribute): Implemented correctly.
4172 2005-05-10 Martin Baulig <martin@ximian.com>
4174 * support.cs (ReflectionParameters.ParameterModifier): Use
4175 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4176 and `ParameterAttributes.In'. Fixes #74884.
4178 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4180 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4182 * expression.cs (Argument.GetParameterModifier): Turned to property.
4183 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4185 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4188 2005-05-09 Raja R Harinath <rharinath@novell.com>
4191 * decl.cs (MemberCache.AddMethods): Register override methods,
4192 rather than non-override methods.
4193 * typemanager.cs (RegisterOverride): New.
4194 (IsOverride): Update.
4196 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4200 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4201 recursive declaration.
4203 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4205 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4207 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4209 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4211 2005-05-05 Raja R Harinath <rharinath@novell.com>
4214 * decl.cs (DeclSpace.FamilyAccessible):
4215 Use TypeManager.IsNestedFamilyAccessible.
4217 Fix reopened #64812.
4218 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4221 2005-05-04 Raja R Harinath <rharinath@novell.com>
4222 Abin Thomas <projectmonokochi@rediffmail.com>
4223 Anoob V E <projectmonokochi@rediffmail.com>
4224 Harilal P R <projectmonokochi@rediffmail.com>
4227 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4228 allow access to all static members.
4230 2005-05-04 Martin Baulig <martin@ximian.com>
4232 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4234 2005-05-04 Martin Baulig <martin@ximian.com>
4238 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4239 section at the end; make things work if `default' is not the last
4242 2005-05-04 Martin Baulig <martin@ximian.com>
4246 * statement.cs (Switch): Replaced the `got_default' field with a
4247 `default_section' one.
4248 (Switch.CheckSwitch): Set `default_section' here.
4249 (Switch.Resolve): If we're a constant switch and the constant is
4250 not found, use the default section.
4252 2005-05-03 Martin Baulig <martin@ximian.com>
4254 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4256 * statement.cs (Foreach.ArrayForeach): New nested class.
4257 (Foreach.TemporaryVariable): New nested class.
4258 (Foreach.EmitArrayForeach): Removed; this is now in the new
4261 2005-05-03 Raja R Harinath <rharinath@novell.com>
4263 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4265 (VerifyPendingMethods): Revert change below.
4267 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4268 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4269 that used to trigger warning -28. Remove warning -28.
4270 * expression.cs (Invocation.OverloadResolve): Use
4271 TypeManager.IsOverride to distinguish override methods.
4274 * pending.cs (VerifyPendingMethods): If a base type implements the
4275 requested interface, don't bother checking individual methods of
4276 the base type. As a side-effect, this prevents the creation of
4277 unnecessary proxies.
4279 2005-05-02 Martin Baulig <martin@ximian.com>
4283 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4284 Also `And' the locals if the old vector is null.
4285 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4286 null; in this case we basically reset all the variables.
4288 2005-05-02 Martin Baulig <martin@ximian.com>
4292 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4293 Added `FlowBranching branching' argument; always `and' the
4294 variables instead of `or'ing them unless we're an infinite loop.
4296 * statement.cs (While.Resolve): Create a new sibling unless we're
4299 2005-05-02 Martin Baulig <martin@ximian.com>
4303 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4304 arguments; use it instead of creating a new TopLevelBlock.
4305 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4306 our ConstructorInitializer.
4309 (TopLevelBlock.TopLevelBranching): New public property.
4310 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4311 and create our `TopLevelBranching'.
4313 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4314 anonymous method host, use `block.TopLevelBranching' rather than
4315 creating a new branching.
4317 2005-04-20 Miguel de Icaza <miguel@novell.com>
4319 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4320 a ScopeInfo, if any of the current children is a child of the new
4321 entry, move those children there.
4323 2005-04-30 Martin Baulig <martin@ximian.com>
4325 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4326 at the beginning of a SwitchSection. Fix #73335.
4328 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4331 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4333 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4334 (FieldExpr.DoResolve): Obsolete members are ignored for field
4337 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4339 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4340 of arrays detection.
4342 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4344 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4346 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4349 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4351 * cs-parser.jay: Use the prefered version of -unsafe in error
4354 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4356 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4359 2005-04-20 John Luke <john.luke@gmail.com>
4361 * driver.cs: fix typo in error message, --outout to --output
4363 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4365 * codegen.cs (InRefOutArgumentResolving): New field.
4367 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4368 fields outside contructor.
4370 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4372 2005-04-19 Miguel de Icaza <miguel@novell.com>
4374 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4375 parameter code was not completed ever, so it was not as up-to-date
4376 as local variables. Must finish it.
4378 The bug fix was to compare the Toplevel of the block, not the
4379 current block. Thanks for Ben for pointing this out.
4381 2005-04-19 Raja R Harinath <rharinath@novell.com>
4383 * decl.cs (AddMethods): Use the declaring type of the problem
4384 method to determine if we want to squash a warning.
4386 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4388 * attribute.cs: Removed debug output.
4390 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4392 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4395 2005-04-18 Raja R Harinath <rharinath@novell.com>
4398 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4399 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4400 all null comparisons against reference types.
4402 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4405 * class.cs (TypeContainer.CircularDepException) New nested
4407 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4408 (TypeContainer.DefineType): Removed error, reset InTransit before
4410 (Class.DefineType): Throw exception when is in Transit.
4411 Catch exception and report error.
4412 (Struct.DefineType): Throw exception when is in Transit.
4413 Catch exception and report error.
4414 (Interface.DefineType): Throw exception when is in Transit.
4415 Catch exception and report error.
4417 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4418 handle nested exception handlers.
4420 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4423 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4424 InFinally and InCatch storage.
4426 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4427 (Catch.Resolve): Set and Restore ec.InCatch.
4428 (Try.Resolve): Set and Restore ec.InFinally.
4429 (Try.HasCatch): True when try has catch.
4431 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4433 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4434 for the same event member, so exclude such cases from warning 419.
4437 2005-04-16 Miguel de Icaza <miguel@novell.com>
4439 * expression.cs (Binary.ResolveOperator): Apply patch from John
4440 Luke to fix bug 59864: operators &, | and ^ on enumerations
4441 require that the same enum type on both sides.
4443 * driver.cs: Add warnings to old flag usage, this is to assist
4444 people who produce Makefiles and hope that the Makefiles will be
4447 * class.cs (TypeContainer.EmitType): Moved the definition of the
4448 special $PRIVATE$ field from the resolve phase to the Emit phase.
4449 During resolve we do not know if we are a struct with
4450 HasExplicitLayout, we know this only after the attributes for the
4453 Set the FieldOffset to zero on the dummy field that we create for
4454 the class. Fixes 74590.
4456 2005-04-16 Raja R Harinath <rharinath@novell.com>
4459 * ecore.cs (PropertyExpr.resolved): New.
4460 (DoResolve): Use it to handle a case of double resolution here.
4461 Handle a case of identical-name-and-type-name.
4462 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4463 resolution by storing the results of expression resolution back
4464 into the "probes" array.
4466 2005-04-15 Raja R Harinath <rharinath@novell.com>
4468 Fix cs0208-7.cs and cs0208-8.cs.
4469 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4470 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4471 error reporting to point out the reason a struct is not unmanaged.
4473 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4475 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4476 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4478 2005-04-13 Raja R Harinath <rharinath@novell.com>
4481 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4482 IdenticalNameAndTypeName here.
4483 (EventExpr.InstanceResolve): Likewise.
4485 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4487 C# 2.0 DefaultCharSetAttribute implementation
4489 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4490 which allows us to set GlobalNamespace for every resolve.
4491 (Attribute.ResolveArguments): Cut from Resolve.
4492 (Attribute.GetCharSetValue): Returns CharSet named argument.
4493 (Attribute.DefinePInvokeMethod): Gets default charset from
4495 (GlobalAttribute.ResolveAsTypeStep): Override.
4496 (GlobalAttribute.ResolveArguments): Override.
4498 * class.cs (TypeAttr): Is protected.
4500 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4501 (ModuleClass.DefaultCharSetType): New memeber.
4502 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4504 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4505 charset from module.
4507 * delegate.cs (TypeAttr): Override.
4508 (Delegate.DefineType): Use this TypeAttr.
4510 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4511 at very early stage (before types are defined) to resolve model
4512 module attributes. It will probably not work with corlib but it
4515 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4516 charset from module.
4518 * typemanager.cs (default_charset_type): New type.
4520 2005-04-13 Raja R Harinath <rharinath@novell.com>
4522 * decl.cs (MemberCache.AddMethods): Don't warn if
4523 System.Object.Finalize has buggy MethodAttributes.
4525 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4528 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4530 * doc.cs : detect ambiguous reference to overloaded members.
4531 Fixed bug #71603. MS 1.1 csc does not detect it.
4533 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4535 * doc.cs : delegates must not be referenced with parameters.
4538 2005-04-12 Miguel de Icaza <miguel@novell.com>
4540 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4542 2005-04-10 Miguel de Icaza <miguel@novell.com>
4544 * driver.cs (MainDriver): Stop processing if the CLS stage found
4547 (CompilerCallableEntryPoint.InvokeCompiler): Always
4548 reset after execution; Take a TextWriter argument for the
4551 * report.cs: Use the error stream instead of hardcoding stderr.
4553 2005-04-09 Miguel de Icaza <miguel@novell.com>
4555 * class.cs: Reduce code paths to test, too small of an
4556 optimization to make it worth the extra testing. Always perform
4559 2005-04-08 Raja R Harinath <rharinath@novell.com>
4562 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4563 operators that had errors reported on them.
4565 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4567 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4569 (Attribute.Resolve): Add named argument type checking.
4571 * class.cs (FixedField.Define): Use IsPrimitiveType
4573 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4575 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4576 unsafe parameter types.
4578 * statement.cs (Using.ResolveExpression): Add better error description.
4580 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4582 2005-04-08 Raja R Harinath <rharinath@novell.com>
4585 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4586 AttributeUsageAttribute in the emitcontext of the attribute class,
4587 not in the emitcontext of the attributable entity it was attached to.
4588 * cs-parser.jay: Use 'current_class', not 'current_container',
4589 when creating a GlobalAttribute.
4591 2005-04-08 Alp Toker <alp@atoker.com>
4593 * pending.cs: The fix to #58413 failed to compile methods implementing
4594 interfaces with/without params modifiers and vice versa, even though
4595 params modifiers aren't part of the signature. Make the modifier check
4596 less strict as in csc.
4598 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4599 Anoob V E <projectmonokochi@rediffmail.com>
4600 Harilal P R <projectmonokochi@rediffmail.com>
4603 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4604 modifiers of pending methods.
4605 (PendingImplementation.PendingImplementation): Initialize it.
4606 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4607 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4608 with ParameterData. Add check for modifiers.
4609 * class.cs (MethodData.Define): Update to changes.
4611 2005-04-07 Raja R Harinath <rharinath@novell.com>
4613 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4615 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4617 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4620 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4623 * typemanager.cs: Registered RequiredAttributeAttribute.
4625 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4627 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4628 Warning CS0169 is back at level 3.
4629 (IMethodData.SetMemberIsUsed): New method.
4631 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4632 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4634 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4636 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4638 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4641 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4644 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4645 to avoid the problems with nested types.
4647 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4648 Anoob V.E <projectmonokochi@rediffmail.com>
4649 Harilal P.R <projectmonokochi@rediffmail.com>
4650 Raja R Harinath <rharinath@novell.com>
4653 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4655 * typemanager (GetConstructor): Make public.
4657 2005-04-05 John Luke <john.luke@gmail.com>
4658 Raja R Harinath <rharinath@novell.com>
4661 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4662 struct too. Return false quicker in a few cases.
4663 (VerifyUnManaged): Use it.
4665 2005-04-05 Raja R Harinath <rharinath@novell.com>
4668 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4669 not 'unreachable_seen'.
4671 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4673 * attribute.cs (Attribute.GetValue): Removed unused.
4675 * codegen.cs (CodeGen.TrimExt): Removed unused.
4677 * cs-parser.jay (output): Removed unused.
4679 * cs-tokenizer.cs (hex_digits): Removed unused.
4681 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4683 * expression.cs (Indirection.LoadExprValue): Removed unused.
4684 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4686 * iterators.cs (Iterator.param_types): Removed unused.
4688 * statement.cs (Goto.block): Removed unused.
4689 (ToplevelBlock.did): Removed unused.
4690 (Switch.ResolveConstantSwitch): Removed unused.
4692 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4694 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4697 2005-04-01 Raja R Harinath <rharinath@novell.com>
4699 Fix #74232 and cs0208-3.cs.
4700 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4701 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4702 unmanaged type. Don't use FieldBuilders when 't' is a
4703 TypeBuilder. Use ModFlags and MemberType fields.
4704 * class.cs (MemberBase.member_type): Rename from MemberType.
4705 (MemberBase.MemberType): New property. Determines member_type on
4707 (MemberBase.DoDefine): Don't initialize MemberType here.
4708 (FieldMember.Define): Likewise.
4710 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4713 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4714 Attributes are emitted there.
4716 2005-04-01 Raja R Harinath <rharinath@novell.com>
4718 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4719 keyword in 'partial enum' too.
4720 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4722 Report from Kamil Skalski <nazgul@omega.pl>.
4725 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4726 have partial containers too.
4728 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4729 in block' checks to Block.CheckInvariantMeaningInBlock.
4730 * statement.cs (Block.GetKnownVariableInfo): Make private.
4731 (Block.IsVariableUsedInChildBlock): Remove.
4732 (Block.IsVariableUsedInBlock): Likewise.
4733 (Block.CheckInvariantMeaningInBlock): New. Show location of
4734 conflicting declaration.
4735 (Block.AddVariable): Make error messages less long-winded and more
4736 specific. Show location of conflicting declaration.
4737 * parameter.cs (Parameters.Location): New readonly property.
4739 2005-03-31 Raja R Harinath <rharinath@novell.com>
4741 Clean up semantics of invoking ResolveMemberAccess.
4742 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4743 can have an instance, ensure that we pass in a non-TypeExpression
4744 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4745 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4746 argument. Update to changes and simplify.
4747 (FieldExpr.Emitinstance): Remove CS0120 check.
4748 (PropertyExpr.EmitInstance): Likewise.
4749 * expression.cs (Argument.Resolve): Likewise.
4750 (Invocation.DoResolve): Update to changes in semantics of
4753 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4756 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4759 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4761 2005-03-31 Raja R Harinath <rharinath@novell.com>
4763 Fix difference in behaviour with commandline invocation.
4764 * driver.cs (Driver.Reset): New.
4765 (CompilerCallableEntryPoint): Call it.
4767 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4768 variable" warnings if the boolean expression failed to resolve.
4770 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4772 * attribute.cs: Fix the union of several permissions when some of them
4773 are unrestricted (so the result isn't an unrestricted permission set).
4776 2005-03-30 Raja R Harinath <rharinath@novell.com>
4778 * ecore.cs (MemberExpr): New class. Convert from interface
4780 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4781 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4783 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4784 (MethodGroupExpr.IsExplicitImpl): Remove.
4785 (Expression.GetFieldFromEvent): Remove.
4786 (SimpleName.MemberStaticCheck): Remove.
4787 (SimpleName.DoSimpleNameResolve): Update to changes.
4788 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4789 (MemberAccess.IdenticalNameAndTypeName): Remove.
4790 (MemberAccess.error176): Move to MemberExpr.
4791 (MemberAccess.DoResolve): Update to changes.
4792 (BaseAccess.DoResolve): Likewise.
4794 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4796 C# 2.0 Conditional attribute class implementation
4798 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4799 Analyzes class whether it has attribute which has ConditionalAttribute
4800 and its condition is not defined.
4802 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4803 (Class.IsExcluded): New method. Search for at least one defined
4804 condition in ConditionalAttribute of attribute class.
4806 2005-03-30 Raja R Harinath <rharinath@novell.com>
4808 * ecore.cs (PropertyExpr): Derive from Expression, not
4809 ExpressionStatement.
4810 (PropertyExpr.EmitStatement): Remove.
4812 2005-03-29 Raja R Harinath <rharinath@novell.com>
4815 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4816 internal field "value__" of an enum be private. The examples for
4817 "value__" that I found on MSDN all used FieldAttributes.Private.
4819 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4820 Don't mention IL method attribute names.
4822 Fix #47991. Remove a TODO.
4823 * statement.cs (Block.Toplevel): Make into a field.
4824 (Block.Parameters): Move into ToplevelBlock.
4825 (Block.known_variables): Rename from child_variable_names.
4826 (Block.Block): Remove variants that take Parameters. Initialize
4827 'Toplevel' with the immediately surrounding toplevel block.
4828 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4829 LocalInfo parameter.
4830 (Block.GetKnownVariableInfo): New.
4831 (Block.IsVariableNameUsedInChildBlock): Update.
4832 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4833 the block, even though it may not be in scope.
4834 (Block.AddVariable): Remove Parameters parameter. Use
4835 Toplevel.Parameters instead.
4836 (Block.AddConstant): Remove Parameters parameter.
4837 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4838 (Block.IsParamaterReference): Likewise.
4839 (Block.IsLocalParameter): Likewise. Simplify a lot.
4840 (ToplevelBlock.Parameters): New. Moved from Block.
4841 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4842 initialize Parameters to a non-null value.
4843 * cs-parser.jay: Update to changes.
4844 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4845 simple names that mean different things in the same block. Use
4846 Block.IsVariableNameUsedInBlock.
4848 2005-03-28 Raja R Harinath <rharinath@novell.com>
4850 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4851 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4852 GetTypeHandle. It is possible for a reflected type to derive from
4853 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4854 System.Array during mscorlib compilation).
4855 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4856 contain a method_hash, don't create one either. Don't create a
4857 deep copy of the base cache's method_hash.
4858 (MemberCache.SetupCache): Rename back from DeepCopy.
4859 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4860 already initialized. If we see an override function, add its
4861 underlying base virtual function to the member_hash too.
4863 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4865 2005-03-26 Raja R Harinath <harinath@acm.org>
4868 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4869 fails to resolve, ensure that the LHS is still resolved as an
4872 2005-03-25 Raja R Harinath <harinath@acm.org>
4874 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4876 (Enum.current_ec): Remove.
4877 (Enum.LookupEnumValue): Remove EmitContext argument.
4878 Just uses the one created during DefineType.
4879 (Enum.FindMembers): Update.
4880 * expression.cs (MemberAccess.DoResolve): Update.
4882 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4884 * assign.cs (Assign.DoResolve): Check for CS1717 when
4885 source and target are same (uses Equals).
4887 * expression.cs (LocalVariableReference, ParameterReference,
4888 This): Implemented Equals, GetHashCode.
4890 * statement.cs (Block.GetParameterReference): Removed useless
4893 2005-03-22 Raja R Harinath <rharinath@novell.com>
4896 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4897 blocks before deciding whether the error is cs0136 or cs0128.
4899 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4900 (using_alias_directive, using_namespace_directive): Pass
4901 MemberName, not an expression to Namespace.UsingAlias and
4903 (MakeName): Use the MemberName of the namespace.
4904 * namespace.cs (Namespace.MemberName): New.
4905 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4906 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4908 * decl.cs (MemberName.Name): Make readonly.
4909 (MemberName.FromDotted): New "constructor".
4910 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4911 (MemberCore.Name): Compute from MemberName on demand.
4912 (MemberCore.SetMemberName): Provide a way to change the
4914 (MemberCore.AddToContainer): Don't take a fullname parameter.
4915 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4916 fully qualified name of the container to the member name.
4917 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4918 only if the type is a member of the root container.
4919 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4920 MemberName.Left rather than searching for an embedded ".".
4921 (PartialContainer.CreatePart): Update to changes in RootContext.
4922 (MemberBase.ShortName): Turn into a property. Use
4923 MemberCore.SetMemberName.
4924 (MemberBase.ExplicitInterfaceName): Remove.
4925 (MemberBase.UpdateMemberName): Remove.
4926 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4927 (PropertyBase.SetMemberName): New override.
4928 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4929 (Tree.GetDecl): New.
4930 (Tree.AllDecls): Rename from Decls.
4931 * attribute.cs, enum.cs, report.cs: Update to changes.
4932 * driver.cs (MainDriver): Use MemberName.FromDotted on
4933 RootContext.MainClass.
4935 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4937 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4940 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4942 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4944 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4945 property accessor modifiers.
4947 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4948 fixed buffer attribute (CS1716).
4949 (PropertyMethod.HasCustomAccessModifier): When property accessor
4950 has custom modifier.
4952 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4954 (PropertyExpr.DoResolveLValue): Add CS0272.
4956 2005-03-17 Miguel de Icaza <miguel@novell.com>
4958 * convert.cs: When converting to a pointer, use the proper Conv.U
4959 or Conv.I depending on the source data type.
4961 * cs-tokenizer.cs: Make the size for large decimal constants,
4964 2005-03-17 Martin Baulig <martin@ximian.com>
4966 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4967 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4969 2005-03-17 Martin Baulig <martin@ximian.com>
4971 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4972 to bool so we can return an error condition.
4973 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4976 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4978 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4981 2005-03-16 Raja R Harinath <rharinath@novell.com>
4983 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4984 Refactor to avoid traversing the list of assemblies, and to avoid
4985 string concatenation.
4986 * typemanager.cs (guid_attr_type): Remove.
4987 (negative_hits, pointers, references): Remove hashes.
4989 (GetConstructedType): New. Uses type_hash to handle constructed
4990 types (arrays, references, pointers).
4991 (GetReferenceType, GetPointerType): Use it.
4992 (GetNestedType): New. Uses type_hash to handle nested types of
4994 (LookupType, LookupTypeDirect): Remove.
4995 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4996 'types' hash and LookupTypeReflection directly.
4997 (params_string, params_object): Use GetConstructedType.
4998 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5000 (Namespace.Lookup): Use cached_types.
5001 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5002 provided by old TypeManager.LookupType.
5003 * rootcontext.cs (MakeFQN): Remove.
5004 * decl.cs (DeclSpace.MakeFQN): Likewise.
5005 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5006 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5007 TypeManager.GetConstructedType.
5008 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5010 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5012 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5015 * cs-parser.jay: Reports CS1527 for any namespace element.
5017 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5020 * expression.cs (ParameterReference.IsAssigned): Changed error to
5022 (Error_WrongNumArguments): Moved CS0245 detection here.
5024 * statement.cs (Return.Resolve): Add CS1622 report.
5026 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5028 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5030 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5032 * attribute.cs expression.cs: Get rid of some allocations.
5034 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5036 * doc.cs : just eliminate the latest change.
5038 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5040 * doc.cs : commented out the latest change. It breaks xml-030.cs
5042 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5044 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5045 fail. So invoke CreateType() in FindDocumentedType().
5047 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5049 * cs-tokenizer.cs : added IsKeyword().
5050 * doc.cs : Detect keyword incorrectly used as identifier.
5051 Allow identifiers prefixed by @.
5053 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5055 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5056 It caused exception in namespace resolving (again!).
5058 * class.cs (Class.ctor): Removed exit.
5059 (PropertyMethod.ctor): ditto.
5061 * codegen.cs (Codegen.Reset): Reset static data.
5062 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5064 * cs-tokenizer.cs (Cleanup): Removed.
5066 * driver.cs (GetSystemDir): Rewrote to one line command.
5067 It caused problem with unloaded dynamic modules.
5068 (UnixParseOption): Removed Exit.
5069 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5070 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5071 Now can be mcs used as library.
5073 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5076 * location.cs (Reset): Reset static data.
5078 * namespace.cs (Reset): Reset static data.
5080 * report.cs (Report.Reset): Reset static data.
5082 * rootcontext.cs (RootContext.Reset): Reset static data.
5084 * tree.cs (RootTypes.ctor): Use Location.Null
5086 * typemanager.cs (TypeManager.Reset): Reset static data.
5087 (CoreLookupType): Removed Exit.
5088 (TypeHandle.Reset): Reset static data.
5090 2005-03-10 Raja R Harinath <rharinath@novell.com>
5093 * typemanager.cs (ComputeNamespaces): Import namespaces from
5094 referenced modules too.
5096 2005-03-09 Raja R Harinath <rharinath@novell.com>
5098 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5101 2005-03-09 Raja R Harinath <rharinath@novell.com>
5103 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5104 enclosing DeclSpace. This ensures that a name-lookup populates
5105 more caches and there are fewer 'TypeExpression's. Carve out
5106 nested type lookup into ...
5107 (LookupNestedTypeInHierarchy): ... this.
5109 2005-03-09 Raja R Harinath <rharinath@novell.com>
5111 Clean up a few partial-class semantics.
5112 Fixes test-357.cs and cs1618-2.cs.
5113 * cs-parser.jay (struct_declaration): Use 'current_class' as
5114 parent of newly-created struct. Remove call to Register ().
5115 Use 'pop_current_class' to complete handing the current struct.
5116 (interface_declaration): Likewise.
5117 (class_declaration): Likewise.
5118 (enum_declaration): Use 'current_class' as parent of newly created
5120 (delegate_declaration): Likewise.
5121 (pop_current_class): New function. This is used to handle closing
5122 up the 'current_class' and 'current_container', and pointing them
5123 to the enclosing class/container.
5124 (CSharpParser): Initialize 'current_class' too.
5125 * decl.cs (MemberCore): Add check for invariant: a partial
5126 container is not a parsed entity, and thus does not enclose any
5128 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5129 (DeclSpace.BaseTypeExpr): Use it.
5130 (DeclSpace.LookupType): Add check for invariant.
5131 * class.cs (TypeContainer): Add check for invariant: a nested
5132 class should have the same NamespaceEntry as its enclosing class.
5133 (TypeContainer.EmitFieldInitializers): Make virtual.
5134 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5136 (TypeContainer.Register): Remove.
5137 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5138 null. Use TypeResolveEmitContext for resolving base types and
5139 interfaces. Move initialization of Parts.TypeBuilder here from
5141 (TypeContainer.DefineNestedTypes): ... here.
5142 (PartialContainer): Take a Namespace not a NamespaceEntry.
5143 (PartialContainer.Create): Don't use Register. Call the
5144 appropriate Add... function directly.
5145 (ClassPart): Take both the PartialContainer and the enclosing
5146 class as constructor arguments.
5147 (ClassPart.EmitFieldInitializers): Override.
5148 (ClassPart.PartFindNestedTypes): Remove.
5149 (FieldBase.GetInitializerExpression): Resolve the initializer
5150 expression in the emit context of the enclosing class.
5151 * tree.cs (RootTypes): Remove Register ().
5153 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5155 * cs-parser.jay: Removed CS0134.
5157 * driver.cs: Removed CS1901.
5159 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5160 for predefined types.
5162 2005-03-07 Duncan Mak <duncan@novell.com>
5164 * codegen.cs (Save): Catch UnauthorizedAccessException as
5165 well. Fixes bug #73454.
5167 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5169 * cs-tokenizer.cs (xtoken): Add CS1035.
5171 * class.cs (MethodData.Define): Add CS0683.
5172 (FieldMember.ctor): Add CS0681.
5174 2005-03-07 Raja R Harinath <rharinath@novell.com>
5176 * ecore.cs (SimpleName.DoResolve): Rename from
5177 SimpleName.DoResolveAllowStatic.
5178 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5179 Pass 'intermediate' flag to MemberStaticCheck.
5180 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5181 of "intermediate" lookups via MemberAccess.
5182 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5183 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5185 2005-03-07 Raja R Harinath <rharinath@novell.com>
5188 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5189 slipped in because of variable names that are identical to a
5190 builtin type's BCL equivalent ('string String;', 'int Int32;').
5191 (PropertyExpr.EmitInstance): Likewise.
5193 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5195 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5197 * report.cs (warning_ignore_table): Made public.
5199 2005-03-04 Raja R Harinath <rharinath@novell.com>
5202 * class.cs (MethodData.Emit): Pass 'container' to
5203 container.GetObsoleteAttribute instead of 'container.Parent'.
5205 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5207 * cs-parser.jay: Add 1534 error test.
5209 * iterators.cs (Yield.CheckContext): Add error 1629.
5210 (Iterator.ctor): Save unsafe modifier.
5211 (MoveNextMethod.DoEmit): Restore unsafe context.
5213 * namespace.cs (UsingAlias): Better error message.
5215 2005-03-03 Dan Winship <danw@novell.com>
5217 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5218 the warning message [#73219]
5220 2005-03-03 Raja R Harinath <rharinath@novell.com>
5222 Fix compile with MCS 1.0.0.0.
5223 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5224 w_restore to not depend on string constant folding.
5226 2005-03-03 Raja R Harinath <rharinath@novell.com>
5228 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5229 CS0246 check to users who passed 'silent = false'.
5230 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5232 (SimpleName.SimpleNameResolve): Update.
5233 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5234 (MemberAccess.IdenticalNameAndTypeName): Update.
5235 * doc.cs (FindDocumentedTypeNonArray): Update.
5237 2005-03-03 Raja R Harinath <rharinath@novell.com>
5239 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5240 * parameters.cs (ComputeAndDefineParameters): Remove.
5241 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5242 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5243 Use GetParameterInfo.
5245 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5247 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5249 2005-03-02 Raja R Harinath <rharinath@novell.com>
5251 Unify DeclSpace.LookupType and DeclSpace.FindType.
5252 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5253 is in charge of defining nested types on demand.
5254 (DeclSpace.LookupType): Use it when the current_type is a
5255 TypeBuilder. Use LookupTypeDirect for reflected types.
5256 (DeclSpace.FindType): Remove.
5257 (DeclSpace.LookupInterfaceOrClass): Likewise.
5258 (DeclSpace.DefineTypeAndParents): Likewise.
5259 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5260 DeclSpace.LookupType.
5261 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5262 * typemanager.cs (LookupType): Simplify.
5263 (AddUserType): Remove type from negative_hits.
5264 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5265 * class.cs (TypeContainer.FindMembers): Move handling of nested
5267 (TypeContainer.FindMembers_NestedTypes): ... here.
5268 (TypeContainer.FindNestedType): Implement override.
5269 (ClassPart.FindNestedType): Delegate to PartialContainer.
5270 (ClassPart.PartFindNestedType): Looks up the nested types of the
5273 2005-03-02 Martin Baulig <martin@ximian.com>
5275 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5276 static constructor in static classes.
5278 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5280 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5281 sizeParamIndex is not specified.
5283 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5286 * report.cs (WarningMessage.IsEnabled): Missing null check.
5288 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5290 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5291 in the fields and not in the properties.
5293 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5295 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5298 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5300 * attribute.cs: Small refactoring (improved robustness).
5301 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5302 (ValidateGuid): Removed.
5303 (Resolve): Removed referenced to above mentioned.
5304 (GetAttributeUsage): Made private and changed to work without
5306 (GetIndexerAttributeValue): Don't crash.
5307 (GetConditionalAttributeValue): Ditto.
5308 (GetClsCompliantAttributeValue): Ditto.
5309 (ExtractSecurityPermissionSet): All attributes exceptions are
5311 (GetPropertyValue): New helper.
5312 (GetMethodImplOptions): New method.
5313 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5314 some missing properties.
5316 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5317 (Method.ApplyAttributeBuilder): Updated.
5319 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5322 2005-02-28 Raja R Harinath <rharinath@novell.com>
5325 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5326 non-simple types (array, pointer, reference).
5328 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5330 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5332 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5334 (Method.CheckBase): Catch wrong destructor here.
5335 (MethodData.Define): Add errors 550, 668.
5337 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5339 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5341 * pending.cs (VerifyPendingMethods): Add error 551.
5343 * typemanager.cs (CSharpName): Next error report helper.
5345 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5347 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5348 attributes. Removed useless attribute double check.
5349 It saves almost 2MBs for corlib.
5351 2005-02-25 Raja R Harinath <rharinath@novell.com>
5354 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5355 called twice in case of error.
5357 2005-02-23 Chris Toshok <toshok@ximian.com>
5359 Fix compiler portions of #72827.
5360 * statement.cs (Block.Emit): call Begin/EndScope on the
5361 EmitContext instead of the ILGenerator.
5363 * codegen.cs (EmitContext.BeginScope): new method, call
5364 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5366 (EmitContext.BeginScope): same, but EndScope and CloseScope
5368 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5369 offset and call the superclass's OpenScope(int) with it.
5370 (SymbolWriter.CloseScope): get the current il
5371 offset and call superclass's CloseScope(int) with it.
5373 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5375 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5376 CS1677 for out and ref as well.
5378 * class.cs (Method.Define): Add error CS1599 detection.
5380 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5382 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5384 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5386 * support.cs.cs (ModifierDesc): New helper method.
5388 2005-02-23 Raja R Harinath <rharinath@novell.com>
5389 Abin Thomas <projectmonokochi@rediffmail.com>
5390 Anoob V E <projectmonokochi@rediffmail.com>
5391 Harilal P R <projectmonokochi@rediffmail.com>
5394 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5395 MemberLookup (used for error reporting) actually returns a result.
5396 Fix error report number (122, not 112).
5398 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5399 Anoob V E <projectmonokochi@rediffmail.com>
5400 Harilal P R <projectmonokochi@rediffmail.com>
5403 * pending.cs (PendingImplementation.GetAbstractMethods):
5404 Find NonPublic members too.
5406 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5408 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5411 * class.cs (MethodCore.CheckMethodAgainstBase):
5412 Add error 239 report.
5414 2005-02-21 Raja R Harinath <rharinath@novell.com>
5417 * expression.cs (Invocation.IsApplicable): Make public.
5418 (Invocation.IsParamsMethodApplicable): Likewise.
5419 * delegate.cs (Delegate.VerifyApplicability): Don't use
5420 Invocation.VerifyArgumentCompat for parameter applicability
5421 testing. Use Invocation.IsApplicable and
5422 Invocation.IsParamsMethodApplicable.
5424 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5426 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5428 * class.cs (Operator.Define): Add error 217 report.
5430 2005-02-21 Raja R Harinath <rharinath@novell.com>
5432 * namespace.cs (UsingEntry.Resolve): Undo change below.
5434 2005-02-21 Raja R Harinath <rharinath@novell.com>
5437 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5438 disable the error message when the extended MemberLookup also
5440 (Expression.MemberLookupFinal): Update.
5441 (SimpleName.DoSimpleNameResolve): Update.
5442 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5443 Don't use MemberLookupFinal.
5444 (New.DoResolve): Update.
5445 (BaseAccess.CommonResolve): Update.
5447 2005-02-21 Raja R Harinath <rharinath@novell.com>
5450 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5451 occured previously, don't resolve again.
5453 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5456 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5457 argument. Call ResolveAttributeUsage for unresolved.
5458 when types doesn't match ctor arguments.
5460 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5461 for nested attribute classes.
5462 (Class.attribute_usage): Removed.
5463 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5464 for attribute class.
5466 * ecore.cs (IsAttribute): Removed.
5468 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5470 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5472 (attribute_types): Removed.
5473 (EmitCode): Global attributes are emited as the latest.
5475 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5477 * class.cs (EmitFieldInitializers): Don't emit field initializer
5478 for default values when optimilization is on.
5480 * constant.cs (Constant.IsDefaultValue): New property.
5482 * driver.cs: Add /optimize handling.
5486 * literal.cs: Implement new IsDefaultValue property.
5488 * rootcontext.cs (Optimize): New field, holds /optimize option.
5490 2005-02-18 Raja R Harinath <rharinath@novell.com>
5492 Fix crasher in re-opened #72347.
5493 * namespace.cs (Namespace.Lookup): Return null if
5494 DeclSpace.DefineType returns null.
5497 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5499 2005-02-18 Raja R Harinath <rharinath@novell.com>
5501 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5502 now returns null if it cannot resolve to an lvalue.
5503 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5504 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5505 returned null. Remove check for SimpleName.
5506 (EventExpr.DoResolveLValue): New.
5507 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5508 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5510 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5512 (Unary.ResolveOperator): Move CS0211 check ...
5513 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5515 (Unary.DoResolveLValue): Simplify.
5516 (AddressOf.DoResolveLValue): New.
5517 (ArrayAccess.DoResolveLValue): New.
5519 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5521 * attribute.cs (Attribute.Resolve): Add arguments casting for
5522 when types doesn't match ctor arguments.
5524 2005-02-16 Raja R Harinath <rharinath@novell.com>
5526 Fix parts of #63202.
5527 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5528 lookup of operator in base type. Ensure that all checks happen
5529 when the operator resolves to an "op_..." method.
5531 2005-02-15 Raja R Harinath <rharinath@novell.com>
5534 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5535 'ignore_cs0104' parameter. Pass it to ...
5536 (NamespaceEntry.Lookup): ... this.
5537 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5538 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5539 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5540 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5541 Update. Request that cs0104 errors be ignored.
5542 (ComposedCast.ResolveAsTypeStep): Update.
5544 2005-02-14 Raja R Harinath <rharinath@novell.com>
5547 * expression.cs (Invocation.BetterFunction): Remove support for
5548 comparing virtual functions and their overrides.
5549 (Invocation.IsOverride): New.
5550 (Invocation.OverloadResolve): Don't consider 'override' functions
5551 during candidate selection. Store them in a lookaside list.
5552 If the selected method is a 'virtual' function, use the list to
5553 find any overrides that are closer to the LHS type.
5555 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5557 * expression.cs (New.DoResolve): Add complex core type reduction.
5558 (New.Constantify): Converts complex core type syntax like 'new int ()'
5561 2005-02-14 Raja R Harinath <rharinath@novell.com>
5563 * decl.cs (EntryType.EntryType): New constructor to create an
5564 updated copy of a cache entry.
5565 (MemberCache.AddMethods): Use it.
5566 (MemberCache.ClearDeclaredOnly): Remove.
5567 (MemberCache.MemberCache): Update.
5569 2005-02-11 Miguel de Icaza <miguel@novell.com>
5571 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5572 variable. This one is represents the actual low-level declaration
5573 of the method, as opposed to the semantic level `IsStatic'.
5575 An anonymous method which is hosted into a static method might be
5576 actually an instance method. IsStatic would reflect the
5577 container, while MethodIsStatic represents the actual code
5580 * expression.cs (ParameterReference): Use the new MethodIsStatic
5581 instead of IsStatic.
5583 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5584 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5585 set on the current EmitContext.
5587 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5588 resolve our casted expression as an LValue. This triggers the
5589 proper LValue processing that is later required by Assign.
5593 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5595 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5597 C# 2.0 Fixed buffer implementation
5599 * anonymous.cs: Update after RegisterHelperClass renaming.
5601 * attribute.cs (AttributeTester.fixed_buffer_cache):
5602 Cache of external fixed buffers.
5603 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5604 implementation if field is fixed buffer else null.
5607 (TypeContainer.AddField): Accept FieldMember instead of Field.
5608 (FieldBase.IsFieldClsCompliant): Extracted code from
5609 VerifyClsCompliance descendant customization.
5610 (FixedField): New class handles fixed buffer fields.
5611 (FixedFieldExternal): Keeps information about imported fixed
5613 (IFixedField): Make access to internal or external fixed buffer
5616 * cs-parser.jay: Add fixed buffer parsing.
5618 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5621 * expression.cs (Indirection): Extended implementation to accept
5623 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5624 (ElementAccess.MakePointerAccess): Get type as parameter.
5625 (DoResolve): Add fixed buffer field expression conversion.
5626 (DoResolveLValue): Ditto.
5627 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5628 (ArrayPtr): Derives from FixedBufferPtr.
5629 (ArrayPtr.Emit): Add extra emit for array elements.
5631 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5633 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5634 for compiler generated types.
5635 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5637 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5638 and consume less memory.
5639 (Fixed.Resolve): Add fixed buffer case.
5641 * typemanager.cs (compiler_generated_attr_ctor,
5642 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5643 (HasElementType): Add our own implementation to work on every
5646 2005-02-11 Miguel de Icaza <miguel@novell.com>
5648 * anonymous.cs (CaptureContext): Track whether `this' has been
5651 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5652 only captured `this' if it was implicitly done (instance
5653 methods/variables were used).
5655 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5656 `this' must be captured.
5658 2005-01-30 Miguel de Icaza <miguel@novell.com>
5660 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5661 is null it means that there has been no need to capture anything,
5662 so we just create a sibling.
5664 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5666 Just a partial fix. The other half is fairly elusive.
5668 2005-02-10 Raja R Harinath <rharinath@novell.com>
5670 Fix #52586, cs0121-4.cs.
5671 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5672 and return a hashtable.
5673 (MemberCache.ClearDeclaredOnly): New.
5674 (MemberCache.MemberCache): Update to change. Make a deep copy of
5675 the method_hash of a base type too.
5676 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5677 type methods. Overwrite entries with the same MethodHandle so
5678 that the ReflectedType is correct. The process leaves in base
5679 virtual functions and their overrides as distinct entries.
5680 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5681 matters since it was boxed in a ArrayList before.
5682 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5684 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5685 case of a virtual function and its override (choose the overload
5687 (Invocation.OverloadResolve): Avoid 'override' members during
5688 'applicable_type' calculation.
5690 2005-02-09 Raja R Harinath <rharinath@novell.com>
5692 Combine two near-redundant caches.
5693 * typemanager.cs (method_params): Rename from method_internal_params.
5694 (TypeManager.GetParameterData): New. Replace
5695 Invocation.GetParameterData.
5696 (TypeManager.LookupParametersByBuilder): Remove.
5697 * expression.cs (Invocation.method_parameter_cache): Remove.
5698 (Invocation.GetParameterData): Remove.
5700 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5703 2005-02-08 Raja R Harinath <rharinath@novell.com>
5706 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5707 TypeManager.multicast_delegate_type is null, resolve it by looking
5708 up "System.MulticastDelegate".
5709 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5711 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5712 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5713 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5716 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5717 (LabeledStatement.AddReference): New. Set 'referenced'.
5718 (Goto.Resolve): Use it.
5720 2005-02-05 John Luke <john.luke@gmail.com>
5722 * driver.cs: remove duplicate -doc line in Usage ()
5724 2005-02-04 Raja R Harinath <rharinath@novell.com>
5726 * location.cs (Location.AddFile): Fix CS2002 error report.
5728 2005-02-02 Martin Baulig <martin@ximian.com>
5730 * delegate.cs (Delegate.DefineType): Report an internal error if
5731 TypeManager.multicast_delegate_type is null. See bug #72015 for
5734 2005-02-02 Raja R Harinath <rharinath@novell.com>
5736 Fix a crasher in a variant of #31984.
5737 * const.cs (Constant.CheckBase): New override that defers the
5738 new-or-override check in case the base type hasn't been populated
5740 (Constant.Define): Ensure the new-or-override check is performed.
5742 2005-02-01 Duncan Mak <duncan@ximian.com>
5744 * const.cs (LookupConstantValue): Check that `ce' is not null
5745 before calling GetValue ().
5747 2005-02-01 Raja R Harinath <rharinath@novell.com>
5749 Fix test-334.cs (#69519).
5750 * cs-parser.jay (using_alias_directive): Pass in an expression to
5751 NamespaceEntry.UsingAlias.
5752 (using_namespace_directive): Pass in an expression to
5753 NamespaceEntry.Using.
5754 (namespace_name): Don't flatten to a string.
5755 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5756 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5758 (NamespaceEntry.UsingEntry): Likewise.
5759 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5761 (NamespaceEntry.LookupForUsing): Remove.
5762 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5764 (NamespaceEntry.Lookup): Remove support for dotted names.
5766 2005-02-01 Raja R Harinath <rharinath@novell.com>
5768 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5770 (NamespaceEntry.ImplicitParent): Compute on demand.
5771 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5772 parallels the current.
5773 (NamespaceEntry.LookupForUsing): Use it.
5774 (NamespaceEntry.Lookup): If the current namespace-entry is
5775 implicit, don't search aliases and using tables.
5777 2005-02-01 Raja R Harinath <rharinath@novell.com>
5780 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5782 (TypeContainer.BaseCache): Compute on demand.
5783 (TypeContainer.FindMembers): Define constants and types if they're
5784 not already created.
5785 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5787 * const.cs (Constant.Define): Make idempotent.
5789 2005-01-29 Miguel de Icaza <miguel@novell.com>
5791 * pending.cs: Produce better code (no nops produced by using Ldarg
5794 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5795 i - 1' it should be arg + 1.
5799 2005-01-28 Raja R Harinath <rharinath@novell.com>
5801 * attribute.cs (Attribute.CheckAttributeType): Make private
5803 (Attribute.ResolveType): Make virtual.
5804 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5805 handling of RootContext.Tree.Types.
5807 2005-01-27 Raja R Harinath <rharinath@novell.com>
5809 Update attribute-handling to use the SimpleName/MemberAccess
5811 * cs-parser.jay (attribute): Pass in an expression to the
5812 constructors of Attribute and GlobalAttribute.
5813 * attribute.cs (Attribute): Take an expression for the name.
5814 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5815 passed in attribute name expression.
5816 (Attribute.CheckAttributeType): Use it.
5817 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5818 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5819 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5820 argument to prevent error messages if the lookup fails.
5822 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5824 * expression.cs (Indirection): Implemented IVariable interface
5825 to support indirection in AddressOf operator.
5826 (PointerArithmetic.Emit): Add optimalization for case where
5827 result can be precomputed.
5829 2005-01-26 Martin Baulig <martin@ximian.com>
5831 * class.cs (TypeContainer.AttributeTargets): Return the correct
5832 AttributeTargets depending on our `Kind' instead of throwing an
5833 exception; fixes #71632.
5835 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5838 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5841 2005-01-25 Raja R Harinath <rharinath@novell.com>
5844 * expression.cs (MemberAccess.DoResolve): Don't complain with
5845 cs0572 when the LHS of a member access has identical name and type
5848 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5851 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5853 Create custom PermissionSet only for PermissionSetAttribute.
5855 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5858 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5859 delegates in static class.
5861 2005-01-24 Martin Baulig <martin@ximian.com>
5863 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5864 merging an implicit block, just use its reachability.
5866 * statement.cs (Block.Resolve): Make the unreachable code check
5867 work wrt. implicit blocks; see test-337 from #63842.
5869 2005-01-21 Alp Toker <alp@atoker.com>
5871 * cs-parser.jay: destructor_declaration's container is PartialContainer
5872 not Class when partial types are used, so use Kind prop instead of
5875 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5877 * cs-parser.jay: Improve error reporting when an interface
5880 2005-01-20 Dick Porter <dick@ximian.com>
5882 * support.cs: SeekableStreamReader fix from Sandor Dobos
5883 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5884 chars are read. Fixes bug 70369.
5886 2005-01-20 Raja R Harinath <rharinath@novell.com>
5888 * cs-parser.jay (catch_clause): Simplify current_block handling
5891 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5893 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5894 code with ImplicitStandardConversion to handle the implicit
5895 conversion of method groups into valid delegate invocations.
5897 The problem is that in parameter handling we were using this code
5898 path. Fixes bug #64698
5900 2005-01-19 Raja R Harinath <rharinath@novell.com>
5902 * cs-parser.jay: Fix several infelicities.
5903 - Avoid assigning to the parser value stack. Code like
5904 '$3 = null' is unclean. Synthesize a value for the code block
5906 - Avoid using oob_stack for storing location information. Use ...
5907 (_mark_): ... this. New (empty) rule. Saves the current location
5909 (foreach_statement): Avoid using oob_stack for current_block
5910 handling. Use technique used in for_statement and
5911 using_statement. Synthesize a value for the code block to store
5912 additional intermediate information.
5914 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5916 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5917 of a different type is only allowed to private fields of a
5918 containing type, not on fields of a base class.
5920 See test-174.cs and error cs0122-9.cs
5922 2005-01-13 Raja R Harinath <rharinath@novell.com>
5924 Fix test-335.cs (bug #58126).
5925 * cs-parser.jay (argument): Split out non-expression parts of the
5926 rule into 'non_simple_argument'.
5927 (invocation_expression): Support parenthesized invocations with
5928 multiple arguments, and with single non-simple arguments.
5930 2005-01-13 Raja R Harinath <rharinath@novell.com>
5932 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5935 2005-01-12 Raja R Harinath <rharinath@novell.com>
5937 Fix cs0038-1.cs, cs1640-6.cs.
5938 * ecore.cs (Expression.Resolve): Remove special-case for
5939 SimpleName in error-handling.
5940 (Expression.almostMatchedMembers): Relax access permission to
5942 (Expression.MemberLookupFailed): Handle duplicates in
5943 almostMatchedMembers list.
5944 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5945 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5946 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5947 overload if the passed in MemberInfo is a MethodBase.
5949 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5952 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5953 for non-CAS & merge permission sets properly.
5955 2005-01-11 Raja R Harinath <rharinath@novell.com>
5957 Improve standard-compliance of simple name and member access
5958 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5959 * ecore.cs (FullNamedExpression): New abstract base class
5960 for Namespaces and TypeExpressions.
5961 (ResolveFlags.SimpleName): Remove.
5962 (SimpleName): Remove support for dotted names.
5963 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5964 DeclSpace.FindType and DeclSpace.LookupType.
5965 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5966 (Expression.ExprClassName): Make member function.
5967 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5968 a namespace. Remove creation of dotted "SimpleName"s.
5969 (MemberAccess.DoResolve): Likewise.
5970 * decl.cs (DeclSpace.Cache): Make private.
5971 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5972 (DeclSpace.FindType): Update.
5973 (DeclSpace.LookupType): Move here from RootContext. Return a
5974 FullNamedExpression.
5975 * namespace.cs (Namespace): Derive from FullNamedExpression
5976 so that it can be part of expression resolution.
5977 (Namespace.Lookup): Return an FullNamedExpression.
5978 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5980 * rootcontext.cs (NamespaceLookup): Remove.
5981 (LookupType): Move to DeclSpace.
5982 * attribute.cs (CheckAttributeType): Update.
5983 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5984 (FindDocumentedTypeNonArray): Likewise.
5986 2005-01-11 Raja R Harinath <rharinath@novell.com>
5988 Fix cs0509.cs, cs1632.cs.
5989 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5990 is the same as IsInterface.
5991 (TypeContainer.GetClassBases): Likewise.
5992 * statement.cs (LabeledStatement.ig): New field.
5993 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5995 (LabeledStatement.DoEmit): Check that the label was created with
5996 the same ILGenerator.
5998 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6001 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6002 accessors to its properties.
6004 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6005 from accessors to property.
6007 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6010 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6013 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6015 * attribute.cs: Check for null and empty strings.
6017 I have lost another battle to Paolo.
6019 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6022 * class.cs (PropertyMethod): Set Parent field in ctors.
6023 (SetMethod.InternalParameters): Add unsafe switch hack.
6024 Override MarkForDuplicationCheck where it is appropriate.
6026 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6027 It says whether container allows members with the same name.
6029 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6030 Removed is_method parameter.
6032 2005-01-06 Duncan Mak <duncan@ximian.com>
6034 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6035 because the previous change led to incorrect reporting of CS1032
6036 ("Cannot define/undefine preprocessor symbols after first token in
6037 file"). Instead of using `tokens_seen' as the only flag that
6038 triggers CS1040, introduce `comments_seen'. This new flag is used
6039 to signify having seen comments on the current line, so it is
6040 unset after a newline.
6042 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6044 * doc.cs : When searching for a type, find nested type too.
6045 This fixes bug #71040.
6047 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6050 - Warn missing member comment on those classes which also does not
6051 have doc comments. Fixed bug #71041.
6052 - Don't warn missing doc comment on default constructor.
6055 2005-01-06 Duncan Mak <duncan@ximian.com>
6057 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6058 comments, set `tokens_seen' to true. This allows us to detect
6059 misplaced preprocessor directives (i.e. not at the beginning of
6060 the a line, nor after whitespaces). In that case, report error
6061 CS1040. This fixes bug #56460.
6063 * cs-parser.jay (interface_member_declaration): Add checks for
6064 IsExplicitImpl, and report CS0541 error if an interface member is
6065 defined as an explicit interface declaration.
6067 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6070 * class.cs (PropertyMethod): Set Parent field in ctors.
6071 (SetMethod.InternalParameters): Add unsafe switch hack.
6073 * decl.cs (MemberCore.Parent): Cannot be readonly.
6075 2005-01-06 Raja R Harinath <rharinath@novell.com>
6077 * decl.cs (DeclSpace.ResolveType): Remove.
6078 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6079 Merge in code from ...
6080 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6081 * class.cs, enum.cs: Update to changes.
6083 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6085 * anonymous.cs: Ensure that we init the scope of our parent if it
6086 has not been initialized yet.
6088 2004-12-30 Duncan Mak <duncan@ximian.com>
6090 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6091 if field.FieldBuilder is null. Fixes #70758.
6093 * convert.cs: Fixed some typos and updated some of the comments.
6094 (ImplicitStandardConversionExists):
6095 (TryImplicitIntConversion): If `target_type' is an interface and
6096 the type of `ic' implements this interface, return true or a new
6097 BoxedCast instead of null. This fixes #70468.
6099 2004-12-29 Duncan Mak <duncan@ximian.com>
6101 * expression.cs (Argument.Emit): Check that Expr is
6102 IMemoryLocation before casting to it, and report CS1510 otherwise.
6106 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6108 * statement.cs (Block.ThisVariable): remove the recursion here, to
6109 make the --profile more sane.
6111 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6113 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6114 assembly, by JB Evain.
6116 2004-12-17 Raja R Harinath <rharinath@novell.com>
6118 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6119 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6120 "parent" refers to enclosing type/class. "base" refers to superclass.
6122 2004-12-17 Raja R Harinath <rharinath@novell.com>
6124 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6125 Ensure that we only have GlobalAttributes.
6126 * attribute.cs (Attribute.Emit): Make non-virtual.
6127 (GlobalAttribute.Emit): Remove.
6128 (Attribute.Resolve): Make virtual.
6129 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6130 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6131 the argument. Don't create one.
6132 (Attribute.GetObsoleteAttribute): Likewise.
6133 (Attribute.GetClsCompliantAttributeValue): Likewise.
6134 * class.cs, decl.cs: Update to changes.
6136 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6138 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6140 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6142 * statement.cs (Foreach.Resolve): Add error 186 report.
6144 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6146 * expression.cs (Conditional.DoResolve): Add warning 429.
6148 * statement.cs (If.Resolve): Add warning 665.
6150 2004-12-16 Raja R Harinath <rharinath@novell.com>
6152 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6153 except when in the parser, and in GlobalAttribute.
6154 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6155 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6156 RootContext.Tree.Types.NamespaceEntry once work is done.
6157 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6158 and resets RootContext.Tree.Types.NamespaceEntry.
6160 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6162 * cs-parser.jay: Don't create a block for every variable.
6164 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6166 * location.cs: Provide extra information.
6168 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6169 variables from the captured environment, it is the ldarg_0.
6171 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6173 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6176 * class.cs: Changed warning level for 169 to avoid developer
6177 displeasure from warning flooding. It will be changed back when they
6178 fix most of current BCL warnings.
6180 * RootContext.cs: Pushed default WarningLevel to 3.
6182 * statement.cs: Removed unused variable.
6184 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6186 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6187 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6188 Add error 502 report.
6189 (StaticClass.DefineType): Add error 441 report.
6190 (Class.AllowedModifiersProp): New virtual property as temporary
6191 extension to AllowedModifiers.
6192 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6193 to share implementation with StaticClass and don't call virtual
6196 * driver.cs (MainDriver): Add error 1558 test.
6198 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6199 report. Moved error 36 test here.
6201 * statement.cs (Throw.Resolve): Add error 724 report.
6203 * typemanager.cs: Add out_attribute_type core type.
6205 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6207 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6209 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6211 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6214 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6216 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6217 Add error 3023 report.
6218 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6220 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6223 2004-12-12 John Luke <john.luke@gmail.com>
6225 * driver.cs (AddArgs): take -- into account when
6226 adding arguments, fixes bug 65710
6228 2004-12-12 Martin Baulig <martin@ximian.com>
6230 * expression.cs (Unary.TryReduceNegative): Added support for
6231 SByteConstant and ByteConstant.
6232 (Unary.Reduce): Check error values from TryReduceNegative().
6234 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6236 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6237 and report exception as error 182.
6239 2004-12-10 Raja R Harinath <rharinath@novell.com>
6241 * driver.cs (Main): Fix message when there are warnings.
6243 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6245 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6247 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6249 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6250 Reduced number of warnings.
6252 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6254 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6256 * driver.cs: Removed message.
6258 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6260 2004-12-08 <vargaz@freemail.hu>
6262 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6264 2004-12-08 Martin Baulig <martin@ximian.com>
6266 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6267 instead of a CS3002 for properties and indexer.
6269 2004-12-08 Martin Baulig <martin@ximian.com>
6271 * decl.cs (MemberName.ToString): Make this work again.
6273 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6275 * attribute.cs (Resolve): Add error 591 detection.
6277 * class.cs (FieldMember.Define): Add error 1547 detection.
6278 (Indexer.Define): Add error 620 detection.
6279 (Operator.Define): Add error 590 detection.
6281 * ecore.cs: Missing argument for error 79.
6283 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6286 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6289 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6292 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6294 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6295 Some operator comments were suppressed.
6296 * doc.cs : Implicit/explicit operator name in doc comments are like
6297 "op_Explicit(type)~returnType", so added suffix handling.
6299 2004-12-07 Martin Baulig <martin@ximian.com>
6302 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6303 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6304 (DeclSpace.ec): New protected field; store the EmitContext here.
6305 (DeclSpace.EmitContext): New public property; moved here from
6307 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6310 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6311 (Enum.Emit): Don't create a new EmitContext.
6313 * delegate.cs (Delegate.DefineType): Always create the
6316 * iterators.cs (Iterators.DefineIterator): Create a new
6317 EmitContext and store it in `ec'.
6319 2004-08-24 Martin Baulig <martin@ximian.com>
6322 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6323 this for accessibility checks.
6324 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6325 IsNestedFamilyAccessible.
6326 (TypeManager.IsSubclassOf): New method, do what the name actually
6329 2004-12-06 Raja R Harinath <rharinath@novell.com>
6331 Fix crash on cs0657-17.cs.
6332 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6333 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6334 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6335 the case where the NamespaceEntry gets overwritten.
6337 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6339 Fixed #69195, #56821
6340 * ecore.cs (ResolveBoolean): Tiny refactoring.
6342 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6343 of right expression resolving when left is false constant and
6344 operator is LogicalAnd OR true constant and operator is LogicalOr.
6346 * statement.cs (ResolveUnreachable): Always reports warning.
6348 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6350 * class.cs: Distinguish between 1721 and 1722 (just a little help
6351 for the programmer).
6353 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6355 * delegate.cs: Only allow this on new versions of the language.
6357 2004-12-02 Duncan Mak <duncan@ximian.com>
6359 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6361 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6362 here as a static method. Take an additional bool out parameter
6363 `must_do_cs1540_check' for signaling to InstanceResolve.
6364 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6365 member field from PropertyExpr class and made it an argument of
6367 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6368 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6369 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6370 and `remove_accessor' as well as InstanceResolve: report CS0122
6375 2004-12-03 Raja R Harinath <rharinath@novell.com>
6377 Fix test-327.cs, test-328.cs, and put in early infrastructure
6378 for eventually fixing #52697.
6379 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6380 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6382 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6383 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6384 (VerifyUsing, error246): Update.
6385 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6386 'NamespaceEntry.LookupNamespaceOrType'.
6388 2004-12-03 Martin Baulig <martin@ximian.com>
6390 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6391 method as our child, call AnonymousMethod.Compatible() on it.
6393 2004-12-03 Raja R Harinath <rharinath@novell.com>
6395 Disable XML documentation support in 'basic' profile.
6396 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6397 Redirect XmlElement to System.Object.
6398 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6399 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6400 * mcs.exe.sources: Add doc-bootstrap.cs.
6401 * doc-bootstrap.cs: New file. Contains empty stub implementation
6404 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6406 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6407 comments are allowed.
6409 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6411 * delegate.cs: Add checks for subtypes in paramaters and return values
6412 in VerifyMethod () to add support for Covariance/Contravariance
6415 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6417 * report.cs: Remove extra closing parenthesis.
6419 * convert.cs (Error_CannotImplicitConversion): If the name of the
6420 types are the same, provide some extra information.
6422 * class.cs (FieldBase): Use an unused bit field from the field to
6423 encode the `has_offset' property from the FieldMember. This saves
6424 a couple of Ks on bootstrap compilation.
6426 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6427 method as our child, return the AnonymousMethod resolved
6430 * expression.cs (New.DoResolve): Allow return values from
6431 NewDelegate to also include AnonymousMethods.
6435 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6438 * attribute.cs (Resolve): Improved implementation of params
6439 attribute arguments.
6441 * support.cs (ParameterData): Add HasParams to be faster.
6443 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6445 all things are for /doc support:
6447 * doc.cs: new file that supports XML documentation generation.
6448 * mcs.exe.sources: added doc.cs.
6450 Handle /doc command line option.
6451 Report error 2006 instead of 5 for missing file name for /doc.
6452 Generate XML documentation when required, after type resolution.
6454 Added support for picking up documentation (/// and /** ... */),
6455 including a new XmlCommentState enumeration.
6457 Added lines to fill Documentation element for field, constant,
6458 property, indexer, method, constructor, destructor, operator, event
6459 and class, struct, interface, delegate, enum.
6460 Added lines to warn incorrect comment.
6462 Added Documentation field (passed only when /doc was specified).
6464 Added DocComment, DocCommentHeader, GenerateDocComment() and
6465 OnGenerateDocComment() and some supporting private members for
6466 /doc feature to MemberCore.
6468 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6470 Added overriden DocCommentHeader.
6472 Added overriden DocCommentHeader and GenerateDocComment().
6474 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6476 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6477 unwrapping the enumeration values, chain to
6478 DoConstantNumericPromotions again, so we can promote things to the
6479 fundamental types (takes care of enums that are bytes, sbytes).
6483 2004-12-01 Raja R Harinath <rharinath@novell.com>
6485 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6486 Fix long-standing bug in type-lookup. Use FindType instead of
6487 LookupType when ec.ResolvingTypeTree.
6488 (Attribute.ResolveType, Attribute.Resolve)
6489 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6491 (Attributes.Search): Remove internal version. Update.
6492 (Attributes.SearchMulti): Update.
6493 (Attributes.GetClsCompliantAttribute): Remove.
6494 (Attributes.GetIndexerNameAttribute): Remove.
6495 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6496 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6497 * class.cs (Indexer.Define): Likewise.
6499 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6502 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6503 MarshallByReference members access.
6505 * expression.cs: Use CheckMarshallByRefAccess;
6506 Better error CS0197 message.
6508 * report.cs: Print whole related error message.
6510 2004-11-30 Raja R Harinath <rharinath@novell.com>
6512 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6513 the current directory to help debugging.
6515 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6517 * class (GetClassBases): Better error 60 report.
6518 (EventProperty): Disabled warning 67 detection.
6520 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6523 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6525 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6528 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6531 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6533 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6535 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6537 * attribute.cs (Attribute.Resolve): Refine error reporting and
6538 report a cs0117 if the identifier does not exist, to distinguish
6539 from 0617 which is a miss-use of the actual identifier.
6541 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6542 between cs0070 and cs0079.
6544 * class.cs (MemberBase.DoDefine): When reporting a wrong
6545 accessibility level, we use MethodCore to compare instead of
6546 Method (this was a regression in some refactoring effort).
6548 So now we correctly report cs0056 again.
6550 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6551 testing the target_type (which was known to be object_type) and
6552 not the source type (which is anonymous_method).
6554 Fixed reporting of error cs1660.
6556 * expression.cs (UserCast.Source): Expose the underlying cast.
6558 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6559 allowed types to find a match to int32 first (most common).
6561 In addition, it ignores any ImplicitUserConversions that did an
6562 internal implicit conversion (as the switch statement allows only
6563 one integral conversion to exist).
6565 * class.cs (PartialContainer.Create): rename `name' to
6566 `member_name' for clarity. Then replace the string calls with a
6567 call to MemberName.GetPartialName, as now using
6568 MemberName.ToString is an error (this is due to the side effects
6569 it had, that were fixed in the past).
6571 This will restore the error reporting on a number of partial class
6572 errors that were missusing this (and getting an exception as a
6573 results, which is now just a plain textual warning, because
6574 yyparse debug output would crash otherwise).
6576 2004-11-26 Raja R Harinath <rharinath@novell.com>
6578 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6580 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6582 * rootcontext.cs (LookupType): Make sure to cache lookups that
6583 don't give us a negative result. This saves about 5% of corlib
6586 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6588 * report.cs (AbstractMessage.Print): messages are sent to stderr
6590 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6591 non-interface in the list of interfaces (at this point, either
6592 parent was properly set, or a base class is being listed in the
6593 interfaces section).
6595 This flags error 1722, and resolves the crash from bug 69259.
6597 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6599 * statement.cs (Using.EmitExpressionFinally): make this work right
6600 for valuetypes. Fixes 69926.
6602 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6604 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6605 converted to an enum" here, before we try to change the underlying
6606 type. This code exists, but it is a different code path than the
6607 one used while encoding constants.
6609 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6610 old bug: when converting from the null literal to a pointer,
6611 return an EmptyCast, not the NullLiteral.
6613 This fixes #69921, the recent null_type changes probably made this
6616 (ImplicitReferenceConversionExists): In addition, resynchronized
6617 the code here, so it matches the same code in
6618 ImplicitReferenceConversionExists for the `from any class-type S
6619 to any interface-type T'.
6622 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6624 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6626 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6628 * cs-parser.jay: Use verbosity accordingly.
6630 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6632 * expression.cs (Unary.ResolveOperator): Do not report warning;
6633 AddressOf reads from variable.
6635 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6637 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6641 * attribute.cs (Attributable): Removed CheckTargets.
6642 (Attributes.Emit): Explicit attribute targets are tested here.
6644 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6645 not enabled for interfaces.
6647 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6648 (GetAssemblyName): Ouch next bug there.
6650 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6652 * expression.cs: Error 275 added.
6654 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6656 Fix bug #69177 (Implemented decimal constant support)
6658 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6659 (BinaryFold): Add DecimalConstant.
6661 * const.cs (Define): Decimal constant
6663 (ChangeType): Add decimal type handling.
6664 (LookupConstantValue): Don't set value for decimal type but
6665 emit DecimalConstantAttribute. Needed for constant optimization.
6667 * constant.cs (ToDecimal): New method.
6668 (ConvertToDecimal): New method.
6669 (IntConstant): Implemented ConvertToDecimal.
6670 (DecimalConstant.Emit): Emit optimized version for decimals in
6673 * expression.cs (ResolveOperator): Changed order of constant
6674 reduction to work correctly with native types which have
6675 overloaded operators.
6676 (ResolveMemberAccess): Extract constant value from attribute
6679 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6681 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6682 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6683 (ChangeType): Decimal is special.
6684 (TypeToCoreType): Add decimal type.
6686 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6688 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6691 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6693 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6696 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6698 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6700 * pending.cs (PendingImplementation): Grab only interfaces.
6702 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6704 * statement.cs (ForeachHelperMethods): Add location member and
6705 error 202 detection.
6707 2004-11-19 Raja R Harinath <rharinath@novell.com>
6709 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
6710 automatically handled by executable.make.
6711 (PROGRAM): Make profile-specific.
6713 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6715 * expression.cs (DoResolveBase): Fixed wrong warning for out
6718 2004-11-18 Martin Baulig <martin@ximian.com>
6720 Merged latest changes into gmcs. Please keep this comment in
6721 here, it makes it easier for me to see what changed in MCS since
6722 the last time I merged.
6724 2004-11-17 Raja R Harinath <rharinath@novell.com>
6726 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6727 (TypeHandle.GetMemberCache): New.
6728 (TypeHandle.TypeHandle): Update.
6729 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6730 (TypeManager.LookupParentInterfacesCache):
6731 Rename from LookupInterfaceCache. Optimize slightly.
6732 (TypeManager.MemberLookup_FindMembers): Update.
6733 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6735 (AddCacheContents): Rename from AddHashtable.
6736 * class.cs (TypeContainer.parent_container): Remove.
6737 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6738 (TypeContainer.DoDefineMembers): Don't initialize it.
6739 Update to name changes.
6741 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6743 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6744 that factors the code to check access modifiers on override.
6746 (PropertyBase): Use the code here.
6748 Patch from Lluis S'anchez, fixes bug #69361.
6750 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6752 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6753 routine that is used to report the use of a captured variable
6754 whose address has been taken.
6756 There are two checks: one when variables are being captured and
6757 the other check is when the address of a variable is taken.
6759 (because an anonymous methods might be resolved before *or* after
6760 the address has been taken) and
6762 * expression.cs (Conditional.DoResolve): Remove the special
6763 casing that Martin added to trueExpr and falseExpr being both
6764 NullLiteral. We get the right behavior now just by introducing
6765 the null_type into the compiler.
6767 * convert.cs (ExplicitConversion): Change the code to use
6768 null_type instead of testing `expr is NullLiteral'.
6769 (ImplicitConversionStandard): use null_type too.
6770 (ImplicitReferenceConversionExists): use null_type too.
6771 (ImplicitReferenceConversion): use null_type too.
6773 * literal.cs: The type of `NullLiteral' is now null_type instead
6775 (Resolve): Set the type here.
6777 * typemanager.cs: Introduce null_type.
6779 2004-11-17 Martin Baulig <martin@ximian.com>
6781 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6782 direction, like FindMembers() does. Fixes #69546, testcase is in
6785 2004-11-16 Martin Baulig <martin@ximian.com>
6787 This is based on a patch from Marek Safar, see bug #69082.
6788 Fixes bugs #63705 and #67130.
6790 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6791 method; create a MemberCache for an interface type and cache the
6794 * decl.cs (IMemberContainer.ParentContainer): Removed.
6795 (IMemberContainer.ParentCache): New property.
6796 (MemberCache.SetupCacheForInterface): Removed.
6797 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6798 to create a cache for an interface's "parent".
6800 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6803 2004-11-16 Martin Baulig <martin@ximian.com>
6805 Merged back from gmcs; these changes already went into gmcs a
6806 couple of weeks ago.
6809 (TypeManager.AddUserType): Removed the `ifaces' argument.
6810 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6812 (TypeManager.AddUserInterface): Removed.
6813 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6815 (TypeManager.GetInterfaces): Likewise.
6816 (TypeManager.GetExplicitInterfaces): Likewise.
6818 * ecore.cs (TypeExpr.GetInterfaces): Removed.
6820 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6821 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6823 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6825 * statement.cs: Avoid adding bools to a hashtable.
6827 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6829 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6830 calling an unsafe method from a safe location.
6832 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6835 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6837 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6839 * namespace.cs (VerifyUsing): use GetPartialName instead of
6842 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6844 * statement.cs (Return.Resolve): Fix regression in typo: if
6845 `in_exc', we have to request a NeedReturnLabel, this was a typo
6846 introduced in the anonymous method check-in. Fixes #69131.
6848 * Indexers were using the ShortName when defining themselves,
6849 causing a regression in the compiler bootstrap when applying the
6850 patch from 2004-11-02 (first part), now they use their full name
6851 and the bug is gone.
6853 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6855 * driver.cs: Strip the path from the names of embedded resources. Fixes
6858 2004-11-04 Raja R Harinath <rharinath@novell.com>
6860 Fix error message regression: cs0104-2.cs.
6861 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6862 (AliasEntry.Resolve): Update.
6863 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6865 (RootContext.LookupType): Update.
6867 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6869 * cs-parser.jay: Add support for handling accessor modifiers
6870 * class: Add support port accessor modifiers and error checking,
6871 define PropertyMethod.Define as virtual (not abstract anymore)
6872 * ecore.cs: Add checking for proeprties access with access modifiers
6873 * iterators.cs: Modify Accessor constructor call based in the modified
6875 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6877 * expression.cs (StringConcat): Handle being called twice,
6878 as when we have a concat in a field init with more than two
6881 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6883 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6884 special case explicit implementations, we should always produce
6885 the .property or .event declaration.
6887 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6888 since it will not return correct data if people use this
6889 unresolved in the presence of using statements (see test-313).
6891 * class.cs (MethodData.Define): If we are an explicit interface
6892 implementation, set the method name to the full name of the
6893 interface plus the name of the method.
6895 Notice that using the method.MethodName.GetFullName() does not
6896 work, as it will only contain the name as declared on the source
6897 file (it can be a shorthand in the presence of using statements)
6898 and not the fully qualifed type name, for example:
6902 class D : ICloneable {
6903 object ICloneable.Clone () {
6907 Would produce a method called `ICloneable.Clone' instead of
6908 `System.ICloneable.Clone'.
6910 * namespace.cs (Alias.Resolve): Use GetPartialName.
6912 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6914 * cs-parser.jay: Add error 1055 report.
6916 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6918 * assign.cs (Assign.DoResolve): Only do the transform of
6919 assignment into a New if the types are compatible, if not, fall
6920 through and let the implicit code deal with the errors and with
6921 the necessary conversions.
6923 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6925 * cs-parser.jay: Add error 1031 report.
6927 * cs-tokenizer.cs: Add location for error 1038.
6929 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6931 * cs-parser.jay: Add error 1016 report.
6933 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6935 * cs-parser.jay: Add errors 1575,1611 report.
6937 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6939 * cs-parser.jay: Add error 1001 report.
6941 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6944 * attribute.cs (GetMarshal): Add method argument for
6945 caller identification.
6947 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6948 agument for GetMarshal and RuntimeMissingSupport.
6950 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6952 * attribute.cs (ExtractSecurityPermissionSet): Removed
6953 TypeManager.code_access_permission_type.
6955 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6957 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6959 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6960 for obsolete use of a variable here. Fixes regression on errors
6961 cs0619-25 and cs0619-26.
6963 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6965 Fix #62358, implemented security attribute encoding.
6967 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6968 Tests permitted SecurityAction for assembly or other types.
6969 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6970 data from SecurityPermissionAttribute to PermisionSet class.
6972 * class.cs (ApplyAttributeBuilder): Added special handling
6973 for System.Security.Permissions.SecurityAttribute based types.
6975 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6976 special handling for System.Security.Permissions.SecurityAttribute
6979 * enum.cs (ApplyAttributeBuilder): Added special handling
6980 for System.Security.Permissions.SecurityAttribute based types.
6982 * parameter.cs (ApplyAttributeBuilder): Added special handling
6983 for System.Security.Permissions.SecurityAttribute based types.
6985 * rootcontext.cs: Next 2 core types.
6987 * typemanager.cs (TypeManager.security_permission_attr_type):
6988 Built in type for the SecurityPermission Attribute.
6989 (code_access_permission_type): Build in type.
6991 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6993 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6994 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6995 all of this information into
6996 EmitContext.EmitCapturedVariableInstance.
6998 * codegen.cs (EmitCapturedVariableInstance): move here the
6999 funcionality of emitting an ldarg.0 in the presence of a
7000 remapping. This centralizes the instance emit code.
7002 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7003 then emit a load of this: it means that we have reached the
7004 topmost ScopeInfo: the one that contains the pointer to the
7005 instance of the class hosting the anonymous method.
7007 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7008 captures to the topmost CaptureContext.
7010 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7012 * expression.cs (LocalVariableReference): Move the knowledge about
7013 the iterators into codegen's EmitCapturedVariableInstance.
7015 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7017 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7018 all code paths return a value from an anonymous method (it is the
7019 same as the 161 error, but for anonymous methods).
7021 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7023 The introduction of anonymous methods in the compiler changed
7024 various ways of doing things in the compiler. The most
7025 significant one is the hard split between the resolution phase
7026 and the emission phases of the compiler.
7028 For instance, routines that referenced local variables no
7029 longer can safely create temporary variables during the
7030 resolution phase: they must do so from the emission phase,
7031 since the variable might have been "captured", hence access to
7032 it can not be done with the local-variable operations from the runtime.
7036 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7037 is a toplevel block.
7039 (ToplevelBlock): A new kind of Block, these are the blocks that
7040 are created by the parser for all toplevel method bodies. These
7041 include methods, accessors and anonymous methods.
7043 These contain some extra information not found in regular blocks:
7044 A pointer to an optional CaptureContext (for tracking captured
7045 local variables and parameters). A pointer to the parent
7048 (Return.Resolve): Catch missmatches when returning a value from an
7049 anonymous method (error 1662).
7050 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7053 (Break.Resolve): ditto.
7055 (SwitchLabel): instead of defining the labels during the
7056 resolution phase, we now turned the public ILLabel and ILLabelCode
7057 labels into methods called GetILLabelCode() and GetILLabel() that
7058 only define the label during the Emit phase.
7060 (GotoCase): Track the SwitchLabel instead of the computed label
7061 (its contained therein). Emit the code by using
7062 SwitchLabel.GetILLabelCode ().
7064 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7065 whether the Local has been captured or not.
7067 (LocalInfo.IsCaptured): New property, used to tell whether the
7068 local has been captured.
7070 * anonymous.cs: Vastly updated to contain the anonymous method
7073 The main classes here are: CaptureContext which tracks any
7074 captured information for a toplevel block and ScopeInfo used to
7075 track the activation frames for various local variables.
7077 Each toplevel block has an optional capture context associated
7078 with it. When a method contains an anonymous method both the
7079 toplevel method and the anonymous method will create a capture
7080 context. When variables or parameters are captured, they are
7081 recorded on the CaptureContext that owns them, for example:
7085 MyDelegate d = delegate {
7090 Here `a' will be recorded as captured on the toplevel
7091 CapturedContext, the inner captured context will not have anything
7092 (it will only have data if local variables or parameters from it
7093 are captured in a nested anonymous method.
7095 The ScopeInfo is used to track the activation frames for local
7096 variables, for example:
7098 for (int i = 0; i < 10; i++)
7099 for (int j = 0; j < 10; j++){
7100 MyDelegate d = delegate {
7105 At runtime this captures a single captured variable `i', but it
7106 captures 10 different versions of the variable `j'. The variable
7107 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7108 recorded on a child.
7110 The toplevel ScopeInfo will also track information like the `this'
7111 pointer if instance variables were referenced (this is necessary
7112 as the anonymous method lives inside a nested class in the host
7113 type of the method).
7115 (AnonymousMethod): Expanded to track the Toplevel, implement
7116 `AnonymousMethod.Compatible' to tell whether an anonymous method
7117 can be converted to a target delegate type.
7119 The routine now also produces the anonymous method content
7121 (AnonymousDelegate): A helper class that derives from
7122 DelegateCreation, this is used to generate the code necessary to
7123 produce the delegate for the anonymous method that was created.
7125 * assign.cs: API adjustments for new changes in
7126 Convert.ImplicitStandardConversionExists.
7128 * class.cs: Adjustments to cope with the fact that now toplevel
7129 blocks are of type `ToplevelBlock'.
7131 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7132 insteda of standard blocks.
7134 Flag errors if params arguments are passed to anonymous methods.
7136 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7137 `CurrentAnonymousMethod' which points to the current Anonymous
7138 Method. The variable points to the AnonymousMethod class that
7139 holds the code being compiled. It is set in the new EmitContext
7140 created for the anonymous method.
7142 (EmitContext.Phase): Introduce a variable and an enumeration to
7143 assist in enforcing some rules about when and where we are allowed
7144 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7145 only one that enfonces this right now).
7147 (EmitContext.HaveCaptureInfo): new helper method that returns
7148 whether we have a CapturedContext initialized.
7150 (EmitContext.CaptureVariable): New method used to register that a
7151 LocalInfo must be flagged for capturing.
7153 (EmitContext.CapturedParameter): New method used to register that a
7154 parameters must be flagged for capturing.
7156 (EmitContext.CapturedField): New method used to register that a
7157 field must be flagged for capturing.
7159 (EmitContext.HaveCapturedVariables,
7160 EmitContext.HaveCapturedFields): Return whether there are captured
7161 variables or fields.
7163 (EmitContext.EmitMethodHostInstance): This is used to emit the
7164 instance for the anonymous method. The instance might be null
7165 (static methods), this (for anonymous methods that capture nothing
7166 and happen to live side-by-side with the current method body) or a
7167 more complicated expression if the method has a CaptureContext.
7169 (EmitContext.EmitTopBlock): Routine that drives the emission of
7170 code: it will first resolve the top block, then emit any metadata
7171 and then emit the code. The split is done so that we can extract
7172 any anonymous methods and flag any captured variables/parameters.
7174 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7175 during this phase, the ILGenerator should not be used as labels
7176 and local variables declared here might not be accessible to any
7177 code that is part of an anonymous method.
7179 Exceptions to this include the temporary variables that are
7180 created by some statements internally for holding temporary
7183 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7186 (EmitContext.TemporaryReturn): This method is typically called
7187 from the Emit phase, and its the only place where we allow the
7188 ReturnLabel to be defined other than the EmitMeta. The reason is
7189 that otherwise we would have to duplicate a lot of logic in the
7190 Resolve phases of various methods that today is on the Emit
7193 (EmitContext.NeedReturnLabel): This no longer creates the label,
7194 as the ILGenerator is not valid during the resolve phase.
7196 (EmitContext.EmitThis): Extended the knowledge in this class to
7197 work in anonymous methods in addition to iterators.
7199 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7200 code is necessary on the stack to access the instance to a local
7201 variable (the variable will be accessed as a field).
7203 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7204 EmitContext.EmitAddressOfParameter): Routines to support
7205 parameters (not completed at this point).
7207 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7208 will also remove the parameters.
7210 * convert.cs (Convert): Define a `ConstantEC' which points to a
7211 null. This is just to prefity some code that uses
7212 ImplicitStandardConversion code and do not have an EmitContext
7215 The idea is to flag explicitly that at that point in time, it is
7216 known that the conversion will not trigger the delegate checking
7217 code in implicit conversions (which requires a valid
7220 Everywhere: pass new EmitContext parameter since
7221 ImplicitStandardConversionExists now requires it to check for
7222 anonymous method conversions.
7224 (Convert.ImplicitStandardConversionExists): If the type of an
7225 expression is the anonymous_method_type, and the type is a
7226 delegate, we invoke the AnonymousMethod.Compatible method to check
7227 whether an implicit conversion is possible.
7229 (Convert.ImplicitConversionStandard): Only do implicit method
7230 group conversions if the language level is not ISO_1.
7232 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7233 MethodInfo for the Invoke method. used by Delegate and
7236 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7237 method conversions if the target type is a delegate.
7239 Removed extra debugging nops.
7241 (LocalVariableReference): Turn the `local_info' into a public
7244 Add `prepared' field, the same hack used for FieldExprs to cope
7245 with composed assignments, as Local variables do not necessarily
7246 operate purely on the stack as they used to: they can be captured
7249 Add `temp' for a temporary result, like fields.
7251 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7253 It now copes with Local variables that are captured and emits the
7254 proper instance variable to load it from a field in the captured
7257 (ParameterReference.DoResolveBase): During the resolve phase,
7258 capture parameters if we are in an anonymous method.
7260 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7261 anonymous method, use the EmitContext helper routines to emit the
7262 parameter reference.
7264 * iterators.cs: Set RemapToProxy to true/false during the
7267 * parameters.cs (GetParameterByName): New helper method.
7269 * typemanager.cs (anonymous_method_type) a new type that
7270 represents an anonyous method. This is always an internal type,
7271 used as a fencepost to test against the anonymous-methodness of an
7274 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7276 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7278 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7280 2004-10-18 Martin Baulig <martin@ximian.com>
7282 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7283 `Type' directly, but call ResolveType() on it.
7284 (Catch.Resolve): Likewise.
7285 (Foreach.Resolve): Likewise.
7287 2004-10-18 Martin Baulig <martin@ximian.com>
7289 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7290 `Type' directly, but call ResolveType() on it.
7291 (Probe.DoResolve): Likewise.
7292 (ArrayCreation.LookupType): Likewise.
7293 (TypeOf.DoResolve): Likewise.
7294 (SizeOf.DoResolve): Likewise.
7296 2004-10-18 Martin Baulig <martin@ximian.com>
7298 * expression.cs (Invocation.BetterFunction): Put back
7299 TypeManager.TypeToCoreType().
7301 2004-10-18 Raja R Harinath <rharinath@novell.com>
7303 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7306 2004-10-18 Martin Baulig <martin@ximian.com>
7308 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
7309 `Type' directly, but call ResolveType() on it.
7311 2004-10-18 Martin Baulig <martin@ximian.com>
7313 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7314 `Type' directly, but call ResolveType() on it.
7315 (MemberBase.DoDefine): Likewise.
7317 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7318 `Type' directly, but call ResolveType() on it.
7319 (ComposedCast.DoResolveAsTypeStep): Likewise.
7321 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7322 `Type' directly, but call ResolveType() on it.
7324 2004-10-17 John Luke <john.luke@gmail.com>
7326 * class.cs (Operator.GetSignatureForError): use CSharpName
7328 * parameter.cs (Parameter.GetSignatureForError): Returns
7329 correct name even if was not defined.
7331 2004-10-13 Raja R Harinath <rharinath@novell.com>
7334 * class.cs (TypeContainer.EmitContext): New property.
7335 (DefineNestedTypes): Create an emitcontext for each part.
7336 (MethodCore.DoDefineParameters): Use container's emitcontext.
7337 Pass type array to InternalParameters.
7338 (MemberBase.DoDefine): Use container's emitcontext.
7339 (FieldMember.Define): Likewise.
7340 (Event.Define): Likewise.
7341 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7342 Pass type array to InternalParameters.
7343 (SetIndexerMethod.GetParameterInfo): Likewise.
7344 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7345 * delegate.cs (Define): Pass emitcontext to
7346 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7347 array to InternalParameters.
7348 * expression.cs (ParameterReference.DoResolveBase): Pass
7349 emitcontext to GetParameterInfo.
7350 (ComposedCast.DoResolveAsTypeStep): Remove check on
7351 ec.ResolvingTypeTree.
7352 * parameter.cs (Parameter.Resolve): Change argument to
7353 EmitContext. Use ResolveAsTypeTerminal.
7354 (Parameter.GetSignature): Change argument to EmitContext.
7355 (Parameters.ComputeSignature): Likewise.
7356 (Parameters.ComputeParameterTypes): Likewise.
7357 (Parameters.GetParameterInfo): Likewise.
7358 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7359 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7360 * support.cs (InternalParameters..ctor): Remove variant that takes
7362 * typemanager.cs (system_intptr_expr): New.
7363 (InitExpressionTypes): Initialize it.
7365 2004-10-12 Chris Toshok <toshok@ximian.com>
7367 * cs-parser.jay: fix location for try_statement and catch_clause.
7369 2004-10-11 Martin Baulig <martin@ximian.com>
7371 * report.cs: Don't make --fatal abort on warnings, we have
7372 -warnaserror for that.
7374 2004-10-07 Raja R Harinath <rharinath@novell.com>
7376 More DeclSpace.ResolveType avoidance.
7377 * decl.cs (MemberCore.InUnsafe): New property.
7378 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7379 with newly created EmitContext.
7380 (FieldMember.Define): Likewise.
7381 * delegate.cs (Delegate.Define): Likewise.
7382 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7383 only if normal name-lookup fails.
7384 (TypeExpr.DoResolve): Enable error-checking.
7385 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7386 (SizeOf.DoResolve): Likewise.
7387 (ComposedCast.DoResolveAsTypeStep): Likewise.
7388 (StackAlloc.DoResolve): Likewise.
7389 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7390 (Block.Unsafe): New property.
7391 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7392 (Unsafe): Set 'unsafe' flag of contained block.
7393 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7394 (Fixed.Resolve): Likewise.
7395 (Catch.Resolve): Likewise.
7396 (Using.ResolveLocalVariableDecls): Likewise.
7397 (Foreach.Resolve): Likewise.
7399 2004-10-05 John Luke <john.luke@gmail.com>
7401 * cs-parser.jay: add location to error CS0175
7403 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7405 * ecore.cs (Expression.Constantity): Add support for turning null
7408 * const.cs (Const.Define): Allow constants to be reference types
7409 as long as the value is Null.
7411 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7413 * namespace.cs (NamespaceEntry.Using): No matter which warning
7414 level is set, check if this namespace name has already been added.
7416 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7418 * expression.cs: reftype [!=]= null should always use br[true,false].
7421 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7424 * attribute.cs: Enum conversion moved to
7425 GetAttributeArgumentExpression to be applied to the all
7428 2004-10-01 Raja R Harinath <rharinath@novell.com>
7430 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7431 * class.c (TypeContainer.DefineType): Flag error if
7432 base types aren't accessible due to access permissions.
7433 * decl.cs (DeclSpace.ResolveType): Move logic to
7434 Expression.ResolveAsTypeTerminal.
7435 (DeclSpace.ResolveTypeExpr): Thin layer over
7436 Expression.ResolveAsTypeTerminal.
7437 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7438 Refactor code into NestedAccess. Use it.
7439 (DeclSpace.NestedAccess): New.
7440 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7441 argument to silence errors. Check access permissions.
7442 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7443 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7444 (Cast.DoResolve): Likewise.
7445 (New.DoResolve): Likewise.
7446 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7447 (TypeOf.DoResolve): Likewise.
7449 * expression.cs (Invocation.BetterConversion): Return the Type of
7450 the better conversion. Implement section 14.4.2.3 more faithfully.
7451 (Invocation.BetterFunction): Make boolean. Make correspondence to
7452 section 14.4.2.2 explicit.
7453 (Invocation.OverloadResolve): Update.
7454 (Invocation): Remove is_base field.
7455 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7456 (Invocation.Emit): Likewise.
7458 2004-09-27 Raja R Harinath <rharinath@novell.com>
7460 * README: Update to changes.
7462 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7464 * cs-parser.jay: Reverted 642 warning fix.
7466 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7469 * decl.cs (FindMemberWithSameName): Indexer can have more than
7472 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7474 * expression.cs (LocalVariableReference.DoResolveLValue):
7475 Do not report warning 219 for out values.
7476 (EmptyExpression.Null): New member to avoid extra allocations.
7478 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7480 * cs-parser.jay: Fix wrong warning 642 report.
7482 * cs-tokenizer.cs (CheckNextToken): New helper;
7483 Inspect next character if is same as expected.
7485 2004-09-23 Martin Baulig <martin@ximian.com>
7487 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7488 (Convert.ImplicitReferenceConversionExists): Likewise.
7490 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7492 * class.cs (Operator.Define): Add error 448 and 559 report.
7494 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7496 * class.cs (MemberBase.IsTypePermitted): New protected
7497 method for checking error CS0610.
7499 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7501 * class.cs (TypeContainer.HasExplicitLayout): New property
7502 Returns whether container has StructLayout attribute set Explicit.
7503 (FieldMember): New abstract class for consts and fields.
7504 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7505 (Field): Reuse FieldMember.
7507 * const.cs (Const): Reuse FieldMember.
7509 * rootcontext.cs: EmitConstants call moved to class.
7511 2004-09-22 Martin Baulig <martin@ximian.com>
7513 Thanks to Peter Sestoft for this bug report.
7515 * expression.cs (Conditional): If both the `trueExpr' and the
7516 `falseExpr' is a NullLiteral, return a NullLiteral.
7518 2004-09-22 Martin Baulig <martin@ximian.com>
7520 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7521 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7522 for the "get_Current" call.
7524 2004-09-22 Martin Baulig <martin@ximian.com>
7526 Marek and me just fixed one of our oldest bugs: #28562 :-)
7528 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7530 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7531 we're an EnumConstant, just return that.
7532 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7533 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7534 to get the value which'll actually be written into the attribute.
7535 However, we have to use GetValue() to access the attribute's value
7538 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7540 * constant.cs (Constant.IsNegative): New abstract property
7543 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7544 (StackAlloc.DoResolve): Reused IsNegative.
7546 2004-09-21 Martin Baulig <martin@ximian.com>
7548 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7549 if we're used in an iterator, we may be called from different
7552 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7553 we actually have an exception block.
7555 2004-09-20 John Luke <jluke@cfl.rr.com>
7557 * class.cs, cs-parser.jay: Improve the error report for 1520:
7558 report the actual line where the error happens, not where the
7561 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7562 Pass location information that was available elsewhere.
7564 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
7566 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7567 runtime to delay sign assemblies.
7569 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7571 * cs-parser.jay: Do not report the stack trace, this is barely
7574 2004-08-22 John Luke <john.luke@gmail.com>
7576 * driver.cs : check that a resource id is not already used
7577 before adding it, report CS1508 if it is, bug #63637
7579 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7581 * ecore.cs: Removed dead code.
7583 2004-09-18 Marek Safar <marek.safar@seznam.cz>
7585 * class.cs: Do not report warning CS0067 on the interfaces.
7587 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7589 * cs-parser.jay: Add error 504 report.
7591 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7593 * rootcontext.cs: WarningLevel is 4 by default now.
7595 * statement.cs (Fixed.Resolve): Do not null
7598 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7601 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7602 deep search when property is not virtual.
7603 (PropertyExpr.ResolveAccessors): Make one call for both
7606 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7609 * statement.cs: Error 152 report constains also location.
7611 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7614 * const.cs: Explicitly set constant as static.
7616 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7619 * cs-parser.jay: Add error 1017 report.
7621 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7623 Fixed bug #59980, #64224
7624 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7626 * typemanager.cs (IsSpecialMethod): Simplified
7628 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7630 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7631 condition with better params.
7633 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7636 * attribute.cs (Resolve): Property has to have both
7639 2004-09-14 Martin Baulig <martin@ximian.com>
7641 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7643 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7646 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7647 called and is obsolete then this member suppress message
7648 when call is inside next [Obsolete] method or type.
7650 * expression.cs: Use TestObsoleteMethodUsage member.
7652 2004-09-14 Martin Baulig <martin@ximian.com>
7654 * cs-parser.jay: Sync a bit with the GMCS version.
7656 2004-09-14 Martin Baulig <martin@ximian.com>
7658 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7659 (CSharpParser.yacc_verbose_flag): New public field.
7661 * genericparser.cs: Removed.
7663 2004-09-14 Raja R Harinath <rharinath@novell.com>
7665 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7667 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7669 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7671 2004-09-10 Martin Baulig <martin@ximian.com>
7673 Backported my MemberName changes from GMCS into MCS.
7675 - we are now using a special `MemberName' class instead of using
7676 strings; in GMCS, the `MemberName' also contains the type
7679 - changed the grammar rules a bit:
7680 * the old `member_name' is now a `namespace_or_type_name':
7681 The rule is that we use `namespace_or_type_name' everywhere
7682 where we expect either a "member name" (GetEnumerator) or a
7683 "member name" with an explicit interface name
7684 (IEnumerable.GetEnumerator).
7685 In GMCS, the explicit interface name may include type arguments
7686 (IEnumerable<T>.GetEnumerator).
7687 * we use `member_name' instead of just `IDENTIFIER' for
7689 The rule is that we use `member_name' wherever a member may
7690 have type parameters in GMCS.
7692 * decl.cs (MemberName): New public class.
7693 (MemberCore.MemberName): New public readonly field.
7694 (MemberCore.ctor): Take a `MemberName' argument, not a string.
7695 (DeclSpace): Likewise.
7697 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7698 * enum.cs (Enum.ctor): Likewise.
7700 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7702 (AliasEntry.ctor): Take a MemberName, not an Expression.
7703 (AliasEntry.UsingAlias): Likewise.
7705 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7706 (IMethodData.MemberName): Changed type from string to MemberName.
7707 (MemberBase.ExplicitInterfaceName): Likewise.
7708 (AbstractPropertyEventMethod.SetupName): Make this private.
7709 (AbstractPropertyEventMethod.ctor): Added `string prefix'
7710 argument; compute the member name here.
7711 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7712 on the `member.MemberName' and the `prefix'.
7714 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7716 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7717 thus, we get a `MemberName' instead of a `string'. These
7718 declarations may have type parameters in GMCS.
7719 (interface_method_declaration, delegate_declaration): Likewise.
7720 (class_declaration, interface_declaration): Likewise.
7721 (method_header): Use `namespace_or_type_name' instead of
7722 `member_name'. We may be an explicit interface implementation.
7723 (property_declaration, event_declaration): Likewise.
7724 (member_name): This is now just an `IDENTIFIER', not a
7725 `namespace_or_type_name'.
7726 (type_name, interface_type): Removed.
7727 (namespace_or_type_name): Return a MemberName, not an Expression.
7728 (primary_expression): Use `member_name' instead of `IDENTIFIER';
7729 call GetTypeExpression() on the MemberName to get an expression.
7730 (IndexerDeclaration.interface_type): Changed type from string to
7732 (MakeName): Operate on MemberName's instead of string's.
7734 2004-09-13 Raja R Harinath <rharinath@novell.com>
7737 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7738 (NamespaceEntry.Lookup): Add new argument to flag if we want the
7739 lookup to avoid symbols introduced by 'using'.
7740 * rootcontext.cs (NamespaceLookup): Update.
7742 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7744 * class.cs (TypeContainer.DoDefineMembers): Do not call
7745 DefineDefaultConstructor for static classes.
7747 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7749 * attribute.cs (Attribute.Resolve): Add error 653 report.
7751 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7753 (Method.ApplyAttributeBuilder): Add error 685 report.
7754 (Operator.Define): Add error 564 report.
7756 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7758 * expression.cs (Invocation.DoResolve): Add error
7761 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7764 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7766 * class.cs (ConstructorInitializer.Resolve):
7767 Wrong error number (515->516).
7769 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7771 * class.cs (Indexer.Define): Add error 631 report.
7773 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7775 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7777 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7779 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7781 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7783 * cs-parser.jay: Added error CS0241 report.
7785 2004-09-10 Raja R Harinath <rharinath@novell.com>
7787 * cs-parser.jay (fixed_statement): Introduce a scope for the
7788 declaration in the 'fixed' statement.
7790 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7792 * cs-parser.jay: Added CS0230 error report.
7794 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7796 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7798 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7800 * expression.cs (Argument.Resolve): Added error CS0192 and
7803 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7805 C# 2.0 #pragma warning feature
7807 * cs-tokenizer.cs (PreProcessPragma): New method;
7808 Handles #pragma directive.
7810 * report.cs (WarningRegions): New class; Support
7811 class for #pragma warning directive. It tests whether
7812 warning is enabled for a given line.
7814 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7816 * const.cs: Add more descriptive error report, tahnks to
7819 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7821 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7823 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7825 * expression.cs: Apply patch from Ben: Remove dead code from
7826 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7827 as that code just threw an exception anwyays.
7829 * const.cs: Remove the call to the turnintoconstant, for details
7832 * literal.cs: The type of the null-literal is the null type; So
7833 we use a placeholder type (literal.cs:System.Null, defined here)
7836 * expression.cs (Conditional.DoResolve): Remove some old code that
7837 is no longer needed, conversions have been fixed.
7839 (ArrayCreationExpression.DoResolve): Return false if we fail to
7840 resolve the inner expression.
7842 2004-09-07 Raja R Harinath <rharinath@novell.com>
7845 * cs-parser.jay (delegate_declaration): Record a delegate
7846 declaration as a type declaration.
7847 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7849 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7851 * parameter.cs: Do not crash if the type can not be resolved.
7853 * expression.cs: Report errors with unsafe pointers, fixes #64896
7855 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7857 * expression.cs: Pointer arith always needs to do a conv.i
7858 if the operand is a long. fix 65320
7860 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7862 Fixed cs0619-37.cs, cs0619-38.cs
7864 * enum.cs (GetObsoleteAttribute): Removed.
7866 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7867 on Enum member is double staged. The first is tested member
7870 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7872 Fixed #56986, #63631, #65231
7874 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7875 adds member to name container.
7876 (TypeContainer.AddToTypeContainer): New method, adds type to
7878 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7879 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7880 AddOperator): Simplified by reusing AddToMemberContainer.
7881 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7883 (Method.CheckForDuplications): Fixed implementation to test all
7885 (MemberBase): Detection whether member is explicit interface
7886 implementation is now in constructor.
7887 (MemberBase.UpdateMemberName): Handles IndexerName.
7888 (Accessor): Changed to keep also location information.
7889 (AbstractPropertyEventMethod): Is derived from MemberCore.
7890 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7891 will be emited or not.
7892 (PropertyBase.AreAccessorsDuplicateImplementation):
7893 Tests whether accessors are not in collision with some method.
7894 (Operator): Is derived from MethodCore to simplify common
7897 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7899 (DeclSpace.AddToContainer): Adds the member to defined_names
7900 table. It tests for duplications and enclosing name conflicts.
7902 * enum.cs (EnumMember): Clean up to reuse the base structures
7904 2004-09-03 Martin Baulig <martin@ximian.com>
7906 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7907 into TypeContainer, to make partial classes work again.
7909 2004-09-03 Martin Baulig <martin@ximian.com>
7911 * rootcontext.cs (RootContext.V2): Removed.
7913 2004-03-23 Martin Baulig <martin@ximian.com>
7915 * expression.cs (Invocation.OverloadResolve): Added `bool
7916 may_fail' argument and use it instead of the Location.IsNull() hack.
7918 2004-09-03 Martin Baulig <martin@ximian.com>
7920 Merged latest changes into gmcs. Please keep this comment in
7921 here, it makes it easier for me to see what changed in MCS since
7922 the last time I merged.
7924 2004-09-03 Raja R Harinath <rharinath@novell.com>
7927 * expression.cs (BetterConversion): Don't allow either conversion
7928 to be null. Remove redundant implicit conversion test when 'q ==
7929 null' -- when this function is invoked, we already know that the
7930 implicit conversion exists.
7931 (BetterFunction): Assume that 'best' is non-null. Remove
7932 redundant reimplementation of IsApplicable when 'best' is null.
7933 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7934 number of arguments.
7935 (IsAncestralType): Extract from OverloadResolve.
7936 (OverloadResolve): Make robust to the MethodGroupExpr being
7937 unsorted. Implement all the logic of Section 14.5.5.1, and
7938 support overloading of methods from multiple applicable types.
7939 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7941 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7942 (RealError, Warning): Append type of report to related symbol.
7944 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7946 * enum.cs: Fixed CLS-Compliance checks for enum members.
7947 Error tests cs3008-8.cs, cs3014-8.cs
7949 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7951 Fixed bug #62342, #63102
7952 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7953 like ImplementMethod.
7955 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7957 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7960 2004-09-02 Martin Baulig <martin@ximian.com>
7962 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7963 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7966 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7968 C# 2.0 Static classes implemented
7970 * class.cs (TypeContainer): instance_constructors,
7971 initialized_fields, initialized_static_fields,
7972 default_constructor, base_inteface_types are protected to be
7973 accessible from StaticClass.
7974 (TypeContainer.DefineDefaultConstructor): New virtual method
7975 for custom default constructor generating
7976 (StaticClass): New class to handle "Static classes" feature.
7978 * cs-parser.jay: Handle static keyword on class like instance
7981 * driver.cs: Added "/langversion" command line switch with two
7982 options (iso-1, default).
7984 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7986 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7988 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7990 * delegate.cs: Style.
7992 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7994 * delegate.cs: Add seperate instance expr field for miguel.
7996 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7998 * PointerArithmetic (Resolve): make sure we are not doing
7999 pointer arith on void*. Also, make sure we are resolved
8000 by not setting eclass until resolve.
8002 All callers: Make sure that PointerArithmetic gets resolved.
8004 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8006 * ArrayCreation (LookupType): If the type does not resolve
8007 to an array, give an error.
8009 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8011 * statement.cs (Try.Resolve): Fixed bug #64222
8013 2004-08-27 Martin Baulig <martin@ximian.com>
8016 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8019 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8021 * ecore.cs (Constantify): Get underlying type via
8022 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8023 Windows in special cases.
8025 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8027 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8028 for obtaining also private methods.
8029 (GetRemoveMethod): Used GetRemoveMethod (true)
8030 for obtaining also private methods.
8032 2004-08-24 Martin Baulig <martin@ximian.com>
8034 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8035 MethodAttributes.HideBySig for operators.
8037 2004-08-23 Martin Baulig <martin@ximian.com>
8039 Back to the old error reporting system :-)
8041 * report.cs (Message): Removed.
8042 (Report.MessageData, ErrorData, WarningData): Removed.
8043 (Report.Error, Warning): Back to the old system.
8045 2004-08-23 Martin Baulig <martin@ximian.com>
8047 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8049 * class.cs (TypeContainer.ParentContainer): New public virtual
8050 method; replaces the explicit interface implementation.
8051 (ClassPart.ParentContainer): Override.
8053 2004-08-23 Martin Baulig <martin@ximian.com>
8055 * statement.cs (Switch): Added support for constant switches; see
8056 #59428 or test-285.cs.
8058 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8061 * statement.cs (GetEnumeratorFilter): Removed useless
8062 logic because C# specs is strict. GetEnumerator must be
8065 2004-08-22 Martin Baulig <martin@ximian.com>
8067 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8068 a switch and may break, reset the barrier. Fixes #59867.
8070 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8072 CLS-Compliance speed up (~5% for corlib)
8074 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8075 New method. Tests container for CLS-Compliant names
8077 * class.cs (TypeContainer.VerifyClsName): New method.
8078 Checks whether container name is CLS Compliant.
8079 (Constructor): Implements IMethodData.
8081 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8082 low-case table for CLS Compliance test.
8083 (MemberCache.VerifyClsParameterConflict): New method.
8084 Checks method parameters for CS3006 error.
8086 * enum.cs (EnumMember): Is derived from MemberCore.
8087 (Enum.VerifyClsName): Optimized for better performance.
8089 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8091 * report.cs: Renamed Error_T to Error and changed all
8094 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8096 * class.cs (TypeContainer.IndexerArrayList): New inner class
8097 container for indexers.
8098 (TypeContainer.DefaultIndexerName): New constant for default
8099 indexer name. Replaced all "Item" with this constant.
8100 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8102 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8103 DefaultMemberAttribute constructor.
8105 2004-08-05 Martin Baulig <martin@ximian.com>
8107 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8110 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8112 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8113 multi platforms problem.
8115 * compiler.csproj: Included shared files.
8117 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8119 Fix bug 60333, 55971 in the more general way
8120 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8121 Added arg_type argument for constant conversion.
8122 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8124 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8127 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8128 OperatorArrayList, MethodCoreArrayList for typecontainer
8129 containers. Changed class member types to these new types.
8130 (MethodArrayList.DefineMembers): Added test for CS0659.
8132 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8134 * cfold.cs: Synchronize the folding with the code in expression.cs
8135 Binary.DoNumericPromotions for uint operands.
8137 * attribute.cs: Revert patch from Raja, it introduced a regression
8138 while building Blam-1.2.1 (hard to isolate a test case).
8140 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8144 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8146 (MethodCore.parent_method): New member. The method we're overriding
8147 if this is an override method.
8148 (MethodCore.CheckBase): Moved from Method class and made common.
8149 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8151 (MethodCore.CheckForDuplications): New abstract method. For custom
8152 member duplication search in a container
8153 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8154 method and its return type.
8155 (Event.conflict_symbol): New member. Symbol with same name in the
8159 (MemberCache.FindMemberWithSameName): New method. The method
8160 is looking for conflict with inherited symbols.
8162 2004-08-04 Martin Baulig <martin@ximian.com>
8164 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8166 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8168 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8170 * report.cs (Message): New enum for better error, warning reference in
8172 (MessageData): New inner abstract class. It generally handles printing of
8173 error and warning messages.
8174 Removed unused Error, Warning, Message methods.
8176 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8178 Fix for cs0592-8.cs test
8180 (Attributable.ValidAttributeTargets): Made public.
8181 (Attribute.ExplicitTarget): New member for explicit target value.
8182 (Attribute.CheckTargets): Now we translate explicit attribute
8183 target to Target here.
8185 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8187 * ecore.cs (MethodGroupExpr): new IsBase property.
8189 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8191 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8192 rather than an instance expr.
8194 (DelegateCreation.Emit): Use the method group rather than
8195 the instance expression. Also, if you have base.Foo as the
8196 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8198 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8200 (NewDelegate.DoResolve): Only check for the existance of Invoke
8201 if the method is going to be needed. Use MethodGroupExpr.
8203 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8205 * expression.cs: For pointer arith., make sure to use
8206 the size of the type, not the size of the pointer to
8209 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8212 * class.cs (Class): Added error CS0502 test.
8214 2004-08-03 John Luke <jluke@cfl.rr.com>
8215 Raja R Harinath <rharinath@novell.com>
8218 * attribute.cs (Attribute.complained_before): New flag.
8219 (Attribute.ResolveType, Attribute.Resolve),
8220 (Attribute.DefinePInvokeMethod): Set it.
8221 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8223 2004-08-03 Martin Baulig <martin@ximian.com>
8225 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8226 use a user-defined operator; we still need to do numeric
8227 promotions in case one argument is a builtin type and the other
8228 one has an implicit conversion to that type. Fixes #62322.
8230 2004-08-02 Martin Baulig <martin@ximian.com>
8232 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8233 (LocalInfo.IsThis): New public property.
8234 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8236 2004-08-01 Martin Baulig <martin@ximian.com>
8238 * class.cs (TypeContainer.GetClassBases): Don't set the default
8239 here since we may get called from GetPartialBases().
8240 (TypeContainer.DefineType): If GetClassBases() didn't return a
8241 parent, use the default one.
8243 2004-07-30 Duncan Mak <duncan@ximian.com>
8245 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8247 2004-07-30 Martin Baulig <martin@ximian.com>
8249 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8251 * class.cs (SourceMethod): New public class, derive from the
8252 symbol writer's ISourceMethod.
8253 (Method): Use the new symbol writer API.
8255 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8256 as argument and use the new symbol writer.
8259 (SourceFile): Implement the symbol writer's ISourceFile.
8260 (Location.SymbolDocument): Removed.
8261 (Location.SourceFile): New public property.
8263 * symbolwriter.cs: Use the new symbol writer API.
8265 2004-07-30 Raja R Harinath <rharinath@novell.com>
8267 * Makefile (install-local): Remove. Functionality moved to
8270 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8272 * Makefile: Install mcs.exe.config file together with mcs.exe.
8273 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8274 correct runtime version.
8276 2004-07-25 Martin Baulig <martin@ximian.com>
8279 (TypeContainer.RegisterOrder): Removed, this was unused.
8280 (TypeContainer, interface_order): Removed.
8281 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8282 TypeContainer as argument since we can also be called with a
8283 `PartialContainer' for a partial class/struct/interface.
8284 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8285 of checking whether we're an `Interface' - we could be a
8287 (PartialContainer.Register): Override; call
8288 AddClass()/AddStruct()/AddInterface() on our parent.
8290 * cs-parser.jay (interface_member_declaration): Add things to the
8291 `current_container', not the `current_class'.
8293 * rootcontext.cs (RegisterOrder): The overloaded version which
8294 takes an `Interface' was unused, removed.
8296 * typemanager.cs (TypeManager.LookupInterface): Return a
8297 `TypeContainer', not an `Interface'.
8298 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8299 contain a `PartialContainer' for an interface, so check it's
8300 `Kind' to figure out what it is.
8302 2004-07-25 Martin Baulig <martin@ximian.com>
8304 * class.cs (Class.DefaultTypeAttributes): New public constant.
8305 (Struct.DefaultTypeAttributes): Likewise.
8306 (Interface.DefaultTypeAttributes): Likewise.
8307 (PartialContainer.TypeAttr): Override this and add the
8308 DefaultTypeAttributes.
8310 2004-07-25 Martin Baulig <martin@ximian.com>
8312 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8313 we can just use the `Parent' field instead.
8315 2004-07-25 Martin Baulig <martin@ximian.com>
8317 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8319 2004-07-25 Martin Baulig <martin@ximian.com>
8321 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8322 our parts before defining any methods.
8323 (TypeContainer.VerifyImplements): Make this virtual.
8324 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8325 on our PartialContainer.
8327 2004-07-25 Martin Baulig <martin@ximian.com>
8329 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8331 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8332 argument, we can just use the `Parent' field instead.
8335 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8336 (MemberBase.DoDefine): Likewise.
8338 2004-07-24 Martin Baulig <martin@ximian.com>
8340 * decl.cs (MemberCore.Parent): New public field.
8341 (DeclSpace.Parent): Moved to MemberCore.
8343 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8344 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8346 (FieldBase, Field, Operator): Likewise.
8347 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8348 (EventField, Event): Likewise.
8350 2004-07-23 Martin Baulig <martin@ximian.com>
8352 * class.cs (PartialContainer): New public class.
8353 (ClassPart): New public class.
8354 (TypeContainer): Added support for partial classes.
8355 (TypeContainer.GetClassBases): Splitted some of the functionality
8356 out into GetNormalBases() and GetPartialBases().
8358 * cs-tokenizer.cs (Token.PARTIAL): New token.
8359 (Tokenizer.consume_identifier): Added some hacks to recognize
8360 `partial', but only if it's immediately followed by `class',
8361 `struct' or `interface'.
8363 * cs-parser.jay: Added support for partial clases.
8365 2004-07-23 Martin Baulig <martin@ximian.com>
8367 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8368 a `DeclSpace' and also made it readonly.
8369 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8370 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8371 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8373 * cs-parser.jay: Pass the `current_class', not the
8374 `current_container' (at the moment, this is still the same thing)
8375 to a new Method, Property, Event, Indexer or Constructor.
8377 2004-07-23 Martin Baulig <martin@ximian.com>
8379 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8380 and removed the `current_interface' one.
8381 (struct_declaration, class_declaration, interface_declaration):
8382 Set `current_class' to the newly created class/struct/interface;
8383 set their `Bases' and call Register() before parsing their body.
8385 2004-07-23 Martin Baulig <martin@ximian.com>
8387 * class.cs (Kind): New public enum.
8388 (TypeContainer): Made this class abstract.
8389 (TypeContainer.Kind): New public readonly field.
8390 (TypeContainer.CheckDef): New public method; moved here from
8392 (TypeContainer.Register): New public abstract method.
8393 (TypeContainer.GetPendingImplementations): New public abstract
8395 (TypeContainer.GetClassBases): Removed the `is_class' and
8396 `is_iface' parameters.
8397 (TypeContainer.DefineNestedTypes): Formerly known as
8399 (ClassOrStruct): Made this class abstract.
8401 * tree.cs (RootTypes): New public type.
8403 2004-07-20 Martin Baulig <martin@ximian.com>
8405 * tree.cs (Tree.RecordNamespace): Removed.
8406 (Tree.Namespaces): Removed.
8408 * rootcontext.cs (RootContext.IsNamespace): Removed.
8410 * cs-parser.jay (namespace_declaration): Just create a new
8411 NamespaceEntry here.
8413 2004-07-20 Martin Baulig <martin@ximian.com>
8415 * statement.cs (ExceptionStatement): New abstract class. This is
8416 now used as a base class for everyone who's using `finally'.
8417 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8418 our local variables before using them.
8420 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8421 virtual method. This is used by Yield.Resolve() to "steal" an
8422 outer block's `finally' clauses.
8423 (FlowBranchingException): The .ctor now takes an ExceptionStatement
8426 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8427 version which takes an ExceptionStatement. This version must be
8428 used to create exception branchings.
8431 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8432 (Iterator.EmitMoveNext): Added exception support; protect the
8433 block with a `fault' clause, properly handle 'finally' clauses.
8434 (Iterator.EmitDispose): Run all the `finally' clauses here.
8436 2004-07-20 Martin Baulig <martin@ximian.com>
8438 * iterator.cs: This is the first of a set of changes in the
8439 iterator code. Match the spec more closely: if we're an
8440 IEnumerable, then GetEnumerator() must be called. The first time
8441 GetEnumerator() is called, it returns the current instance; all
8442 subsequent invocations (if any) must create a copy.
8444 2004-07-19 Miguel de Icaza <miguel@ximian.com>
8446 * expression.cs: Resolve the constant expression before returning
8449 2004-07-19 Martin Baulig <martin@ximian.com>
8451 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8452 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8453 the return type of the new EmitContext.
8455 2004-07-18 Martin Baulig <martin@ximian.com>
8457 * class.cs (Property.Define): Fix iterators.
8459 * iterators.cs (Iterator.Define): Moved the
8460 `container.AddInterator (this)' call here from the .ctor; only do
8461 it if we resolved successfully.
8463 2004-07-17 Miguel de Icaza <miguel@ximian.com>
8465 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8466 `true' for preprocessing directives that we parse. The return
8467 value indicates whether we should return to regular tokenizing or
8468 not, not whether it was parsed successfully.
8470 In the past if we were in: #if false ... #line #endif, we would
8471 resume parsing after `#line'. See bug 61604.
8473 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8474 building: IsEnumType should return true only for enums, not for
8475 enums or System.Enum itself. This fixes #61593.
8477 Likely what happened is that corlib was wrong: mcs depended on
8478 this bug in some places. The bug got fixed, we had to add the
8479 hack, which caused bug 61593.
8481 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8482 that was a workaround for the older conditions.
8484 2004-07-16 Ben Maurer <bmaurer@ximian.com>
8486 * assign.cs: IAssignMethod has a new interface, as documented
8487 inline. All assignment code now uses this new api.
8489 * ecore.cs, expression.cs: All classes which implement
8490 IAssignMethod now use the new interface.
8492 * expression.cs (Invocation): add a hack to EmitCall so that
8493 IndexerAccess can be the target of a compound assignment without
8494 evaluating its arguments twice.
8496 * statement.cs: Handle changes in Invocation api.
8498 2004-07-16 Martin Baulig <martin@ximian.com>
8500 * iterators.cs: Rewrote this. We're now using one single Proxy
8501 class for both the IEnumerable and the IEnumerator interface and
8502 `Iterator' derives from Class so we can use the high-level API.
8504 * class.cs (TypeContainer.AddIterator): New method.
8505 (TypeContainer.DoDefineType): New protected virtual method, which
8506 is called from DefineType().
8507 (TypeContainer.DoDefineMembers): Call DefineType() and
8508 DefineMembers() on all our iterators.
8509 (TypeContainer.Emit): Call Emit() on all our iterators.
8510 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8512 * codegen.cs (EmitContext.CurrentIterator): New public field.
8514 2004-07-15 Martin Baulig <martin@ximian.com>
8517 (TypeManager.not_supported_exception_type): New type.
8519 2004-07-14 Martin Baulig <martin@ximian.com>
8521 * iterators.cs: Use real error numbers.
8523 2004-07-14 Martin Baulig <martin@ximian.com>
8525 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8526 requires this to be a System.Collection.IEnumerable and not a
8527 class implementing that interface.
8528 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8530 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8532 * class.cs: Fixed previous fix, it broke some error tests.
8534 2004-07-12 Martin Baulig <martin@ximian.com>
8536 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8539 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8541 * assign.cs (LocalTemporary): Add new argument: is_address,If
8542 `is_address' is true, then the value that we store is the address
8543 to the real value, and not the value itself.
8545 * ecore.cs (PropertyExpr): use the new local temporary
8546 stuff to allow us to handle X.Y += z (where X is a struct)
8548 2004-07-08 Martin Baulig <martin@ximian.com>
8550 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8551 not always return, just like we're doing in Using.Resolve().
8553 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8555 * cs-parser.jay (fixed_statement): flag this as Pinned.
8557 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8559 * typemanager.cs (TypeManager): Removed MakePinned method, this
8560 mechanism is replaced with the .NET 2.x compatible mechanism of
8561 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8563 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8564 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8565 `IsFixed' property which has a different meaning.
8567 2004-07-02 Raja R Harinath <rharinath@novell.com>
8569 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8570 visible from inside a nested class, not just the names of the
8571 immediately enclosing class.
8574 2004-06-24 Raja R Harinath <rharinath@novell.com>
8576 * expression.cs (BetterConversion): Remove buggy special-case
8577 handling of "implicit constant expression conversions". At this
8578 point, we already know that the conversion is possible -- we're
8579 only checking to see which is better.
8581 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8583 * cs-parser.jay: Added error CS0210 test.
8585 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8587 * cs-parser.jay: Added error CS0134 test.
8589 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8592 * cs-parser.jay: Added error CS0145 test.
8594 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8596 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8598 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8600 * expression.cs (StackAlloc.Resolve): The argument may not
8601 be a constant; deal with this case.
8603 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8605 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8606 GetIndexerAttributeValue.
8607 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8609 * class.cs (Indexer.Define): Added error tests for CS0415,
8612 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8614 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8617 2004-06-23 Martin Baulig <martin@ximian.com>
8619 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8620 neither return nor throw, reset the barrier as well. Fixes #60457.
8622 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8624 * class.cs : EventAttributes is now set to None by default.
8625 This fixes bug #60459.
8627 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8630 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8631 Don't throw exception but return null (it's sufficient now).
8633 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8635 * typemanager.cs (GetArgumentTypes): Faster implementation.
8637 2004-06-18 Martin Baulig <martin@ximian.com>
8639 * attribute.cs (Attribute.Resolve): Check whether we're an
8640 EmptyCast which a Constant child. Fixes #60333.
8642 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8644 * statement.cs (EmitCollectionForeach): Account for the fact that
8645 not all valuetypes are in areas which we can take the address of.
8646 For these variables, we store to a temporary variable. Also, make
8647 sure that we dont emit a `callvirt' on a valuetype method.
8649 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8651 * expression.cs (StackAlloc.DoReSolve): Added test for
8652 negative parameter (CS0247).
8654 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8657 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8659 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8662 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8665 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8667 Fix bug #58254 & cs1555.cs, cs1556.cs
8668 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8670 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8672 * cs-parser.jay: Added error CS1669 test for indexers.
8674 2004-06-11 Martin Baulig <martin@ximian.com>
8676 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8677 call this twice: for params and varargs methods.
8679 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8682 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8684 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8686 * attribute.cs (Attribute.GetValidTargets): Made public.
8689 (AbstractPropertyEventMethod): New class for better code sharing.
8690 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8692 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8694 2004-06-11 Raja R Harinath <rharinath@novell.com>
8697 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8698 that the call to Resolve is part of a MemberAccess.
8699 (Expression.Resolve): Use it for SimpleName resolution.
8700 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8701 Add 'intermediate' boolean argument.
8702 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
8703 error message when the SimpleName can be resolved ambiguously
8704 between an expression and a type.
8705 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8707 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8708 call on the left-side.
8710 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8713 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8715 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8717 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8719 2004-06-11 Martin Baulig <martin@ximian.com>
8721 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8722 varargs methods if applicable.
8724 2004-06-11 Martin Baulig <martin@ximian.com>
8726 * expression.cs (Invocation.EmitCall): Don't use
8727 `method.CallingConvention == CallingConventions.VarArgs' since the
8728 method could also have `CallingConventions.HasThis'.
8730 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8732 * class.cs (Event.GetSignatureForError): Implemented.
8733 Fixed crash in error test cs3010.cs
8735 2004-06-10 Miguel de Icaza <miguel@ximian.com>
8737 * cs-tokenizer.cs: Change the way we track __arglist to be
8738 consistent with the other keywords.
8740 2004-06-09 Miguel de Icaza <miguel@ximian.com>
8742 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8745 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
8747 * codegen.cs: Check that all referenced assemblies have a strongname
8748 before strongnaming the compiled assembly. If not report error CS1577.
8749 Fix bug #56563. Patch by Jackson Harper.
8750 * typemanager.cs: Added a method to return all referenced assemblies.
8751 Fix bug #56563. Patch by Jackson Harper.
8753 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8756 (Method.ApplyAttributeBuilder): Moved and added conditional
8757 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8760 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8762 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8765 * class.cs: (EventField.attribute_targets): Changed default target.
8767 2004-06-08 Martin Baulig <martin@ximian.com>
8769 * expression.cs (Invocation.EmitCall): Enable varargs methods.
8771 2004-06-08 Martin Baulig <martin@ximian.com>
8773 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8775 2004-06-07 Martin Baulig <martin@ximian.com>
8777 Added support for varargs methods.
8779 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8782 * cs-parser.jay: Added support for `__arglist'.
8784 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8786 * expression.cs (Argument.AType): Added `ArgList'.
8787 (Invocation): Added support for varargs methods.
8788 (ArglistAccess): New public class.
8789 (Arglist): New public class.
8791 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8793 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
8794 a method's top-level block if the method has varargs.
8796 * support.cs (ReflectionParameters, InternalParameters): Added
8797 support for varargs methods.
8799 2004-06-07 Miguel de Icaza <miguel@ximian.com>
8801 * class.cs: Provide location in indexer error report.
8803 * driver.cs: Use standard names.
8805 * namespace.cs: Catch the use of using after a namespace has been
8806 declared also on using aliases.
8808 2004-06-03 Raja R Harinath <rharinath@novell.com>
8811 * typemanager.cs (closure_private_ok, closure_invocation_type)
8812 (closure_qualifier_type, closure_invocation_assembly)
8813 (FilterWithClosure): Move to ...
8814 (Closure): New internal nested class.
8815 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8816 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8817 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8818 (MemberLookup, MemberLookupFailed): Use it.
8819 * expression.cs (New.DoResolve): Treat the lookup for the
8820 constructor as being qualified by the 'new'ed type.
8821 (Indexers.GetIndexersForTypeOrInterface): Update.
8823 2004-06-03 Marek Safar <marek.safar@seznam.cz>
8826 (GetConditionalAttributeValue): New method. Returns
8827 condition of ConditionalAttribute.
8828 (SearchMulti): New method. Returns all attributes of type 't'.
8829 Use it when attribute is AllowMultiple = true.
8830 (IsConditionalMethodExcluded): New method.
8833 (Method.IsExcluded): Implemented. Returns true if method has conditional
8834 attribute and the conditions is not defined (method is excluded).
8835 (IMethodData): Extended interface for ConditionalAttribute support.
8836 (PropertyMethod.IsExcluded): Implemented.
8839 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8842 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8845 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
8847 * expression.cs (ArrayCreationExpression): Make this just an
8848 `expression'. It can't be a statement, so the code here was
8851 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8854 * typemanager.cs (GetFullNameSignature): New method for
8857 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8860 * class.cs (MemberBase.GetSignatureForError): New virtual method.
8861 Use this method when MethodBuilder is null.
8862 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8863 Added test for error CS0626 (MONO reports error for this situation).
8864 (IMethodData.GetSignatureForError): Extended interface.
8866 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8869 (AttributeTester.GetObsoleteAttribute): Returns instance of
8870 ObsoleteAttribute when type is obsolete.
8873 (TypeContainer.VerifyObsoleteAttribute): Override.
8874 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8875 (MethodCode.VerifyObsoleteAttribute): Override.
8876 (MemberBase.VerifyObsoleteAttribute): Override.
8879 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8880 and report proper error.
8883 Delegate.VerifyObsoleteAttribute): Override.
8886 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8887 and report proper error.
8888 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8891 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8895 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8896 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8897 Added test for ObsoleteAttribute.
8900 (Catch): Derived from Statement.
8902 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8904 Fixed bug #59071 & cs0160.cs
8906 * statement.cs (Try.Resolve): Check here whether order of catch
8907 clauses matches their dependencies.
8909 2004-05-31 Miguel de Icaza <miguel@ximian.com>
8911 * Reverted patch to namespace.cs (Use lookuptypedirect). This
8912 caused a regression: #59343. Referencing nested classes from an
8913 assembly stopped working.
8915 2004-05-31 Martin Baulig <martin@ximian.com>
8917 MCS is now frozen for beta 2.
8919 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8921 * convert.cs: add a trivial cache for overload operator resolution.
8923 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8925 * decl.cs: If possible, use lookuptypedirect here. We can only do
8926 this if there is no `.' after the namespace. Avoids using
8927 LookupType, which does lots of slow processing.
8928 (FindNestedType) New method, does what it says :-).
8929 * namespace.cs: use LookupTypeDirect.
8930 * rootcontext.cs: use membercache, if possible.
8931 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8933 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8936 According to the spec,
8938 In a member access of the form E.I, if E is a single identifier,
8939 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8940 field, property, localvariable, or parameter with the same type as
8941 the meaning of E as a type-name (§3.8), then both possible
8942 meanings of E are permitted.
8944 We did not check that E as a simple-name had the same type as E as
8947 This trivial check gives us 5-7% on bootstrap time.
8949 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8951 * expression.cs (Invocation.OverloadResolve): Avoid the
8952 use of hashtables and boxing here by allocating on demand.
8954 2004-05-30 Martin Baulig <martin@ximian.com>
8956 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8957 we're doing a silent lookup. Don't try to lookup nested types in
8958 TypeManager.object_type (thanks to Ben Maurer).
8960 2004-05-30 Martin Baulig <martin@ximian.com>
8962 Committing a patch from Ben Maurer.
8964 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8966 2004-05-29 Martin Baulig <martin@ximian.com>
8968 * class.cs (IMethodData.ShouldIgnore): New method.
8970 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8971 `Location' argument, we don't need it anywhere. Use
8972 `IMethodData.ShouldIgnore ()' instead of
8973 `MethodData.GetMethodFlags ()'.
8974 (TypeManager.AddMethod): Removed.
8975 (TypeManager.AddMethod2): Renamed to AddMethod.
8977 2004-05-29 Martin Baulig <martin@ximian.com>
8979 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8981 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8982 converting from a class type S to an interface type and we already
8983 have an object on the stack, don't box it again. Fixes #52578.
8985 2004-05-29 Martin Baulig <martin@ximian.com>
8987 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8988 Added support for `params' parameters. Fixes #59267.
8990 2004-05-29 Martin Baulig <martin@ximian.com>
8992 * literal.cs (NullPointer): Provide a private .ctor which sets
8993 `type' to TypeManager.object_type. Fixes #59048.
8995 2004-05-29 Martin Baulig <martin@ximian.com>
8997 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8998 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9000 * ecore.cs (EventExpr.instance_expr): Make the field private.
9002 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9004 Fixed bug #50080 & cs0214-2.cs
9005 * expression.cs (Cast.DoResolve): Check unsafe context here.
9007 * statement.cs (Resolve.DoResolve): Likewise.
9009 2004-05-26 Martin Baulig <martin@ximian.com>
9011 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9013 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9014 (RootContext.LookupType): Pass down the `silent' flag.
9016 2004-05-25 Martin Baulig <martin@ximian.com>
9019 (MethodGroupExpr.IdenticalTypeName): New public property.
9020 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9021 expression actually refers to a type.
9023 2004-05-25 Martin Baulig <martin@ximian.com>
9025 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9026 for #56176 and made it actually work.
9028 2004-05-25 Martin Baulig <martin@ximian.com>
9030 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9031 (FieldExpr, PropertyExpr): Override and implement
9032 CacheTemporaries. Fixes #52279.
9034 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9036 * location.cs: In the new compiler listing a file twice is a
9037 warning, not an error.
9039 2004-05-24 Martin Baulig <martin@ximian.com>
9041 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9042 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9044 2004-05-24 Martin Baulig <martin@ximian.com>
9046 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9047 walking the `using' list. Fixes #53921.
9049 2004-05-24 Martin Baulig <martin@ximian.com>
9051 * const.cs (Const.LookupConstantValue): Added support for
9052 EmptyCast's; fixes #55251.
9054 2004-05-24 Martin Baulig <martin@ximian.com>
9056 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9057 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9058 which does the CS0135 check. The reason is that we first need to
9059 check whether the variable actually exists.
9061 2004-05-24 Martin Baulig <martin@ximian.com>
9063 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9064 than RootContext.LookupType() to find the explicit interface
9067 2004-05-24 Raja R Harinath <rharinath@novell.com>
9069 * Makefile: Simplify. Use executable.make.
9070 * mcs.exe.sources: New file. List of sources of mcs.exe.
9072 2004-05-24 Anders Carlsson <andersca@gnome.org>
9076 Use the invariant culture when doing String.Compare for CLS case
9079 2004-05-23 Martin Baulig <martin@ximian.com>
9081 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9082 don't have any dots. Fixes #52622, added cs0246-8.cs.
9084 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9086 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9088 * class.cs (MemberBase.Define): Reuse MemberType member for
9089 resolved type. Other methods can use it too.
9091 2004-05-23 Martin Baulig <martin@ximian.com>
9093 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9094 the variable also exists in the current block (otherwise, we need
9095 to report a CS0103). Fixes #58670.
9097 2004-05-23 Martin Baulig <martin@ximian.com>
9099 * flowanalysis.cs (Reachability.Reachable): Compute this
9100 on-the-fly rather than storing it as a field.
9102 2004-05-23 Martin Baulig <martin@ximian.com>
9104 * flowanalysis.cs (Reachability.And): Manually compute the
9105 resulting `barrier' from the reachability.
9107 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9110 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9111 instance of ObsoleteAttribute when symbol is obsolete.
9114 (IMethodData): Extended interface for ObsoleteAttribute support.
9116 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9118 * attribute.cs: Fix bug #55970
9120 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9124 (GetObsoleteAttribute): New method. Creates the instance of
9126 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9127 ObsoleteAttribute when member is obsolete.
9128 (AttributeTester.Report_ObsoleteMessage): Common method for
9129 Obsolete error/warning reporting.
9132 (TypeContainer.base_classs_type): New member for storing parent type.
9135 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9136 for this MemberCore.
9138 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9140 * attribute.cs, const.cs: Fix bug #58590
9142 2004-05-21 Martin Baulig <martin@ximian.com>
9144 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9145 out parameters if the end of the method is unreachable. Fixes
9148 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9150 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9151 Hari was right, why extra method.
9153 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9155 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9157 2004-05-20 Martin Baulig <martin@ximian.com>
9159 Merged this back from gmcs to keep the differences to a minumum.
9161 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9162 instead of a Declspace.
9163 (Attribute.ResolveType): Likewise.
9164 (Attributes.Search): Likewise.
9165 (Attributes.Contains): Likewise.
9166 (Attributes.GetClsCompliantAttribute): Likewise.
9168 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9170 (MethodData.ApplyAttributes): Take an EmitContext instead of a
9173 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9175 Fix bug #58688 (MCS does not report error when the same attribute
9178 * attribute.cs (Attribute.Emit): Distinction between null and default.
9180 2004-05-19 Raja R Harinath <rharinath@novell.com>
9182 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9183 of a top-level attribute without an attribute target.
9184 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9186 (Attribute.Conditional_GetConditionName),
9187 (Attribute.Obsolete_GetObsoleteMessage): Update.
9188 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9189 part of ScanForIndexerName.
9190 (Attribute.CanIgnoreInvalidAttribute): New function.
9191 (Attribute.ScanForIndexerName): Move to ...
9192 (Attributes.ScanForIndexerName): ... here.
9193 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9194 (Attributes.Search): New internal variant that can choose not to
9195 complain if types aren't resolved. The original signature now
9197 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9198 complaints suppressed.
9199 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9200 only if it not useful.
9201 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9202 top-level for attributes that are shared between the assembly
9203 and a top-level class.
9204 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9205 * class.cs: Update to reflect changes.
9206 (DefineIndexers): Fuse loops.
9207 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9208 a couple more variants of attribute names.
9210 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9212 Fix bug #52585 (Implemented explicit attribute declaration)
9215 (Attributable.ValidAttributeTargets): New abstract method. It gets
9216 list of valid attribute targets for explicit target declaration.
9217 (Attribute.Target): It holds target itself.
9218 (AttributeSection): Removed.
9219 (Attribute.CheckTargets): New method. It checks whether attribute
9220 target is valid for the current element.
9223 (EventProperty): New class. For events that are declared like
9224 property (with add and remove accessors).
9225 (EventField): New class. For events that are declared like field.
9228 * cs-parser.jay: Implemented explicit attribute target declaration.
9230 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9231 Override ValidAttributeTargets.
9234 (ReturnParameter): Class for applying custom attributes on
9236 (ParameterAtribute): New class. Class for applying custom
9237 attributes on the parameter type.
9239 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9241 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9244 (Method): Allow UNSAFE here.
9246 * modifiers.cs: Support unsafe reporting.
9248 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9250 * decl.cs: Fix bug #58478.
9252 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9254 * statement.cs: When checking for unreachable code on an EmptyStatement,
9255 set the location. Fixes bug #58488.
9257 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9259 * driver.cs: Add -pkg handling.
9261 From Gonzalo: UseShelLExecute=false
9263 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9266 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9268 (Attribute.IsClsCompliaceRequired): Moved to base for better
9270 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9271 when attribute is AttributeUsageAttribute.
9272 (Attribute.GetValidTargets): Simplified.
9273 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9274 attribute for this type.
9275 (Attribute.ApplyAttributes): Method renamed to Emit and make
9277 (GlobalAttributeSection): New class for special handling of global
9278 attributes (assembly, module).
9279 (AttributeSection.Emit): New method.
9281 * class.cs: Implemented Attributable abstract methods.
9282 (MethodCore.LabelParameters): Moved to Parameter class.
9283 (Accessor): Is back simple class.
9284 (PropertyMethod): Implemented Attributable abstract class.
9285 (DelegateMethod): Implemented Attributable abstract class.
9286 (Event): New constructor for disctintion between normal Event
9287 and Event with accessors.
9289 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9291 * codegen.cs, const.cs, decl.cs, delegate.cs:
9292 (CommonAssemblyModulClass): Implemented Attributable abstract class
9295 * enum.cs: Implement IAttributeSupport interface.
9296 (EnumMember): New class for emum members. Implemented Attributable
9300 (ParameterBase): Is abstract.
9301 (ReturnParameter): New class for easier [return:] attribute handling.
9303 * typemanager.cs: Removed builder_to_attr.
9305 2004-05-11 Raja R Harinath <rharinath@novell.com>
9308 * attribute.cs (Attribute.GetPositionalValue): New function.
9309 * class.cs (TypeContainer.VerifyMembers): New function.
9310 (TypeContainer.Emit): Use it.
9311 (ClassOrStruct): New base class for Class and Struct.
9312 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9313 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9315 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9316 then each non-static field should have a FieldOffset attribute.
9317 Otherwise, none of the fields should have a FieldOffset attribute.
9318 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9319 and FieldOffset attributes.
9320 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9321 (TypeManager.field_offset_attribute_type): New core types.
9322 (TypeManager.InitCoreTypes): Initialize them.
9324 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9326 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9327 Return correct type.
9330 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9332 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9333 be implicitly converted to ulong.
9335 * expression.cs: The logic for allowing operator &, | and ^ worked
9336 was wrong, it worked before because we did not report an error in
9337 an else branch. Fixes 57895.
9339 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9340 allow volatile fields to be reference types.
9342 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9344 * driver.cs: Add support for /debug-
9346 2004-05-07 Raja R Harinath <rharinath@novell.com>
9348 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9349 Add a 'complain' parameter to silence errors.
9350 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9351 silently overlooked type-resolutions.
9352 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9354 (Attributes.Search): New function.
9355 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9356 (Attributes.GetAttributeFullName): Remove hack.
9357 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9358 Update to reflect changes.
9359 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9360 Use Attributes.Search instead of nested loops.
9362 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9365 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9366 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9367 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9369 * report.cs: (Report.Warning): Renamed to Warning_T because of
9370 parameter collision.
9372 2004-05-05 Raja R Harinath <rharinath@novell.com>
9374 * expression.cs (MemberAccess.ResolveMemberAccess):
9375 Exit with non-zero status after Report.Error.
9376 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9378 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9380 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9382 * support.cs: Don't hang when the file is empty.
9384 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9386 * support.cs: In SeekableStreamReader, compute the preamble size of the
9387 underlying stream. Position changes should take into account that initial
9390 2004-05-03 Todd Berman <tberman@sevenl.net>
9392 * driver.cs: remove unused GetSysVersion function.
9394 2004-05-03 Todd Berman <tberman@sevenl.net>
9396 * driver.cs: Remove the hack from saturday, as well as the hack
9397 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9398 link_paths to get that bit proper.
9400 2004-05-01 Todd Berman <tberman@sevenl.net>
9402 * driver.cs: Try a LoadFrom before a Load, this checks the current
9403 path. This is currently a bug in mono that is be fixed, however, this
9404 provides a workaround for now. This will be removed when the bug
9407 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9409 * CryptoConvert.cs: Updated to latest version. Fix issue with
9410 incomplete key pairs (#57941).
9412 2004-05-01 Todd Berman <tberman@sevenl.net>
9414 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9417 2004-04-30 Jackson Harper <jackson@ximian.com>
9419 * codegen.cs: Open keys readonly.
9421 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9423 * typemanager.cs: don't report cyclic struct layout when a struct
9424 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9425 which has 2 Pango.Rectangle fields.
9427 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9429 * expression.cs: Handle IntPtr comparisons with IL code
9430 rather than a method call.
9432 2004-04-29 Martin Baulig <martin@ximian.com>
9434 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9435 the list of PropertyInfo's in class hierarchy and find the
9436 accessor. Fixes #56013.
9438 2004-04-29 Martin Baulig <martin@ximian.com>
9440 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9442 2004-04-29 Martin Baulig <martin@ximian.com>
9444 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9446 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9448 2004-04-29 Martin Baulig <martin@ximian.com>
9450 * class.cs (ConstructorInitializer.Resolve): Check whether the
9451 parent .ctor is accessible. Fixes #52146.
9453 2004-04-29 Martin Baulig <martin@ximian.com>
9455 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9457 * statement.cs (Using.EmitLocalVariableDecls): Use
9458 TypeManager.idisposable_type, not typeof (IDisposable).
9459 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9461 2004-04-29 Martin Baulig <martin@ximian.com>
9463 * class.cs (Event.Define): Don't emit the field and don't set
9464 RTSpecialName and SpecialName for events on interfaces. Fixes
9467 2004-04-29 Raja R Harinath <rharinath@novell.com>
9469 Refactor Attribute.ApplyAttributes.
9470 * attribute.cs (Attributable): New base class for objects that can
9471 have Attributes applied on them.
9472 (Attribute): Make AttributeUsage fields public.
9473 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9474 (Attribute.IsInternalCall): New property.
9475 (Attribute.UsageAttr): Convert to a public read-only property.
9476 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9477 (Attribute.ResolveType, Attribute.Resolve)
9478 (Attribute.ScanForIndexerName): Update to reflect changes.
9479 (Attribute.CheckAttributeTarget): Re-format.
9480 (Attribute.ApplyAttributes): Refactor, to various
9481 Attributable.ApplyAttributeBuilder methods.
9482 * decl.cs (MemberCore): Make Attributable.
9483 * class.cs (Accessor): Make Attributable.
9484 (MethodData.ApplyAttributes): Use proper attribute types, not
9486 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9487 (TypeContainer.ApplyAttributeBuilder)
9488 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9489 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9490 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9491 (Operator.ApplyAttributeBuilder): New factored-out methods.
9492 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9493 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9494 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9495 * parameter.cs (ParameterBase): New Attributable base class
9496 that can also represent Return types.
9497 (Parameter): Update to the changes.
9499 2004-04-29 Jackson Harper <jackson@ximian.com>
9501 * driver.cs: Prefer the corlib system version when looking for
9502 assemblies in the GAC. This is still a hack, but its a better hack
9505 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9507 * decl.cs, enum.cs: Improved error 3005 reporting.
9509 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9510 (related_symbols): New private member for list of symbols
9511 related to reported error/warning.
9513 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9515 2004-04-29 Martin Baulig <martin@ximian.com>
9517 * ecore.cs (Expression.Constantify): If we're an enum and
9518 TypeManager.TypeToCoreType() doesn't give us another type, use
9519 t.UnderlyingSystemType. Fixes #56178.
9521 2004-04-29 Martin Baulig <martin@ximian.com>
9523 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9524 interfaces and for each interface, only add members directly
9525 declared in that interface. Fixes #53255.
9527 2004-04-28 Martin Baulig <martin@ximian.com>
9529 * expression.cs (ConditionalLogicalOperator): Use a temporary
9530 variable for `left' to avoid that we evaluate it more than once;
9533 2004-04-28 Martin Baulig <martin@ximian.com>
9535 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9538 2004-04-28 Martin Baulig <martin@ximian.com>
9540 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9543 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9544 whether the type is not void (CS1547).
9546 2004-04-28 Martin Baulig <martin@ximian.com>
9548 * expression.cs (Unary.DoResolveLValue): Override this and report
9549 CS0131 for anything but Operator.Indirection.
9551 2004-04-28 Martin Baulig <martin@ximian.com>
9553 Committing a patch from Ben Maurer; see bug #50820.
9555 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9558 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9561 2004-04-28 Martin Baulig <martin@ximian.com>
9563 Committing a patch from Ben Maurer; see bug #50820.
9565 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9568 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9571 2004-04-28 Martin Baulig <martin@ximian.com>
9573 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9574 (Block.AddLabel): Call DoLookupLabel() to only search in the
9577 2004-04-28 Martin Baulig <martin@ximian.com>
9579 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9580 comparing StringConstants and NullLiterals in Equality and Inequality.
9582 2004-04-28 Jackson Harper <jackson@ximian.com>
9584 * driver.cs: Attempt to load referenced assemblies from the
9585 GAC. This is the quick and dirty version of this method that
9586 doesnt take into account versions and just takes the first
9587 canidate found. Will be good enough for now as we will not have more
9588 then one version installed into the GAC until I update this method.
9590 2004-04-28 Martin Baulig <martin@ximian.com>
9592 * typemanager.cs (TypeManager.CheckStructCycles): New public
9593 static method to check for cycles in the struct layout.
9595 * rootcontext.cs (RootContext.PopulateTypes): Call
9596 TypeManager.CheckStructCycles() for each TypeContainer.
9597 [Note: We only need to visit each type once.]
9599 2004-04-28 Martin Baulig <martin@ximian.com>
9601 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9603 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9604 success and added `out object value'. Use a `bool resolved' field
9605 to check whether we've already been called rather than
9606 `ConstantValue != null' since this breaks for NullLiterals.
9608 2004-04-28 Raja R Harinath <rharinath@novell.com>
9610 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9611 setting of this flag, since the 'set' method may be non-public.
9613 2004-04-28 Raja R Harinath <rharinath@novell.com>
9615 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9616 check on current_vector.Block.
9618 2004-04-27 Martin Baulig <martin@ximian.com>
9620 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9621 a field initializer. Fixes #56459.
9623 2004-04-27 Martin Baulig <martin@ximian.com>
9625 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9626 we're not attempting to use an indexer. Fixes #52154.
9628 2004-04-27 Martin Baulig <martin@ximian.com>
9630 * statement.cs (Return): Don't create a return label if we don't
9631 need it; reverts my change from January 20th. Thanks to Ben
9634 2004-04-27 Martin Baulig <martin@ximian.com>
9636 According to the spec, `goto' can only leave a nested scope, but
9639 * statement.cs (Block.LookupLabel): Only lookup in the current
9640 block, don't recurse into parent or child blocks.
9641 (Block.AddLabel): Check in parent and child blocks, report
9642 CS0140/CS0158 if we find a duplicate.
9643 (Block): Removed this indexer for label lookups.
9644 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9645 this already does the error reporting for us.
9648 (FlowBranching.UsageVector.Block): New public variable; may be null.
9649 (FlowBranching.CreateSibling): Added `Block' argument.
9650 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9651 label for the target of a `goto' and check whether we're not
9652 leaving a `finally'.
9654 2004-04-27 Martin Baulig <martin@ximian.com>
9656 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9657 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9660 2004-04-27 Martin Baulig <martin@ximian.com>
9662 * statement.cs (Block.AddLabel): Also check for implicit blocks
9663 and added a CS0158 check.
9665 2004-04-27 Martin Baulig <martin@ximian.com>
9667 * flowanalysis.cs (FlowBranchingLoop): New class.
9668 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9669 UsageVector's instead of an ArrayList.
9670 (FlowBranching.Label): Likewise.
9671 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9672 (FlowBranching.AddBreakVector): New method.
9674 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9676 * attribute.cs: Small regression fix: only convert the type if we
9677 the type is different, fixes System.Drawing build.
9679 2004-04-27 Martin Baulig <martin@ximian.com>
9681 * attribute.cs (Attribute.Resolve): If we have a constant value
9682 for a named field or property, implicity convert it to the correct
9685 2004-04-27 Raja R Harinath <rharinath@novell.com>
9687 * statement.cs (Block.Block): Implicit blocks share
9688 'child_variable_names' fields with parent blocks.
9689 (Block.AddChildVariableNames): Remove.
9690 (Block.AddVariable): Mark variable as "used by a child block" in
9691 every surrounding block.
9692 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9693 been used in a child block, complain about violation of "Invariant
9694 meaning in blocks" rule.
9695 * cs-parser.jay (declare_local_variables): Don't use
9696 AddChildVariableNames.
9697 (foreach_statement): Don't create an implicit block: 'foreach'
9700 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9702 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9703 converting from 0L to ulong. Fixes 57522.
9705 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9707 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9708 derived class hides via 'new' keyword field from base class (test-242.cs).
9709 TODO: Handle this in the more general way.
9711 * class.cs (CheckBase): Ditto.
9713 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9715 * decl.cs (caching_flags): New member for storing cached values
9717 (MemberCore.Flags): New enum where bit flags for caching_flags
9719 (MemberCore.cls_compliance): Moved to caching_flags.
9720 (DeclSpace.Created): Moved to caching_flags.
9722 * class.cs: Use caching_flags instead of DeclSpace.Created
9724 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9726 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9727 if we are only a derived class, not a nested class.
9729 * typemanager.cs: Same as above, but do this at the MemberLookup
9730 level (used by field and methods, properties are handled in
9731 PropertyExpr). Allow for the qualified access if we are a nested
9734 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9736 * class.cs: Refactoring.
9737 (IMethodData): New inteface; Holds links to parent members
9738 to avoid member duplication (reduced memory allocation).
9739 (Method): Implemented IMethodData interface.
9740 (PropertyBase): New inner classes for get/set methods.
9741 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9742 (Event): New inner classes for add/remove methods.
9743 (Event.DelegateMethod): Implemented IMethodData interface.
9745 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9746 EmitContext (related to class.cs refactoring).
9748 2004-04-21 Raja R Harinath <rharinath@novell.com>
9750 * delegate.cs (Delegate.VerifyApplicability): If the number of
9751 arguments are the same as the number of parameters, first try to
9752 verify applicability ignoring any 'params' modifier on the last
9756 2004-04-16 Raja R Harinath <rharinath@novell.com>
9758 * class.cs (TypeContainer.AddIndexer): Use
9759 'ExplicitInterfaceName' to determine if interface name was
9760 explicitly specified. 'InterfaceType' is not initialized at this time.
9761 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9762 Indexers array is already in the required order. Initialize
9763 'IndexerName' only if there are normal indexers.
9764 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9765 (TypeContainer.Emit): Emit DefaultMember attribute only if
9766 IndexerName is initialized.
9769 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9771 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9774 2004-04-15 Raja R Harinath <rharinath@novell.com>
9776 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9780 * attribute.cs (Attribute.Resolve): Check for duplicate named
9784 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9786 * iterators.cs (MarkYield): track whether we are in an exception,
9787 and generate code accordingly. Use a temporary value to store the
9788 result for our state.
9790 I had ignored a bit the interaction of try/catch with iterators
9791 since their behavior was not entirely obvious, but now it is
9792 possible to verify that our behavior is the same as MS .NET 2.0
9796 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9798 * iterators.cs: Avoid creating temporaries if there is no work to
9801 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9802 Enumerations, use TypeManager.EnumToUnderlying and call
9805 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9808 (This.Emit): Use EmitContext.EmitThis to emit our
9811 (This.EmitAssign): Ditto.
9813 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9814 codepaths, we will move all the functionality into
9817 (FieldExpr.EmitAssign): Ditto.
9819 This fixes several hidden bugs that I uncovered while doing a code
9820 review of this today.
9822 * codegen.cs (EmitThis): reworked so the semantics are more clear
9823 and also support value types "this" instances.
9825 * iterators.cs: Changed so that for iterators in value types, we
9826 do not pass the value type as a parameter.
9828 Initialization of the enumerator helpers is now done in the caller
9829 instead of passing the parameters to the constructors and having
9830 the constructor set the fields.
9832 The fields have now `assembly' visibility instead of private.
9834 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9836 * expression.cs (Argument.Resolve): Check if fields passed as ref
9837 or out are contained in a MarshalByRefObject.
9839 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9840 another compiler type.
9842 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9844 * class.cs (Indexer.Define): use the new name checking method.
9845 Also, return false on an error.
9846 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9847 (is_identifier_[start/part]_character): make static.
9849 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9851 * expression.cs (Binary.ResolveOperator): Do no append strings
9852 twice: since we can be invoked more than once (array evaluation)
9853 on the same concatenation, take care of this here. Based on a fix
9854 from Ben (bug #56454)
9856 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9858 * codegen.cs: Fix another case where CS1548 must be reported (when
9859 delay-sign isn't specified and no private is available #56564). Fix
9860 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9861 error when MCS is used on the MS runtime and we need to delay-sign
9862 (which seems unsupported by AssemblyBuilder - see #56621).
9864 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9866 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9867 (TypeManager.ComputeNamespaces): Faster implementation for
9870 * compiler.csproj: Updated AssemblyName to mcs.
9872 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9874 * rootcontext.cs: Add new types to the boot resolution.
9876 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9877 MulticastDelegate is not allowed.
9879 * typemanager.cs: Add new types to lookup: System.TypedReference
9882 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9883 check for TypedReference or ArgIterator, they are not allowed.
9885 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9886 makes us properly catch 1510 in some conditions (see bug 56016 for
9889 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9891 * CryptoConvert.cs: update from corlib version
9894 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9896 * class.cs (Indexer.Define): Check indexername declaration
9898 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9900 * attribute.cs (IsClsCompliant): Fixed problem with handling
9901 all three states (compliant, not-compliant, undetected).
9903 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9905 * attribute.cs (Attribute): Location is now public.
9906 (Resolve): Store resolved arguments (pos_values) in attribute class.
9907 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9908 (GetClsCompliantAttributeValue): New method that gets
9909 CLSCompliantAttribute value.
9910 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9911 if exists else null.
9912 (AttributeTester): New class for CLS-Compliant verification routines.
9914 * class.cs (Emit): Add CLS-Compliant verification.
9915 (Method.GetSignatureForError): Implemented.
9916 (Constructor.GetSignatureForError): Implemented
9917 (Constructor.HasCompliantArgs): Returns if constructor has
9918 CLS-Compliant arguments.
9919 (Constructor.Emit): Override.
9920 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9921 is needed to test only parameters.
9922 (FieldBase.GetSignatureForError): Implemented.
9923 (TypeContainer): New member for storing base interfaces.
9924 (TypeContainer.FindMembers): Search in base interfaces too.
9926 * codegen.cs (GetClsComplianceAttribute): New method that gets
9927 assembly or module CLSCompliantAttribute value.
9928 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9930 (ModuleClass.Emit): Add error 3012 test.
9932 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9934 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9935 state for all decl types.
9936 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9937 if CLS-Compliant tests are required.
9938 (IsClsCompliaceRequired): New method. Analyze whether code
9939 must be CLS-Compliant.
9940 (IsExposedFromAssembly): New method. Returns true when MemberCore
9941 is exposed from assembly.
9942 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9943 value or gets cached value.
9944 (HasClsCompliantAttribute): New method. Returns true if MemberCore
9945 is explicitly marked with CLSCompliantAttribute.
9946 (IsIdentifierClsCompliant): New abstract method. This method is
9947 used to testing error 3005.
9948 (IsIdentifierAndParamClsCompliant): New method. Common helper method
9949 for identifier and parameters CLS-Compliant testing.
9950 (VerifyClsCompliance): New method. The main virtual method for
9951 CLS-Compliant verifications.
9952 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9953 null. I don't know why is null (too many public members !).
9954 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9955 and get value of first CLSCompliantAttribute that found.
9957 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9958 (VerifyClsCompliance): Override and add extra tests.
9960 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9961 clscheck- disable CLS-Compliant verification event if assembly is has
9962 CLSCompliantAttribute(true).
9964 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9965 ApllyAttribute is now called in emit section as in the other cases.
9966 Possible future Emit integration.
9967 (IsIdentifierClsCompliant): New override.
9968 (VerifyClsCompliance): New override.
9969 (GetEnumeratorName): Returns full enum name.
9971 * parameter.cs (GetSignatureForError): Implemented.
9973 * report.cs (WarningData): New struct for Warning message information.
9974 (LocationOfPreviousError): New method.
9975 (Warning): New method. Reports warning based on the warning table.
9976 (Error_T): New method. Reports error based on the error table.
9978 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9979 verifications are done here.
9981 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9983 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9984 CLSCompliantAttribute.
9985 (all_imported_types): New member holds all imported types from other
9987 (LoadAllImportedTypes): New method fills static table with exported types
9988 from all referenced assemblies.
9989 (Modules): New property returns all assembly modules.
9991 2004-03-30 Miguel de Icaza <miguel@ximian.com>
9993 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9994 throwing a parser error.
9996 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9997 which removes the hardcoded get_/set_ prefixes for properties, as
9998 IL allows for the properties to be named something else.
10002 * expression.cs: Do not override operand before we know if it is
10003 non-null. Fix 56207
10005 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10007 * typemanager.cs: support for pinned variables.
10009 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10011 * decl.cs, typemanager.cs: Avoid using an arraylist
10012 as a buffer if there is only one result set.
10014 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10016 * expression.cs: Make sure you cant call a static method
10017 with an instance expression, bug #56174.
10019 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10021 * class.cs (IsDuplicateImplementation): Improve error reporting to
10022 flag 663 (method only differs in parameter modifier).
10024 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10025 in preprocessor directives.
10027 * location.cs (LookupFile): Allow for the empty path.
10029 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10030 better approach for some of that patch, but its failing with the
10031 CharSet enumeration. For now try/catch will do.
10033 * typemanager.cs: Do not crash if a struct does not have fields.
10036 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10038 * expression.cs: cs0213, cant fix a fixed expression.
10041 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10043 * cs-parser.jay: detect invalid embeded statements gracefully.
10046 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10048 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10051 the invocation type may not be a subclass of the tye of the item/
10052 The type of the item must be a subclass of the invocation item.
10057 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10059 * attribute.cs: Added methods to get a string and a bool from an
10060 attribute. Required to information from AssemblyKeyFileAttribute,
10061 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10062 * codegen.cs: Modified AssemblyName creation to include support for
10063 strongnames. Catch additional exceptions to report them as CS1548.
10064 * compiler.csproj: Updated include CryptoConvert.cs.
10065 * compiler.csproj.user: Removed file - user specific configuration.
10066 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10067 Mono.Security assembly. The original class is maintained and tested in
10068 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10069 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10070 like CSC 8.0 (C# v2) supports.
10071 * Makefile: Added CryptoConvert.cs to mcs sources.
10072 * rootcontext.cs: Added new options for strongnames.
10074 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10076 * driver.cs: For --expect-error, report error code `2'
10077 if the program compiled with no errors, error code `1' if
10078 it compiled with an error other than the one expected.
10080 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10082 * compiler.csproj: Updated for Visual Studio .NET 2003.
10083 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10084 * compiler.sln: Updated for Visual Studio .NET 2003.
10086 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10088 * expression.cs: Fix bug #47234. We basically need to apply the
10089 rule that we prefer the conversion of null to a reference type
10090 when faced with a conversion to 'object' (csc behaviour).
10092 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10094 * statement.cs: Shorter form for foreach, eliminates
10095 a local variable. r=Martin.
10097 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10099 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10100 checks if we can use brtrue/brfalse to test for 0.
10101 * expression.cs: use the above in the test for using brtrue/brfalse.
10102 cleanup code a bit.
10104 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10106 * expression.cs: Rewrite string concat stuff. Benefits:
10108 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10109 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10110 rather than a concat chain.
10112 * typemanager.cs: Add lookups for more concat overloads.
10114 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10116 * expression.cs: Emit shorter il code for array init.
10133 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10135 * statement.cs: Before, two switch blocks would be merged if the
10136 total size of the blocks (end_item - begin_item + 1) was less than
10137 two times the combined sizes of the blocks.
10139 Now, it will only merge if after the merge at least half of the
10144 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10146 * class.cs : csc build fix for GetMethods(). See bug #52503.
10148 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10150 * expression.cs: Make sure fp comparisons work with NaN.
10151 This fixes bug #54303. Mig approved this patch a long
10152 time ago, but we were not able to test b/c the runtime
10155 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10157 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10159 2004-03-19 Martin Baulig <martin@ximian.com>
10161 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10162 error here and not in our caller.
10164 2004-03-19 Martin Baulig <martin@ximian.com>
10166 * interface.cs: Completely killed this file.
10167 (Interface): We're now a TypeContainer and live in class.cs.
10169 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10170 argument; we're now also called for interfaces.
10171 (TypeContainer.DefineMembers): Allow this method being called
10173 (TypeContainer.GetMethods): New public method; formerly known as
10174 Interface.GetMethod(). This is used by PendingImplementation.
10175 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10176 it's now private and non-static.
10177 (Interface): Moved this here; it's now implemented similar to
10179 (Method, Property, Event, Indexer): Added `bool is_interface'
10180 argument to their .ctor's.
10181 (MemberBase.IsInterface): New public field.
10183 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10184 instances instead of InterfaceMethod, InterfaceProperty, etc.
10185 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10186 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10188 2004-03-19 Martin Baulig <martin@ximian.com>
10190 * class.cs (MethodCore.IsDuplicateImplementation): New private
10191 method which does the CS0111 checking.
10192 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10193 Use IsDuplicateImplementation().
10195 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10197 * decl.cs (FindMemberToOverride): New method to find the correct
10198 method or property to override in the base class.
10200 - Make Method/Property use the above method to find the
10201 version in the base class.
10202 - Remove the InheritableMemberSignatureCompare as it is now
10205 This patch makes large code bases much faster to compile, as it is
10206 O(n) rather than O(n^2) to do this validation.
10208 Also, it fixes bug 52458 which is that nested classes are not
10209 taken into account when finding the base class member.
10211 Reviewed/Approved by Martin.
10213 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10215 * interface.cs: In all interface classes removed redundant
10216 member initialization.
10218 2004-03-16 Martin Baulig <martin@ximian.com>
10220 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10222 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10224 * decl.cs (DefineTypeAndParents): New helper method to define a
10225 type's containers before the type itself is defined; This is a
10226 bug exposed by the recent changes to Windows.Forms when an
10227 implemented interface was defined inside a class that had not been
10230 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10232 (Check): Loop correctly to report errors modifiers
10233 (UNSAFE was not in the loop, since it was the same as TOP).
10235 * interface.cs: Every interface member now takes a ModFlags,
10236 instead of a "is_new" bool, which we set on the base MemberCore.
10238 Every place where we called "UnsafeOk" in the interface, now we
10239 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10240 the unsafe settings from the member declaration instead of the
10241 container interface.
10243 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10245 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10246 `set_indexer_name' to the pending bits (one per type).
10248 We fixed a bug today that was picking the wrong method to
10249 override, since for properties the existing InterfaceMethod code
10250 basically ignored the method name. Now we make sure that the
10251 method name is one of the valid indexer names.
10253 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10255 * support.cs (SeekableStreamReader): Keep track of stream byte
10256 positions and don't mix them with character offsets to the buffer.
10258 Patch from Gustavo Giráldez
10260 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10262 * interface.cs (InterfaceSetGetBase): Removed double member
10263 initialization, base class does it as well.
10265 2004-03-13 Martin Baulig <martin@ximian.com>
10267 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10268 when compiling corlib.
10270 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10272 * convert.cs (ExplicitConversion): We were reporting an error on
10273 certain conversions (object_type source to a value type, when the
10274 expression was `null') before we had a chance to pass it through
10275 the user defined conversions.
10277 * driver.cs: Replace / and \ in resource specifications to dots.
10280 * class.cs: Add check for duplicate operators. Fixes 52477
10282 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10284 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10285 that are in the middle of the statements, not only at the end.
10288 * class.cs (TypeContainer.AddField): No longer set the
10289 `HaveStaticConstructor' flag, now we call it
10290 `UserDefineStaticConstructor' to diferentiate the slightly
10291 semantic difference.
10293 The situation is that we were not adding BeforeFieldInit (from
10294 Modifiers.TypeAttr) to classes that could have it.
10295 BeforeFieldInit should be set to classes that have no static
10300 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10302 And most importantly Zoltan's comment:
10304 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10306 "I think beforefieldinit means 'it's ok to initialize the type sometime
10307 before its static fields are used', i.e. initialization does not need
10308 to be triggered by the first access to the type. Setting this flag
10309 helps the JIT to compile better code, since it can run the static
10310 constructor at JIT time, and does not need to generate code to call it
10311 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10312 this flag for lots of classes like String.
10314 csc sets this flag if the type does not have an explicit static
10315 constructor. The reasoning seems to be that if there are only static
10316 initalizers for a type, and no static constructor, then the programmer
10317 does not care when this initialization happens, so beforefieldinit
10320 This bug prevents the AOT compiler from being usable, since it
10321 generates so many calls to mono_runtime_class_init that the AOT code
10322 is much slower than the JITted code. The JITted code is faster,
10323 because it does not generate these calls if the vtable is type is
10324 already initialized, which is true in the majority of cases. But the
10325 AOT compiler can't do this."
10327 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10329 * class.cs (MethodData.Emit): Refactor the code so symbolic
10330 information is generated for destructors; For some reasons we
10331 were taking a code path that did not generate symbolic information
10334 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10336 * class.cs: Create a Constructor.CheckBase method that
10337 takes care of all validation type code. The method
10338 contains some code that was moved from Define.
10340 It also includes new code that checks for duplicate ctors.
10341 This fixes bug #55148.
10343 2004-03-09 Joshua Tauberer <tauberer@for.net>
10345 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10346 a { ... }-style array creation invokes EmitStaticInitializers
10347 which is not good for reference-type arrays. String, decimal
10348 and now null constants (NullCast) are not counted toward
10349 static initializers.
10351 2004-03-05 Martin Baulig <martin@ximian.com>
10353 * location.cs (SourceFile.HasLineDirective): New public field;
10354 specifies whether the file contains or is referenced by a "#line"
10356 (Location.DefineSymbolDocuments): Ignore source files which
10357 either contain or are referenced by a "#line" directive.
10359 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10361 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10362 direct access to our parent, so check the method inline there.
10364 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10366 * expression.cs (Invocation.EmitCall): Miguel's last commit
10367 caused a regression. If you had:
10372 In Foo the implict this would be null.
10374 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10376 * expression.cs (Invocation.EmitCall): If the method is not
10377 virtual, do not emit a CallVirt to it, use Call.
10379 * typemanager.cs (GetFullNameSignature): Improve the method to
10380 cope with ".ctor" and replace it with the type name.
10382 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10383 as an argument the ConstructorBuilder where it is being defined,
10384 to catch the recursive constructor invocations.
10386 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10388 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10389 routines to check if a type is an enumerable/enumerator allow
10390 classes that implement the IEnumerable or IEnumerator interfaces.
10392 * class.cs (Property, Operator): Implement IIteratorContainer, and
10393 implement SetYields.
10395 (Property.Define): Do the block swapping for get_methods in the
10396 context of iterators. We need to check if Properties also
10397 include indexers or not.
10399 (Operator): Assign the Block before invoking the
10400 OperatorMethod.Define, so we can trigger the Iterator code
10403 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10404 Property and Operator classes are not created when we parse the
10405 declarator but until we have the block completed, so we use a
10406 singleton SimpleIteratorContainer.Simple to flag whether the
10407 SetYields has been invoked.
10409 We propagate this setting then to the Property or the Operator to
10410 allow the `yield' to function.
10412 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10414 * codegen.cs: Implemented attribute support for modules.
10415 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10416 Assembly/Module functionality.
10418 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10419 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10420 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10422 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10424 * interface.cs (FindMembers): The operation is performed on all base
10425 interfaces and not only on the first. It is required for future CLS Compliance patch.
10427 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10429 * statement.cs, codegen.cs:
10430 This patch deals with patterns such as:
10432 public class List : IEnumerable {
10434 public MyEnumerator GetEnumerator () {
10435 return new MyEnumerator(this);
10438 IEnumerator IEnumerable.GetEnumerator () {
10442 public struct MyEnumerator : IEnumerator {
10447 Before, there were a few things we did wrong:
10448 1) we would emit callvirt on a struct, which is illegal
10449 2) we emited ldarg when we needed to emit ldarga
10450 3) we would mistakenly call the interface methods on an enumerator
10451 type that derived from IEnumerator and was in another assembly. For example:
10453 public class MyEnumerator : IEnumerator
10455 Would have the interface methods called, even if there were public impls of the
10456 method. In a struct, this lead to invalid IL code.
10458 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10460 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10463 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10465 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10467 * cs-parser.jay: Fix small regression: we were not testing V2
10468 compiler features correctly.
10470 * interface.cs: If the emit context is null, then create one
10472 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10474 * decl.cs (GetSignatureForError): New virtual method to get full name
10475 for error messages.
10477 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10478 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10480 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10481 Duplicated members and code in these classes has been removed.
10482 Better encapsulation in these classes.
10484 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10486 * assign.cs (Assign.DoResolve): When dealing with compound
10487 assignments, there is a new rule in ECMA C# 2.4 (might have been
10488 there before, but it is documented here) that states that in:
10492 If b is of type int, and the `op' is a shift-operator, then the
10493 above is evaluated as:
10497 * expression.cs (Binary.ResolveOperator): Instead of testing for
10498 int/uint/long/ulong, try to implicitly convert to any of those
10499 types and use that in pointer arithmetic.
10501 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10502 method to print information for from the type, not from the
10503 null-method we were given.
10505 2004-02-01 Duncan Mak <duncan@ximian.com>
10507 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10508 parsing for cmd, fixes bug #53694.
10510 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10512 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10513 in the member name duplication tests. Property and operator name duplication
10514 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10516 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10518 * interface.cs (PopulateMethod): Fixed crash when interface method
10519 returns not existing type (error test cs0246-3.cs).
10521 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10523 * cs-parser.jay (interface_accessors): Re-write actions to also
10524 store attributes attached to get and set methods. Fix spelling
10527 (inteface_property_declaration): Modify accordingly.
10529 (InterfaceAccessorInfo): New helper class to store information to pass
10530 around between rules that use interface_accessors.
10532 * interface.cs (Emit): Apply attributes on the get and set
10533 accessors of properties and indexers too.
10535 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10536 right MethodBuilder when applying attributes to the get and set accessors.
10538 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10540 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10542 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10544 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10546 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10548 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10549 changes that treat `yield' specially when present before `break'
10550 or `return' tokens.
10552 * cs-tokenizer.cs: yield is no longer a keyword.
10554 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10556 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10557 setting for default constructors.
10558 For default constructors are almost every time set wrong Modifier. The
10559 generated IL code has been alright. But inside mcs this values was
10560 wrong and this was reason why several of my CLS Compliance tests
10563 2004-01-22 Martin Baulig <martin@ximian.com>
10565 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10566 not a QualifiedIdentifier. This is what `type_name_expression'
10567 was previously doing.
10568 (type_name_expression): Removed; the code is now in
10569 `namespace_or_type_name'.
10570 (qualified_identifier): Removed, use `namespace_or_type_name'
10572 (QualifiedIdentifier): Removed this class.
10574 2004-01-22 Martin Baulig <martin@ximian.com>
10576 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10577 not a string as alias name.
10579 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10581 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10582 #52730 bug, and instead compute correctly the need to use a
10583 temporary variable when requesting an address based on the
10584 static/instace modified of the field and the constructor.
10586 2004-01-21 Martin Baulig <martin@ximian.com>
10588 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10589 class and namespace before looking up aliases. Fixes #52517.
10591 2004-01-21 Martin Baulig <martin@ximian.com>
10593 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10594 assinged in a 'try'; fixes exception4.cs.
10596 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10597 * class.cs : Implemented parameter-less constructor for TypeContainer
10599 * decl.cs: Attributes are now stored here. New property OptAttributes
10601 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10603 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10605 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10607 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10608 (CSharpSignature): New method for indexer and property signature.
10610 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10612 * pending.cs (IsVirtualFilter): Faster implementation.
10614 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10616 * typemanager.cs: Avoid inclusion of same assembly more than once.
10618 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10620 * cs-parser.jay: Fixed problem where the last assembly attribute
10621 has been applied also to following declaration (class, struct, etc.)
10623 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10625 * class.cs: Added error CS0538, CS0539 reporting.
10626 Fixed crash on Microsoft runtime when field type is void.
10628 * cs-parser.jay: Added error CS0537 reporting.
10630 * pending.cs: Added error CS0535 reporting.
10631 Improved error report for errors CS0536, CS0534.
10633 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10635 Merge a few bits from the Anonymous Method MCS tree.
10637 * statement.cs (ToplevelBlock): New class for toplevel methods,
10638 will hold anonymous methods, lifted variables.
10640 * cs-parser.jay: Create toplevel blocks for delegates and for
10641 regular blocks of code.
10643 2004-01-20 Martin Baulig <martin@ximian.com>
10645 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10646 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10647 and `NeedExplicitReturn'; added `IsLastStatement'.
10648 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10649 have a `ReturnLabel' or we're not unreachable.
10651 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10652 child's reachability; don't just override ours with it. Fixes
10653 #58058 (lluis's example).
10654 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10655 InFinally(), InLoop(), InSwitch() and
10656 BreakCrossesTryCatchBoundary() methods.
10658 * statement.cs (Return): Do all error checking in Resolve().
10659 Unless we are the last statement in a top-level block, always
10660 create a return label and jump to it.
10661 (Break, Continue): Do all error checking in Resolve(); also make
10662 sure we aren't leaving a `finally'.
10663 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10664 statement in a top-level block.
10665 (Block.Flags): Added `IsDestructor'.
10666 (Block.IsDestructor): New public property.
10668 2004-01-20 Martin Baulig <martin@ximian.com>
10670 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10672 2004-01-20 Martin Baulig <martin@ximian.com>
10674 * statement.cs (Statement.ResolveUnreachable): New public method.
10675 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10676 (Block.Resolve): Resolve unreachable statements.
10678 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10680 * expression.cs: We need to fix the case where we do
10681 not have a temp variable here.
10683 * assign.cs: Only expression compound assignments need
10684 temporary variables.
10686 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10688 * flowanalysis.cs: Reduce memory allocation in a few ways:
10689 - A block with no variables should not allocate a bit
10691 - A method with no out parameters does not need any tracking
10692 for assignment of the parameters, so we need not allocate
10695 public readonly Type[] VariableTypes;
10696 public readonly string[] VariableNames;
10697 Are redundant. The data is already stored in the variable
10698 map, so we need not allocate another array for it.
10699 - We need to add alot of checks for if (params | locals) == null
10700 due to the first two changes.
10702 2004-01-18 Miguel de Icaza <miguel@ximian.com>
10704 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10705 implement IMemoryLocation, we store a copy on a local variable and
10706 take the address of it. Patch from Benjamin Jemlich
10708 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10709 to use a special "type_name_expression" rule which reduces the
10710 number of "QualifiedIdentifier" classes created, and instead
10711 directly creates MemberAccess expressions.
10713 2004-01-17 Miguel de Icaza <miguel@ximian.com>
10715 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10716 that fixes #52853. Null literal assignment to ValueType
10718 * class.cs (MethodData.Emit): Instead of checking the name of the
10719 method to determine if its a destructor, create a new derived
10720 class from Method called Destructor, and test for that.
10722 * cs-parser.jay: Create a Destructor object instead of a Method.
10724 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10728 2004-01-16 Miguel de Icaza <miguel@ximian.com>
10730 * expression.cs (Binary.ResolveOperator): Perform an implicit
10731 conversion from MethodGroups to their delegate types on the
10732 Addition operation.
10734 * delegate.cs: Introduce a new class DelegateCreation that is the
10735 base class for `NewDelegate' and `ImplicitDelegateCreation',
10736 factor some code in here.
10738 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10739 conversion from MethodGroups to compatible delegate types.
10741 * ecore.cs (Expression.Resolve): Do not flag error 654
10742 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10743 we allow conversions from MethodGroups to delegate types now.
10745 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10746 assignments in v2 either.
10748 2004-01-10 Miguel de Icaza <miguel@ximian.com>
10750 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10751 static read-only fields in ctors.
10753 Applied patch from Benjamin Jemlich
10755 * expression.cs (UnaryMutator): Avoid leaking local variables.
10757 2004-01-09 Miguel de Icaza <miguel@ximian.com>
10759 * cs-tokenizer.cs (IsCastToken): Allow the various native types
10760 here to return true, as they can be used like this:
10762 (XXX) int.MEMBER ()
10764 Fixed 49836 and all the other dups
10766 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
10768 * driver.cs: Implement /win32res and /win32icon.
10770 2004-01-08 Miguel de Icaza <miguel@ximian.com>
10772 * cs-parser.jay: Add a rule to improve error handling for the
10773 common mistake of placing modifiers after the type.
10775 2004-01-07 Miguel de Icaza <miguel@ximian.com>
10777 * cs-parser.jay (interface_event_declaration): Catch
10778 initialization of events on interfaces, and report cs0068
10780 * cs-parser.jay (interface_event_declaration): Catch
10781 initialization of events.
10783 * ecore.cs: Better report missing constructors.
10785 * expression.cs (Binary.ResolveOperator): My previous bug fix had
10786 the error reporting done in the wrong place. Fix.
10788 * expression.cs (Binary.ResolveOperator): Catch the
10789 operator + (E x, E y) error earlier, and later allow for implicit
10790 conversions in operator +/- (E e, U x) from U to the underlying
10793 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10794 52596, if the container class is abstract, the default constructor
10795 is protected otherwise its public (before, we were always public).
10797 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10800 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10801 Jemlich that fixes bug #52597, MCS was generating invalid code for
10802 idisposable structs. Thanks to Ben for following up with this
10805 2004-01-06 Miguel de Icaza <miguel@ximian.com>
10807 * driver.cs: Allow assemblies without code to be generated, fixes
10810 2004-01-07 Nick Drochak <ndrochak@gol.com>
10812 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10814 2004-01-05 Miguel de Icaza <miguel@ximian.com>
10816 * cs-parser.jay: Add rules to improve error reporting if fields or
10817 methods are declared at the namespace level (error 116)
10819 * Add rules to catch event add/remove
10821 2004-01-04 David Sheldon <dave-mono@earth.li>
10823 * expression.cs: Added matching ")" to error message for
10826 2004-01-03 Todd Berman <tberman@gentoo.org>
10828 * ecore.cs, attribute.cs:
10829 Applying fix from #52429.
10831 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10833 * ecore.cs, expression.cs, statement.cs:
10834 Total rewrite of how we handle branching. We
10835 now handle complex boolean expressions with fewer
10836 jumps. As well if (x == 0) no longer emits a ceq.
10838 if (x is Foo) is much faster now, because we generate
10841 Overall, we get a pretty big improvement on our benchmark
10842 tests. The code we generate is smaller and more readable.
10844 I did a full two-stage bootstrap. The patch was reviewed
10845 by Martin and Miguel.
10847 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10849 * cs-parser.jay: Make primary_expression not take a QI.
10850 we dont need this because the member_access rule covers
10851 us here. So we replace the rule with just IDENTIFIER.
10853 This has two good effects. First, we remove a s/r conflict.
10854 Second, we allocate many fewer QualifiedIdentifier objects.
10856 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10858 * attribute.cs: Handle MarshalAs attributes as pseudo, and
10859 set the correct information via SRE. This prevents
10860 hanging on the MS runtime. Fixes #29374.
10862 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10864 * convert.cs: correctly handle conversions to value types
10865 from Enum and ValueType as unboxing conversions.
10867 Fixes bug #52569. Patch by Benjamin Jemlich.
10869 2004-01-02 Ravi Pratap <ravi@ximian.com>
10871 * expression.cs (BetterConversion): Prefer int -> uint
10872 over int -> ulong (csc's behaviour). This fixed bug #52046.
10874 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10876 * decl.cs (MemberCache.FindMembers): now returns a
10879 * typemanager.cs: In general, go with with ^^.
10880 (CopyNewMethods): take an IList.
10881 (RealMemberLookup): Only allocate an arraylist
10882 if we copy from two sets of methods.
10884 This change basically does two things:
10885 1) Fewer array lists allocated due to CopyNewMethods.
10886 2) the explicit cast in MemberList costed ALOT.
10888 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10890 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10891 a hashtable to avoid needless string allocations when an identifier is
10892 used more than once (the common case).
10894 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10896 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10897 is broken, it will not return anything. So, we
10898 have to use the information we have in mcs to
10901 * typemanager.cs: Add a cache for GetInterfaces,
10902 since this will now be used more often (due to ^^)
10904 (GetExplicitInterfaces) New method that gets the
10905 declared, not effective, interfaces on a type
10906 builder (eg, if you have interface IFoo, interface
10907 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10910 This patch makes MCS able to bootstrap itself on
10913 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10915 * expression.cs: Remove the Nop's that Miguel put
10918 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10920 * report.cs, codegen.cs: Give the real stack trace to
10921 the error when an exception is thrown.
10923 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10925 * decl.cs: only allocate hashtables for ifaces if
10928 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10930 * expression.cs: fix the error from cs0121-2.cs
10931 (a parent interface has two child interfaces that
10932 have a function with the same name and 0 params
10933 and the function is called through the parent).
10935 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10937 * class.cs, rootcontext.cs, typmanager.cs: do not
10940 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10942 * codegen.cs: remove stack for the ec flow branching.
10943 It is already a linked list, so no need.
10945 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10947 * Makefile: Allow custom profiler here.
10949 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10951 * typemanager.cs (LookupType):
10952 - Use a static char [], because split takes
10953 a param array for args, so it was allocating
10955 - Do not store true in a hashtable, it boxes.
10957 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10959 * flowanalysis.cs: bytify common enums.
10961 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10963 * modifiers.cs: Add a new set of flags for the
10964 flags allowed on explicit interface impls.
10965 * cs-parser.jay: catch the use of modifiers in
10966 interfaces correctly.
10967 * class.cs: catch private void IFoo.Blah ().
10969 All related to bug #50572.
10971 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10973 * decl.cs: Rewrite the consistant accessability checking.
10974 Accessability is not linear, it must be implemented in
10975 a tableish way. Fixes #49704.
10977 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10979 * expression.cs: Handle negation in a checked context.
10980 We must use subtraction from zero. Fixes #38674.
10982 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10984 * class.cs: Ignore static void main in DLLs.
10985 * rootcontext.cs: Handle the target type here,
10986 since we are have to access it from class.cs
10987 * driver.cs: account for the above.
10989 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10991 * report.cs: Give line numbers and files if available.
10993 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10995 * driver.cs: Implement /addmodule.
10997 * typemanager.cs: Change 'modules' field so it now contains Modules not
11000 2003-12-20 Martin Baulig <martin@ximian.com>
11002 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11003 (FieldBase.IsAssigned): Removed this field.
11004 (FieldBase.SetAssigned): New public method.
11005 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11007 2003-12-20 Martin Baulig <martin@ximian.com>
11009 * expression.cs (LocalVariableReference.DoResolve): Don't set
11010 `vi.Used' if we're called from DoResolveLValue().
11012 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11013 returns the usage vector it just merged into the current one -
11014 pass this one to UsageWarning().
11015 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11016 of the `EmitContext', don't call this recursively on our children.
11018 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11020 * driver.cs: Implement /target:module.
11022 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11024 * support.cs (CharArrayHashtable): New helper class.
11026 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11027 char arrays, not strings, so we can avoid creating a string in
11028 consume_identifier if the identifier is a keyword.
11030 2003-12-16 Martin Baulig <martin@ximian.com>
11032 * statement.cs (LocalInfo.Assigned): Removed this property.
11033 (LocalInfo.Flags): Removed `Assigned'.
11034 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11035 and uses flow analysis.
11036 (Block.UsageWarning): Made this method private.
11037 (Block.Resolve): Call UsageWarning() if appropriate.
11039 * expression.cs (LocalVariableReference.DoResolve): Always set
11040 LocalInfo.Used here.
11042 2003-12-13 Martin Baulig <martin@ximian.com>
11044 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11045 any value here; we're now using flow analysis to figure out
11046 whether a statement/block returns a value.
11048 2003-12-13 Martin Baulig <martin@ximian.com>
11050 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11052 (FlowBranching.MergeFinally): Don't call
11053 `branching.CheckOutParameters()' here, this is called in
11055 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11056 when adding the `finally' vector.
11058 2003-12-13 Martin Baulig <martin@ximian.com>
11061 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11062 actually work and also fix #48962.
11064 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11066 * decl.cs: Do not check System.Object for nested types,
11067 since we know it does not have any. Big bang for buck:
11070 Run 1: 8.35 seconds
11071 Run 2: 8.32 seconds
11072 corlib: 17.99 seconds
11074 Run 1: 8.17 seconds
11075 Run 2: 8.17 seconds
11076 corlib: 17.39 seconds
11078 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11080 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11081 time we are returning 0 members, so we save alot here.
11083 2003-12-11 Martin Baulig <martin@ximian.com>
11085 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11086 `MergeChild()', also just take the `FlowBranching' as argument;
11087 call Merge() on it and return the result.
11088 (FlowBranching.Merge): We don't need to do anything if we just
11091 2003-12-11 Martin Baulig <martin@ximian.com>
11093 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11094 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11095 Maurer for this idea.
11097 2003-12-11 Martin Baulig <martin@ximian.com>
11099 * flowanalysis.cs (MergeResult): This class is now gone; we now
11100 use the `UsageVector' for this. The reason for this is that if a
11101 branching just has one sibling, we don't need to "merge" them at
11102 all - that's the next step to do.
11103 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11106 2003-12-11 Martin Baulig <martin@ximian.com>
11108 Reworked flow analyis and made it more precise and bug-free. The
11109 most important change is that we're now using a special `Reachability'
11110 class instead of having "magic" meanings of `FlowReturns'. I'll
11111 do some more cleanups and optimizations and also add some more
11112 documentation this week.
11114 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11115 largely reworked this class.
11116 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11117 the new `Reachability' class instead of having "magic" values here.
11118 (FlowBranching): We're now using an instance of `Reachability'
11119 instead of having separate `Returns', `Breaks' etc. fields.
11121 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11122 based on flow analysis; ignore the return value of block.Emit ().
11124 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11126 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11127 if they are private.
11129 2003-12-09 Martin Baulig <martin@ximian.com>
11131 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11132 call them directly on the UsageVector.
11134 2003-12-09 Martin Baulig <martin@ximian.com>
11136 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11137 Changed return type from `FlowReturns' to `Reachability'.
11139 2003-12-09 Martin Baulig <martin@ximian.com>
11141 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11142 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11143 `Reachable' fields with a single `Reachability' one.
11145 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11147 * class.cs (FindMembers): Remove foreach's.
11152 Run 1: 8.74 seconds
11153 Run 2: 8.71 seconds
11156 Run 1: 8.64 seconds
11157 Run 2: 8.58 seconds
11160 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11165 This patch does a few things:
11166 1. EmptyStatement is now a singleton, so it is never reallocated.
11167 2. All blah is EmptyStatement constructs have been changed to
11168 blah == EmptyStatement.Value, which is much faster and valid
11169 now that EmptyStatement is a singleton.
11170 3. When resolving a block, rather than allocating a new array for
11171 the non-empty statements, empty statements are replaced with
11172 EmptyStatement.Value
11173 4. Some recursive functions have been made non-recursive.
11174 Mainly the performance impact is from (3), however (1) and (2) are needed for
11175 this to work. (4) does not make a big difference in normal situations, however
11176 it makes the profile look saner.
11181 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11182 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11183 Total memory allocated: 56397 KB
11186 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11187 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11188 Total memory allocated: 55666 KB
11190 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11192 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11193 than the hashtable in a hashtable version
11195 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11196 we always end up concating a string. This results in a huge perf
11197 loss, because many strings have to be tracked by the GC. In this
11198 patch, we first use a hashtable that works with two keys, so that
11199 the strings do not need to be concat'ed.
11203 Run 1: 8.74 seconds
11204 Run 2: 8.71 seconds
11207 Run 1: 8.65 seconds
11208 Run 2: 8.56 seconds
11210 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11212 * Makefile: Add a new target `do-time' that does a quick and simple
11213 profile, leaving easy to parse output.
11215 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11217 * codegen.cs (Init): Create the dynamic assembly with
11218 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11220 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11222 * support.cs: Make the PtrHashtable use only one
11223 instance of its comparer.
11225 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11227 * typemanager.cs: Fix lookup of GetNamespaces.
11229 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11231 * expression.cs: Removed redundant line.
11233 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11234 ArrayLists, use for loops with bounds.
11236 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11239 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11240 arraylists, use for loop with bounds.
11242 The above three changes give us a 0.071 second performance
11243 improvement out of 3.294 seconds down to 3.223. On my machine
11244 the above changes reduced the memory usage by 1,387 KB during
11245 compiler bootstrap.
11247 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11248 QualifiedIdentifiers. Before we created a new string through
11249 concatenation, and mostly later on, the result would be
11250 manipulated by DecomposeQI through string manipulation.
11252 This reduced the compiler memory usage for bootstrapping from
11253 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11254 compile times in 0.05 seconds.
11256 2003-11-28 Dick Porter <dick@ximian.com>
11258 * support.cs: Do string compares with the Invariant culture.
11266 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11267 the comparison is done with the Invariant culture.
11269 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11271 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11272 GetEnumerator method.
11274 (ProbeCollectionType): Iterate starting at the most specific type
11275 upwards looking for a GetEnumerator
11277 * expression.cs: Shift count can be up to 31 for int/uint and 63
11280 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11282 * statement.cs (Block.LookupLabel): Also look for the label on the
11283 children blocks. Use a hash table to keep track of visited
11286 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11287 we actually did transform the other operand, otherwise fall back
11288 to the common codepath that casts to long.
11290 * cs-tokenizer.cs: Use the same code pattern as the int case.
11291 Maybe I should do the parsing myself, and avoid depending on the
11292 Parse routines to get this done.
11294 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11296 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11297 which fixes bug 51347. This time test it.
11299 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11300 attributes for example can not tell the difference between these.
11301 The difference was only a syntax feature of the language.
11303 * attribute.cs: Apply attributes to delegates.
11305 * delegate.cs: Call the apply attributes method.
11307 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11309 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11310 comparing 0 vs Byte.MinValue, not the value
11312 (ImplicitConversionRequired): When reporting a conversion error,
11313 use error 31 to print out the constant error instead of the
11316 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11317 which fixes bug 51347.
11319 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11321 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11322 which fixes the -warnaserror command line option.
11324 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11326 * cfold.cs (DoNumericPromotions): During constant folding of
11327 additions on UIntConstant, special case intconstants with
11328 IntConstants like we do on the expression binary operator.
11330 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11332 * convert.cs (ImplicitReferenceConversion): We were missing a case
11333 (System.Enum are not value types or class types, so we need to
11334 classify them separatedly).
11336 * driver.cs: We do not support error 2007.
11338 2003-11-12 Jackson Harper <jackson@ximian.com>
11340 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11341 system directory. Also use the full file name so users can
11342 libraries names mscorlib-o-tron.dll in a non system dir.
11344 2003-11-10 Martin Baulig <martin@ximian.com>
11346 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11347 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11348 calling `ResolveType()' on them, directly assign their `Type'.
11350 2003-11-08 Martin Baulig <martin@ximian.com>
11352 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11353 return value and the `out parent' parameter.
11354 (TypeContainer.DefineType): Moved the CS0644 check into
11355 GetClassBases(). Don't pass the interface types to the
11356 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11357 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11359 * ecore.cs (TypeExpr.IsAttribute): New property.
11360 (TypeExpr.GetInterfaces): New method.
11362 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11363 TypeExpr instead of a Type.
11364 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11365 (Interface.DefineType): Don't pass the interface types to the
11366 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11367 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11369 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11370 instead of a `Type[]'.
11371 (TypeManager.RegisterBuilder): Likewise.
11372 (TypeManager.AddUserInterface): Likewise.
11373 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11374 `Type[]' and also return a `TypeExpr[]'.
11375 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11377 2003-11-08 Martin Baulig <martin@ximian.com>
11379 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11382 2003-11-08 Martin Baulig <martin@ximian.com>
11384 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11385 TypeManager.ResolveExpressionTypes().
11387 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11388 instead of an Expression.
11389 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11390 (TypeExpression): New public class; formerly known as `TypeExpr'.
11392 * expression.cs (ComposedCast): Derive from TypeExpr.
11394 * typemanager.cs (TypeManager.system_*_expr): These are now
11395 TypExpr's instead of Expression's.
11396 (TypeManager.ResolveExpressionTypes): New public static function;
11397 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11400 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11402 * expression.cs (New.DoResolve): Do not dereference value that
11403 might be a null return.
11405 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11406 sure that the constant value has the right type. Fixes an
11407 unreported bug, similar to 50425.
11409 * const.cs (Const.LookupConstantValue): Call
11410 ImplicitStandardConversionExists before doing a conversion to
11411 avoid havng the TypeManager.ChangeType do conversions.
11413 Reduced the number of casts used
11415 (Const.ChangeType): New routine to enable reuse of the constant
11416 type changing code from statement.
11418 * typemanager.cs (ChangeType): Move common initialization to
11419 static global variables.
11423 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11424 every value type to go through, even if it was void. Fix that.
11426 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11427 character of the define, and the is_identifier_part_character for
11428 the rest of the string.
11430 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11432 * expression.cs (UnaryMutator.EmitCode): When I updated
11433 LocalVariableReference.DoResolve, I overdid it, and dropped an
11434 optimization done on local variable references.
11436 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11438 * ecore.cs: Convert the return from Ldlen into an int.
11440 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11442 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11443 the accessibility, this is a special case for toplevel non-public
11444 classes (internal for instance).
11446 2003-10-20 Nick Drochak <ndrochak@gol.com>
11448 * ecore.cs: Fix typo and build. Needed another right paren.
11450 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11452 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11453 `internal' case regular and protected, but not allowing protected
11454 to be evaluated later. Bug 49840
11456 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11458 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11459 to kb.Nlast, and not the kb.nFirst to isolate the switch
11462 Extract the underlying type, so enumerations of long/ulong are
11463 treated like long/ulong.
11465 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11467 * expression.cs (New): Overload the meaning of RequestedType to
11468 track the possible creation of the NewDelegate type, since
11469 DoResolve is invoked more than once for new constructors on field
11472 See bugs: #48800 and #37014
11474 * cs-parser.jay (declare_local_constants): Take an arraylist
11475 instead of a single constant.
11477 (local_constant_declaration): It should take a
11478 constant_declarators, not a constant_declarator. Fixes 49487
11480 * convert.cs: Fix error report.
11482 2003-10-13 Jackson Harper <jackson@ximian.com>
11484 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11487 2003-10-09 Martin Baulig <martin@ximian.com>
11489 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11491 (MethodCore.DoDefineParameters): Removed the TypeContainer
11492 argument; use the DeclSpace which was passed to the .ctor instead.
11493 (MethodCore.CheckParameter): Take a DeclSpace instead of a
11494 TypeContainer; we only need a DeclSpace here.
11496 2003-10-09 Martin Baulig <martin@ximian.com>
11498 * class.cs (MethodData): Added additional `DeclSpace ds' argument
11500 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11501 EmitContext's .ctor.
11503 2003-10-09 Martin Baulig <martin@ximian.com>
11505 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11506 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11507 AsAccessible(), moved them as well.
11509 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11511 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11513 * cs-parser.jay : Renamed yyName to yyNames related to jay.
11515 2003-10-07 Miguel de Icaza <miguel@ximian.com>
11517 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11518 generation for >=, as spotted by Paolo, bug 48679.
11519 Patch from David Waite.
11521 * cs-tokenizer.cs: Add handling for #pragma.
11523 * cs-parser.jay: Allow for both yield and yield return in the
11524 syntax. The anti-cobolization of C# fight will go on!
11526 * class.cs (TypeBuilder.DefineType): Catch error condition here
11527 (Parent.DefineType erroring out and returning null).
11529 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11530 coping with enumerations variables, we were mistakenly processing
11531 them as a regular value type instead of built-in types. Fixes the
11534 * typemanager.cs (IsBuiltinOrEnum): New method.
11536 2003-09-30 Miguel de Icaza <miguel@ximian.com>
11538 * cs-parser.jay: Upgrade: yield now needs the return clause.
11540 2003-09-19 Martin Baulig <martin@ximian.com>
11542 * decl.cs (MemberCache.SetupCacheForInterface): Take a
11543 `MemberCache parent' argument. Normally, an interface doesn't
11544 have a parent type except System.Object, but we use this in gmcs
11545 for generic type parameters.
11547 2003-09-18 Martin Baulig <martin@ximian.com>
11549 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11550 on `type.IsInterface'; don't check whether the type has a parent
11551 to determine whether it's an interface.
11553 2003-09-15 Martin Baulig <martin@ximian.com>
11555 * class.cs (TypeContainer.DefineType): Added an error flag to
11556 avoid reporting duplicate CS0146's ("class definition is
11559 * driver.cs (Driver.MainDriver): Abort if
11560 RootContext.ResolveTree() reported any errors.
11562 2003-09-07 Martin Baulig <martin@ximian.com>
11564 * report.cs (Error, Warning): Added overloaded versions which take
11565 a `params object[] args' and call String.Format().
11567 2003-09-07 Martin Baulig <martin@ximian.com>
11569 * decl.cs (DeclSpace..ctor): Don't call
11570 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11571 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
11572 (DeclSpace.RecordDecl): New method.
11574 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11576 2003-09-02 Ravi Pratap <ravi@ximian.com>
11578 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11579 value attributes to be applied to ParameterBuilders.
11581 * class.cs (MethodCore.LabelParameters): Make static and more
11582 generic so that it can be used from other places - like interface
11583 methods, for instance.
11585 * interface.cs (Interface.Emit): Call LabelParameters before
11586 emitting attributes on the InterfaceMethod.
11588 2003-08-26 Martin Baulig <martin@ximian.com>
11590 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11591 resolving aliases; fixes #47927.
11593 2003-08-26 Martin Baulig <martin@ximian.com>
11595 * statement.cs (Using.DoResolve): This is internally emitting a
11596 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11597 do not always return. Fixes #47681.
11599 2003-08-26 Martin Baulig <martin@ximian.com>
11601 * decl.cs (MemberCore): Moved WarningNotHiding(),
11602 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11604 (AdditionResult): Make this nested in DeclSpace.
11605 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11606 argument; call NamespaceEntry.Define() unless we're nested in a
11609 * namespace.cs (Namespace.DefineName): New public function. This
11610 is called from DeclSpace's .ctor to add
11611 (Namespace.Lookup): Include DeclSpaces in the lookup.
11613 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11615 * const.cs (Const): Derive from MemberBase, not MemberCore.
11617 2003-08-25 Martin Baulig <martin@ximian.com>
11619 * convert.cs (Convert.ExplicitReferenceConversion): When
11620 converting from an interface type to a class, unbox if the target
11621 type is a struct type. Fixes #47822.
11623 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11625 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11628 2003-08-22 Martin Baulig <martin@ximian.com>
11630 * class.cs (TypeManager.DefineType): When defining a nested type,
11631 call DefineType() on our parent; fixes #47801.
11633 2003-08-22 Martin Baulig <martin@ximian.com>
11635 * class.cs (MethodData.Define): While checking if a method is an
11636 interface implementation, improve the test a bit more to fix #47654.
11638 2003-08-22 Martin Baulig <martin@ximian.com>
11640 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11641 correctly; fixes #47722.
11643 2003-08-22 Martin Baulig <martin@ximian.com>
11645 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11646 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11648 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11650 2003-08-22 Martin Baulig <martin@ximian.com>
11652 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11653 can only be assigned in static constructors. Fixes #47161.
11655 2003-08-22 Martin Baulig <martin@ximian.com>
11657 Rewrote and improved the flow analysis code.
11659 * flowbranching.cs (FlowBranching): Make this class abstract.
11660 (FlowBranching.CreateBranching): New static function to create a
11661 new flow branching.
11662 (FlowBranchingBlock, FlowBranchingException): New classes.
11663 (FlowBranching.UsageVector.Type): New public readonly field.
11664 (FlowBranching.UsageVector.Breaks): Removed the setter.
11665 (FlowBranching.UsageVector.Returns): Removed the setter.
11666 (FlowBranching.UsageVector): Added Break(), Return(),
11667 NeverReachable() and Throw() methods to modify the reachability.
11668 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11669 done by FlowBranching.Merge().
11670 (FlowBranching.UsageVector.MergeChild): New method; merges the
11671 merge result into the current vector.
11672 (FlowBranching.Merge): New abstract method to merge a branching.
11674 2003-08-12 Martin Baulig <martin@ximian.com>
11676 * expression.cs (Indirection.CacheTemporaries): Create the
11677 LocalTemporary with the pointer type, not its element type.
11679 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11681 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11682 token was a keyword or not.
11684 Add `error' options where an IDENTIFIER was expected; Provide
11685 CheckToken and CheckIdentifierToken convenience error reporting
11688 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11690 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11691 NameSpaceEntry NameSpaceEntry.
11693 (LookupInterfaceOrClass): Avoid creating a full qualified name
11694 from namespace and name: avoid doing lookups when we know the
11695 namespace is non-existant. Use new Tree.LookupByNamespace which
11696 looks up DeclSpaces based on their namespace, name pair.
11698 * driver.cs: Provide a new `parser verbose' to display the
11699 exception thrown during parsing. This is turned off by default
11700 now, so the output of a failure from mcs is more graceful.
11702 * namespace.cs: Track all the namespaces defined in a hashtable
11705 (IsNamespace): New method
11707 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11709 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11710 we know that we need to concatenate (full typename can never be
11715 * statement.cs: Use a bitfield; Do not initialize to null things
11716 which are done by the constructor by default.
11718 * cs-parser.jay: bug fix, parameter was 4, not 3.
11720 * expression.cs: Just use the property;
11722 * statement.cs: No need for GetVariableInfo method.
11724 2003-08-08 Martin Baulig <martin@ximian.com>
11726 * flowanalysis.cs (FlowReturns): This is now nested in the
11727 `FlowBranching' class.
11728 (MyBitVector): Moved this here from statement.cs.
11729 (FlowBranching.SiblingType): New enum type.
11730 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11732 2003-08-07 Martin Baulig <martin@ximian.com>
11734 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11735 `FlowBranching' class and called `BranchingType'.
11737 2003-08-07 Martin Baulig <martin@ximian.com>
11739 * flowanalysis.cs: Moved all the control flow analysis code into
11742 2003-08-07 Martin Baulig <martin@ximian.com>
11744 * assign.cs (Assign.DoResolve): `target' must either be an
11745 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11748 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11750 * expression.cs (BinaryMethod): This kind of expression is created by the
11751 Binary class if it determines that the operator has to be handled
11754 (BinaryDelegate): This kind of expression is created if we are
11755 dealing with a + or - operator on delegates.
11757 (Binary): remove method, argumetns, and DelegateOperator: when
11758 dealing with methods,
11760 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11762 * statement.cs (Block): use bitfields for the three extra booleans
11763 we had in use. Remove unused topblock parameter.
11765 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11767 * assign.cs: Drop extra unneeded tests.
11769 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11771 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11773 * statement.cs (Foreach): Use VariableStorage instead of
11776 * codegen.cs (VariableStorage): New class used by clients that
11777 require a variable stored: locals or fields for variables that
11778 need to live across yield.
11780 Maybe provide a convenience api for EmitThis+EmitLoad?
11782 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11785 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11787 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11788 RemapParameterLValue): New methods that are used to turn a
11789 precomputed FieldInfo into an expression like this:
11793 The idea is to use this instead of making LocalVariableReference
11794 have more than one meaning.
11796 * cs-parser.jay: Add error production to BASE.
11798 * ecore.cs: Deal with TypeManager.GetField returning null, which
11799 is now a valid return value.
11801 (FieldExprNoAddress): New expression for Fields whose address can
11804 * expression.cs (LocalVariableReference): During the resolve
11805 phases, create new expressions if we are in a remapping context.
11806 Remove code that dealt with remapping here.
11808 (ParameterReference): same.
11810 (ProxyInstance): New expression, like the `This' expression, but
11811 it is born fully resolved. We know what we are doing, so remove
11812 the errors that are targeted to user-provided uses of `this'.
11814 * statement.cs (Foreach): our variable is now stored as an
11815 Expression; During resolution, follow the protocol, dont just
11816 assume it will return this.
11818 2003-08-06 Martin Baulig <martin@ximian.com>
11820 * support.cs (SeekableStreamReader.cs): New public class.
11822 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11823 SeekableStreamReader instead of the normal StreamReader.
11825 2003-08-04 Martin Baulig <martin@ximian.com>
11827 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11828 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11829 deambiguate casts and delegate invocations.
11830 (parenthesized_expression): Use the new tokens to ensure this is
11831 not a cast of method invocation.
11833 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11834 when reading a `)' and Deambiguate_CloseParens () was previously
11837 * expression.cs (ParenthesizedExpression): New class. This is
11838 just used for the CS0075 test.
11839 (Binary.DoResolve): Check for CS0075.
11841 2003-07-29 Ravi Pratap <ravi@ximian.com>
11843 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11844 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11845 reference comparison.
11847 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11848 examine the ReturnType for equality - this is necessary in the
11849 cases of implicit and explicit operators whose signature also
11850 includes the return type.
11852 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11854 * namespace.cs: Cache the result of the namespace computation,
11855 instead of computing it every time.
11857 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11859 * decl.cs: Use a global arraylist that we reuse over invocations
11860 to avoid excesive memory consumption. Reduces memory usage on an
11861 mcs compile by one meg (45 average).
11863 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11864 private, work around that.
11866 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11868 * literal.cs (IntLiteral): Define Zero and One static literals.
11870 * cs-parser.jay (integer_literal): use static literals to reduce
11871 memory usage for the most used literals (0, 1 and -1). 211kb
11872 reduced in memory usage.
11874 Replace all calls to `new ArrayList' with `new
11875 ArrayList(4)' which is a good average number for most allocations,
11876 and also requires only 16 bytes of memory for its buffer by
11879 This reduced MCS memory usage in seven megabytes for the RSS after
11882 2003-07-28 Ravi Pratap <ravi@ximian.com>
11884 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11885 handle params methods the correct way by forming only one
11886 applicable set with params and normal methods in them. Earlier we
11887 were looking at params methods only if we found no normal methods
11888 which was not the correct thing to do.
11890 (Invocation.BetterFunction): Take separate arguments indicating
11891 when candidate and the best method are params methods in their
11894 This fixes bugs #43367 and #46199.
11896 * attribute.cs: Documentation updates.
11898 (CheckAttribute): Rename to CheckAttributeTarget.
11899 (GetValidPlaces): Rename to GetValidTargets.
11901 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11902 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11906 2003-07-28 Martin Baulig <martin@ximian.com>
11908 * class.cs (TypeContainer.DefineMembers): Use the base type's full
11909 name when looking up the base class of a nested class. Fixes #46977.
11911 2003-07-26 Martin Baulig <martin@ximian.com>
11913 * expression.cs (Indexers.Indexer): New nested struct; contains
11914 getter, setter and the indexer's type.
11915 (Indexers.Properties): This is now an ArrayList of
11916 Indexers.Indexer's.
11917 (IndexerAccess.DoResolveLValue): Correctly set the type if the
11918 indexer doesn't have any getters.
11920 * assign.cs (Assign.DoResolve): Also do the implicit conversions
11921 for embedded property and indexer assignments.
11923 2003-07-26 Martin Baulig <martin@ximian.com>
11925 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11926 preprocessor directive is not the first non-whitespace character
11929 2003-07-26 Martin Baulig <martin@ximian.com>
11931 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11932 namespace parsing, follow the spec more closely.
11934 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11935 NamespaceEntry.Lookup().
11937 2003-07-25 Martin Baulig <martin@ximian.com>
11939 * MethodCore.cs (OverridesSomething): New public field; it's set
11940 from TypeContainer.DefineMembers if this method overrides
11941 something (which doesn't need to be a method). Fix #39462.
11943 2003-07-25 Ravi Pratap <ravi@ximian.com>
11945 * typemanager.cs (GetMembers): Ensure that the list of members is
11946 reversed. This keeps things in sync.
11948 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11949 find an AttributeUsage attribute.
11951 * expression.cs (Invocation.OverloadResolve): Perform the check
11952 which disallows Invoke to be directly called on a Delegate.
11954 (Error_InvokeOnDelegate): Report error cs1533.
11956 2003-07-25 Martin Baulig <martin@ximian.com>
11958 * expression.cs (Indexers.GetIndexersForType): Only look in the
11959 interface hierarchy if the requested type is already an
11960 interface. Fixes #46788 while keeping #46502 fixed.
11962 2003-07-25 Martin Baulig <martin@ximian.com>
11964 * class.cs (TypeContainer.DefineMembers): Check whether all
11965 readonly fields have been assigned and report warning CS0649 if
11968 * statement.cs (LocalInfo.IsFixed): Always return true if this is
11971 2003-07-24 Ravi Pratap <ravi@ximian.com>
11973 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11974 returned from GetMethods to make things consistent with the
11975 assumptions MCS makes about ordering of methods.
11977 This should comprehensively fix bug #45127 and it does :-)
11979 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11980 ordering is actually reverse.
11982 * Clean up some debug messages I left lying around.
11984 * interface.cs (Populate*): Get rid of code which emits attributes
11985 since the stage in which we emit attributes is the 'Emit' stage,
11986 not the define stage.
11988 (Emit): Move attribute emission for interface members here.
11990 2003-07-22 Ravi Pratap <ravi@ximian.com>
11992 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11993 closely: we eliminate methods in base types when we have an
11994 applicable method in a top-level type.
11996 Please see section 14.5.5.1 for an exact description of what goes
11999 This fixes bug #45127 and a host of other related to corlib compilation.
12001 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12002 array is the method corresponding to the top-level type (this is
12003 because of the changes made to icall.c) so we change this
12006 (MethodGroupExpr.Name): This too.
12008 * typemanager.cs (GetElementType): New method which does the right
12009 thing when compiling corlib.
12011 * everywhere: Make use of the above in the relevant places.
12013 2003-07-22 Martin Baulig <martin@ximian.com>
12015 * cs-parser.jay (invocation_expression): Moved
12016 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12017 `cast_expression', but create a InvocationOrCast which later
12018 resolves to either an Invocation or a Cast.
12020 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12021 method; call this before EmitStatement() to make sure that this
12022 expression can be used as a statement.
12024 * expression.cs (InvocationOrCast): New class; resolves to either
12025 an Invocation or a Cast.
12027 * statement.cs (StatementExpression): Call ResolveStatement() on
12028 the ExpressionStatement before emitting it.
12030 2003-07-21 Martin Baulig <martin@ximian.com>
12032 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12033 `ref' and `out' attributes match; fixes #46220.
12034 (MemberAccess.ResolveMemberAccess): You can't reference a type
12035 through an expression; fixes #33180.
12036 (Indexers.GetIndexersForType): Don't return the indexers from
12037 interfaces the class implements; fixes #46502.
12039 2003-07-21 Martin Baulig <martin@ximian.com>
12041 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12042 CS0661 checks; fixes bug #30442.
12044 2003-07-21 Martin Baulig <martin@ximian.com>
12046 * decl.cs (AdditionResult): Added `Error'.
12048 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12050 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12051 makes cs0031.cs actually work.
12053 2003-07-20 Martin Baulig <martin@ximian.com>
12055 * namespace.cs: Fixed that bug which caused a crash when compiling
12056 the debugger's GUI.
12058 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12060 * typemanager.cs (LookupTypeReflection): Never expose types which
12061 are NotPublic, NestedPrivate, NestedAssembly, or
12062 NestedFamANDAssem. We used to return these, and later do a check
12063 that would report a meaningful error, but the problem is that we
12064 would not get the real match, if there was a name override.
12066 2003-07-18 Miguel de Icaza <miguel@ximian.com>
12068 * namespace.cs (Namespace, Name): Do not compute the namespace
12069 name dynamically, compute it in the constructor. This reduced
12070 memory usage by 1697 KB.
12072 * driver.cs: Use --pause to pause at the end.
12074 2003-07-17 Peter Williams <peter@newton.cx>
12076 * Makefile: Change the name of the test target so that it doesn't
12077 conflict with the recursive test target.
12079 2003-07-17 Miguel de Icaza <miguel@ximian.com>
12081 * expression.cs (LocalVariableReference.Emit, EmitAssign,
12082 AddressOf): Do not use EmitThis, that was wrong, use the actual
12085 2003-07-15 Miguel de Icaza <miguel@ximian.com>
12087 * class.cs (MethodData.Define): While checking if a method is an
12088 interface implementation, improve the test: If we are not public
12089 (use new test here: use the computed MethodAttributes directly,
12090 instead of the parsed modifier flags) check if the `implementing'
12091 method comes from an interface or not.
12093 * pending.cs (VerifyPendingMethods): Slightly better error
12096 * makefile: add test target that does the mcs bootstrap.
12098 2003-07-16 Ravi Pratap <ravi@ximian.com>
12100 * interface.cs (Define): Do nothing here since there are no
12101 members to populate etc. Move the attribute emission out of here
12102 since this was just totally the wrong place to put it. Attribute
12103 application happens during the 'Emit' phase, not in the 'Define'
12106 (Emit): Add this method and move the attribute emission here
12108 * rootcontext.cs (EmitCode): Call the Emit method on interface
12111 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12113 * expression.cs (OverloadResolve): Report error only if Location
12114 is not 'Null' which means that there was a probe going on.
12116 2003-07-14 Martin Baulig <martin@ximian.com>
12118 * expression.cs (ConditionalLogicalOperator): New public class to
12119 implement user defined conditional logical operators.
12120 This is section 14.11.2 in the spec and bug #40505.
12122 2003-07-14 Martin Baulig <martin@ximian.com>
12124 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12126 2003-07-14 Martin Baulig <martin@ximian.com>
12128 * codegen.cs (EmitContext.InFixedInitializer): New public field.
12130 * ecore.cs (IVariable.VerifyFixed): New interface method.
12132 * expression.cs (Unary.ResolveOperator): When resolving the `&'
12133 operator, check whether the variable is actually fixed. Fixes bug
12134 #36055. Set a variable definitely assigned when taking its
12135 address as required by the spec.
12137 * statement.cs (LocalInfo.IsFixed): New field.
12138 (LocalInfo.MakePinned): Set `IsFixed' to true.
12140 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12142 * attribute.cs (Attribute.Resolve): While doing a Member lookup
12143 for .ctors, ensure that we only ask for members declared in the
12144 attribute type (BindingFlags.DeclaredOnly).
12148 * expression.cs (Error_WrongNumArguments): Report error 1501
12149 correctly the way CSC does.
12151 2003-07-13 Martin Baulig <martin@ximian.com>
12153 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12154 lookup on the fully qualified name, to make things like "X.X" work
12155 where "X.X" is a fully qualified type name, but we also have a
12156 namespace "X" in the using list. Fixes #41975.
12158 2003-07-13 Martin Baulig <martin@ximian.com>
12160 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12161 function. If we're a CompoundAssign, we need to create an embedded
12162 CompoundAssign, not an embedded Assign.
12163 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12166 2003-07-13 Martin Baulig <martin@ximian.com>
12168 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12169 work to fix bug #46088.
12171 2003-07-13 Ravi Pratap <ravi@ximian.com>
12173 * class.cs (Operator.Emit): Do not emit attributes here - it is
12174 taken care of by the Method class that we delegate too. This takes
12175 care of bug #45876.
12177 2003-07-10 Martin Baulig <martin@ximian.com>
12179 * expression.cs (TypeOfVoid): New class.
12180 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12182 2003-07-10 Martin Baulig <martin@ximian.com>
12184 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12187 2003-07-10 Martin Baulig <martin@ximian.com>
12189 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12190 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12192 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12194 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12196 2003-07-10 Martin Baulig <martin@ximian.com>
12198 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12199 of decimal. Fixes #42850.
12201 NOTE: I also fixed the created byte blob, but this doesn't work on
12202 the MS runtime and csc never produces any byte blobs for decimal
12205 2003-07-10 Martin Baulig <martin@ximian.com>
12207 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12208 structs; fixes #32068.
12209 (Block.AddChildVariableNames): Fixed #44302.
12211 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12213 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12215 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12217 * attribute.cs: And this test is onger needed.
12219 2003-07-08 Martin Baulig <martin@ximian.com>
12221 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12222 inaccessible types. Fixes #36313.
12224 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12226 * namespace.cs (NamespaceEntry): Create implicit entries for all
12227 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12228 implicit entries for N1.N2 and N1.
12230 2003-07-08 Martin Baulig <martin@ximian.com>
12232 Rewrote the handling of namespaces to fix a lot of the issues
12233 wrt. `using' aliases etc.
12235 * namespace.cs (Namespace): Splitted this class into a
12236 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12238 * typemanager.cs (TypeManager.IsNamespace): Removed.
12239 (TypeManager.ComputeNamespaces): Only compute namespaces from
12240 loaded assemblies here, not the namespaces from the assembly we're
12241 currently compiling.
12243 2003-07-08 Martin Baulig <martin@ximian.com>
12245 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12247 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12249 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12252 I thought about the memory savings here, but LookupTypeReflection
12253 is used under already very constrained scenarios. Compiling
12254 corlib or mcs only exposes one hit, so it would not really reduce
12255 any memory consumption.
12257 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12259 * typemanager.cs: fixes bug #45889 by only adding public types from
12260 other assemblies to the list of known types.
12262 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12264 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12265 on the type we resolved.
12267 2003-07-05 Martin Baulig <martin@ximian.com>
12269 * pending.cs (PendingImplementation.ParentImplements): Don't
12270 create the proxy if the parent is abstract.
12272 * class.cs (TypeContainer.DefineIndexers): Process explicit
12273 interface implementations first. Fixes #37714.
12275 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12277 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12278 defined recursively; but since we modify the input parameters
12279 (left is set to `this' temporarily), we reset this value if the
12280 left_is_explicit is false, which gives the original semantics to
12283 * literal.cs (NullPointer): new class used to represent a null
12284 literal in a pointer context.
12286 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12287 type is a pointer, use a NullPointer object instead of a
12288 NullLiteral. Closes 43687
12290 (ExplicitConversion): Convert pointer values using
12291 the conv opcode to the proper type.
12293 * ecore.cs (New): change ValueTypeVariable property into a method,
12294 that returns whether the valuetype is suitable for being used.
12296 * expression.cs (Binary.DoNumericPromotions): Only return if we
12297 the int constant was a valid uint, and we can return both left and
12298 right as uints. If not, we continue processing, to trigger the
12299 type conversion. This fixes 39018.
12301 * statement.cs (Block.EmitMeta): During constant resolution, set
12302 the CurrentBlock property on the emitcontext, so that we resolve
12303 constants propertly.
12305 2003-07-02 Martin Baulig <martin@ximian.com>
12307 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12308 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12310 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12311 than emitting it here.
12313 * statement.cs: Fixed some more flow analysis bugs.
12315 2003-07-02 Martin Baulig <martin@ximian.com>
12317 * class.cs (MethodData.Define): When implementing interface
12318 methods, set Final unless we're Virtual.
12320 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12321 check work for interface methods.
12323 2003-07-01 Martin Baulig <martin@ximian.com>
12325 * ecore.cs (EmitContext.This): Replaced this property with a
12326 GetThis() method which takes a Location argument. This ensures
12327 that we get the correct error location for a CS0188.
12329 2003-07-01 Miguel de Icaza <miguel@ximian.com>
12331 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12332 ImplicitStandardConversion.
12334 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12336 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
12338 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12341 2003-06-30 Miguel de Icaza <miguel@ximian.com>
12343 * class.cs (Constructor.Define): Turn off initlocals for unsafe
12346 (MethodData.Define): Turn off initlocals for unsafe methods.
12348 2003-06-29 Miguel de Icaza <miguel@ximian.com>
12350 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12351 complete; Fixes #37521.
12353 * delegate.cs: Use Modifiers.TypeAttr to compute the
12354 TypeAttributes, instead of rolling our own. This makes the flags
12355 correct for the delegates.
12357 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12359 * class.cs (Constructor.Define): Set the private flag for static
12360 constructors as well.
12362 * cs-parser.jay (statement_expression): Set the return value to
12363 null, to avoid a crash when we catch an error.
12365 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12367 * cs-parser.jay: Applied patch from Jackson that adds support for
12368 extern and unsafe modifiers to destructor declarations.
12370 * expression.cs: Report error 21 if the user is trying to index a
12373 * driver.cs: Add an error message, suggested by the bug report.
12375 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12376 if we do not have a ": this ()" constructor initializer. Fixes 45149
12378 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12380 * namespace.cs: Add some information to reduce FAQs.
12382 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12384 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12385 underlying enumeration types. Fixes #43915.
12387 * expression.cs: Treat ushort/short as legal values to be used in
12388 bitwise operations.
12390 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12392 * delegate.cs: transfer custom attributes for paramenters from
12393 the delegate declaration to Invoke and BeginInvoke.
12395 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12397 * attribute.cs: handle custom marshalers and emit marshal info
12400 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12402 * makefile.gnu: Added anonymous.cs to the compiler sources.
12404 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12406 * iterators.cs: Change the name of the proxy class to include two
12409 * cs-parser.jay: Update grammar to include anonymous methods.
12411 * anonymous.cs: new file.
12413 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12415 * class.cs (Field.Define): Add missing test for pointers and
12418 2003-05-27 Ravi Pratap <ravi@ximian.com>
12420 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12421 we use the stobj opcode.
12423 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12424 since it wasn't the correct fix.
12426 It still is puzzling that we are required to use stobj for IntPtr
12427 which seems to be a ValueType.
12429 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12431 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12432 during regular simple name resolution. Now, the trick is that
12433 instead of returning for processing the simplename, we do a
12434 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12435 contextual lookup type). If a match is found, return that, if
12436 not, return for further composition.
12438 This fixes long-standing 30485.
12440 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12441 using the address to initialize an object, do an Stobj instead of
12442 using the regular Stelem.
12444 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12445 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12446 Because if we are a BaseIndexerAccess that value will be true.
12449 * statement.cs (GotoCase.Resolve): Return after reporting an
12450 error, do not attempt to continue.
12452 * expression.cs (PointerArithmetic.Emit): If our operand is a
12453 long, convert our constants to match the operand before
12454 multiplying. Convert to I type before adding. Fixes 43670.
12456 2003-05-14 Ravi Pratap <ravi@ximian.com>
12458 * enum.cs (ImplicitConversionExists) : Rename to
12459 ImplicitEnumConversionExists to remove ambiguity.
12461 * ecore.cs (NullCast): New type of cast expression class which
12462 basically is very similar to EmptyCast with the difference being
12463 it still is a constant since it is used only to cast a null to
12465 (eg. (string) null)
12467 * convert.cs (ImplicitReferenceConversion): When casting a null
12468 literal, we return a NullCast.
12470 * literal.cs (NullLiteralTyped): Remove - I don't see why this
12471 should be around anymore.
12473 The renaming (reported was slightly wrong). Corrections:
12475 ConvertImplicitStandard -> ImplicitConversionStandard
12476 ConvertExplicitStandard -> ExplicitConversionStandard
12478 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12479 before passing them in !
12481 * convert.cs (ImplicitConversionStandard): When comparing for
12482 equal expr and target types, ensure that expr is not a
12485 In general, we must not be checking (expr_type ==
12486 target_type) in the top level conversion methods
12487 (ImplicitConversion, ExplicitConversion etc). This checking is
12488 done in the methods that they delegate to.
12490 2003-05-20 Miguel de Icaza <miguel@ximian.com>
12492 * convert.cs: Move Error_CannotConvertType,
12493 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12494 ImplicitNumericConversion, ImplicitConversionExists,
12495 ImplicitUserConversionExists, StandardConversionExists,
12496 FindMostEncompassedType, FindMostSpecificSource,
12497 FindMostSpecificTarget, ImplicitUserConversion,
12498 ExplicitUserConversion, GetConversionOperators,
12499 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12500 TryImplicitIntConversion, Error_CannotConvertImplicit,
12501 ConvertImplicitRequired, ConvertNumericExplicit,
12502 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12503 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12506 Perform the following renames:
12508 StandardConversionExists -> ImplicitStandardConversionExists
12509 ConvertImplicit -> ImplicitConversion
12510 ConvertImplicitStandard -> ImplicitStandardConversion
12511 TryImplicitIntConversion -> ImplicitIntConversion
12512 ConvertImplicitRequired -> ImplicitConversionRequired
12513 ConvertNumericExplicit -> ExplicitNumericConversion
12514 ConvertReferenceExplicit -> ExplicitReferenceConversion
12515 ConvertExplicit -> ExplicitConversion
12516 ConvertExplicitStandard -> ExplicitStandardConversion
12518 2003-05-19 Martin Baulig <martin@ximian.com>
12520 * statement.cs (TypeInfo.StructInfo): Made this type protected.
12521 (TypeInfo): Added support for structs having structs as fields.
12523 * ecore.cs (FieldExpr): Implement IVariable.
12524 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12525 VariableInfo for the field.
12527 2003-05-18 Martin Baulig <martin@ximian.com>
12529 * expression.cs (This.DoResolve): Report a CS0027 if we're
12530 emitting a field initializer.
12532 2003-05-18 Martin Baulig <martin@ximian.com>
12534 * expression.cs (This.ResolveBase): New public function.
12535 (This.DoResolve): Check for CS0188.
12537 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12540 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12541 `instance_expression' to null if we don't have any non-static
12544 2003-05-18 Martin Baulig <martin@ximian.com>
12546 Reworked the way how local variables and parameters are handled by
12547 the flow analysis code.
12549 * statement.cs (TypeInfo, VariableMap): New public classes.
12550 (VariableInfo): New public class. This is now responsible for
12551 checking whether a variable has been assigned. It is used for
12552 parameters and local variables.
12553 (Block.EmitMeta): Take the InternalParameters as argument; compute
12554 the layout of the flow vectors here.
12555 (Block.LocalMap, Block.ParameterMap): New public properties.
12556 (FlowBranching): The .ctor doesn't get the InternalParameters
12557 anymore since Block.EmitMeta() now computes the layout of the flow
12559 (MyStructInfo): This class is now known as `StructInfo' and nested
12560 in `TypeInfo'; we don't access this directly anymore.
12562 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12563 property and removed IsAssigned(), IsFieldAssigned(),
12564 SetAssigned() and SetFieldAssigned(); we now call them on the
12565 VariableInfo so we don't need to duplicate this code everywhere.
12567 * expression.cs (ParameterReference): Added `Block block' argument
12569 (LocalVariableReference, ParameterReference, This): The new
12570 VariableInfo class is now responsible for all the definite
12573 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12574 IsParameterAssigned, SetParameterAssigned): Removed.
12576 2003-05-18 Martin Baulig <martin@ximian.com>
12578 * typemanager.cs (InitCoreTypes): Try calling
12579 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12580 the 3-args-version. Corlib now also needs our `void_type'.
12581 (GetMethod): Added overloaded version which takes an optional
12582 `bool report_errors' to allow lookups of optional methods.
12584 2003-05-12 Martin Baulig <martin@ximian.com>
12586 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12587 only used for locals and not for parameters.
12589 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12591 * support.cs (InternalParameters.ParameterType): Return the
12592 ExternalType of the parameter.
12594 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12597 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12599 * class.cs (MethodData.Define): Do not set the `newslot' on
12600 interface members, if they are also flagged as "override".
12602 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12603 better code for ++i and i++. This only works for static fields
12604 and local variables.
12606 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12607 want to pull the DeclSpace out of the builder_to_declspace instead
12608 of the TypeBuilder (like in TypeContainer.FindMembers).
12610 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12611 instead of LookupTypeContainer. Fixes the crash on .NET for
12612 looking up interface members.
12614 * const.cs: Create our own emit context during the Definition
12615 stage, so that constants are evaluated in the proper context, when
12616 a recursive definition happens.
12618 2003-05-11 Martin Baulig <martin@ximian.com>
12620 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12621 new block for a switch section.
12622 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12623 the adding/lookup in the switch block. Fixes #39828.
12625 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12627 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12628 functionality: I needed to convert the data after I had performed
12629 the add/sub operation into the operands type size.
12631 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12632 pass the type for the box operation, otherwise the resulting
12633 object would have been of type object.
12635 (BoxedCast): Add constructor to specify the type to box as.
12637 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12639 * iterators.cs: I was reusing the `count' variable inadvertently,
12640 take steps to not allow this to happen.
12642 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12644 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12645 by creating an array at the point where the params starts and
12646 putting all those arguments there, then adjusting the size of the
12649 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12651 * expression.cs (New.AddressOf): Implement interface
12652 IMemoryLocation. This is used when the `new' operator is used in
12653 the context of an invocation to a method on a value type.
12655 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12658 * namespace.cs: Also check the using aliases here.
12660 * driver.cs: Move the test for using validity after the types have
12661 been entered, so we do a single pass that also includes the using
12664 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12665 in the regular case. CreateSiblingForFinally is doing extra
12668 * attribute.cs (GetAttributeArgumentExpression): Store the result
12669 on an out value, and use the return value to indicate failure
12670 instead of using null (which is a valid return for Constant.GetValue).
12672 * statement.cs: Perform the analysis flow for the increment
12673 portion after the statement, because this will be the real flow of
12674 execution. Fixes #42385
12676 * codegen.cs (EmitContext.EmitArgument,
12677 EmitContext.EmitStoreArgument): New helper functions when the
12678 RemapToProxy flag is set.
12680 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12683 Add support for remapping parameters.
12685 * iterators.cs: Propagate parameter values; Store parameter
12686 values in the proxy classes.
12688 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12690 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12691 need a proxy reference; I do not know what I was thinking
12693 * cs-parser.jay (constructor_initializer): catch another error,
12694 and display nice message.
12696 (field_declaration): catch void field declaration
12697 to flag a better error.
12699 * class.cs (MemberBase.CheckBase): Report an error instead of a
12700 warning if a new protected member is declared in a struct.
12701 (Field.Define): catch the error of readonly/volatile.
12703 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12705 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12706 volatile variable is taken
12708 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12710 * statement.cs (Fixed.Resolve): Report an error if we are not in
12713 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12715 * typemanager.cs: reuse the code that handles type clashes for
12716 delegates and enumerations.
12718 * class.cs (Report28): Always report.
12720 * expression.cs (EncodeAsAttribute): Allow nulls here.
12722 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12724 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12725 the functionality for testing whether an expression is valid for
12726 an attribute here. Also handle the case of arrays of elements
12729 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12730 encoding a linear array into an array of objects that are suitable
12731 to be passed to an CustomAttributeBuilder.
12733 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12735 * ecore.cs: (FieldExpr): Handle field remapping here.
12737 * iteratators.cs: Pass the instance variable (if the method is an
12738 instance method) to the constructors, so we can access the field
12739 variables on the class.
12741 TODO: Test this with structs. I think the THIS variable on
12742 structs might have to be a pointer, and not a refenrece
12744 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12746 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12747 local variables to fields in a proxy class.
12749 * iterators.cs (PopulateProxy): Rename our internal fields to
12751 Create a <THIS> field if we are an instance method, so we can
12752 reference our parent container variables.
12753 (MapVariable): Called back from the EmitContext code to enter a
12754 new variable to field mapping into the proxy class (we just create
12758 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12759 for using the remapped locals to fields.
12761 I placed the code here, because that gives the same semantics to
12762 local variables, and only changes the Emit code.
12764 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12765 statements inside iterators.
12766 (VariableInfo): Add a FieldBuilder for the cases when we are
12767 remapping local variables to fields in a proxy class
12769 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12770 current_block != null.
12772 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12773 not cope with strings, as it has been moved to the
12774 TableSwitchEmit. Fixed bug in switch generation.
12776 * expression.cs (New.DoResolve): Provide more context for the user
12777 when reporting an error.
12779 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12782 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12783 check the permissions for it. Note than in a type-resolution
12784 context the check was already present in DeclSpace.ResolveType,
12785 but was missing from the MemberAccess.
12787 (ArrayCreation.CheckIndices): warn if the user has
12788 more nested levels of expressions, but there are no more
12789 dimensions specified. Avoids crash on bug 41906.
12791 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12793 * statement.cs (Block): replace Implicit bool, for a generic
12795 New flag: `Unchecked'. This is used during the EmitMeta phase
12796 (which is out-of-line with the regular Resolve/Emit process for a
12797 statement, as this is done ahead of time, but still gets a chance
12798 to call constant resolve).
12800 (Block.Flags): new enum for adding a new flag.
12802 (Block.EmitMeta): track the state of unchecked.
12804 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12805 to enable constant resolution to work there as well.
12807 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12809 * typemanager.cs (ienumerable_type): Also look up
12810 System.Collections.IEnumerable.
12812 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12814 TODO: Test more than one conditional per method.
12816 * class.cs (Indexer.Define): Report the location where the user is
12817 referencing the unsupported feature.
12819 (MethodData): Overload the use of `conditionals' to
12820 minimize the creation of needless ArrayLists. This saves roughly
12821 212kb on my machine.
12823 (Method): Implement the new IIteratorContainer interface.
12824 (Method.SetYields): Implement the method by setting the ModFlags
12825 to contain METHOD_YIELDS.
12827 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12828 which just got set to null.
12830 * iterators.cs: New file.
12832 (Yield, YieldBreak): New statements.
12834 * statement.cs (Return.Resolve): Flag an error if we are used in
12835 an iterator method.
12837 * codegen.cs (InIterator): New flag set if the code is being
12838 compiled in an iterator method.
12840 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12841 internal modifier, and we just use it to avoid adding extra
12842 fields, as this is seldom used.
12844 * cs-parser.jay: Add yield_statement (yield and yield break).
12846 * driver.cs: New flag -v2 to turn on version 2 features.
12848 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12849 hashtable when v2 is enabled.
12851 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12853 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12854 there is already a namespace defined with this name.
12856 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12857 people upgraded their corlibs.
12859 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12860 always use fully qualified types, no need to use the compiler
12863 (TypeManager.IsNamespace): Use binarysearch.
12865 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12866 AddDelegate): I did not quite use the new IsValid API properly: I
12867 have to pass the short-name and the fullname. I was passing only
12868 the basename instead of the fullname sometimes.
12870 (TypeContainer.DefineType): call NamespaceClash.
12872 * interface.cs (Interface.DefineType): use NamespaceClash before
12875 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12878 * enum.cs: (Enum.DefineType): use NamespaceClash before
12881 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12882 speed increase. First, use the negative_hits cache when we get a
12883 negative. Second, add the type with its full original name
12884 instead of the new . and + encoded name (reflection uses + to
12885 separate type from a nested type). Use LookupTypeReflection
12886 directly which bypasses the type->name hashtable (that we already
12887 know does not contain the type.
12889 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12890 location/container type.
12892 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12894 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12896 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12898 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12899 method is being referenced in the method group from a static
12900 context, and report error 120 if so.
12902 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12905 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12906 is created, we create the A namespace).
12908 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12911 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12913 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12914 invocation to ModuleBuilder.GetType with the same values will
12915 return a new type instance, so we need to cache its return
12918 * expression.cs (Binary.ResolveOperator): Only allow the compare
12919 operators on enums if they are of the same type.
12921 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12922 types of ValueType on their own case. Before we were giving them
12923 the same treatment as objects.
12925 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12926 fullname. Short name is used to compare against container name.
12927 Fullname is used to check against defined namespace names.
12929 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12930 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12932 (Method.CheckBase): Call parent.
12933 (MemberBase.CheckBase): Check for protected members on sealed
12935 (PropertyBase.CheckBase): Call parent.
12936 (Field.Define): Call parent.
12938 * report.cs: Negative error codes are now mapped to 8000 - code,
12939 so that the display is render more nicely.
12941 * typemanager.cs: Do not use try/catch, instead report a regular
12944 (GetPointerType, GetReferenceType): These methods provide
12945 mechanisms to obtain the T* and T& from a T. We had the code
12946 previously scattered around the code base, and it also used
12947 TypeManager.LookupType that would go through plenty of caches.
12948 This one goes directly to the type source.
12950 In some places we did the Type.GetType followed by
12951 ModuleBuilder.GetType, but not in others, so this unifies the
12952 processing as well.
12954 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12955 statements now that we have namespace information.
12957 * typemanager.cs (IsNamespace): New method, returns whether the
12958 string presented is a namespace or not.
12960 (ComputeNamespaces): New public entry point, computes the list of
12961 available namespaces, using the GetNamespaces API call in Mono, or
12962 the slower version in MS.NET.
12964 Now before we start the semantic analysis phase, we have a
12965 complete list of namespaces including everything that the user has
12968 Deleted old code to cache namespaces in .nsc files.
12970 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12972 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12973 class/struct location definition Location for the implicit
12974 constructor location.
12976 (Operator.Define): Use the location of the operator for the
12977 implicit Method definition.
12979 (Constructor.Emit): use the constructor location for the implicit
12980 base initializer constructor.
12982 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12983 and the Expression class now contains two new methods:
12985 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12986 isolate type lookup from the rest of the resolution process.
12988 Since we use Expressions to hold type definitions due to the way
12989 we parse the input we have historically overloaded Resolve to
12990 perform the Type lookups if a special flag is passed. Now this is
12991 eliminated and two methods take their place.
12993 The differences in the two methods between xStep and xTerminal is
12994 that xStep is involved in our current lookup system that uses
12995 SimpleNames to compose a name, while xTerminal is used just to
12996 catch the case where the simplename lookup failed.
12998 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13000 * expression.cs (ResolveMemberAccess): Remove redundant code.
13001 TypeExpr expressions are always born fully resolved.
13003 * interface.cs (PopulateMethod): Do not lookup the types twice.
13004 We were doing it once during SemanticAnalysis and once during
13007 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13008 in local variable type definitions, were being returned as a
13009 SimpleName (we decomposed everything into a string), that is
13010 because primary_expression was being used instead of a type in the
13011 grammar (reduce/reduce conflicts).
13013 The part that was wrong is that we converted the expression into a
13014 string (an oversimplification in one hand, compounded with primary
13015 expressions doing string concatenation).
13021 Would return "A.B.C[]" as a SimpleName. This stopped things like
13022 using clauses from working on this particular context. And a type
13023 was being matched directly against "A.B.C[]".
13025 We now use the correct approach, and allow for ComposedCast to be
13026 part of the unary expression. So the "A.B.C []" become a composed
13027 cast of "A.B.C" (as a nested group of MemberAccess with a
13028 SimpleName at the end) plus the rank composition "[]".
13032 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13034 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13035 for the access level checking.
13037 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13038 `TypeContainer container', because I kept getting confused when I
13039 was debugging this code.
13041 * expression.cs (Indexers): Instead of tracking getters/setters,
13042 we now track them in parallel. We create one arraylist less, but
13043 most importantly it is possible now for the LValue code to find a
13044 matching get for a set.
13046 (IndexerAccess.DoResolveLValue): Update the code.
13047 GetIndexersForType has been modified already to extract all the
13048 indexers from a type. The code assumed it did not.
13050 Also make the code set the correct return type for the indexer.
13051 This was fixed a long time ago for properties, but was missing for
13052 indexers. It used to be void_type.
13054 (Binary.Emit): Test first for doubles instead of
13055 floats, as they are more common.
13057 (Binary.EmitBranchable): Use the .un version of the branch opcodes
13058 when dealing with floats and the <=, >= operators. This fixes bug
13061 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13062 to load the array value by emitting a load on the foreach variable
13063 type. This was incorrect.
13065 We now emit the code to load an element using the the array
13066 variable type, and then we emit the conversion operator.
13070 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
13072 * attribute.cs: Avoid allocation of ArrayLists in the common case.
13074 2003-04-09 Miguel de Icaza <miguel@ximian.com>
13076 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13077 test for protection before we test for signatures.
13079 (MethodSignature.ToString): implement.
13081 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13082 to the case where we reduced into a LongConstant.
13084 * decl.cs (CheckAccessLevel): If the type is an array, we can not
13085 depend on whether the information is acurrate, because the
13086 Microsoft runtime will always claim that the array type is public,
13087 regardless of the real state.
13089 If the type is a pointer, another problem happens: the type is
13090 reported as non-public in Microsoft.
13092 In both cases we have to call CheckAccessLevel recursively with
13093 the underlying type as the argument to be tested.
13095 2003-04-08 Miguel de Icaza <miguel@ximian.com>
13097 * assign.cs (Assign.Emit): If we are dealing with a compound
13098 assignment expression, we should use the code path that stores the
13099 intermediate result in a temporary value. This fixes #40903.
13101 *expression.cs (Indirection.ToString): Provide ToString method for
13104 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
13106 * class.cs: Null out fields holding references to Block objects so
13107 they can be garbage collected.
13109 * expression.cs (OverloadResolve): Remove unused local.
13111 2003-04-07 Martin Baulig <martin@ximian.com>
13113 * codegen.cs (EmitContext.CurrentFile): New public field.
13114 (EmitContext.Mark): Use the CurrentFile to check whether the
13115 location is in the correct file.
13116 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13118 2003-04-07 Martin Baulig <martin@ximian.com>
13120 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13122 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13123 location. [FIXME: The location argument which gets passed to this
13124 method is sometimes wrong!]
13126 2003-04-07 Nick Drochak <ndrochak@gol.com>
13128 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13130 2003-04-07 Miguel de Icaza <miguel@ximian.com>
13132 * expression.cs (Indirection.EmitAssign): We were using the
13133 temporary, but returning immediately instead of continuing the
13136 2003-04-06 Martin Baulig <martin@ximian.com>
13138 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13139 if it's a nested child, but also deriving from the outer class.
13142 * typemanager.cs (IsNestedChildOf): Make this work if it's a
13143 nested child, but also deriving from the outer class. See
13145 (FilterWithClosure): We may access private members of the outer
13146 class if we're a nested child and deriving from the outer class.
13147 (RealMemberLookup): Only set `closure_private_ok' if the
13148 `original_bf' contained BindingFlags.NonPublic.
13150 2003-04-05 Martin Baulig <martin@ximian.com>
13152 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13154 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13156 * class.cs (Event.Define): Do not allow abstract events to have
13159 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13161 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13162 block in event declarations.
13164 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13165 value type, get its address.
13167 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13168 leaving a class on the stack instead of a boolean value (int
13169 0/1). Change the code so we compare against null, and then the
13170 result against zero.
13172 * class.cs (TypeContainer.GetClassBases): We were checking for the
13173 parent class being sealed too late.
13175 * expression.cs (Binary.Emit): For <= and >= when dealing with
13176 floating point values, use cgt.un and clt.un instead of cgt and
13179 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13181 * statement.cs: Apply the same optimization as MS: skip the
13182 GetEnumerator returning an IEnumerator, and use the one returning a
13183 CharEnumerator instead. This allows us to avoid the try-finally block
13186 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13188 * cs-parser.jay: Attributes cannot be applied to
13189 namespaces. Fixes #40473
13191 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13194 (Add*): check if the name is valid using the full name for constants,
13195 fields, properties and events.
13197 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13199 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13200 char constants to be part of the enumeration.
13202 * expression.cs (Conditional.DoResolve): Add support for operator
13203 true. Implements the missing functionality from 14.12
13205 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13206 operator true/false as required by the spec.
13208 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13209 implicit conversion to boolean.
13211 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13212 also one where the type implements `operator true'.
13214 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13215 get an expression that will invoke operator true based on an
13218 (GetConversionOperators): Removed the hack that called op_True
13221 (Expression.ResolveBoolean): Move this from Statement.
13223 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13225 * ecore.cs (FieldExpr): do not allow initialization of initonly
13226 fields on derived classes
13228 2003-03-13 Martin Baulig <martin@ximian.com>
13230 * statement.cs (Block.Emit): Call ig.BeginScope() and
13231 ig.EndScope() when compiling with debugging info; call
13232 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13234 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13236 * expression.cs (Indexers): Do not construct immediately, allow
13237 for new members to be appended as we go. Fixes 38143
13239 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13241 * expression.cs: save/restore context when resolving an unchecked
13244 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13246 * cfold.cs: Catch division by zero in modulus operator during
13249 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13251 * interface.cs (Interface.DefineMembers): Avoid defining members
13254 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13256 * driver.cs: handle the +/- options for -noconfig
13258 * statement.cs (Unckeched.Resolve): Also track the state of
13259 unchecked in the Resolve phase.
13261 2003-02-27 Martin Baulig <martin@ximian.com>
13263 * ecore.cs (Expression.MemberLookup): Don't create a
13264 MethodGroupExpr for something which is not a method. Fixes #38291.
13266 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13268 * class.cs (MemberBase.CheckParameters): Also check that the type
13269 is unmanaged if it is a pointer.
13271 * expression.cs (SizeOf.Resolve): Add location information.
13273 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13274 a managed type is declared.
13276 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13277 parameter modifiers as well. Fixes bug 38606
13279 * class.cs: Very sad. Am backing out the speed up changes
13280 introduced by the ArrayList -> Array in the TypeContainer, as they
13281 were not actually that much faster, and introduced a bug (no error
13282 reports on duplicated methods).
13284 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13285 source first, this will guarantee that we have a valid expression
13286 before calling in lower levels functions that will require a
13287 resolved object. Then use this original_source in the
13288 target.ResolveLValue instead of the original source that was
13291 Another change. Use target.Resolve instead of LValueResolve.
13292 Although we are resolving for LValues, we will let the Assign code
13293 take care of that (it will be called again from Resolve). This
13294 basically allows code like this:
13296 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13297 class Y { void A (X x) { x [0] += o; }
13299 The problem was that the indexer was trying to resolve for
13300 set_Item (idx, object o) and never finding one. The real set_Item
13301 was set_Item (idx, X). By delaying the process we get the right
13306 2003-02-23 Martin Baulig <martin@ximian.com>
13308 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13309 while calling DoEmit ().
13311 * codegen.cs (EmitContext.Mark): Don't mark locations in other
13312 source files; if you use the #line directive inside a method, the
13313 compiler stops emitting line numbers for the debugger until it
13314 reaches the end of the method or another #line directive which
13315 restores the original file.
13317 2003-02-23 Martin Baulig <martin@ximian.com>
13319 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13321 2003-02-23 Martin Baulig <martin@ximian.com>
13323 * statement.cs (Block.AddChildVariableNames): We need to call this
13324 recursively, not just for our immediate children.
13326 2003-02-23 Martin Baulig <martin@ximian.com>
13328 * class.cs (Event.Define): Always make the field private, like csc does.
13330 * typemanager.cs (TypeManager.RealMemberLookup): Make events
13331 actually work, fixes bug #37521.
13333 2003-02-23 Miguel de Icaza <miguel@ximian.com>
13335 * delegate.cs: When creating the various temporary "Parameters"
13336 classes, make sure that we call the ComputeAndDefineParameterTypes
13337 on those new parameters (just like we do with the formal ones), to
13338 allow them to be resolved in the context of the DeclSpace.
13340 This fixes the bug that Dick observed in Bugzilla #38530.
13342 2003-02-22 Miguel de Icaza <miguel@ximian.com>
13344 * expression.cs (ResolveMemberAccess): When resolving a constant,
13345 do not attempt to pull a constant if the value was not able to
13346 generate a valid constant.
13348 * const.cs (LookupConstantValue): Do not report more errors than required.
13350 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13352 * expression.cs: fixes bug #38328.
13354 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13356 * class.cs: Changed all the various members that can be part of a
13357 class from being an ArrayList to be an Array of the right type.
13358 During the DefineType type_list, interface_list, delegate_list and
13359 enum_list are turned into types, interfaces, delegates and enums
13362 And during the member population, indexer_list, event_list,
13363 constant_list, field_list, instance_constructor_list, method_list,
13364 operator_list and property_list are turned into their real arrays.
13366 Although we could probably perform this operation earlier, for
13367 good error reporting we need to keep the lists and remove the
13368 lists for longer than required.
13370 This optimization was triggered by Paolo profiling the compiler
13371 speed on the output of `gen-sample-program.pl' perl script.
13373 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13374 not crash in methods like MemberLookupFailed that use this field.
13376 This problem arises when the compiler fails to resolve a type
13377 during interface type definition for example.
13379 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13381 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13382 inherit from System.Object, so we have to stop at null, not only
13383 when reaching System.Object.
13385 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13387 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13388 DeclaredOnly because the parent indexer might have had a different
13389 name, but did not loop until the top of the hierarchy was reached.
13391 The problem this one fixes is 35492: when a class implemented an
13392 indexer from an interface, we were getting the interface method
13393 (which was abstract) and we were flagging an error (can not invoke
13396 This also keeps bug 33089 functioning, and test-148 functioning.
13398 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13399 out if a method is special is to see if it is declared in a
13400 property or event, or whether it is one of the predefined operator
13401 names. This should fix correctly #36804.
13403 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13405 The goal here is to remove the dependency on EmptyCast.Peel ().
13406 Killing it completely.
13408 The problem is that currently in a number of places where
13409 constants are expected, we have to "probe" for an EmptyCast, and
13410 Peel, which is not the correct thing to do, as this will be
13411 repetitive and will likely lead to errors.
13413 The idea is to remove any EmptyCasts that are used in casts that
13414 can be reduced to constants, so we only have to cope with
13417 This bug hunt was triggered by Bug 37363 and the desire to remove
13418 the duplicate pattern where we were "peeling" emptycasts to check
13419 whether they were constants. Now constants will always be
13422 * ecore.cs: Use an enumconstant here instead of wrapping with
13425 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13426 throwing me off. By handling this we can get rid of a few hacks.
13428 * statement.cs (Switch): Removed Peel() code.
13430 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13432 * class.cs: Location information for error 508
13434 * expression.cs (New.DoResolve): Add a guard against double
13435 resolution of an expression.
13437 The New DoResolve might be called twice when initializing field
13438 expressions (see EmitFieldInitializers, the call to
13439 GetInitializerExpression will perform a resolve on the expression,
13440 and later the assign will trigger another resolution
13442 This leads to bugs (#37014)
13444 * delegate.cs: The signature for EndInvoke should contain any ref
13445 or out parameters as well. We were not doing this in the past.
13447 * class.cs (Field.Define): Do not overwrite the type definition
13448 inside the `volatile' group. Turns out that volatile enumerations
13449 were changing the type here to perform a validity test, which
13452 2003-02-12 Miguel de Icaza <miguel@ximian.com>
13454 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13455 and structs, we do not want to load the instance variable
13457 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13458 enum_type has to be handled like an object reference (implicit
13459 conversions exists from this to object), but the regular IsClass
13460 and IsValueType tests will never return true for this one.
13462 Also we use TypeManager.IsValueType instead of type.IsValueType,
13463 just for consistency with the rest of the code (this is only
13464 needed if we ever use the construct exposed by test-180.cs inside
13465 corlib, which we dont today).
13467 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
13469 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13472 2003-02-09 Martin Baulig <martin@ximian.com>
13474 * namespace.cs (Namespace..ctor): Added SourceFile argument.
13475 (Namespace.DefineNamespaces): New static public method; this is
13476 called when we're compiling with debugging to add all namespaces
13477 to the symbol file.
13479 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13480 pass it to the Namespace's .ctor.
13482 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13483 and MethodBase arguments; pass the namespace ID to the symwriter;
13484 pass the MethodBase instead of the token to the symwriter.
13485 (SymbolWriter.DefineNamespace): New method to add a namespace to
13488 2003-02-09 Martin Baulig <martin@ximian.com>
13490 * symbolwriter.cs: New file. This is a wrapper around
13491 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
13492 methods here in near future.
13494 2003-02-09 Martin Baulig <martin@ximian.com>
13496 * codegen.cs (EmitContext.Mark): Just pass the arguments to
13497 ILGenerator.MarkSequencePoint() which are actually used by the
13500 2003-02-09 Martin Baulig <martin@ximian.com>
13502 * location.cs (SourceFile): New public sealed class. This
13503 contains the name and an index which is used in the location's token.
13504 (Location): Reserve an appropriate number of bits in the token for
13505 the source file instead of walking over that list, this gives us a
13506 really huge performance improvement when compiling with debugging.
13508 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13509 `SourceFile' argument instead of a string.
13510 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13511 but don't parse/tokenize here, we need to generate the list of all
13512 source files before we do that.
13513 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13516 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13517 instead of a string.
13519 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13522 2003-02-09 Martin Baulig <martin@ximian.com>
13524 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13525 filename on `#line default'.
13527 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13529 * statement.cs: don't clear the pinned var when the fixed statement
13530 returns from the method (fixes bug#37752).
13532 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13534 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13537 2003-02-07 Martin Baulig <martin@ximian.com>
13539 * driver.cs: Removed the `--debug-args' command line argument.
13541 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13542 automatically by the AsssemblyBuilder.
13543 (CodeGen.InitializeSymbolWriter): We don't need to call any
13544 initialization function on the symbol writer anymore. This method
13545 doesn't take any arguments.
13547 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13549 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13550 from referenced assemblies as well.
13552 2003-02-02 Martin Baulig <martin@ximian.com>
13554 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13556 2003-02-02 Martin Baulig <martin@ximian.com>
13558 * class.cs (Constructor.Emit): Open the symbol writer before
13559 emitting the constructor initializer.
13560 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13561 single-stepping through constructor initializers.
13563 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13565 * class.cs: Handle error 549: do not allow virtual methods in
13568 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13570 * decl.cs: Check access levels when resolving types
13572 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13574 * statement.cs: Add parameters and locals set in catch blocks that might
13575 return to set vector
13577 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13579 * class.cs (Operator): Set the SpecialName flags for operators.
13581 * expression.cs (Invocation.DoResolve): Only block calls to
13582 accessors and operators on SpecialName methods.
13584 (Cast.TryReduce): Handle conversions from char constants.
13587 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13589 * statement.cs: small memory and time optimization in FlowBranching.
13591 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13593 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13594 problem that the last fix but in the other sid (Set).
13596 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13597 access when there is no indexer in the hierarchy.
13599 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13601 * class.cs: Combine some if statements.
13603 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13605 * driver.cs: fixed bug #37187.
13607 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13609 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13610 any indexer, it's needed to build a list with all the indexers in the
13611 hierarchy (AllGetters), else we have problems. Fixes #35653.
13613 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13615 * class.cs (MethodData.Define): It is wrong for an interface
13616 implementation to be static in both cases: explicit and implicit.
13617 We were only handling this in one case.
13619 Improve the if situation there to not have negations.
13621 * class.cs (Field.Define): Turns out that we do not need to check
13622 the unsafe bit on field definition, only on usage. Remove the test.
13624 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13626 * driver.cs: use assembly.Location instead of Codebase (the latest
13627 patch made mcs fail when using MS assemblies).
13629 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13631 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13632 get the path to *corlib.dll.
13634 2003-01-21 Nick Drochak <ndrochak@gol.com>
13638 * typemanager.cs: Remove compiler warnings
13640 2003-01-20 Duncan Mak <duncan@ximian.com>
13642 * AssemblyInfo.cs: Bump the version number to 0.19.
13644 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13646 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13648 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13650 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13652 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13654 * cs-parser.jay: Small fix: we were not comparing the constructor
13655 name correctly. Thanks to Zoltan for the initial pointer.
13657 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13659 * cs-tokenizer.cs: Set file name when specified with #line
13661 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13663 * cs-parser.jay: Only perform the constructor checks here if we
13664 are named like the class; This will help provider a better
13665 error. The constructor path is taken when a type definition is
13666 not found, but most likely the user forgot to add the type, so
13667 report that rather than the constructor error.
13669 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13671 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13674 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13676 * cs-parser.jay: Add cleanup call.
13678 2003-01-13 Duncan Mak <duncan@ximian.com>
13680 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13681 consistent with other methods.
13683 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13685 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13687 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13689 * attribute.cs: only set GuidAttr to true when we have a
13692 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13696 * typemanager.cs: fixes to allow mcs compile corlib with the new
13697 Type.IsSubclassOf fix.
13699 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13701 * expression.cs (LocalVariableReference.DoResolve): Classify a
13702 constant as a value, not as a variable. Also, set the type for
13705 * cs-parser.jay (fixed_statement): take a type instead of a
13706 pointer_type, so we can produce a better error message later.
13708 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13711 (For.DoEmit): Make inifinite loops have a
13712 non-conditional branch back.
13714 (Fixed.DoEmit): First populate the pinned variables, then emit the
13715 statement, then clear the variables. Before I was emitting the
13716 code once for each fixed piece.
13719 2003-01-08 Martin Baulig <martin@ximian.com>
13721 * statement.cs (FlowBranching.MergeChild): A break in a
13722 SWITCH_SECTION does not leave a loop. Fixes #36155.
13724 2003-01-08 Martin Baulig <martin@ximian.com>
13726 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13727 lives in the same number space than `param_map'. Fixes #36154.
13729 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13731 * cs-parser.jay (constructor_declaration): Set the
13732 Constructor.ModFlags before probing for it. This makes the
13733 compiler report 514, 515 and 132 (the code was there, but got
13736 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13737 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13738 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13740 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13742 * enum.cs: create the enum static fields using the enum type.
13744 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13746 * class.cs: don't try to create the ParamBuilder for the return
13747 type if it's not needed (and handle it breaking for the ms runtime
13750 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13752 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13754 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13756 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13757 the command. This showed up while compiling the JANET source
13758 code, which used \r as its only newline separator.
13760 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13762 * class.cs (Method.Define): If we are an operator (because it
13763 reuses our code), then set the SpecialName and HideBySig. #36128
13765 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13767 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13768 exception, report error 120 `object reference required'.
13770 * driver.cs: Add --pause option, used during to measure the size
13771 of the process as it goes with --timestamp.
13773 * expression.cs (Invocation.DoResolve): Do not allow methods with
13774 SpecialName to be invoked.
13776 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13778 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13779 number before adding it.
13781 2002-12-21 Ravi Pratap <ravi@ximian.com>
13783 * ecore.cs (StandardImplicitConversion): When in an unsafe
13784 context, we allow conversion between void * to any other pointer
13785 type. This fixes bug #35973.
13787 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13789 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13790 is not thrown when extensionless outputs are used
13792 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13794 * rootcontext.cs: fixed compilation of corlib.
13796 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13798 * attribute.cs (Attributes.Contains): Add new method.
13800 * class.cs (MethodCore.LabelParameters): if the parameter is an
13801 `out' parameter, check that no attribute `[In]' has been passed.
13803 * enum.cs: Handle the `value__' name in an enumeration.
13805 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13807 * decl.cs: Added special case to allow overrides on "protected
13810 2002-12-18 Ravi Pratap <ravi@ximian.com>
13812 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13813 since it makes much more sense.
13815 (Attributes.ctor): Don't require a Location parameter.
13817 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13819 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13820 since we already have that information per attribute.
13822 * everywhere : make appropriate changes.
13824 * class.cs (LabelParameters): Write the code which actually
13825 applies attributes to the return type. We can't do this on the MS
13826 .NET runtime so we flag a warning in the case an exception is
13829 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13831 * const.cs: Handle implicit null conversions here too.
13833 2002-12-17 Ravi Pratap <ravi@ximian.com>
13835 * class.cs (MethodCore.LabelParameters): Remove the extra
13836 Type [] parameter since it is completely unnecessary. Instead
13837 pass in the method's attributes so that we can extract
13838 the "return" attribute.
13840 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13842 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13843 of ignoring it and letting the compile continue.
13845 * typemanager.cs (ChangeType): use an extra argument to return an
13846 error condition instead of throwing an exception.
13848 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13850 * expression.cs (Unary.TryReduce): mimic the code for the regular
13851 code path. Perform an implicit cast in the cases where we can
13852 implicitly convert to one of the integral types, and then reduce
13853 based on that constant. This fixes bug #35483.
13855 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13857 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13859 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13861 * namespace.cs: fixed bug #35489.
13863 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13865 * class.cs: Remove some dead code.
13867 * cs-parser.jay: Estimate the number of methods needed
13868 (RootContext.MethodCount);
13870 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13871 numbers instead of StringBuilders.
13873 * support.cs (PtrHashtable): Add constructor with initial size;
13874 We can now reduce reallocations of the method table.
13876 2002-12-10 Ravi Pratap <ravi@ximian.com>
13878 * attribute.cs (ApplyAttributes): Keep track of the emitted
13879 attributes on a per-target basis. This fixes bug #35413.
13881 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13883 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13884 default to the Windows 1252 encoding.
13886 (UnixParseOption): Support version, thanks to Alp for the missing
13889 * AssemblyInfo.cs: Add nice assembly information.
13891 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13894 * cs-parser.jay: Allow a trailing comma before the close bracked
13895 in the attribute_section production.
13897 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13898 address of the instance was being taken, I will take this out,
13899 because we take the address of the object immediately here.
13901 2002-12-09 Ravi Pratap <ravi@ximian.com>
13903 * typemanager.cs (AreMultipleAllowed): Take care of the most
13904 obvious case where attribute type is not in the current assembly -
13907 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13909 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13910 definitions, instead of doing that afterwards.
13912 Also we use a nice little hack, depending on the constructor, we
13913 know if we are a "composed" name or a simple name. Hence, we
13914 avoid the IndexOf test, and we avoid
13916 * codegen.cs: Add code to assist in a bug reporter to track down
13917 the source of a compiler crash.
13919 2002-12-07 Ravi Pratap <ravi@ximian.com>
13921 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13922 types have been emitted for a given element and flag an error
13923 if something which does not have AllowMultiple set is used more
13926 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13927 attribute types and their corresponding AllowMultiple properties
13929 (AreMultipleAllowed): Check the property for a given type.
13931 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13932 property in the case we have a TypeContainer.
13934 (Attributes.AddAttribute): Detect duplicates and just skip on
13935 adding them. This trivial fix catches a pretty gross error in our
13936 attribute emission - global attributes were being emitted twice!
13938 Bugzilla bug #33187 is now fixed.
13940 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13942 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13943 instead of pp_and).
13945 * expression.cs (Binary.ResolveOperator): I can only use the
13946 Concat (string, string, string) and Concat (string, string,
13947 string, string) if the child is actually a concatenation of
13950 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13952 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13953 context where we need a 2-character lookahead.
13955 * pending.cs (PendingImplementation): Rework so we can keep track
13956 of interface types all the time, and flag those which were
13957 implemented by parents as optional.
13959 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13961 * expression.cs (Binary.ResolveOperator): Use
13962 String.Concat(string,string,string) or
13963 String.Concat(string,string,string,string) when possible.
13965 * typemanager: More helper methods.
13968 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13970 * pending.cs: remove the bogus return from GetMissingInterfaces()
13971 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13973 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13975 * namespace.cs: avoid duplicated 'using xxx' being added to
13976 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13977 when we get more than one 'using' statement for the same namespace.
13978 Report a CS0105 warning for it.
13980 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13982 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13983 of calling getChar/putback, uses internal knowledge of it.
13985 (xtoken): Reorder tokenizer so most common patterns are checked
13986 first. This reduces the compilation time in another 5% (from 8.11s
13987 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13989 The parsing time is 22% of the compilation in mcs, and from that
13990 64% is spent on the tokenization process.
13992 I tried using a binary search for keywords, but this is slower
13993 than the hashtable. Another option would be to do a couple of
13996 * Not use a StringBuilder, instead use an array of chars,
13997 with a set value. Notice that this way we could catch
13998 the 645 error without having to do it *afterwards*.
14000 * We could write a hand-parser to avoid the hashtable
14001 compares altogether.
14003 The identifier consumption process takes 37% of the tokenization
14004 time. Another 15% is spent on is_number. 56% of the time spent
14005 on is_number is spent on Int64.Parse:
14007 * We could probably choose based on the string length to
14008 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14011 Another 3% is spend on wrapping `xtoken' in the `token' function.
14013 Handle 0xa0 as whitespace (#34752)
14015 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14017 * typemanager.cs (IsCLRType): New routine to tell whether a type
14018 is one of the builtin types.
14020 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14021 typecode in more places instead of doing pointer comparissions.
14022 We could leverage some knowledge about the way the typecodes are
14025 New code to cache namespaces in assemblies, it is currently not
14026 invoked, to be used soon.
14028 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14030 * expression.cs (Binary.ResolveOperator): specially handle
14031 strings, and do not perform user-defined operator overloading for
14034 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14036 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14037 internalcall as it is a pretty simple operation; Avoid whenever
14038 possible to call Char.IsLetter.
14040 (consume_identifier): Cut by half the number of
14041 hashtable calls by merging the is_keyword and GetKeyword behavior.
14043 Do not short-circuit, because if we do, we
14044 report errors (ie, #if false && true would produce an invalid
14048 2002-11-24 Martin Baulig <martin@ximian.com>
14050 * expression.cs (Cast.TryReduce): If we're in checked syntax,
14051 check constant ranges and report a CS0221. Fixes #33186.
14053 2002-11-24 Martin Baulig <martin@ximian.com>
14055 * cs-parser.jay: Make this work for uninitialized variable
14056 declarations in the `for' initializer. Fixes #32416.
14058 2002-11-24 Martin Baulig <martin@ximian.com>
14060 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14061 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
14063 2002-11-24 Martin Baulig <martin@ximian.com>
14065 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14066 argument; if true, we also check for user-defined conversions.
14067 This is only needed if both arguments are of a user-defined type.
14068 Fixes #30443, added test-175.cs.
14069 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14071 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14073 2002-11-24 Martin Baulig <martin@ximian.com>
14075 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14076 function to get the store opcode.
14077 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14078 only emit the Ldelema if the store opcode is Stobj. You must run
14079 both test-34 and test-167 to test this. Fixes #34529.
14081 2002-11-23 Martin Baulig <martin@ximian.com>
14083 * ecore.cs (Expression.MemberLookup): Added additional
14084 `qualifier_type' argument which is used when we're being called
14085 from MemberAccess.DoResolve() and null if we're called from a
14087 (Expression.MemberLookupFailed): New method to report errors; this
14088 does the CS1540 check and reports the correct error message.
14090 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14091 argument for the CS1540 check and redone the way how we're dealing
14092 with private members. See the comment in the source code for details.
14093 (FilterWithClosure): Reverted this back to revision 1.197; renamed
14094 `closure_start_type' to `closure_qualifier_type' and check whether
14095 it's not null. It was not this filter being broken, it was just
14096 being called with the wrong arguments.
14098 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14099 and pass it the correct `qualifier_type'; this also does the error
14102 2002-11-22 Miguel de Icaza <miguel@ximian.com>
14104 * expression.cs (Invocation.EmitParams): If the we are dealing
14105 with a non-built-in value type, load its address as well.
14107 (ArrayCreation): Use a a pretty constant instead
14108 of the hardcoded value 2. Use 6 instead of 2 for the number of
14109 static initializers.
14111 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14112 because they are not really value types, just glorified integers.
14114 * driver.cs: Do not append .exe, the CSC compiler does not do it.
14116 * ecore.cs: Remove redundant code for enumerations, make them use
14117 the same code path as everything else, fixes the casting issue
14118 with enumerations in Windows.Forms.
14120 * attribute.cs: Do only cast to string if it is a string, the
14121 validation happens later.
14123 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14124 people upgrade their corlibs.
14126 * ecore.cs: Oops, enumerations were not following the entire code path
14128 2002-11-21 Miguel de Icaza <miguel@ximian.com>
14130 * typemanager.cs (FilterWithClosure): Commented out the test for
14131 1540 in typemanager.cs, as it has problems when accessing
14132 protected methods from a parent class (see test-174.cs).
14134 * attribute.cs (Attribute.ValidateGuid): new method.
14135 (Attribute.Resolve): Use above.
14137 2002-11-19 Miguel de Icaza <miguel@ximian.com>
14139 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14141 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14142 handling for enumerations, as we only needed the TypeContainer
14143 functionality to begin with (this is required for the fix below to
14144 work for enums that reference constants in a container class for
14147 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14149 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14150 a valid TypeBuilder to perform lookups on.o
14152 * class.cs (InheritableMemberSignatureCompare): Use true in the
14153 call to GetGetMethod and GetSetMethod, because we are comparing
14154 the signature, and we need to get the methods *even* if they are
14157 (PropertyBase.CheckBase): ditto.
14159 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14160 GotoCase.Resolve): Use Peel on EmpytCasts.
14162 * ecore.cs (EmptyCast): drop child, add Peel method.
14164 2002-11-17 Martin Baulig <martin@ximian.com>
14166 * ecore.cs (EmptyCast.Child): New public property.
14168 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14169 label resolved to an EmptyCast. Fixes #34162.
14170 (GotoCase.Resolve): Likewise.
14171 (Block.EmitMeta): Likewise.
14173 2002-11-17 Martin Baulig <martin@ximian.com>
14175 * expression.cs (Invocation.BetterConversion): Prefer int over
14176 uint; short over ushort; long over ulong for integer literals.
14177 Use ImplicitConversionExists instead of StandardConversionExists
14178 since we also need to check for user-defined implicit conversions.
14179 Fixes #34165. Added test-173.cs.
14181 2002-11-16 Martin Baulig <martin@ximian.com>
14183 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14184 with the `true' and `false' literals. Fixes #33151.
14186 2002-11-16 Martin Baulig <martin@ximian.com>
14188 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14189 October 22nd; don't do the cs1540 check for static members.
14191 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14192 now using our own filter here and doing the cs1540 check again.
14194 2002-11-16 Martin Baulig <martin@ximian.com>
14196 * support.cs (InternalParameters): Don't crash if we don't have
14197 any fixed parameters. Fixes #33532.
14199 2002-11-16 Martin Baulig <martin@ximian.com>
14201 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14202 when looking up static methods to make this work on Windows.
14205 2002-11-16 Martin Baulig <martin@ximian.com>
14207 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14208 a setter rather than using PropertyInfo.CanWrite.
14210 2002-11-15 Nick Drochak <ndrochak@gol.com>
14212 * class.cs: Allow acces to block member by subclasses. Fixes build
14215 2002-11-14 Martin Baulig <martin@ximian.com>
14217 * class.cs (Constructor.Emit): Added the extern/block check.
14220 2002-11-14 Martin Baulig <martin@ximian.com>
14222 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14223 iteration while looking for indexers, this is needed because the
14224 indexer may have a different name in our base classes. Fixed the
14225 error reporting (no indexers at all, not get accessor, no
14226 overloaded match). Fixes bug #33089.
14227 (IndexerAccess.DoResolveLValue): Likewise.
14229 2002-11-14 Martin Baulig <martin@ximian.com>
14231 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14232 indexers. Fixes the first part of bug #33089.
14233 (MethodSignature.InheritableMemberSignatureCompare): Added support
14236 2002-11-13 Ravi Pratap <ravi@ximian.com>
14238 * attribute.cs (Attribute.Resolve): Catch the
14239 NullReferenceException and report it since it isn't supposed to
14242 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14244 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14245 LogicalOr and LogicalAnd that can benefit from recursively
14246 handling EmitBranchable. The code now should be nice for Paolo.
14248 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14250 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14251 the Type lookups, as we perform quite a number of lookups on
14252 non-Types. This can be removed once we can deterministically tell
14253 whether we have a type or a namespace in advance.
14255 But this might require special hacks from our corlib.
14259 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14260 and double which avoids a conversion from an integer to a double.
14262 * expression.cs: tiny optimization, avoid calling IsConstant,
14263 because it effectively performs the lookup twice.
14265 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14267 But a bogus return here to keep the semantics of the old code
14268 until the Mono runtime is fixed.
14270 * pending.cs (GetMissingInterfaces): New method used to remove all
14271 the interfaces that are already implemented by our parent
14272 classes from the list of pending methods.
14274 * interface.cs: Add checks for calls after ResolveTypeExpr.
14276 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14278 * class.cs (Class.Emit): Report warning 67: event not used if the
14279 warning level is beyond 3.
14281 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14282 being a NullLiteral.
14284 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14287 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14288 path that might fail if a type can not be resolved.
14290 * expression.cs (Binary.Emit): Emit unsigned versions of the
14293 * driver.cs: use error 5.
14295 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14297 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14299 2002-11-01 Miguel de Icaza <miguel@ximian.com>
14301 * cs-parser.jay (switch_section): A beautiful patch from Martin
14302 Baulig that fixed 33094.
14304 2002-10-31 Miguel de Icaza <miguel@ximian.com>
14306 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14307 Check whether the base is abstract and report an error if so.
14309 * expression.cs (IndexerAccess.DoResolveLValue,
14310 IndexerAccess.DoResolve): ditto.
14312 (Invocation.DoResolve): ditto.
14314 (Invocation.FullMethodDesc): Improve the report string.
14316 * statement.cs (Block): Eliminate IsVariableDefined as it is
14317 basically just a wrapper for GetVariableInfo.
14319 * ecore.cs (SimpleName): Use new
14321 * support.cs (ReflectionParamter.ParameterType): We unwrap the
14322 type, as we return the actual parameter ref/unref state on a
14325 2002-10-30 Miguel de Icaza <miguel@ximian.com>
14327 * support.cs: Return proper flags REF/OUT fixing the previous
14330 * expression.cs: Reverted last patch, that was wrong. Is_ref is
14331 not used to mean `ref' but `ref or out' in ParameterReference
14333 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14334 full type signature instead of calling TypeManger.CSharpName
14337 * support.cs (InternalParameters.ParameterDesc): Do not compare
14338 directly to the modflags, because REF/OUT will actually be bitsets
14341 * delegate.cs (VerifyMethod): Check also the modifiers.
14343 * cs-tokenizer.cs: Fix bug where floating point values with an
14344 exponent where a sign was missing was ignored.
14346 * driver.cs: Allow multiple assemblies to be specified in a single
14349 2002-10-28 Miguel de Icaza <miguel@ximian.com>
14351 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
14352 because identifiers after a parenthesis would end up in this kind
14353 of production, and we needed to desamiguate it for having casts
14356 (UserDefinedType *) xxx
14358 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14360 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14361 we should set on the Bindingflags.NonPublic, but not turn on
14362 private_ok. private_ok controls whether a Private member is
14363 returned (this is chekced on the filter routine), while the
14364 BindingFlags.NonPublic just controls whether private/protected
14365 will be allowed. This fixes the problem part of the problem of
14366 private properties being allowed to be used in derived classes.
14368 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14369 so we can call the children DoResolveLValue method (this will
14370 properly signal errors on lvalue assignments to base properties)
14372 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14373 getter are null, and we have a property info, we know that this
14374 happened because the lookup failed, so we report an error 122 for
14375 protection level violation.
14377 We also silently return if setter and getter are null in the
14378 resolve functions, this condition only happens if we have flagged
14379 the error before. This is the other half of the problem.
14381 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14382 not have accessibility information, that is why we were returning
14383 true in the filter function in typemanager.cs.
14385 To properly report 122 (property is inaccessible because of its
14386 protection level) correctly, we report this error in ResolveAccess
14387 by failing if both the setter and the getter are lacking (ie, the
14390 DoResolve and DoLResolve have been modified to check for both
14391 setter/getter being null and returning silently, the reason being
14392 that I did not want to put the knowledge about this error in upper
14395 int old = Report.Errors;
14396 x = new PropertyExpr (...);
14397 if (old != Report.Errors)
14402 So the property expr is returned, but it is invalid, so the error
14403 will be flagged during the resolve process.
14405 * class.cs: Remove InheritablePropertySignatureCompare from the
14406 class, as we no longer depend on the property signature to compute
14407 whether it is possible to implement a method or not.
14409 The reason is that calling PropertyInfo.GetGetMethod will return
14410 null (in .NET, in Mono it works, and we should change this), in
14411 cases where the Get Method does not exist in that particular
14416 class X { public virtual int A { get { return 1; } } }
14418 class Z : Y { public override int A { get { return 2; } } }
14420 Would fail in Z because the parent (Y) would not have the property
14421 defined. So we avoid this completely now (because the alternative
14422 fix was ugly and slow), and we now depend exclusively on the
14425 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14426 reference method, instead of using the property.
14428 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14429 routines are gone now.
14431 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14432 names, they were incorrectly named.
14434 * cs-tokenizer.cs: Return are more gentle token on failure.
14436 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14437 had an out-of-sync index variable, which caused it to remove from
14438 the list of pending methods the wrong method sometimes.
14440 2002-10-22 Miguel de Icaza <miguel@ximian.com>
14442 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14443 CanWrite, because those refer to this particular instance of the
14444 property, and do not take into account the fact that we can
14445 override single members of a property.
14447 Constructor requires an EmitContext. The resolution process does
14448 not happen here, but we need to compute the accessors before,
14449 because the resolution does not always happen for properties.
14451 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14452 subclass, before we did not update this flag, but we did update
14455 (GetAccessors): Drop this routine, as it did not work in the
14456 presence of partially overwritten set/get methods.
14458 Notice that this broke the cs1540 detection, but that will require
14461 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14465 * driver.cs: issue a warning instead of an error if we don't support
14466 debugging for the platform. Also ignore a couple of errors that may
14467 arise when trying to write the symbols. Undo my previous patch.
14469 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14471 * driver.cs: ignore /debug switch except for Unix platforms.
14473 2002-10-23 Nick Drochak <ndrochak@gol.com>
14475 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14477 2002-10-21 Miguel de Icaza <miguel@ximian.com>
14479 * driver.cs: Do not make mcs-debug conditional, so we do not break
14480 builds that use it.
14482 * statement.cs (UsageVector.MergeChildren): I would like Martin to
14483 review this patch. But basically after all the children variables
14484 have been merged, the value of "Breaks" was not being set to
14485 new_breaks for Switch blocks. I think that it should be set after
14486 it has executed. Currently I set this to the value of new_breaks,
14487 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14488 conservative, but I do not understand this code very well.
14490 I did not break anything in the build, so that is good ;-)
14492 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14494 2002-10-20 Mark Crichton <crichton@gimp.org>
14496 * cfold.cs: Fixed compile blocker. Really fixed it this time.
14498 2002-10-20 Nick Drochak <ndrochak@gol.com>
14500 * cfold.cs: Fixed compile blocker.
14502 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14504 * driver.cs: I was chekcing the key, not the file.
14506 2002-10-19 Ravi Pratap <ravi@ximian.com>
14508 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14509 message that we were generating - we just need to silently return
14512 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14514 * class.cs (Event.Define): Change my previous commit, as this
14515 breaks the debugger. This is a temporary hack, as it seems like
14516 the compiler is generating events incorrectly to begin with.
14518 * expression.cs (Binary.ResolveOperator): Added support for
14519 "U operator - (E x, E y)"
14521 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14524 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14525 init-only variables, but this path did not take into account that
14526 there might be also instance readonly variables. Correct this
14529 This fixes bug 32253
14531 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14534 * driver.cs: Change the extension for modules to `netmodule'
14536 * cs-parser.jay: Improved slightly the location tracking for
14537 the debugger symbols.
14539 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14540 modifiers that were specified instead of the hardcoded value
14541 (FamAndAssem). This was basically ignoring the static modifier,
14542 and others. Fixes 32429.
14544 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14545 fixed a bug in the process (32476)
14547 * expression.cs (ArrayAccess.EmitAssign): Patch from
14548 hwang_rob@yahoo.ca that fixes bug 31834.3
14550 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14552 * driver.cs: Make the module extension .netmodule.
14554 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14556 * driver.cs: Report an error if the resource file is not found
14557 instead of crashing.
14559 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14560 false, like Emit does.
14562 2002-10-16 Nick Drochak <ndrochak@gol.com>
14564 * typemanager.cs: Remove unused private member. Also reported mcs
14565 bug to report this as a warning like csc.
14567 2002-10-15 Martin Baulig <martin@gnome.org>
14569 * statement.cs (Statement.Emit): Made this a virtual method; emits
14570 the line number info and calls DoEmit().
14571 (Statement.DoEmit): New protected abstract method, formerly knows
14572 as Statement.Emit().
14574 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14576 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14578 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14579 have fixed a remaining problem: not every AddXXXX was adding a
14580 fully qualified name.
14582 Now everyone registers a fully qualified name in the DeclSpace as
14583 being defined instead of the partial name.
14585 Downsides: we are slower than we need to be due to the excess
14586 copies and the names being registered this way.
14588 The reason for this is that we currently depend (on the corlib
14589 bootstrap for instance) that types are fully qualified, because
14590 we dump all the types in the namespace, and we should really have
14591 types inserted into the proper namespace, so we can only store the
14592 basenames in the defined_names array.
14594 2002-10-10 Martin Baulig <martin@gnome.org>
14596 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14597 from bug #31834, see the bug report for a testcase which is
14600 2002-10-10 Martin Baulig <martin@gnome.org>
14602 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14603 flow analysis code for this.
14605 * statement.cs (Do, While, For): Tell the flow analysis code about
14607 (FlowBranching.UsageVector): Added support for infinite loops.
14608 (Block.Resolve): Moved the dead code elimination here and use flow
14611 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14613 * class.cs (Field.Define): Catch cycles on struct type
14616 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14617 fields if the fields are static. We only need to check instance
14620 * expression.cs (As.DoResolve): Test for reference type.
14622 * statement.cs (Using.ResolveExpression): Use
14623 ConvertImplicitRequired, not ConvertImplicit which reports an
14625 (Using.ResolveLocalVariableDecls): ditto.
14627 * expression.cs (Binary.ResolveOperator): Report errors in a few
14628 places where we had to.
14630 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14632 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14634 * expression.cs: Use StoreFromPtr instead of extracting the type
14635 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14637 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14638 an enumeration value to a System.Enum, but System.Enum is not a
14639 value type, but an class type, so we need to box.
14641 (Expression.ConvertExplicit): One codepath could return
14642 errors but not flag them. Fix this. Fixes #31853
14644 * parameter.cs (Resolve): Do not allow void as a parameter type.
14646 2002-10-06 Martin Baulig <martin@gnome.org>
14648 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14649 if it's a class type and not a struct. Fixes #31815.
14651 2002-10-06 Martin Baulig <martin@gnome.org>
14653 * statement.cs: Reworked the flow analysis code a bit to make it
14654 usable for dead code elimination.
14656 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14658 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14660 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14662 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14663 to fix the test 165, will investigate deeper.
14665 2002-10-04 Martin Baulig <martin@gnome.org>
14667 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14668 finally blocks actually work.
14669 (Try.Resolve): We don't need to create a sibling for `finally' if
14670 there is no finally block.
14672 2002-10-04 Martin Baulig <martin@gnome.org>
14674 * class.cs (Constructor.Define): The default accessibility for a
14675 non-default constructor is private, not public.
14677 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14679 * class.cs (Constructor): Make AllowedModifiers public, add
14682 * cs-parser.jay: Perform the modifiers test here, as the
14683 constructor for the Constructor class usually receives a zero
14684 because of the way we create it (first we create, later we
14685 customize, and we were never checking the modifiers).
14687 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14688 is a version of LookupTypeReflection that includes the type-name
14689 cache. This can be used as a fast path for functions that know
14690 the fully qualified name and are only calling into *.GetType() to
14691 obtain a composed type.
14693 This is also used by TypeManager.LookupType during its type
14696 (LookupType): We now also track the real type name, as sometimes
14697 we can get a quey for the real type name from things like
14698 ComposedCast. This fixes bug 31422.
14700 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14701 complete type fullname, it does not have to go through the type
14702 resolution system to obtain the composed version of the type (for
14703 obtaining arrays or pointers).
14705 (Conditional.Emit): Use the EmitBoolExpression to
14706 generate nicer code, as requested by Paolo.
14708 (ArrayCreation.CheckIndices): Use the patch from
14709 hwang_rob@yahoo.ca to validate the array initializers.
14711 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14713 * class.cs (ConstructorInitializer.Emit): simplify code by using
14714 Invocation.EmitCall, and at the same time, fix the bugs in calling
14715 parent constructors that took variable arguments.
14717 * ecore.cs (Expression.ConvertNumericExplicit,
14718 Expression.ImplicitNumericConversion): Remove the code that
14719 manually wrapped decimal (InternalTypeConstructor call is now gone
14722 * expression.cs (Cast.TryReduce): Also handle decimal types when
14723 trying to perform a constant fold on the type.
14725 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14727 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14728 that only turned off an error report, and did nothing else.
14730 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14732 * driver.cs: Handle and ignore /fullpaths
14734 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14736 * expression.cs (Binary.ResolveOperator): Catch the case where
14737 DoNumericPromotions returns true,
14739 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14741 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14743 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14746 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14748 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14749 conversion exists, but it is also required that the conversion be
14750 performed. This manifested in "(Type64Enum) 2".
14752 * class.cs (TypeManager.AddMethod): The fix is not to change
14753 AddEnum, because that one was using a fully qualified name (every
14754 DeclSpace derivative does), but to change the AddMethod routine
14755 that was using an un-namespaced name. This now correctly reports
14756 the duplicated name.
14758 Revert patch until I can properly fix it. The issue
14759 is that we have a shared Type space across all namespaces
14760 currently, which is wrong.
14762 Options include making the Namespace a DeclSpace, and merge
14763 current_namespace/current_container in the parser.
14765 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14767 * cs-parser.jay: Improve error reporting when we get a different
14768 kind of expression in local_variable_type and
14769 local_variable_pointer_type.
14771 Propagate this to avoid missleading errors being reported.
14773 * ecore.cs (ImplicitReferenceConversion): treat
14774 TypeManager.value_type as a target just like object_type. As
14779 Is valid, and needs to result in the int 1 being boxed before it
14780 is assigned to the value type v.
14782 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14783 to validate the enumeration name.
14785 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14786 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14787 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14789 * ecore.cs (TryImplicitIntConversion): When doing an
14790 implicit-enumeration-conversion, check if the type is 64-bits and
14791 perform a conversion before passing to EnumConstant.
14793 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14795 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14796 report ambiguous type references. Unlike the MS version, we
14797 report what the ambiguity is. Innovation at work ;-)
14799 (DeclSpace.FindType): Require a location argument to
14800 display when we display an ambiguous error.
14802 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14804 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14806 * expression.cs (EmitDynamicInitializers): Apply patch from
14807 hwang_rob@yahoo.ca that fixes the order in which we emit our
14810 2002-09-21 Martin Baulig <martin@gnome.org>
14812 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14813 delegate takes no arguments.
14815 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14817 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14820 * expression.cs: Extract the underlying type.
14822 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14824 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14826 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14828 * class.cs (TypeContainer.DefineType): We can not use the nice
14829 PackingSize with the size set to 1 DefineType method, because it
14830 will not allow us to define the interfaces that the struct
14833 This completes the fixing of bug 27287
14835 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14836 means also structs. This fixes part of the problem.
14837 (Expresion.ImplicitReferenceConversionExists): ditto.
14839 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14840 error if there were no errors reported during the type lookup
14841 process, to avoid duplicates or redundant errors. Without this
14842 you would get an ambiguous errors plus a type not found. We have
14843 beaten the user enough with the first error.
14845 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14848 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14849 during the resolution process, stop the lookup, this avoids
14850 repeated error reports (same error twice).
14852 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14854 * typemanager.cs (LookupType): Redo the type lookup code to match
14855 the needs of System.Reflection.
14857 The issue is that System.Reflection requires references to nested
14858 types to begin with a "+" sign instead of a dot. So toplevel
14859 types look like: "NameSpace.TopLevelClass", and nested ones look
14860 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14863 2002-09-19 Martin Baulig <martin@gnome.org>
14865 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14866 says that a method always returns or always throws an exception,
14867 don't report the CS0161.
14869 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14870 set `Returns = new_returns'.
14872 2002-09-19 Martin Baulig <martin@gnome.org>
14874 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14875 to an enum constant, check for a CS0176.
14877 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14879 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14880 for operators that must be in pairs and report errors.
14882 * ecore.cs (SimpleName.DoResolveType): During the initial type
14883 resolution process, when we define types recursively, we must
14884 check first for types in our current scope before we perform
14885 lookups in the enclosing scopes.
14887 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14889 (Invocation.VerifyArgumentsCompat): Call
14890 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14891 I thought we were supposed to always call this, but there are a
14892 few places in the code where we dont do it.
14894 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14896 * driver.cs: Add support in -linkres and -resource to specify the
14897 name of the identifier.
14899 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14901 * ecore.cs (StandardConversionExists): Sync with the conversion
14902 code: allow anything-* to void* conversions.
14904 (FindMostSpecificSource): Use an Expression argument
14905 instead of a Type, because we might be handed over a Literal which
14906 gets a few more implicit conversions that plain types do not. So
14907 this information was being lost.
14909 Also, we drop the temporary type-holder expression when not
14912 2002-09-17 Martin Baulig <martin@gnome.org>
14914 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14915 this is an explicit interface implementation.
14917 2002-09-17 Martin Baulig <martin@gnome.org>
14919 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14920 different `IndexerName' attributes.
14922 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14923 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14924 virtual CommonResolve().
14926 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14928 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14929 and convert that to the UnderlyingType.
14931 * statement.cs (Foreach.Resolve): Indexers are just like variables
14932 or PropertyAccesses.
14934 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14935 inside quoted strings, we were not doing this before.
14937 2002-09-16 Martin Baulig <martin@gnome.org>
14939 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14940 resolve it. This is needed for the definite assignment check of the
14941 instance expression, fixes bug #29846.
14942 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14944 2002-09-16 Nick Drochak <ndrochak@gol.com>
14946 * parameter.cs: Fix compile error. Cannot reference static member
14947 from an instance object. Is this an mcs bug?
14949 2002-09-14 Martin Baulig <martin@gnome.org>
14951 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14952 multiple times. Fixes bug #30295, added test-166.cs.
14954 2002-09-14 Martin Baulig <martin@gnome.org>
14956 * statement.cs (Block.Emit): Don't emit unreachable code.
14957 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14958 `break' statements.
14959 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14961 2002-09-14 Martin Baulig <martin@gnome.org>
14963 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14966 2002-09-14 Martin Baulig <martin@gnome.org>
14968 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14969 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14970 be false on the ms runtime.
14972 2002-09-13 Martin Baulig <martin@gnome.org>
14974 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14975 the CS0038 error message.
14977 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14979 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14980 constant inside, return it.
14982 2002-09-12 Martin Baulig <martin@gnome.org>
14984 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14985 implicit conversion can be done between enum types.
14987 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14988 check whether an implicit conversion to the current enum's UnderlyingType
14989 exists and report an error if not.
14991 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14992 without debugging support.
14994 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14995 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14997 2002-09-12 Martin Baulig <martin@gnome.org>
14999 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15001 * ecore.cs (IMemberExpr.DeclaringType): New property.
15002 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15003 nonstatic member of an outer type (CS0038).
15005 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15007 * driver.cs: Activate the using-error detector at warning level
15008 4 (at least for MS-compatible APIs).
15010 * namespace.cs (VerifyUsing): Small buglett fix.
15012 * pending.cs (PendingImplementation): pass the container pointer.
15014 * interface.cs (GetMethods): Allow for recursive definition. Long
15015 term, I would like to move every type to support recursive
15016 definitions, not the current ordering mechanism that we have right
15019 The situation is this: Attributes are handled before interfaces,
15020 so we can apply attributes to interfaces. But some attributes
15021 implement interfaces, we will now handle the simple cases
15022 (recursive definitions will just get an error).
15024 * parameter.cs: Only invalidate types at the end if we fail to
15027 2002-09-09 Martin Baulig <martin@gnome.org>
15029 * ecore.cs (PropertyExpr.Emit): Also check for
15030 TypeManager.system_int_array_get_length so this'll also work when
15031 compiling corlib. Fixes #30003.
15033 2002-09-09 Martin Baulig <martin@gnome.org>
15035 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15036 and throw an exception if we can't get the type's size. Fixed #30040,
15039 2002-09-09 Martin Baulig <martin@gnome.org>
15041 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15043 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15044 context. Fixes bug #30027.
15046 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15047 virtual functions. Fixes bug #30043, added test-164.cs.
15049 2002-09-08 Ravi Pratap <ravi@ximian.com>
15051 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15053 2002-09-08 Nick Drochak <ndrochak@gol.com>
15055 * driver.cs: Use an object to get the windows codepage since it's not a
15058 2002-09-08 Miguel de Icaza <miguel@ximian.com>
15060 * statement.cs (For.Emit): for infinite loops (test == null)
15061 return whether there is a break inside, not always "true".
15063 * namespace.cs (UsingEntry): New struct to hold the name of the
15064 using definition, the location where it is defined, and whether it
15065 has been used in a successful type lookup.
15067 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15072 2002-09-06 Ravi Pratap <ravi@ximian.com>
15074 * attribute.cs : Fix incorrect code which relied on catching
15075 a NullReferenceException to detect a null being passed in
15076 where an object was expected.
15078 2002-09-06 Miguel de Icaza <miguel@ximian.com>
15080 * statement.cs (Try): flag the catch variable as assigned
15082 * expression.cs (Cast): Simplified by using ResolveType instead of
15083 manually resolving.
15085 * statement.cs (Catch): Fix bug by using ResolveType.
15087 2002-09-06 Ravi Pratap <ravi@ximian.com>
15089 * expression.cs (BetterConversion): Special case for when we have
15090 a NullLiteral as the argument and we have to choose between string
15091 and object types - we choose string the way csc does.
15093 * attribute.cs (Attribute.Resolve): Catch the
15094 NullReferenceException and report error #182 since the Mono
15095 runtime no more has the bug and having this exception raised means
15096 we tried to select a constructor which takes an object and is
15099 2002-09-05 Ravi Pratap <ravi@ximian.com>
15101 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15102 message (1502, 1503) when we can't locate a method after overload
15103 resolution. This is much more informative and closes the bug
15106 * interface.cs (PopulateMethod): Return if there are no argument
15107 types. Fixes a NullReferenceException bug.
15109 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15110 expressions too. Previously we were checking only in one place for
15111 positional arguments leaving out named arguments.
15113 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15114 type to the enum type is not allowed. Remove code corresponding to
15117 (ConvertNumericExplicit): Allow explicit conversions from
15118 the underlying type to enum type. This precisely follows the spec
15119 and closes a bug filed by Gonzalo.
15121 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15124 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15126 2002-09-03 Miguel de Icaza <miguel@ximian.com>
15128 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15129 it was important that we stored the right value after the
15130 reduction in `converted'.
15132 2002-09-04 Martin Baulig <martin@gnome.org>
15134 * location.cs (Location.SymbolDocument): Use full pathnames for the
15137 2002-08-30 Miguel de Icaza <miguel@ximian.com>
15139 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15140 of the expression resolve mechanism, because that will catch the
15141 SimpleName error failures.
15143 (Conditional): If we can not resolve the
15144 expression, return, do not crash.
15146 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15149 (location): display token name instead of its number.
15151 2002-08-28 Martin Baulig <martin@gnome.org>
15153 * expression.cs (Binary.ResolveOperator): Don't silently return
15154 but return an error if an operator cannot be applied between two
15157 2002-08-28 Martin Baulig <martin@gnome.org>
15159 * class.cs (Constructor.Define): Set the permission attributes
15160 correctly instead of making all constructors public.
15162 2002-08-28 Martin Baulig <martin@gnome.org>
15164 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15165 for private members before reporting a CS0103; if we find anything,
15168 2002-08-28 Martin Baulig <martin@gnome.org>
15170 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15171 to check whether `closure_start_type == closure_invocation_type',
15172 we also need to check whether `m.DeclaringType == closure_invocation_type'
15173 before bypassing the permission checks. We might be accessing
15174 protected/private members from the base class.
15175 (TypeManager.RealMemberLookup): Only set private_ok if private
15176 members were requested via BindingFlags.NonPublic.
15178 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15180 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15181 MethodGroupExpr.IsExplicitImpl if appropriate.
15182 (Invocation.DoResolve): Don't report the CS0120 for explicit
15183 interface implementations.
15185 2002-08-27 Martin Baulig <martin@gnome.org>
15187 * expression.cs (Invocation.DoResolve): If this is a static
15188 method and we don't have an InstanceExpression, we must report
15191 2002-08-25 Martin Baulig <martin@gnome.org>
15193 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15194 `==' between a valuetype and an object.
15196 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15198 * ecore.cs (TypeExpr): Provide a ToString method.
15200 2002-08-24 Martin Baulig <martin@gnome.org>
15202 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15203 now called proggie.dbg and it's a binary file.
15205 2002-08-23 Martin Baulig <martin@gnome.org>
15207 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15209 2002-08-23 Martin Baulig <martin@gnome.org>
15211 * struct.cs (MyStructInfo.ctor): Make this work with empty
15212 structs; it's not allowed to use foreach() on null.
15214 2002-08-23 Martin Baulig <martin@gnome.org>
15216 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15217 writer the full pathname of the generated assembly.
15219 2002-08-23 Martin Baulig <martin@gnome.org>
15221 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15222 A `finally' block never returns or breaks; improved handling of
15225 2002-08-23 Martin Baulig <martin@gnome.org>
15227 * statement.cs (Throw.Resolve): Allow `throw null'.
15229 2002-08-23 Martin Baulig <martin@gnome.org>
15231 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15232 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15233 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15234 MemberLookup would return a wrong event if this is an explicit
15235 interface implementation and the class has an event with the same
15238 2002-08-23 Martin Baulig <martin@gnome.org>
15240 * statement.cs (Block.AddChildVariableNames): New public method.
15241 (Block.AddChildVariableName): Likewise.
15242 (Block.IsVariableNameUsedInChildBlock): Likewise.
15243 (Block.AddVariable): Check whether a variable name has already
15244 been used in a child block.
15246 * cs-parser.jay (declare_local_variables): Mark all variable names
15247 from the current block as being used in a child block in the
15250 2002-08-23 Martin Baulig <martin@gnome.org>
15252 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15253 find the symbol writer.
15255 * driver.cs: csc also allows the arguments to /define being
15256 separated by commas, not only by semicolons.
15258 2002-08-23 Martin Baulig <martin@gnome.org>
15260 * interface.cs (Interface.GetMembers): Added static check for events.
15262 2002-08-15 Martin Baulig <martin@gnome.org>
15264 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15265 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15267 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15268 why the MethodData.EmitDestructor() change was necessary.
15270 2002-08-20 Martin Baulig <martin@gnome.org>
15272 * class.cs (TypeContainer.FindMembers): Added static check for events.
15274 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15276 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15277 use Type.GetEvents(), not Type.FindMembers().
15279 2002-08-20 Martin Baulig <martin@gnome.org>
15281 * decl.cs (MemberCache): Added a special method cache which will
15282 be used for method-only searched. This ensures that a method
15283 search will return a MethodInfo with the correct ReflectedType for
15286 2002-08-20 Martin Baulig <martin@gnome.org>
15288 * decl.cs (DeclSpace.FindMembers): Made this public.
15290 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15292 * delegate.cs: fixed build on windows.
15293 [FIXME: Filed as bug #29150: MCS must report these errors.]
15295 2002-08-19 Ravi Pratap <ravi@ximian.com>
15297 * ecore.cs (StandardConversionExists): Return a false
15298 if we are trying to convert the void type to anything else
15299 since that is not allowed.
15301 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15302 we flag error 70 in the event an event is trying to be accessed
15303 directly from outside the declaring type.
15305 2002-08-20 Martin Baulig <martin@gnome.org>
15307 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15308 MemberCache from typemanager.cs to decl.cs.
15310 2002-08-19 Martin Baulig <martin@gnome.org>
15312 * class.cs (TypeContainer): Implement IMemberContainer.
15313 (TypeContainer.DefineMembers): Create the MemberCache.
15314 (TypeContainer.FindMembers): Do better BindingFlags checking; only
15315 return public members if BindingFlags.Public was given, check
15316 whether members are static.
15318 2002-08-16 Martin Baulig <martin@gnome.org>
15320 * decl.cs (DeclSpace.Define): Splitted this in Define and
15321 DefineMembers. DefineMembers is called first and initializes the
15324 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
15325 DefineMembers() on all our DeclSpaces.
15327 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15328 but call DefineMembers() on all nested interfaces. We call their
15329 Define() in our new Define() function.
15331 * interface.cs (Interface): Implement IMemberContainer.
15332 (Interface.Define): Moved all code except the attribute stuf to
15334 (Interface.DefineMembers): Initialize the member cache.
15336 * typemanager.cs (IMemberFinder): Removed this interface, we don't
15337 need this anymore since we can use MemberCache.FindMembers directly.
15339 2002-08-19 Martin Baulig <martin@gnome.org>
15341 * typemanager.cs (MemberCache): When creating the cache for an
15342 interface type, add all inherited members.
15343 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15344 to `out bool used_cache' and documented it.
15345 (TypeManager.MemberLookup): If we already used the cache in the first
15346 iteration, we don't need to do the interfaces check.
15348 2002-08-19 Martin Baulig <martin@gnome.org>
15350 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
15351 here from IMemberFinder and don't implement this interface anymore.
15352 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15354 * typemanager.cs (IMemberFinder): This interface is now only used by
15355 classes which actually support the member cache.
15356 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15357 since we only put DeclSpaces into this Hashtable.
15358 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15359 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15361 2002-08-16 Martin Baulig <martin@gnome.org>
15363 * typemanager.cs (ICachingMemberFinder): Removed.
15364 (IMemberFinder.MemberCache): New property.
15365 (TypeManager.FindMembers): Merged this with RealFindMembers().
15366 This function will never be called from TypeManager.MemberLookup()
15367 so we can't use the cache here, just the IMemberFinder.
15368 (TypeManager.MemberLookup_FindMembers): Check whether the
15369 IMemberFinder has a MemberCache and call the cache's FindMembers
15371 (MemberCache): Rewrote larger parts of this yet another time and
15372 cleaned it up a bit.
15374 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15376 * driver.cs (LoadArgs): Support quoting.
15378 (Usage): Show the CSC-like command line arguments.
15380 Improved a few error messages.
15382 2002-08-15 Martin Baulig <martin@gnome.org>
15384 * typemanager.cs (IMemberContainer.Type): New property.
15385 (IMemberContainer.IsInterface): New property.
15387 The following changes are conditional to BROKEN_RUNTIME, which is
15388 defined at the top of the file.
15390 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15391 class'es members, but add all members from TypeHandle.ObjectType
15392 if we're an interface.
15393 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15394 is the current type.
15395 (MemberCache.CacheEntry.Container): Removed this field.
15396 (TypeHandle.GetMembers): Include inherited members.
15398 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15400 * typemanager.cs: fixed compilation and added a comment on a field that
15403 2002-08-15 Martin Baulig <martin@gnome.org>
15405 * class.cs (ConstructorInitializer.Resolve): In the
15406 Expression.MemberLookup call, use the queried_type as
15409 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15410 declared' attribute, it's always true.
15411 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15412 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15413 temporary wrapper for FindMembers which tells MemberLookup whether
15414 members from the base classes are included in the return value.
15415 This will go away soon.
15416 (TypeManager.MemberLookup): Use this temporary hack here; once the
15417 new MemberCache is completed, we don't need to do the DeclaredOnly
15418 looping here anymore since the MemberCache will take care of this.
15419 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15420 (MemberCache): When creating the MemberCache for a class, get
15421 members from the current class and all its base classes.
15422 (MemberCache.CacheEntry.Container): New field. This is a
15423 temporary hack until the Mono runtime is fixed to distinguish
15424 between ReflectedType and DeclaringType. It allows us to use MCS
15425 with both the MS runtime and the unfixed Mono runtime without
15426 problems and without accecting performance.
15427 (MemberCache.SearchMembers): The DeclaredOnly looping from
15428 TypeManager.MemberLookup is now done here.
15430 2002-08-14 Martin Baulig <martin@gnome.org>
15432 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15433 Type.GetFields on dynamic types but get the fields from the
15434 corresponding TypeContainer.
15435 (MyStructInfo.GetStructInfo): Added check for enum types.
15437 * typemanager.cs (MemberList.IsSynchronized): Implemented.
15438 (MemberList.SyncRoot): Implemented.
15439 (TypeManager.FilterWithClosure): No need to check permissions if
15440 closure_start_type == closure_invocation_type, don't crash if
15441 closure_invocation_type is null.
15443 2002-08-13 Martin Baulig <martin@gnome.org>
15445 Rewrote TypeContainer.FindMembers to use a member cache. This
15446 gives us a speed increase of about 35% for the self-hosting MCS
15447 build and of about 15-20% for the class libs (both on GNU/Linux).
15449 * report.cs (Timer): New class to get enhanced profiling. This
15450 whole class is "TIMER" conditional since it remarkably slows down
15453 * class.cs (MemberList): New class. This is an IList wrapper
15454 which we're now using instead of passing MemberInfo[]'s around to
15455 avoid copying this array unnecessarily.
15456 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15457 (ICachingMemberFinder, IMemberContainer): New interface.
15458 (TypeManager.FilterWithClosure): If `criteria' is null, the name
15459 has already been checked, otherwise use it for the name comparision.
15460 (TypeManager.FindMembers): Renamed to RealMemberFinder and
15461 provided wrapper which tries to use ICachingMemberFinder.FindMembers
15462 if possible. Returns a MemberList, not a MemberInfo [].
15463 (TypeHandle): New class, implements IMemberContainer. We create
15464 one instance of this class per type, it contains a MemberCache
15465 which is used to do the member lookups.
15466 (MemberCache): New class. Each instance of this class contains
15467 all members of a type and a name-based hash table.
15468 (MemberCache.FindMembers): This is our new member lookup
15469 function. First, it looks up all members of the requested name in
15470 the hash table. Then, it walks this list and sorts out all
15471 applicable members and returns them.
15473 2002-08-13 Martin Baulig <martin@gnome.org>
15475 In addition to a nice code cleanup, this gives us a performance
15476 increase of about 1.4% on GNU/Linux - not much, but it's already
15477 half a second for the self-hosting MCS compilation.
15479 * typemanager.cs (IMemberFinder): New interface. It is used by
15480 TypeManager.FindMembers to call FindMembers on a TypeContainer,
15481 Enum, Delegate or Interface.
15482 (TypeManager.finder_to_member_finder): New PtrHashtable.
15483 (TypeManager.finder_to_container): Removed.
15484 (TypeManager.finder_to_delegate): Removed.
15485 (TypeManager.finder_to_interface): Removed.
15486 (TypeManager.finder_to_enum): Removed.
15488 * interface.cs (Interface): Implement IMemberFinder.
15490 * delegate.cs (Delegate): Implement IMemberFinder.
15492 * enum.cs (Enum): Implement IMemberFinder.
15494 * class.cs (TypeContainer): Implement IMemberFinder.
15496 2002-08-12 Martin Baulig <martin@gnome.org>
15498 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15500 2002-08-12 Martin Baulig <martin@gnome.org>
15502 * ecore.cs (ITypeExpression): New interface for expressions which
15504 (TypeExpression): Renamed to TypeLookupExpression.
15505 (Expression.DoResolve): If we're doing a types-only lookup, the
15506 expression must implement the ITypeExpression interface and we
15507 call DoResolveType() on it.
15508 (SimpleName): Implement the new ITypeExpression interface.
15509 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15510 hack, the situation that we're only looking up types can't happen
15511 anymore when this method is called. Moved the type lookup code to
15512 DoResolveType() and call it.
15513 (SimpleName.DoResolveType): This ITypeExpression interface method
15514 is now doing the types-only lookup.
15515 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15516 (ResolveFlags): Added MaskExprClass.
15518 * expression.cs (MemberAccess): Implement the ITypeExpression
15520 (MemberAccess.DoResolve): Added support for a types-only lookup
15521 when we're called via ITypeExpression.DoResolveType().
15522 (ComposedCast): Implement the ITypeExpression interface.
15524 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15525 Expression.Resolve() with ResolveFlags.Type instead.
15527 2002-08-12 Martin Baulig <martin@gnome.org>
15529 * interface.cs (Interface.Define): Apply attributes.
15531 * attribute.cs (Attribute.ApplyAttributes): Added support for
15532 interface attributes.
15534 2002-08-11 Martin Baulig <martin@gnome.org>
15536 * statement.cs (Block.Emit): Only check the "this" variable if we
15537 do not always throw an exception.
15539 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15540 whether the property has a set accessor.
15542 2002-08-11 Martin Baulig <martin@gnome.org>
15544 Added control flow analysis support for structs.
15546 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15547 with control flow analysis turned off.
15548 (IVariable): New interface.
15549 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15550 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15551 (FieldExpr.DoResolve): Resolve the instance expression with flow
15552 analysis turned off and do the definite assignment check after the
15553 resolving when we know what the expression will resolve to.
15555 * expression.cs (LocalVariableReference, ParameterReference):
15556 Implement the new IVariable interface, only call the flow analysis
15557 code if ec.DoFlowAnalysis is true.
15558 (This): Added constructor which takes a Block argument. Implement
15559 the new IVariable interface.
15560 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15561 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15562 This does the definite assignment checks for struct members.
15564 * class.cs (Constructor.Emit): If this is a non-static `struct'
15565 constructor which doesn't have any initializer, call
15566 Block.AddThisVariable() to tell the flow analysis code that all
15567 struct elements must be initialized before control returns from
15570 * statement.cs (MyStructInfo): New public class.
15571 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15572 argument to this indexer. If non-zero, check an individual struct
15573 member, not the whole struct.
15574 (FlowBranching.CheckOutParameters): Check struct members.
15575 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15576 overloaded versions of these methods which take an additional
15577 `int field_idx' argument to check struct members.
15578 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15579 overloaded versions of these methods which take an additional
15580 `string field_name' argument to check struct member.s
15581 (VariableInfo): Implement the IVariable interface.
15582 (VariableInfo.StructInfo): New public property. Returns the
15583 MyStructInfo instance of the variable if it's a struct or null.
15584 (Block.AddThisVariable): New public method. This is called from
15585 Constructor.Emit() for non-static `struct' constructor which do
15586 not have any initializer. It creates a special variable for the
15587 "this" instance variable which will be checked by the flow
15588 analysis code to ensure that all of the struct's fields are
15589 initialized before control returns from the constructor.
15590 (UsageVector): Added support for struct members. If a
15591 variable/parameter is a struct with N members, we reserve a slot
15592 in the usage vector for each member. A struct is considered fully
15593 initialized if either the struct itself (slot 0) or all its
15594 members are initialized.
15596 2002-08-08 Martin Baulig <martin@gnome.org>
15598 * driver.cs (Driver.MainDriver): Only report an error CS5001
15599 if there were no compilation errors.
15601 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15602 `UnsafeContext' property to determine whether the parent is in
15603 unsafe context rather than checking the parent's ModFlags:
15604 classes nested in an unsafe class are unsafe as well.
15606 2002-08-08 Martin Baulig <martin@gnome.org>
15608 * statement.cs (UsageVector.MergeChildren): Distinguish between
15609 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15610 we return. Added test17() and test18() to test-154.cs.
15612 2002-08-08 Martin Baulig <martin@gnome.org>
15614 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15615 Family access, make sure the invoking type isn't a subclass of the
15616 queried type (that'd be a CS1540).
15618 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15619 this method which takes an additional `Type invocation_type'.
15621 * expression.cs (BaseAccess.DoResolve): Use the base type as
15622 invocation and query type.
15623 (MemberAccess.DoResolve): If the lookup failed and we're about to
15624 report a CS0122, try a lookup with the ec.ContainerType - if this
15625 succeeds, we must report a CS1540.
15627 2002-08-08 Martin Baulig <martin@gnome.org>
15629 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15630 (MethodGroupExpr): Implement the IMemberExpr interface.
15632 * expression (MemberAccess.ResolveMemberAccess): No need to have
15633 any special code for MethodGroupExprs anymore, they're now
15636 2002-08-08 Martin Baulig <martin@gnome.org>
15638 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15639 Family, FamANDAssem and FamORAssem permissions.
15640 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15642 2002-08-08 Martin Baulig <martin@gnome.org>
15644 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15645 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15648 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15650 * driver.cs: implemented /resource option to embed managed resources.
15652 2002-08-07 Martin Baulig <martin@gnome.org>
15654 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15655 (FieldBase.HasFieldInitializer): New public property.
15656 (FieldBase.GetInitializerExpression): New public method. Resolves and
15657 returns the field initializer and makes sure it is only resolved once.
15658 (TypeContainer.EmitFieldInitializers): Call
15659 FieldBase.GetInitializerExpression to get the initializer, this ensures
15660 that it isn't resolved multiple times.
15662 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15663 the resolving process (SimpleName/MemberLookup) that we're currently
15664 emitting a field initializer (which must not access any instance members,
15665 this is an error CS0236).
15667 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15668 argument, if the `IsFieldInitializer' flag is set, we must report and
15669 error CS0236 and not an error CS0120.
15671 2002-08-07 Martin Baulig <martin@gnome.org>
15673 * ecore.cs (IMemberExpr): New public interface.
15674 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15675 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15676 if the expression is an IMemberExpr.
15678 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15679 to be null, implicitly default to `this' if we're non-static in
15680 this case. Simplified the code a lot by using the new IMemberExpr
15681 interface. Also fixed bug #28176 here.
15683 2002-08-06 Martin Baulig <martin@gnome.org>
15685 * cs-parser.jay (SimpleLookup): Removed. We need to create
15686 ParameterReferences during semantic analysis so that we can do a
15687 type-only search when resolving Cast, TypeOf and SizeOf.
15688 (block): Pass the `current_local_parameters' to the Block's
15691 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15692 argument to the constructor.
15693 (ConstructorInitializer.Resolve): Create a temporary implicit
15694 block with the parameters.
15696 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15697 references here if we aren't doing a type-only search.
15699 * statement.cs (Block): Added constructor which takes a
15700 `Parameters parameters' argument.
15701 (Block.Parameters): New public property.
15703 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15704 to `Parameters' and made it public readonly.
15706 2002-08-06 Martin Baulig <martin@gnome.org>
15708 * ecore.cs (Expression.Warning): Made this public as well.
15710 * report.cs (Report.Debug): Print the contents of collections.
15712 2002-08-06 Martin Baulig <martin@gnome.org>
15714 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15715 used to tell Resolve() which kinds of expressions it may return.
15716 (Expression.Resolve): Added overloaded version of this method which
15717 takes a `ResolveFlags flags' argument. This can be used to tell
15718 Resolve() which kinds of expressions it may return. Reports a
15720 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15721 ResolveFlags.SimpleName.
15722 (Expression.Error118): Added overloaded version of this method which
15723 takes a `ResolveFlags flags' argument. It uses the flags to determine
15724 which kinds of expressions are allowed.
15726 * expression.cs (Argument.ResolveMethodGroup): New public method.
15727 Resolves an argument, but allows a MethodGroup to be returned.
15728 This is used when invoking a delegate.
15730 * TODO: Updated a bit.
15732 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15734 Fixed compilation with csc.
15736 * ecore.cs: Expression.Error made public. Is this correct? Should
15737 Warning be made public too?
15739 * expression.cs: use ea.Location instead of ea.loc.
15740 [FIXME: Filed as bug #28607: MCS must report these errors.]
15742 2002-08-06 Martin Baulig <martin@gnome.org>
15744 * ecore.cs (Expression.loc): Moved the location here instead of
15745 duplicating it in all derived classes.
15746 (Expression.Location): New public property.
15747 (Expression.Error, Expression.Warning): Made them non-static and
15748 removed the location argument.
15749 (Expression.Warning): Added overloaded version which takes an
15750 `int level' argument.
15751 (Expression.Error118): Make this non-static and removed the
15752 expression and location arguments.
15753 (TypeExpr): Added location argument to the constructor.
15755 * expression.cs (StaticCallExpr): Added location argument to
15757 (Indirection, PointerArithmetic): Likewise.
15758 (CheckedExpr, UnCheckedExpr): Likewise.
15759 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15760 (StringPtr): Likewise.
15763 2002-08-05 Martin Baulig <martin@gnome.org>
15765 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15767 * assign.cs (Assign.DoResolve): Check whether the source
15768 expression is a value or variable.
15770 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15771 while resolving the corresponding blocks.
15773 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15774 an error, don't silently return null.
15776 * statement.cs (Block.AddVariable): Do the error reporting here
15777 and distinguish between CS0128 and CS0136.
15778 (Block.DoResolve): Report all unused labels (warning CS0164).
15779 (LabeledStatement): Pass the location to the constructor.
15780 (LabeledStatement.HasBeenReferenced): New property.
15781 (LabeledStatement.Resolve): Set it to true here.
15783 * statement.cs (Return.Emit): Return success even after reporting
15784 a type mismatch error (CS0126 or CS0127), this is what csc does and
15785 it avoids confusing the users with any consecutive errors.
15787 2002-08-05 Martin Baulig <martin@gnome.org>
15789 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15791 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15793 * expression.cs (MemberAccess.DoResolve): Silently return if an
15794 error has already been reported.
15796 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15797 error has already been reported.
15799 2002-08-05 Martin Baulig <martin@gnome.org>
15801 * statement.cs (UsageVector): Only initialize the `parameters'
15802 vector if we actually have any "out" parameters.
15804 2002-08-05 Martin Baulig <martin@gnome.org>
15806 * expression.cs (Binary.ResolveOperator): When combining delegates,
15807 they must have the same type.
15809 2002-08-05 Martin Baulig <martin@gnome.org>
15811 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15812 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15813 work with the ms runtime and we also don't need it: if we're a
15814 PropertyBuilder and not in the `indexer_arguments' hash, then we
15815 are a property and not an indexer.
15817 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15818 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15819 since the latter one doesn't work with the ms runtime.
15821 2002-08-03 Martin Baulig <martin@gnome.org>
15823 Fixed bugs #27998 and #22735.
15825 * class.cs (Method.IsOperator): New public field.
15826 (Method.CheckBase): Report CS0111 if there's already a method
15827 with the same parameters in the current class. Report CS0508 when
15828 attempting to change the return type of an inherited method.
15829 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15830 and it's not marked abstract or extern.
15831 (PropertyBase): New abstract base class for Property and Indexer.
15832 (PropertyBase.CheckBase): Moved here from Property and made it work
15834 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15835 the same so we can reuse it there.
15836 (Property, Indexer): Derive from PropertyBase.
15837 (MethodSignature.inheritable_property_signature_filter): New delegate
15838 to find properties and indexers.
15840 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15841 argument and improved error reporting.
15843 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15844 EmptyReadOnlyParameters and made it a property.
15846 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15847 version of this method which takes a `PropertyInfo indexer'.
15848 (TypeManager.RegisterIndexer): New method.
15850 * class.cs: Added myself as author of this file :-)
15852 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15854 * class.cs: fixed compilation on windoze.
15856 2002-08-03 Martin Baulig <martin@gnome.org>
15858 * interface.cs (Interface.GetInterfaceBases): Check whether all
15859 base interfaces are at least as accessible than the current one.
15861 * class.cs (TypeContainer.GetClassBases): Check whether base types
15862 are at least as accessible than the current type.
15863 (TypeContainer.AsAccessible): Implemented and made non-static.
15864 (MemberBase.CheckParameters): Report errors if the accessibility
15867 * delegate.cs (Delegate.Delegate): The default visibility is
15868 internal for top-level types and private for nested types.
15869 (Delegate.Define): Report errors if the accessibility checks fail.
15871 * enum.cs (Enum.Enum): The default visibility is internal for
15872 top-level types and private for nested types.
15873 (Enum.DefineType): Compute the correct visibility.
15875 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15876 function which takes a `bool is_toplevel' instead of a TypeContainer.
15878 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15881 2002-08-02 Martin Baulig <martin@gnome.org>
15883 * expression.cs (LocalVariableReferenc): Added constructor which
15884 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15885 (LocalVariableReference.IsReadOnly): New property.
15886 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15887 variable is readonly, use our own readonly flag to do this; you can
15888 use the new constructor to get a writable reference to a read-only
15891 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15892 reference to the local variable.
15894 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15896 * rootcontext.cs (ResolveCore): Also include System.Exception
15898 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15899 we reach an EmptyStatement.
15901 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15904 * expression.cs (Binary.ResolveOperator): Check error result in
15907 use brtrue/brfalse directly and avoid compares to null.
15909 2002-08-02 Martin Baulig <martin@gnome.org>
15911 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15912 Fixes bug #28407, added test-155.cs.
15914 2002-08-01 Martin Baulig <martin@gnome.org>
15916 * class.cs (Event.EmitDefaultMethod): Make this work with static
15917 events. Fixes #28311, added verify-3.cs.
15919 2002-08-01 Martin Baulig <martin@gnome.org>
15921 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15922 `is_disposable' fields.
15923 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15924 `hm.is_disposable' if we're using the collection pattern.
15925 (Foreach.EmitCollectionForeach): Use the correct type for the
15926 enumerator's local variable, only emit the try/finally block if
15927 necessary (fixes #27713).
15929 2002-08-01 Martin Baulig <martin@gnome.org>
15931 * ecore.cs (Expression.report118): Renamed to Error118 and made
15934 * statement.cs (Throw.Resolve): Check whether the expression is of
15935 the correct type (CS0118) and whether the type derives from
15936 System.Exception (CS0155).
15937 (Catch.Resolve): New method. Do the type lookup here and check
15938 whether it derives from System.Exception (CS0155).
15939 (Catch.CatchType, Catch.IsGeneral): New public properties.
15941 * typemanager.cs (TypeManager.exception_type): Added.
15943 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15945 * driver.cs: Updated About function.
15947 2002-07-31 Martin Baulig <martin@gnome.org>
15949 Implemented Control Flow Analysis.
15951 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15952 (EmitContext.CurrentBranching): Added.
15953 (EmitContext.StartFlowBranching): Added.
15954 (EmitContext.EndFlowBranching): Added.
15955 (EmitContext.KillFlowBranching): Added.
15956 (EmitContext.IsVariableAssigned): Added.
15957 (EmitContext.SetVariableAssigned): Added.
15958 (EmitContext.IsParameterAssigned): Added.
15959 (EmitContext.SetParameterAssigned): Added.
15960 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15961 Added control flow analysis stuff here.
15963 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15964 resolve the expression as lvalue.
15965 (LocalVariableReference.DoResolve): Check whether the variable has
15966 already been assigned.
15967 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15968 the parameter as assigned here.
15969 (ParameterReference.DoResolve): Check whether the parameter has already
15971 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15972 expression as lvalue.
15974 * statement.cs (FlowBranching): New class for the flow analysis code.
15975 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15976 (LabeledStatement.IsDefined): New public property.
15977 (LabeledStatement.AddUsageVector): New public method to tell flow
15978 analyis that the label may be reached via a forward jump.
15979 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15981 (VariableInfo.Number): New public field. This is used by flow analysis
15982 to number all locals of a block.
15983 (Block.CountVariables): New public property. This is the number of
15984 local variables in this block (including the locals from all parent
15986 (Block.EmitMeta): Number all the variables.
15988 * statement.cs: Added flow analysis support to all classes.
15990 2002-07-31 Martin Baulig <martin@gnome.org>
15992 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15993 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15994 then use this argument.
15996 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15998 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15999 use this to specify /define options.
16001 2002-07-29 Martin Baulig <martin@gnome.org>
16003 * statement.cs (Fixed): Moved all code that does variable lookups
16004 and resolvings from Emit to Resolve.
16006 * statement.cs (For): Moved all code that does variable lookups
16007 and resolvings from Emit to Resolve.
16009 * statement.cs (Using): Moved all code that does variable lookups
16010 and resolvings from Emit to Resolve.
16012 2002-07-29 Martin Baulig <martin@gnome.org>
16014 * attribute.cs (Attribute.Resolve): Explicitly catch a
16015 System.NullReferenceException when creating the
16016 CustromAttributeBuilder and report a different warning message.
16018 2002-07-29 Martin Baulig <martin@gnome.org>
16020 * support.cs (ParameterData.ParameterName): Added method to
16021 get the name of a parameter.
16023 * typemanager.cs (TypeManager.IsValueType): New public method.
16025 2002-07-29 Martin Baulig <martin@gnome.org>
16027 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16028 is a flag which specifies that it's either ref or out.
16029 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16030 the out parameter to `out Parameter.Modifier mod', also set the
16031 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16033 * support.cs (InternalParameters.ParameterModifier): Distinguish
16034 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16035 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16037 * expression.cs (Argument.GetParameterModifier): Distinguish
16038 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16039 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16041 2002-07-29 Martin Baulig <martin@gnome.org>
16043 * expression.cs (ParameterReference.ParameterReference): Added
16044 `Location loc' argument to the constructor.
16046 * cs-parser.jay: Pass location to ParameterReference.
16048 2002-07-28 Miguel de Icaza <miguel@ximian.com>
16050 * statement.cs (Try): Initialize the location.
16052 * cs-parser.jay: pass location to Try.
16054 * expression.cs (Unary.Reduce): Change the prototype to return
16055 whether a constant fold could be performed or not. The result is
16056 returned in an out parameters. In the case of Indirection and
16057 AddressOf, we want to perform the full tests.
16059 2002-07-26 Miguel de Icaza <miguel@ximian.com>
16061 * statement.cs (Statement.Emit): Flag dead code.
16063 2002-07-27 Andrew Birkett <andy@nobugs.org>
16065 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16067 2002-07-27 Martin Baulig <martin@gnome.org>
16069 * class.cs (MethodData.Define): Put back call to
16070 TypeManager.AddMethod(), accidentally commented this out.
16072 * report.cs (Debug): New public method to print debugging information,
16073 this is `[Conditional ("DEBUG")]'.
16075 2002-07-26 Martin Baulig <martin@gnome.org>
16077 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16078 (switch_statement): Push the current_block to the switch_stack and
16079 pop it again when we're done with the switch.
16080 (switch_section): The new block is a child of the current_block.
16081 Fixes bug #24007, added test-152.cs.
16083 2002-07-27 Martin Baulig <martin@gnome.org>
16085 * expression.cs (Invocation.EmitArguments): When calling a varargs
16086 function with only its fixed arguments, we need to pass an empty
16089 2002-07-27 Martin Baulig <martin@gnome.org>
16091 Mono 0.13 has been released.
16093 2002-07-25 Miguel de Icaza <miguel@ximian.com>
16095 * driver.cs: Rename --resource to --linkres, because that is what
16096 we do currently, we dont support --resource yet.
16098 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16100 2002-07-25 Martin Baulig <martin@gnome.org>
16102 * class.cs (MethodData): New public class. This is a `method builder'
16103 class for a method or one accessor of a Property/Indexer/Event.
16104 (MethodData.GetMethodFlags): Moved here from MemberBase.
16105 (MethodData.ApplyAttributes): Likewise.
16106 (MethodData.ApplyObsoleteAttribute): Likewise.
16107 (MethodData.ApplyConditionalAttribute): Likewise.
16108 (MethodData.ApplyDllImportAttribute): Likewise.
16109 (MethodData.CheckAbstractAndExternal): Likewise.
16110 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16111 (MethodData.Emit): Formerly known as Method.Emit().
16112 (MemberBase): Moved everything which was specific to a single
16113 accessor/method to MethodData.
16114 (Method): Create a new MethodData and call Define() and Emit() on it.
16115 (Property, Indexer, Event): Create a new MethodData objects for each
16116 accessor and call Define() and Emit() on them.
16118 2002-07-25 Martin Baulig <martin@gnome.org>
16120 Made MethodCore derive from MemberBase to reuse the code from there.
16121 MemberBase now also checks for attributes.
16123 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16124 (MemberBase.GetMethodFlags): Moved here from class Method and marked
16126 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16127 `CallingConventions cc' and `Attributes opt_attrs' arguments.
16128 (MemberBase.ApplyAttributes): New virtual method; applies the
16129 attributes to a method or accessor.
16130 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16131 (MemberBase.ApplyConditionalAttribute): Likewise.
16132 (MemberBase.ApplyDllImportAttribute): Likewise.
16133 (MemberBase.CheckAbstractAndExternal): Likewise.
16134 (MethodCore.ParameterTypes): This is now a property instead of a
16135 method, it's initialized from DoDefineParameters().
16136 (MethodCore.ParameterInfo): Removed the set accessor.
16137 (MethodCore.DoDefineParameters): New protected virtual method to
16138 initialize ParameterTypes and ParameterInfo.
16139 (Method.GetReturnType): We can now simply return the MemberType.
16140 (Method.GetMethodFlags): Override the MemberBase version and add
16141 the conditional flags.
16142 (Method.CheckBase): Moved some code from Define() here, call
16143 DoDefineParameters() here.
16144 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16145 here to avoid some larger code duplication.
16146 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16147 ensure that abstract and external accessors don't declare a body.
16149 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16150 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16151 lookup in the attribute's parent classes, so we need to abort as soon
16152 as we found the first match.
16153 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16154 the attribute has no arguments.
16156 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16159 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16161 * cs-parser.jay: reverted previous patch.
16163 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16165 * cs-parser.jay: fixed bug #22119.
16167 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16169 * attribute.cs: fixed compilation. The error was:
16170 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16171 be assigned to before control leaves the current method."
16172 [FIXME: Filed as bug #28186: MCS must report this error.]
16174 2002-07-25 Martin Baulig <martin@gnome.org>
16176 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16177 method to pull the condition name ouf of a Conditional attribute.
16178 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16179 the obsolete message and error flag out of an Obsolete attribute.
16181 * class.cs (Method.GetMethodFlags): New public method to get the
16182 TypeManager.MethodFlags for this method.
16183 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16185 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16186 if we're overriding a virtual function, set the new private variable
16187 `parent_method'; call the new TypeManager.AddMethod().
16189 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16190 the MethodBuilder and the Method in a PtrHashtable.
16191 (TypeManager.builder_to_method): Added for this purpose.
16192 (TypeManager.MethodFlags): Added IsObsoleteError.
16193 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16194 Obsolete and Conditional arguments in MethodBuilders. If we discover
16195 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16196 the message from the attribute.
16198 2002-07-24 Martin Baulig <martin@gnome.org>
16200 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16201 preprocessor directives, ensure that the argument to #define/#undef is
16202 exactly one identifier and that it's actually an identifier.
16204 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16207 2002-07-24 Martin Baulig <martin@gnome.org>
16209 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16210 initialize it to TypeManager.object_type in the constructor.
16211 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16212 of the `hm.get_current' method if we're using the collection pattern.
16213 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16214 for the explicit conversion to make it work when we're using the collection
16215 pattern and the `Current' property has a different return type than `object'.
16218 2002-07-24 Martin Baulig <martin@gnome.org>
16220 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16221 does not match, but don't report any errors. This method is called in
16222 order for all methods in a MethodGroupExpr until a matching method is
16223 found, so we don't want to bail out if the first method doesn't match.
16224 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16225 matches, report the 123. Fixes #28070.
16227 2002-07-24 Martin Baulig <martin@gnome.org>
16229 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16230 TypeManager.TypeToCoreType() to the top of the method so the
16231 following equality checks will work. Fixes #28107.
16233 2002-07-24 Martin Baulig <martin@gnome.org>
16235 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16236 operand is of type uint, and the other operand is of type sbyte,
16237 short or int, the operands are converted to type long." -
16238 Actually do what this comment already told us. Fixes bug #28106,
16241 2002-07-24 Martin Baulig <martin@gnome.org>
16243 * class.cs (MethodBase): New abstract class. This is now a base
16244 class for Property, Indexer and Event to avoid some code duplication
16245 in their Define() and DefineMethods() methods.
16246 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16247 generic methods for Define() and DefineMethods().
16248 (FieldBase): Derive from MemberBase, not MemberCore.
16249 (Property): Derive from MemberBase, not MemberCore.
16250 (Property.DefineMethod): Moved all the code from this method to the
16251 new MethodBase.DefineAccessor(), just call it with appropriate
16253 (Property.Define): Call the new Property.DoDefine(), this does some
16254 sanity checks and we don't need to duplicate the code everywhere.
16255 (Event): Derive from MemberBase, not MemberCore.
16256 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16257 accessors, this will also make them work with interface events.
16258 (Indexer): Derive from MemberBase, not MemberCore.
16259 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16260 (Indexer.Define): Use the new MethodBase functions.
16262 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16263 argument to the constructor.
16264 (Interface.FindMembers): Added support for interface events.
16265 (Interface.PopluateEvent): Implemented.
16267 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16269 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16271 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16272 but this is required to check for a method name being the same as
16273 the containing class.
16277 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16279 * interface.cs: initialize variable.
16281 2002-07-23 Martin Baulig <martin@gnome.org>
16283 Implemented the IndexerName attribute in interfaces.
16285 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16286 name if this is an explicit interface implementation.
16287 (Indexer.InterfaceIndexerName): New public variable. If we're
16288 implementing an interface indexer, this is the IndexerName in that
16289 interface. Otherwise, it's the IndexerName.
16290 (Indexer.DefineMethod): If we're implementing interface indexer,
16291 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16292 and Pending.ImplementIndexer methods.
16293 (Indexer.Define): Also define the PropertyBuilder if we're
16294 implementing an interface indexer and this is neither an explicit
16295 interface implementation nor do the IndexerName match the one in
16298 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16299 If a method is defined here, then we always need to create a proxy
16300 for it. This is used when implementing interface indexers.
16301 (Pending.IsInterfaceIndexer): New public method.
16302 (Pending.ImplementIndexer): New public method.
16303 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16304 This is used when implementing interface indexers to define a proxy
16306 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16307 define a proxy if necessary.
16309 * interface.cs (Interface.IndexerName): New public variable.
16310 (Interface.PopulateIndexer): Set the IndexerName.
16311 (Interface.DefineIndexers): New private method. Populate all the
16312 indexers and make sure their IndexerNames match.
16314 * typemanager.cs (IndexerPropertyName): Added support for interface
16317 2002-07-22 Martin Baulig <martin@gnome.org>
16319 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16320 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16321 ret if HasReturnLabel.
16322 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16325 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16326 and set the ec.LoopBeginTryCatchLevel.
16327 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16328 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16329 the current ec.TryCatchLevel, the branch goes out of an exception
16330 block. In this case, we need to use Leave and not Br.
16332 2002-07-22 Martin Baulig <martin@gnome.org>
16334 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16335 block unless the block does not always return or it is contained in
16336 another try { ... } catch { ... } block. Fixes bug #26506.
16337 Added verify-1.cs to the test suite.
16339 2002-07-22 Martin Baulig <martin@gnome.org>
16341 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16342 then we do not always return. Fixes bug #24985.
16344 2002-07-22 Martin Baulig <martin@gnome.org>
16346 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16347 lookup on a per-class level; ie. walk up the class hierarchy until we
16348 found at least one applicable method, then choose the best among them.
16349 Fixes bug #24463 and test-29.cs.
16351 2002-07-22 Martin Baulig <martin@gnome.org>
16353 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16354 return types of the methods. The return type is not part of the
16355 signature and we must not check it to make the `new' modifier work.
16356 Fixes bug #27999, also added test-147.cs.
16357 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16359 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16360 on the method's return type.
16362 2002-07-21 Martin Baulig <martin@gnome.org>
16364 * assign.cs: Make this work if the rightmost source is a constant and
16365 we need to do an implicit type conversion. Also adding a few more tests
16366 to test-38.cs which should have caught this.
16368 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16369 target in the makefile for this. The makefile.gnu is primarily intended
16370 for end-users who don't want to debug the compiler.
16372 2002-07-21 Martin Baulig <martin@gnome.org>
16374 * assign.cs: Improved the Assign class so it can now handle embedded
16375 assignments (X = Y = Z = something). As a side-effect this'll now also
16376 consume less local variables. test-38.cs now passes with MCS, added
16377 a few new test cases to that test.
16379 2002-07-20 Martin Baulig <martin@gnome.org>
16381 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16382 instructions. Fixes bug #27977, also added test-146.cs.
16384 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16386 * cs-tokenizer.cs: fixed getHex ().
16388 2002-07-19 Martin Baulig <martin@gnome.org>
16390 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16391 not Type.GetType() to lookup the array type. This is needed when
16392 we're constructing an array of a user-defined type.
16393 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16394 single-dimensional arrays, but also for single-dimensial arrays of
16397 2002-07-19 Martin Baulig <martin@gnome.org>
16399 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16400 this function is called, it's not allowed to share LocalBuilders
16401 among ILGenerators.
16403 2002-07-19 Martin Baulig <martin@gnome.org>
16405 * expression.cs (Argument.Resolve): Report an error 118 when trying
16406 to pass a type as argument.
16408 2002-07-18 Martin Baulig <martin@gnome.org>
16410 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16411 Conv_R_Un for the signed `long' type.
16413 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16415 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16416 `expr' for the temporary result, as that will fail if we do
16417 multiple resolves on the same expression.
16419 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16421 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16422 ec.TypeContainer for looking up aliases.
16424 * class.cs (TypeContainer): Remove LookupAlias from here.
16426 * decl.cs (DeclSpace); Move here.
16428 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16430 * class.cs (FindMembers): Only call filter if the constructor
16431 bulider is not null.
16433 Also handle delegates in `NestedTypes' now. Now we will perform
16434 type lookups using the standard resolution process. This also
16437 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16438 This uses Expressions (the limited kind that can be parsed by the
16439 tree) instead of strings.
16441 * expression.cs (ComposedCast.ToString): Implement, used to flag
16442 errors since now we have to render expressions.
16444 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
16447 * ecore.cs (SimpleName.ToString): ditto.
16449 * cs-parser.jay: Instead of using strings to assemble types, use
16450 Expressions to assemble the type (using SimpleName, ComposedCast,
16451 MemberAccess). This should fix the type lookups in declarations,
16452 because we were using a different code path for this.
16454 * statement.cs (Block.Resolve): Continue processing statements
16455 even when there is an error.
16457 2002-07-17 Miguel de Icaza <miguel@ximian.com>
16459 * class.cs (Event.Define): Also remove the `remove' method from
16460 the list of pending items.
16462 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16463 generate more compact code.
16465 2002-07-17 Martin Baulig <martin@gnome.org>
16467 * const.cs (Const.LookupConstantValue): Add support for constant
16468 `unchecked' and `checked' expressions.
16469 Also adding test case test-140.cs for this.
16471 2002-07-17 Martin Baulig <martin@gnome.org>
16473 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16474 check whether mi.ReturnType implements the IEnumerator interface; the
16475 `==' and the IsAssignableFrom() will fail in this situation.
16477 2002-07-16 Ravi Pratap <ravi@ximian.com>
16479 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
16482 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16484 * expression.cs: fixed bug #27811.
16486 2002-07-14 Miguel de Icaza <miguel@ximian.com>
16488 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16489 Molaro: when we are a ref, the value already contains a pointer
16490 value, do not take the address of it.
16492 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16493 * removed mb-parser.jay and mb-tokenizer.cs
16495 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16497 * expression.cs: check against the building corlib void type.
16499 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16501 * ecore.cs: fix for valuetype static readonly fields: when
16502 initializing them, we need their address, not the address of a copy.
16504 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16506 * typemanager.cs: register also enum_type in corlib.
16508 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16510 * class.cs: allow calling this (but not base) initializers in structs.
16512 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16514 * ecore.cs: make sure we compare against the building base types
16517 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16519 * typemanager.cs: fix TypeToCoreType() to handle void and object
16520 (corlib gets no more typerefs after this change).
16522 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16524 * expression.cs (ArrayCreation.EmitArrayArguments): use
16525 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16527 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16528 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16529 array indexes, the runtime actually forbids them.
16531 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16532 for array arguments here.
16534 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16535 instead of the default for ValueTypes.
16537 (New.DoEmit): Use IsValueType instead of
16538 IsSubclassOf (value_type)
16539 (New.DoResolve): ditto.
16540 (Invocation.EmitCall): ditto.
16542 * assign.cs (Assign): ditto.
16544 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16545 Statements *are* currently doing part of their resolution during
16548 Expressions do always resolve during resolve, but statements are
16549 only required to propagate resolution to their children.
16551 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16553 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16555 (LoadAssembly): Do not add the dll if it is already specified
16557 (MainDriver): Add the System directory to the link path at the end,
16558 after all the other -L arguments.
16560 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16561 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16562 ldelem.u1) and using the opposite for sbytes.
16564 This fixes Digger, and we can finally run it.
16566 * driver.cs (UnixParseOption): Move the option parsing here.
16567 (CSCParseOption): Implement CSC-like parsing of options.
16569 We now support both modes of operation, the old Unix way, and the
16570 new CSC-like way. This should help those who wanted to make cross
16571 platform makefiles.
16573 The only thing broken is that /r:, /reference: and /lib: are not
16574 implemented, because I want to make those have the same semantics
16575 as the CSC compiler has, and kill once and for all the confussion
16576 around this. Will be doing this tomorrow.
16578 * statement.cs (Unsafe.Resolve): The state is checked during
16579 resolve, not emit, so we have to set the flags for IsUnsfe here.
16581 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16583 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16584 not catch the Error_ObjectRefRequired in SimpleName (as it is
16585 possible to have a class/instance variable name that later gets
16586 deambiguated), we have to check this here.
16588 2002-07-10 Ravi Pratap <ravi@ximian.com>
16590 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16591 make static and put into Expression.
16593 (Event.Define): Register the private field of the event with the
16594 TypeManager so that GetFieldFromEvent can get at it.
16596 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16597 keep track of the private field associated with an event which
16600 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16603 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16605 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16607 * expression.cs (Binary.EmitBranchable): this routine emits the
16608 Binary expression in a branchable context. This basically means:
16609 we need to branch somewhere, not just get the value on the stack.
16611 This works together with Statement.EmitBoolExpression.
16613 * statement.cs (Statement.EmitBoolExpression): Use
16616 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16618 * statement.cs (For): Reduce the number of jumps in loops.
16620 (For): Implement loop inversion for the For statement.
16622 (Break): We can be breaking out of a Try/Catch controlled section
16623 (foreach might have an implicit try/catch clause), so we need to
16624 use Leave instead of Br.
16626 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16627 now). If the instace expression supports IMemoryLocation, we use
16628 the AddressOf method from the IMemoryLocation to extract the
16629 address instead of emitting the instance.
16631 This showed up with `This', as we were emitting the instance
16632 always (Emit) instead of the Address of This. Particularly
16633 interesting when This is a value type, as we dont want the Emit
16634 effect (which was to load the object).
16636 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16638 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16640 * statement.cs (Checked): Set the CheckedState during the resolve
16641 process too, as the ConvCast operations track the checked state on
16642 the resolve process, and not emit.
16644 * cs-parser.jay (namespace_member_declaration): Flag that we have
16645 found a declaration when we do. This is used to flag error 1529
16647 * driver.cs: Report ok when we display the help only.
16649 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16651 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16653 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16655 * cs-tokenizer.cs (define): We also have to track locally the
16656 defines. AllDefines is just used for the Conditional Attribute,
16657 but we also need the local defines for the current source code.
16659 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16661 * statement.cs (While, For, Do): These loops can exit through a
16662 Break statement, use this information to tell whether the
16663 statement is the last piece of code.
16665 (Break): Flag that we break.
16667 * codegen.cs (EmitContexts): New `Breaks' state variable.
16669 2002-07-03 Martin Baulig <martin@gnome.org>
16671 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16672 modifiers in method declarations in structs. Otherwise, you won't
16673 be able to override things like Object.Equals().
16675 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16677 * class.cs (Method, Property, Indexer): Do not allow the public
16678 modifier to be used in explicit interface implementations.
16680 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16681 override modifiers in method declarations in structs
16683 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16685 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16686 integer or real overflow, report an error
16688 2002-07-02 Martin Baulig <martin@gnome.org>
16690 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16691 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16692 to tell the runtime about our newly created System.Object and
16693 System.ValueType types.
16695 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16697 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16698 struct instead of Ldarg/Starg.
16700 2002-07-02 Martin Baulig <martin@gnome.org>
16702 * expression.cs (Indirection.Indirection): Call
16703 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16705 2002-07-02 Martin Baulig <martin@gnome.org>
16707 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16708 ValueType, call TypeManager.TypeToCoreType() on it.
16709 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16710 the OpCodes.Newarr argument.
16712 2002-07-02 Martin Baulig <martin@gnome.org>
16714 * expression.cs (Invocation.EmitCall): When compiling corlib,
16715 replace all calls to the system's System.Array type to calls to
16716 the newly created one.
16718 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16719 System.Array methods.
16720 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16721 from the system's System.Array type which must be replaced.
16723 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16725 * typemanager.cs: load unverifiable_code_ctor so we can build
16726 corlib using the correct type. Avoid using GetTypeCode() with
16728 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16729 TypeManager.object_type to allow building corlib.
16731 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16733 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16735 2002-07-01 Martin Baulig <martin@gnome.org>
16737 * class.cs: Make the last change actually work, we need to check
16738 whether `ifaces != null' to avoid a crash.
16740 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16742 * class.cs: when we build structs without fields that implement
16743 interfaces, we need to add the interfaces separately, since there is
16744 no API to both set the size and add the interfaces at type creation
16747 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16749 * expression.cs: the dimension arguments to the array constructors
16750 need to be converted if they are a long.
16752 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16754 * class.cs: don't emit ldarg.0 if there is no parent constructor
16755 (fixes showstopper for corlib).
16757 2002-06-29 Martin Baulig <martin@gnome.org>
16759 MCS now compiles corlib on GNU/Linux :-)
16761 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16762 ie. check for MethodImplOptions.InternalCall.
16764 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16765 and TypeManager.attribute_type are null, so we must explicitly check
16766 whether parent is not null to find out whether it's an attribute type.
16767 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16768 and SetBuilder, not only if the property is neither abstract nor external.
16769 This is necessary to set the MethodImplOptions on the accessor methods.
16770 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16771 SetBuilder, see Property.Emit().
16773 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16774 populate "System.Object", "System.ValueType" and "System.Attribute" since
16775 they've already been populated from BootCorlib_PopulateCoreTypes().
16777 2002-06-29 Martin Baulig <martin@gnome.org>
16779 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16780 is the NullLiteral, we also need to make sure that target_type is not
16783 2002-06-29 Martin Baulig <martin@gnome.org>
16785 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16786 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16787 before calling BootstrapCorlib_ResolveDelegate ().
16789 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16791 * statement.cs: fixed build-breaker. All tests passed ok.
16793 2002-06-27 Martin Baulig <martin@gnome.org>
16795 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16796 for System.Decimal when compiling corlib.
16798 2002-06-27 Martin Baulig <martin@gnome.org>
16800 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16801 switch blocks which contain nothing but a default clause.
16803 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16805 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16807 2002-06-27 Martin Baulig <martin@gnome.org>
16809 * ecore.cs (PropertyExpr.PropertyExpr): Call
16810 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16812 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16813 is already a TypeBuilder.
16815 2002-06-27 Martin Baulig <martin@gnome.org>
16817 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16818 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16819 the "from an array-type to System.Array" case. This makes it work
16820 when compiling corlib.
16822 2002-06-27 Martin Baulig <martin@gnome.org>
16824 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16825 non-static PropertyExpr, set its InstanceExpression. This makes
16826 the `ICollection.Count' property work in System/Array.cs.
16828 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16830 * driver.cs: Made error handling more consistent. Errors now
16831 tracked by Report class, so many methods which used to return int
16832 now return void. Main() now prints success/failure and
16833 errors/warnings message.
16835 Renamed '--probe' compiler argument to '--expect-error'. Removed
16836 the magic number return values (123 and 124). Now, if the
16837 expected error occurs, the compiler exits with success (exit value
16838 0). If the compilation completes without seeing that particular
16839 error, the compiler exits with failure (exit value 1). The
16840 makefile in mcs/errors has been changed to handle the new behaviour.
16842 * report.cs: Made 'expected error' number a property and renamed
16843 it from 'Probe' to 'ExpectedError'.
16845 * genericparser.cs: Removed error handling support, since it is
16846 now all done by Report class.
16848 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16849 class, so parse() no longer returns an int.
16851 * namespace.cs: Use Report.Error instead of GenericParser.error
16853 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16855 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16856 TypeContainer.AddOperator): At the front of the list put the
16857 explicit implementations, so they get resolved/defined first.
16859 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16861 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16862 interface type is implemented by this TypeContainer. Used during
16863 explicit interface implementation.
16865 (Property.Define, Indexer.Define, Method.Define): Validate that
16866 the given interface in the explicit implementation is one of the
16867 base classes for the containing type.
16869 Also if we are explicitly implementing an interface, but there is
16870 no match in the pending implementation table, report an error.
16872 (Property.Define): Only define the property if we are
16873 not explicitly implementing a property from an interface. Use the
16874 correct name also for those properties (the same CSC uses,
16875 although that is really not needed).
16877 (Property.Emit): Do not emit attributes for explicitly implemented
16878 properties, as there is no TypeBuilder.
16880 (Indexer.Emit): ditto.
16882 Hiding then means that we do not really *implement* a pending
16883 implementation, which makes code fail.
16885 2002-06-22 Martin Baulig <martin@gnome.org>
16887 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16888 the return value of Object.GetType(). [FIXME: we need to do this whenever
16889 we get a type back from the reflection library].
16891 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16893 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16895 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16897 * attribute.cs: Return null if we can not look up the type.
16899 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16900 the interface types found.
16902 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16903 interface types found.
16905 * typemanager.cs (GetInterfaces): Make this routine returns alll
16906 the interfaces and work around the lame differences between
16907 System.Type and System.Reflection.Emit.TypeBuilder in the results
16908 result for GetInterfaces.
16910 (ExpandInterfaces): Given an array of interface types, expand and
16911 eliminate repeated ocurrences of an interface. This expands in
16912 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16915 2002-06-21 Martin Baulig <martin@gnome.org>
16917 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16920 2002-06-21 Martin Baulig <martin@gnome.org>
16922 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16923 and called with one of the core types, return the corresponding typebuilder for
16926 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16929 2002-06-21 Martin Baulig <martin@gnome.org>
16931 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16932 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16933 (Expression.ConvertReferenceExplicit): Likewise.
16935 * expression.cs (ElementAccess.DoResolve): Likewise.
16936 (ElementAccess.DoResolveLValue): Likewise.
16938 2002-06-10 Martin Baulig <martin@gnome.org>
16940 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16941 add the "value" parameter to the parameter list.
16943 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16946 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16948 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16949 the argument to an int, uint, long or ulong, per the spec. Also
16950 catch negative constants in array creation.
16952 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16954 * class.cs: do not allow the same interface to appear twice in
16955 the definition list.
16957 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16959 * ecore.cs: don't use ldlen with System.Array.
16961 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16963 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16965 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16967 * modifiers.cs: produce correct field attributes for protected
16968 internal. Easy fix so miguel can work on ther harder stuff:-)
16970 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16972 * pending.cs: New file. Move the code from class.cs here.
16973 Support clearning the pending flag for all methods (when not doing
16974 explicit interface implementation).
16976 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16978 * rootcontext.cs: added a couple more types needed to bootstrap.
16980 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16982 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16983 constructor in the type, instead of any constructor in the type
16984 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16985 a bug in the Mono runtime when applying the params attribute).
16987 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16988 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16990 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16992 * expression.cs (Unary.ResolveOperator): Use TypeManager
16993 to resolve the type.
16995 2002-06-13 Ravi Pratap <ravi@ximian.com>
16997 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17000 * enum.cs (AddEnumMember): Add support to store the attributes associated
17001 with each member too.
17003 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17004 field builders too - this takes care of the enum member case.
17006 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17008 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17009 address-of operator on both value types and pointers.
17011 2002-06-10 Martin Baulig <martin@gnome.org>
17013 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17014 PropertyBuilder to the `property_builders' list.
17016 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17017 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17018 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17019 find any indexers which are inherited from an interface.
17021 2002-06-09 Martin Baulig <martin@gnome.org>
17023 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17024 the same type as the constant if necessary. There's also a test-130.cs
17027 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17029 * typemanager.cs (TypeManager.ChangeType): Previously known as
17030 Enum.ChangeEnumType().
17032 2002-06-09 Martin Baulig <martin@gnome.org>
17034 * expression.cs (Cast.TryReduce): Added support for consts.
17036 2002-06-08 Ravi Pratap <ravi@ximian.com>
17038 * class.cs (Accessor): Hold attributes information so we can pass
17041 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17042 Modify to pass in attributes attached to the methods.
17044 (add_accessor_declaration, remove_accessor_declaration): Ditto.
17046 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17047 to handle the Accessor kind :-)
17049 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17051 2002-06-08 Martin Baulig <martin@gnome.org>
17053 * expression.cs (Unary.TryReduceNegative): Added support for
17056 2002-06-08 Martin Baulig <martin@gnome.org>
17058 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17059 name can't be found in the `defined_names' - the caller will do a
17060 MemberLookup in this case and thus find methods in System.Enum
17061 such as Enum.IsDefined().
17063 2002-06-08 Martin Baulig <martin@gnome.org>
17065 * enum.cs (Enum.ChangeEnumType): This is a custom version of
17066 Convert.ChangeType() which works with TypeBuilder created types.
17067 (Enum.LookupEnumValue, Enum.Define): Use it here.
17069 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17070 `TypeBuilder.BaseType != null' check.
17071 (TypeContainer.FindMembers): Only lookup parent members if we
17072 actually have a parent.
17073 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17074 (ConstructorInitializer.Resolve): Likewise.
17076 * interface.cs (Interface.FindMembers): Added
17077 `TypeBuilder.BaseType != null' check.
17079 * rootcontext.cs (RootContext.ResolveCore): Added
17080 "System.Runtime.CompilerServices.IndexerNameAttribute" to
17081 classes_second_stage.
17083 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17084 debug_type and trace_type when compiling with --nostdlib.
17086 2002-06-07 Martin Baulig <martin@gnome.org>
17088 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17089 (AddField): Set it to true when adding a non-static field.
17090 (DefineType): Use `have_nonstatic_fields' to find out whether we
17091 have non-static fields, not `Fields != null'.
17093 2002-06-02 Miguel de Icaza <miguel@ximian.com>
17095 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17096 dereferencing a null on the static-field code path)
17098 2002-05-30 Martin Baulig <martin@gnome.org>
17100 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17101 to take command line arguments. Use reflection to call the new
17102 custom `Initialize' function on the symbol writer and pass it the
17103 command line arguments.
17105 * driver.cs (--debug-args): New command line argument to pass command
17106 line arguments to the symbol writer.
17108 2002-05-28 Miguel de Icaza <miguel@ximian.com>
17110 * assign.cs (DoResolve): Forgot to do the implicit conversion to
17111 the target type for indexers and properties. Thanks to Joe for
17114 2002-05-27 Miguel de Icaza <miguel@ximian.com>
17116 * typemanager.cs (MethodFlags): returns the method flags
17117 (Obsolete/ShouldIgnore) that control warning emission and whether
17118 the invocation should be made, or ignored.
17120 * expression.cs (Invocation.Emit): Remove previous hack, we should
17121 not do this on matching a base type, we should do this based on an attribute
17123 Only emit calls to System.Diagnostics.Debug and
17124 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17125 on the command line.
17127 * rootcontext.cs: Global settings for tracing and debugging.
17129 * cs-tokenizer.cs (define): New utility function to track
17130 defines. Set the global settings for TRACE and DEBUG if found.
17132 2002-05-25 Ravi Pratap <ravi@ximian.com>
17134 * interface.cs (Populate*): Pass in the TypeContainer as well as
17135 the DeclSpace as parameters so that we can create EmitContexts and
17136 then use that to apply attributes etc.
17138 (PopulateMethod, PopulateEvent, PopulateProperty)
17139 (PopulateIndexer): Apply attributes everywhere.
17141 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17144 (ApplyAttributes): Update accordingly.
17146 We now apply interface attributes for all members too.
17148 2002-05-26 Miguel de Icaza <miguel@ximian.com>
17150 * class.cs (Indexer.Define); Correctly check if we are explicit
17151 implementation (instead of checking the Name for a ".", we
17152 directly look up if the InterfaceType was specified).
17154 Delay the creation of the PropertyBuilder.
17156 Only create the PropertyBuilder if we are not an explicit
17157 interface implementation. This means that explicit interface
17158 implementation members do not participate in regular function
17159 lookups, and hence fixes another major ambiguity problem in
17160 overload resolution (that was the visible effect).
17162 (DefineMethod): Return whether we are doing an interface
17165 * typemanager.cs: Temporary hack until we get attributes in
17166 interfaces (Ravi is working on that) and we get IndexerName
17167 support in interfaces.
17169 * interface.cs: Register the indexers as properties.
17171 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17172 warning, I have verified that this is a bug in the .NET runtime
17173 (JavaScript suffers of the same problem).
17175 * typemanager.cs (MemberLookup): When looking up members for
17176 interfaces, the parent of an interface is the implicit
17177 System.Object (so we succeed in searches of Object methods in an
17178 interface method invocation. Example: IEnumerable x; x.ToString
17181 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17183 * class.cs (Event): Events should also register if they do
17184 implement the methods that an interface requires.
17186 * typemanager.cs (MemberLookup); use the new GetInterfaces
17189 (GetInterfaces): The code used to lookup interfaces for a type is
17190 used in more than one place, factor it here.
17192 * driver.cs: Track the errors at the bottom of the file, we kept
17195 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17196 instance if the method we are calling is static!
17198 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17200 * attribute.cs (ApplyAttributes): Make this function filter out
17201 the IndexerName attribute (as that attribute in reality is never
17202 applied) and return the string constant for the IndexerName
17205 * class.cs (TypeContainer.Emit): Validate that all the indexers
17206 have the same IndexerName attribute, and if so, set the
17207 DefaultName attribute on the class.
17209 * typemanager.cs: The return value might contain other stuff (not
17210 only methods). For instance, consider a method with an "Item"
17211 property and an Item method.
17213 * class.cs: If there is a problem with the parameter types,
17216 2002-05-24 Ravi Pratap <ravi@ximian.com>
17218 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17219 looks at user defined conversion after making a call to
17220 StandardConversionExists - we need this for overload resolution.
17222 * expression.cs : Update accordingly the various method calls.
17224 This fixes 2 bugs filed against implicit user defined conversions
17226 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17228 * statement.cs: Track the result of the assignment.
17230 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17232 * expression.cs (MemberAccess): Improved error reporting for
17233 inaccessible members.
17235 2002-05-22 Martin Baulig <martin@gnome.org>
17237 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17238 itself with debugging support.
17240 2002-05-22 Martin Baulig <martin@gnome.org>
17242 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17243 Removed, this isn't needed anymore.
17245 2002-05-20 Martin Baulig <martin@gnome.org>
17247 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17248 be underlying type for an enum.
17250 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17252 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17253 that splits out the loading of just the core types.
17255 * rootcontext.cs (ResolveCore): Split the struct resolution in
17256 two, so we can load the enumeration underlying types before any
17259 * expression.cs (Is): Bandaid until we fix properly Switch (see
17260 bug #24985 for details).
17262 * typemanager.cs (ImplementsInterface): The hashtable will contain
17263 a null if there are no interfaces implemented.
17265 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17267 * cs-parser.jay (indexer_declarator): It is fine to have array
17270 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17272 * typemanager.cs: (RegisterBuilder): New function used to register
17273 TypeBuilders that implement interfaces. Since
17274 TypeBuilder.GetInterfaces (as usual) does not work with lame
17276 (AddUserType): register interfaces.
17278 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17279 dealing with TypeBuilder. Also, arrays are showing up as
17280 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17281 methods can not be invoked on them!
17283 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17284 (ImplicitReferenceConversionExists): Split out from
17285 StandardConversionExists.
17287 * expression.cs (As): We were only implementing one of the three
17288 cases for the as operator. We now implement them all.
17289 (Is): Implement the various other cases for Is as well.
17291 * typemanager.cs (CACHE): New define used to control if we want or
17292 not the FindMembers cache. Seems to have a negative impact on
17293 performance currently
17295 (MemberLookup): Nested types have full acess to
17296 enclosing type members
17298 Remove code that coped with instance/static returns for events, we
17299 now catch this in RealFindMembers.
17301 (RealFindMembers): only perform static lookup if the instance
17302 lookup did not return a type or an event.
17304 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17306 * assign.cs (CompoundAssign): We pass more semantic information
17307 now to Compound Assignments than we did before: now we have all
17308 the information at hand, and now we resolve the target *before* we
17309 do the expression expansion, which allows the "CacheValue" method
17310 to have the effect we intended (before, a [x] += 1 would generate
17311 two differen ArrayAccess expressions from the ElementAccess,
17312 during the resolution process).
17314 (CompoundAssign.DoResolve): Resolve target and original_source here.
17316 2002-05-16 Miguel de Icaza <miguel@ximian.com>
17318 * expression.cs (ArrayAccess): dropped debugging information.
17320 * typemanager.cs: Small bug fix: I was always returning i_members,
17321 instead of one of i_members or s_members (depending on which had
17324 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
17325 method is invoked before any code generation takes place, and it
17326 is a mechanism to inform that the expression will be invoked more
17327 than once, and that the method should use temporary values to
17328 avoid having side effects
17330 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17332 * ecore.cs (Expression.CacheTemporaries): Provide empty default
17335 * expression.cs (Indirection, ArrayAccess): Add support for
17336 CacheTemporaries in these two bad boys.
17338 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17339 ldobj or ldind_ref.
17340 (StoreFromPtr): Handle stobj as well.
17342 * expression.cs (UnaryMutator): Share more code.
17344 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17345 down: I was not tracking the Filter function as well, which
17346 was affecting the results of the cache.
17348 2002-05-15 Miguel de Icaza <miguel@ximian.com>
17350 * attribute.cs: Remove the hack to handle the CharSet property on
17353 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17355 * attribute.cs (DoResolve): More uglyness, we now only try to
17356 resolve the attribute partially, to extract the CharSet
17357 information (only if we are a StructLayout attribute). Otherwise
17359 (GetExtraTypeInfo): Add some code to conditionally kill in the
17360 future this. I am more and more convinced that the .NET
17361 framework has special code to handle the attribute setting on
17364 * expression.cs (IsParamsMethodApplicable): Revert my previous
17365 foreach change here, it was wrong.
17367 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17369 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17370 (pp_expr): do not abort on unknown input, just return.
17371 (eval): abort if there are pending chars.
17373 * attribute.cs (Attribute.Resolve): Positional parameters are
17374 optional. Deal with that case.
17376 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17377 the Ansi/Unicode/Auto information for the type.
17379 (TypeContainer.DefineType): instantiate the EmitContext here, as
17380 we will be using it during the type definition (to resolve
17381 attributes) and during the emit phase.
17383 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17384 to pull type information out of the attributes
17386 (Attribute.Resolve): track the constructor builder, and allow for
17387 multiple invocations (structs and classes will use this).
17389 * ecore.cs (MemberLookupFinal): new version with all the
17390 parameters customizable.
17392 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17393 constructors. Return if the result value is null (as the error
17394 would have been flagged already by MemberLookupFinal)
17396 Do not allow instances of abstract classes or interfaces to be
17399 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17400 We have to compare the assembly property here when dealing with
17401 FamANDAssem and Assembly access modifiers, because we might be
17402 creating an assembly from *modules* (that means that we are not
17403 getting TypeBuilders for types defined in other modules that are
17404 part of this assembly).
17406 (Method.Emit): If the method is marked abstract and has a body,
17409 (TypeContainer.DefineMembers): If both the defined member and the
17410 parent name match are methods, then do not emit any warnings: let
17411 the Method.Define routine take care of flagging warnings. But if
17412 there is a mismatch (method overrides something else, or method is
17413 overriwritten by something, then emit warning).
17415 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17416 set to null, this means `do not check for the return type on the
17419 (Method.Define): set the return type for the method signature to
17420 null, so that we get methods with the same name and parameters and
17421 different return types. This is used to flag warning 114 (you are
17422 hiding a method, and you probably want to use the new/override
17425 * typemanager.cs (MemberLookup): Implemented proper access
17426 control, closing a long standing set of bug reports. The problem
17427 was that the Framework only has two bits: Public and NonPublic,
17428 and NonPublic includes private and protected methods, but we need
17429 to enforce the FamANDAssem, FamOrAssem and Family.
17431 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17433 * statement.cs (GotoCase): Return true: Ammounts to giving up
17434 knowledge on whether we return or not, and letting the other case
17435 be responsible for it.
17437 2002-05-10 Miguel de Icaza <miguel@ximian.com>
17439 * driver.cs: Do not load directories for each file processed, only
17440 do it if there is a pattern.
17442 * ecore.cs: Report readonly assigns here as well, as we might have
17443 been resolved only by MemberAccess.
17445 (SimpleName.SimpleNameResolve): Also be useful for LValue
17446 resolution. We need this to propagate assign to local readonly variables
17448 * typemanager.cs: Use a ptrhashtable for the criteria, because we
17449 do not want to reuse potential criteria memory.
17451 * class.cs (MyEventBuilder): Set reflected_type;
17453 * ecore.cs (Constantify): Added support for constifying bools.
17455 (RootContext.LookupType): Added a cache for values looked up in
17456 the declaration space.
17458 * typemanager.cs (FindMembers): Now is a front-end to
17459 RealFindMembers, and provides a two-level hashtable-based cache to
17462 15% performance improvement: from 22.5 to 19.2 seconds.
17464 * expression.cs (IsParamsMethodApplicable): use foreach.
17465 (Invocation.DoResolve): ditto.
17466 (New.DoResolve): ditto.
17467 (ArrayCreation.DoResolve): ditto.
17469 * ecore.cs (FindMostEncompassingType): use foreach.
17471 * delegate.cs (NewDelegate.DoResolve): Use foreach
17473 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17474 (RemoveMethods): use foreach.
17476 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17477 nested foreach statements instead of for, and also break out of
17478 the inner loop once a match is found.
17480 (Invocation.OverloadResolve): Use foreach, simplify the code.
17482 2002-05-08 Miguel de Icaza <miguel@ximian.com>
17484 * cfold.cs (BinaryFold): During an enumeration evaluation context,
17485 we actually unwrap the expression to allow for extra information
17488 * expression.cs: Use Shr_Un on unsigned operations.
17490 2002-05-08 Ravi Pratap <ravi@ximian.com>
17492 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
17493 applicable operators was not being considered correctly. This closes
17494 the bug Miguel reported.
17496 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17498 * attribute.cs: check that the type derives from System.Attribute
17499 and report the correct error in that case (moved the duplicate code to
17500 its own method, too).
17502 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17504 * attribute.cs: lookup attribute type name as the spec says: first the
17505 bare attribute name and then name + "Attribute" (nant compiles with
17506 mcs after this fix).
17508 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17510 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17511 Because of the way we parse things, we should try to see if a
17512 UIntConstant can fit in an integer.
17514 2002-05-07 Ravi Pratap <ravi@ximian.com>
17516 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17517 when we are in an explicit context.
17519 (ConvertReferenceExplicit): When converting from Iface type S to Class
17520 T make sure the rules are implemented as an OR.
17522 * parameter.cs (ParameterType): Make it a property for now although the
17523 purpose really isn't anything immediate.
17525 * expression.cs (Is*Applicable): Do better checking on the parameter type
17526 of a ref/out parameter. The ones from the system assemblies are already
17527 marked with the correct type so we don't need to do any correction.
17529 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17530 the object type is standard too so include that.
17532 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17534 * ecore.cs (StandardConversionExists): Augment with missing code:
17535 deal with IntConstant, LongConstants and Enumerations.
17537 * assign.cs: Report the error, instead of failing silently
17539 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17540 typecontainer that they are declared, because the
17541 typecontainer/namespace will have the list of using clauses that
17542 need to be applied.
17544 Assembly Attributes were escaping the normal registration
17547 (EmitCode): Apply attributes within an EmitContext that represents
17548 the container they were declared on.
17550 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17552 2002-05-06 Ravi Pratap <ravi@ximian.com>
17554 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17555 Revamp completely - make much cleaner as we now operate only
17558 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17559 to implement the logic detailed in the spec more correctly.
17561 (UserDefinedConversion): Update accordingly.
17563 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17565 * statement.cs: Return flow analysis information up.
17567 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17570 (token): Do not consume an extra character before calling
17573 2002-05-06 Piers Haken <piersh@friskit.com>
17575 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17577 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17579 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17580 EmitContext during the instance constructor initializer
17581 resolution, to stop access to instance variables.
17583 This is mandated by the spec, last paragraph of the `constructor
17584 initializers' section.
17586 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17588 * cs-parser.jay, class.cs (Accessor): new class used to represent
17589 an accessor (get or set). In the past we used `null' to represent
17590 a missing accessor. But this is ambiguous because there was no
17591 way to tell in abstract indexers/properties if one of them was
17594 Now there is a way of addressing that.
17596 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17597 instead of FindMembers.
17599 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17600 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17602 * attribute.cs: Treat indexers and properties as the same in terms
17603 of applying attributes
17605 * ecore.cs (FindMostEncompassedType): Use statically initialized
17606 EmptyExpressions()s like we do elsewhere to avoid creating useless
17607 objects (and we take this out of the tight loop).
17609 (GetConversionOperators): Move the code to extract the actual
17610 operators to a separate routine to clean things up.
17612 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17614 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17615 events are always registered FieldBuilders.
17617 * class.cs (FieldBase): New class shared by Fields
17619 * delegate.cs: If we are a toplevel delegate, use our full name.
17620 If we are a nested delegate, then only use our tail name.
17622 2002-05-02 Ravi Pratap <ravi@ximian.com>
17624 * expression.cs (IsApplicable): Ensure that we add the "&" to
17625 ref/out types before comparing it with the type of the argument.
17627 (IsParamsMethodApplicable): Ditto.
17629 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17632 * delegate.cs : Handle the case when we have more than one applicable
17633 method. Flag an error only when we finish checking all.
17635 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17637 * expression.cs: Add support for boolean static initializers.
17639 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17641 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17643 * parameter.cs (ComputeParameterTypes,
17644 ComputeAndDefineParameterTypes): Better error handling: now we
17645 clear the `types' cache if we fail during any of the type lookups.
17646 We also return the status code correctly to our caller
17648 * delegate.cs: If we fail to define a delegate, abort the extra
17651 * expression.cs (Binary.ResolveOperator): for
17652 operator==(object,object) and operator !=(object, object) we also
17653 have to verify that there is an implicit conversion from one to
17656 (ArrayAccess.DoResolve): Array Access can operate on
17659 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17661 * assign.cs (CompoundAssign): A new class used as a "flag" that
17662 the assignment actually is happening as part of a compound
17663 assignment operator.
17665 During compound assignment, a few new rules exist to enable things
17672 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17673 to the type of x) if y is implicitly convertible to the type of x,
17674 and the operator is a builtin operator and the return type of the
17675 operator is explicitly convertible to the type of x.
17677 * rootcontext.cs: Reset warning level to 2. 4 catches various
17678 "interesting" features in mcs, we must clean this up at some
17679 point, but currently am trying to kill other bugs ;-)
17681 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17682 in container classes as well.
17684 * expression.cs (Binary.ResolveOperator): Handle string case
17685 before anything else (as operator overloading does emit an error
17686 before doing anything else).
17688 This code could go away when we move to a table driven model, but
17689 i could not come up with a good plan last night.
17691 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17693 * typemanager.cs (CSharpName): reimplementation using regex.
17694 * class.cs: added null check for fields in Emit
17695 * rootcontext.cs: set warninglevel to 4
17697 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17699 * typemanager.cs (CSharpName): reimplemented with Lupus
17702 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17704 * statement.cs (If): correclty implement Resolve, because we were
17705 not catching sem errors in there. The same process is needed
17707 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17710 (Statement.Warning_DeadCodeFound): Factorize code.
17711 (While): Report dead code here too.
17713 (Statement): Added Resolve virtual method to allow
17714 for resolution split from the emit code.
17716 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17718 * statement.cs (EmitBoolExpression): No longer try to resolve the
17720 (MakeBoolean): New utility function that resolve, implicitly
17721 converts to boolean and tags the expression.
17724 (If, Do): Implement dead code elimination.
17725 (While): Implement loop inversion
17727 (Do, While, For, If): Resolve the expression prior to calling our
17730 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17733 - added method Report28 (warning: program has more than one entry point)
17734 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17735 - modified method Method.Define, the part at the end of the method
17737 * rootcontext.cs: added static public Location EntryPointLocation;
17739 * ../errors/cs0028.cs : Add test case for the above warning.
17742 - modified method CSharpName to allow arrays of primitive type to
17743 be printed nicely (e.g. instead of System.Int32[][] it now prints
17745 - added method CSharpSignature: returns the signature of a method
17746 in string format to be used in reporting errors, warnings, etc.
17748 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17751 2002-04-26 Ravi Pratap <ravi@ximian.com>
17753 * delegate.cs (Define): Fix extremely silly bug where I was
17754 setting the type of the 'object' parameter of the BeginInvoke
17755 method to System.IAsyncResult instead of System.Object ;-)
17757 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17759 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17762 (Constructor.Emit): return if we fail to initialize the
17763 constructor. Another door closed!
17765 * expression.cs (New.DoResolve): Improve error message (from -6 to
17766 1501). Use DeclaredOnly lookup to find the exact constructor.
17768 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17769 loop. This is useful.
17771 * cs-parser.jay: Adjust the default parameters so that destructors
17772 have the proper signature.
17774 2002-04-26 Martin Baulig <martin@gnome.org>
17776 * driver.cs (LoadAssembly): If `assembly' contains any characters
17777 which are only valid in path names and not in assembly names
17778 (currently slash, backslash and point), use Assembly.LoadFrom ()
17779 instead of Assembly.Load () on the `assembly' (before iteration
17780 over the link_paths).
17782 2002-04-26 Martin Baulig <martin@gnome.org>
17784 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17786 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17788 * class.cs (Property): use the new typemanager.MemberLookup
17790 (TypeContainer.MemberLookup): Implement using the
17791 TypeManager.MemberLookup now.
17793 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17794 and return MemberInfos, so that these can be used without an
17795 EmitContext (what we had before).
17797 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17799 * expression.cs: Fix the case where the argument to params if the
17800 type of the params. I omitted handling this before. Fixed
17802 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17804 * driver.cs: Call BootCorlib_PopulateCoreType
17806 * class.cs (Property.CheckBase): Check for properties only, not
17809 * interface.cs: Temporary hack: try/catch around the
17810 CustomAttributeBuilder, because I am getting an exception that I
17813 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17814 types whose definitions are required to be there (attributes are
17815 defined before standard types).
17817 Compute definitions as we boot the various types, as they are used
17818 immediately (value_type class will need object_type, but if we do
17819 not initialize object_type, we will pass a null, which will let
17820 the runtime pick the System.Object from the existing corlib, which
17821 is not what we want).
17823 2002-04-22 Patrik Torstensson <totte@labs2.com>
17825 * cs-tokenizer.cs: fixed a number of trim() issues.
17827 2002-04-22 Ravi Pratap <ravi@ximian.com>
17829 * expression.cs (Argument.Type): Ensure that we return the correct
17830 type when we have out or ref parameters [in which case we
17833 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17835 * class.cs (Property, Indexer): Allow extern modifier in there.
17837 * typemanager.cs (InitBaseTypes): Initializes object_type and
17838 value_type, since those will be used early on during the bootstrap
17839 process to compile corlib.
17841 (InitCoreTypes): Move code from here to InitBaseTypes.
17843 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17845 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17846 single-dimension arrays as using the ldlen opcode.
17848 Daniel Lewis discovered this optimization.
17850 * typemanager.cs: Add signature for System.Array::get_Length
17852 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17854 * statement.cs: report the error when the foreach does not apply to an
17855 array nor a collection.
17857 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17859 * expression.cs: Add implicit conversions to the operator ~.
17861 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17863 * typemanager.cs: Locate the decimal constructor.
17865 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17867 * attribute.cs: use the new property of TypeOf.
17868 * expression.cs: added 'get' property around typearg.
17870 These changes fix a build breaker reported by NickD. Is this the
17871 correct way to fix? If not, please, revert my changes and make it
17874 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17876 * attribute.cs: Add support for typeof in attribute invocations.
17877 I am not sure that this is right though.
17879 2002-04-14 Duncan Mak <duncan@ximian.com>
17881 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17882 Binary.Operator.Division case.
17884 2002-04-13 Ravi Pratap <ravi@ximian.com>
17886 * class.cs (DefineType): Ensure that we do a proper check on
17887 attribute types and also register it with the TypeManager.
17889 (TypeContainer.Targets): The default for attribute types is
17890 AttributeTargets.All.
17892 * attribute.cs (ApplyAttributes): Registering the attribute type
17893 is done elsewhere, not when we discover we have a Usage attribute.
17895 2002-04-12 Ravi Pratap <ravi@ximian.com>
17897 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17898 and get rid of is_delegate parameter.
17900 * everywhere : update.
17902 2002-04-12 Ravi Pratap <ravi@ximian.com>
17904 * cs-parser.jay (compilation_unit): Revamp completely to use
17905 some new ideas that I got from Rhys' grammar to solve the problems
17906 with assembly level attributes.
17908 (outer_declaration): New grammar production.
17910 (attribute_sections): Add.
17912 (opt_attributes): Base on attribute_sections
17914 (namespace_declaration): Allow opt_attributes to tackle the case
17915 when we have assembly level attributes - we are clever in this
17918 * attribute.cs (ApplyAttributes): Do not worry about assembly
17919 attributes in the non-global context.
17921 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17922 instead of SetGlobalAttributes.
17924 * class.cs, rootcontext.cs : Ensure we define and generate
17925 attribute types before anything else.
17927 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17928 and flag the new error -20 for the case when the attribute type
17929 does not have valid targets specified. csc does not catch this.
17931 * ../errors/errors.txt : update for error # -20
17933 2002-04-11 Ravi Pratap <ravi@ximian.com>
17935 * support.cs (InternalParameters.ParameterModifier): Do some null
17936 checking and return sane values.
17938 * class.cs (Method.Define): If we are a PInvoke method, ensure
17939 that we are static and extern. Report error # 601
17941 * ../errors/cs0601.cs : Add test case for the above error.
17943 2002-04-07 Ravi Pratap <ravi@ximian.com>
17945 * rootcontext.cs (attribute_types): We need to keep type of
17946 all attribute types separately and emit code for them first.
17948 (RegisterAttribute) : Implement.
17950 * class.cs (DefineType): Check if the current Type is a custom
17951 attribute type and register it accordingly.
17953 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17954 adding the first attribute twice and rename to
17956 (SetGlobalAttributes): this.
17958 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17961 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17962 if we are processing global arguments. Hmm, I am unsure of this.
17964 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17966 * expression.cs: added static array of strings to avoid calling
17967 Enum.ToString () for Operator in Binary. Significant recover of
17970 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17972 * class.cs (FindMembers): Allow the Builders of the various
17973 members to be null. If they are skip them. This only happens
17974 during the PInvoke declaration.
17976 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17978 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17979 failure, so we do not keep going afterwards.
17981 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17982 wanted to pass `false' as the `is_delegate' argument. If this is
17983 the case, why not use delegate_type == null to mean `is_delegate =
17984 false' and anything else as is_delegate = true.
17986 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17988 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17989 code for the section, not the beginning of the tests.
17991 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17993 * cfold.cs: Handle operator + (Enum x, Underlying x)
17995 * expression.cs (Binary): same. Warn about errors where we have
17996 Enum/Enum in operator + as well.
17998 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18001 - added support for switch(bool)
18002 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18003 - add TableSwitchEmit() to handle table-based switch statements
18005 2002-04-05 Ravi Pratap <ravi@ximian.com>
18007 * expression.cs (Invocation.OverloadResolve): Factor out code which
18008 does parameter compatibility checking with arguments so that we can
18009 re-use the code even from Delegate.VerifyApplicability
18011 (VerifyArgumentsCompat): Move above code here.
18013 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18014 and instead make a call to the above method.
18016 2002-03-31 Ravi Pratap <ravi@ximian.com>
18018 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18019 We use it to keep track of classes which are attribute types.
18021 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18023 * delegate.cs (Delegate.Define): Correctly define the types in the
18024 presence of fixed and array parameters.
18026 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18029 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18030 include NonPublic after the first iteration.
18032 * class.cs (Indexer.CheckBase): Only check if both parents are
18035 * cs-parser.jay (accessor_body): If empty, set to null.
18037 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18038 same code path here to resolve constants names that we did have in
18039 MemberAccess.DoResolve. There is too much code duplicated here.
18041 2002-04-01 Miguel de Icaza <miguel@ximian.com>
18043 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18045 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18048 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18049 tokens, numbers and strings.
18051 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18054 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18055 asyncronous parameters and the regular parameters.
18057 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18058 specify the target directory.
18060 * expression.cs: (This.DoResolve): Simplify
18061 (As.Emit): Optimize, do not generate IsInst if the expression is
18062 always of the given type.
18064 (Is.DoResolve): Bug fix, we were reporting both always/never for
18067 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18068 creating too many unnecessary arrays.
18070 2002-03-31 Miguel de Icaza <miguel@ximian.com>
18072 * class.cs (EmitFieldInitializer): Use Assign expression to assign
18073 fields instead of rolling our own initializer. Takes care of all
18074 implicit conversions, and drops unnecessary static checks/argument.
18076 2002-03-31 Dick Porter <dick@ximian.com>
18078 * driver.cs: use the GetDirectories() return values properly, and
18079 use "/" as path separator.
18081 2002-03-30 Miguel de Icaza <miguel@ximian.com>
18083 * expression.cs (Unary): Optimize - - expr into expr.
18084 (Binary): Optimize a + (-b) into a -b.
18086 * codegen.cs (CodeGen): Made all methods static.
18088 2002-03-29 Miguel de Icaza <miguel@ximian.com>
18092 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18093 TypeBuilder property.
18095 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18098 * tree.cs: Removed the various RecordXXXX, and replaced with a
18099 single RecordDecl. Removed all the accessor methods, and just
18100 left a single access point Type
18102 * enum.cs: Rename DefineEnum to DefineType.
18104 * decl.cs: New abstract method `DefineType' used to unify the
18105 Defines for Enumerations, Interfaces, TypeContainers and
18108 (FindType): Moved LookupInterfaceOrClass here. Moved the
18109 LookupBaseClasses method that used to live in class.cs and
18110 interface.cs here, and renamed to FindType.
18112 * delegate.cs: Implement DefineType. Take advantage of the
18113 refactored pattern for locating the parent builder without taking
18114 the parent_builder argument (which we know does not work if we are
18115 nested, and triggering a toplevel definition).
18117 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18119 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18120 accessibility of a member has changed during override and report
18123 * class.cs (Method.Define, Property.Define): Only complain on
18124 overrides if the method is private, any other accessibility is
18125 fine (and since we just checked the permission is the same, we are
18128 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18129 and elif are processed always. The other pre-processing
18130 directives are only processed if we are "taking" the path
18132 2002-03-29 Martin Baulig <martin@gnome.org>
18134 * class.cs (Method.Emit): Only emit symbolic debugging info if the
18135 current location is not Null.
18137 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18138 a separate method so we can profile it.
18140 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18141 `span.Seconds' are just seconds, but no minutes or hours.
18142 (MainDriver): Profile the CodeGen.SaveSymbols calls.
18144 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18146 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18147 Remove the gratuitous set of Final:
18149 // If an interface implementation, then we can set Final.
18150 if (((flags & MethodAttributes.Abstract) == 0) &&
18151 implementing.DeclaringType.IsInterface)
18152 flags |= MethodAttributes.Final;
18154 I do not know what I was smoking when I used that.
18157 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18158 step into fixing the name resolution issues for delegates and
18159 unifying the toplevel name resolution.
18161 2002-03-28 Martin Baulig <martin@gnome.org>
18163 * class.cs (Method.Emit): If we have a symbol writer, call its
18164 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18165 tell it about the current method.
18167 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18168 writer that we're going to emit the first byte of IL code for a new
18169 statement (a new source line).
18170 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18171 EmitContext.Mark() before emitting any code.
18173 * location.cs (SymbolDocument): Return null when we're Null.
18175 * statement.cs (Statement): Moved the `Location loc' variable here.
18176 (Statement.EmitBoolExpression): If we have a symbol writer, call
18177 ec.Mark() before emitting any code to tell it that we're at the
18178 beginning of a new statement.
18179 (StatementExpression): Added `Location' argument to the constructor.
18180 (Block): Added public readonly variable `StartLocation' and public
18181 variable `EndLocation'. The latter is to be set using SetEndLocation().
18182 (Block): Added constructor which takes a start and end location.
18183 (Block.SetEndLocation): New method. This sets the end location.
18184 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18185 local variables we create.
18186 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18187 each statement and do also mark the begin and end of the block.
18189 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18190 tell it the current lexer.Location, use Location.Null for the end of the
18192 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18193 current block, set its end location using SetEndLocation().
18194 (statement_expression): StatementExpression constructor now takes the
18195 lexer.Location as additional argument.
18196 (for_statement, declare_local_variables): Likewise.
18197 (declare_local_variables): When creating a new implicit block, use the
18198 new Block constructor and pass it the lexer.Location.
18200 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18202 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18203 members also on the parent interfaces recursively.
18205 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18207 * report.cs: Use new formats, since Gonzalo finished the missing
18210 * expression.cs (Binary.ResolveOperator): added missing operator|
18211 operator& and operator^ for bool/bool.
18213 * cs-parser.jay: CheckDef now takes a Location argument that is
18214 used to report errors more precisly (instead of reporting the end
18215 of a definition, we try to track something which is a lot closer
18216 to the source of the problem).
18218 * cs-tokenizer.cs: Track global token use, so we can properly flag
18219 the use of #define/#undef after the first token has been seen.
18221 Also, rename the reportXXXX to Error_DescriptiveName
18223 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18224 TypeContainer, so that Enum and Interface can use this too.
18226 * class.cs (TypeContainer.LookupInterfaceOrClass,
18227 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18228 `builder' argument. Typically this was used to pass the parent
18229 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18232 The problem is that a nested class could trigger the definition of
18233 a toplevel class, and the builder would be obviously wrong in that
18236 So we drop this argument, and we compute dynamically the
18237 TypeBuilder/ModuleBuilder (the correct information was available
18238 to us anyways from DeclSpace.Parent)
18240 * interface.cs (Interface.DefineInterface): Drop builder
18241 parameter cleanup like class.cs
18243 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18246 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18249 (Try.Emit): Propagate the returns value from the statement.
18251 (Return.Emit): Even if we are leavning
18253 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18255 * modifiers.cs: Fix the computation of MethodAttributes flags.
18257 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18259 * driver.cs: allow compilation of files that start with '/'.
18260 Add a default case when checking the argument of --target.
18262 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18264 * interface.cs: Implement the same search algorithm for types in
18265 the interface code.
18267 * delegate.cs: Do not allow multiple definition.
18269 * Recovered ChangeLog that got accidentally amputated
18271 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18273 * rootcontext.cs: Load manually enum to allow core classes to
18274 contain enumerations.
18276 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18277 Update to new static methods in TypeManager.
18279 * typemanager.cs (GetMethod, GetConstructor): Use our
18280 implementation of FindMembers to find the members, since during
18281 corlib compilation, the types are TypeBuilders and GetMethod and
18282 GetConstructor do not work.
18284 Make all methods in TypeManager static.
18286 (InitCodeHelpers): Split the functionality from
18287 the InitCodeTypes function.
18289 * driver.cs: Call InitCodeHelpers after we have populated the
18292 * cs-parser.jay (delegate_declaration): we did not used to compute
18293 the delegate name correctly for void delegates.
18295 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18297 * rootcontext.cs (RootContext): Init the interface_resolve_order
18298 and type_container_resolve_order always.
18300 (ResolveCore, BootstrapCorlib_ResolveClass,
18301 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18302 compiler when compiling with --nostdlib
18304 * class.cs (TypeContainer.DefineType): Check that our parent is
18305 not null. This test is most important when we are bootstraping
18308 * codegen.cs: Split out the symbol writing code.
18310 2002-03-25 Martin Baulig <martin@gnome.org>
18312 * driver.cs (-g): Made -g an alias for --debug.
18314 2002-03-24 Martin Baulig <martin@gnome.org>
18316 * codegen.cs (SymbolWriter): New public variable. Returns the
18317 current symbol writer.
18318 (CodeGen): Added `bool want_debugging_support' argument to the
18319 constructor. If true, tell the ModuleBuild that we want debugging
18320 support and ask it for the ISymbolWriter.
18321 (Save): If we have a symbol writer, call it's Close() method after
18322 saving the assembly.
18324 * driver.c (--debug): New command line argument to create a
18325 debugger information file.
18327 * location.cs (SymbolDocument): New public property. Returns an
18328 ISymbolDocumentWriter object for the current source file or null
18329 if we don't have a symbol writer.
18331 2002-03-21 Miguel de Icaza <miguel@ximian.com>
18333 * driver.cs (LoadAssembly): Correctly return when all the paths
18334 have been tried and not before.
18336 * statement.cs (Switch.Emit): return the actual coverage for this
18337 statement (returns/not-returns)
18339 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18340 switch of the statement if we are the last switch section. That
18341 kills two problems: try/catch problems (we used to emit an empty
18342 nop at the end) and switch statements where all branches would
18345 2002-03-19 Miguel de Icaza <miguel@ximian.com>
18347 * driver.cs: Add default assemblies (the equivalent to the
18348 Microsoft CSC.RSP file)
18350 * cs-tokenizer.cs: When updating `cols and setting it to zero,
18351 also update tokens_seen and set it to false.
18353 * driver.cs: Implement --recurse for Mike.
18355 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18356 correctly splitting out the paths.
18358 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18360 * interface.cs (Interface.PopulateProperty): Instead of using
18361 `parent' as the declaration space for the set parameters, use
18364 * support.cs (InternalParameters): InternalParameters constructor
18365 takes a DeclSpace instead of a TypeContainer.
18367 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18368 types are being initialized, load the address of it before calling
18371 (New): Provide a mechanism to disable the generation of local
18372 value type temporaries when the caller will be providing us with
18373 an address to store it.
18375 (ArrayCreation.EmitDynamicInitializers): Use it.
18377 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18379 * expression.cs (Invocation.EmitArguments): Only probe for array
18380 property if there is more than one argument. Sorry about that.
18382 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18383 empty param arrays.
18385 * class.cs (Method.LabelParameters): Fix incorrect code path that
18386 prevented the `ParamArrayAttribute' from being applied to the
18389 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18391 * support.cs (ReflectionParameters): Correctly compute whether the
18392 last argument is a params array. Fixes the problem with
18395 * typemanager.cs: Make the assemblies array always be non-null
18396 (empty, but non-null)
18398 * tree.cs (RecordDecl): New function that abstracts the recording
18399 of names. This reports error 101, and provides a pointer to the
18400 previous declaration. Fixes a crash in the compiler.
18402 * cs-parser.jay (constructor_declaration): Update to new grammar,
18403 and provide a constructor_body that can be empty.
18405 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18407 * driver.cs: Add support for --resources.
18409 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18410 Make all types for the various array helper methods be integer.
18412 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18413 CheckState to ConvCast.
18415 (ConvCast): Now it takes a `checked' state argument, to avoid
18416 depending on the emit context for the conversion, and just using
18417 the resolve time setting.
18419 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18420 instead of Invocation.EmitArguments. We do not emit the original
18421 arguments, instead we emit those which have been converted to
18422 unsigned int expressions.
18424 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18426 * codegen.cs: ditto.
18428 * expression.cs (LocalVariableReference): Drop the use of the
18429 Store function that depended on the variable index.
18431 * statement.cs (VariableInfo): Drop the `Idx' property from this
18432 class, as this is not taking into account the indexes for
18433 temporaries tat we generate during the execution, getting the
18436 * class.cs: First emit class initializers, then call the parent
18439 * expression.cs (Binary): Fix opcode emision.
18440 (UnaryMutator.EmitCode): Support checked code generation
18442 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18443 matches for events for both the Static and Instance scans,
18444 pointing to the same element. Fix that.
18446 2002-03-14 Miguel de Icaza <miguel@ximian.com>
18448 * rootcontext.cs (ResolveTree): Always set the
18449 interface_resolve_order, because nested interfaces will be calling
18452 * class.cs (GetInterfaceOrClass): Track the same resolution
18453 process used by TypeManager.LookupType. This fixes the nested
18454 type lookups in class declarations (separate path from
18457 (TypeContainer.DefineType): Also define nested interfaces.
18458 (TypeContainer.RegisterOrder): New public function used to
18459 register the order in which child interfaces need to be closed.
18461 Nested interfaces need to be closed after their parents have been
18464 * interface.cs (InterfaceAttr): Put all the logic for computing
18465 the interface attribute here.
18467 (DefineInterface): Register our interface order with the
18468 RootContext or with the TypeContainer depending on the case.
18470 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18472 * cs-parser.jay: rework foreach statement to work with the new
18473 changes to the policy on SimpleNames.
18475 * report.cs: support Stacktrace on warnings as well.
18477 * makefile: drop --unsafe and /unsafe from the compile.
18479 2002-03-13 Ravi Pratap <ravi@ximian.com>
18481 * ecore.cs (StandardConversionExists): Modify to take an Expression
18482 as the first parameter. Ensure we do null -> reference type conversion
18485 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18486 temporary Expression objects.
18488 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18490 * interface.cs: workaround bug in method overloading resolution
18491 (there is already a bugzilla bug for it).
18493 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18495 We could also solve this problem by having a separate path for
18496 performing type lookups, instead of DoResolve, we could have a
18497 ResolveType entry point, and only participating pieces of the
18498 production (simplename, deref, array) would implement this.
18500 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18501 signal SimpleName to only resolve type names and not attempt to
18502 resolve anything else.
18504 * expression.cs (Cast): Set the flag.
18506 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18508 * class.cs: Only report 108 if there is no `new' modifier.
18510 * cs-parser.jay: rework foreach statement to work with the new
18511 changes to the policy on SimpleNames.
18513 * report.cs: support Stacktrace on warnings as well.
18515 * makefile: drop --unsafe and /unsafe from the compile.
18517 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18519 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18520 lookups here, instead of doing that at parse time. This means
18521 that our grammar will not introduce `LocalVariableReferences' as
18522 expressions at this point. That solves the problem of code like
18526 static void Main ()
18530 This is only half the fix. The full fix requires parameters to
18531 also be handled in this way.
18533 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18534 makes the use more obvious of the DeclSpace. The
18535 ec.TypeContainer.TypeBuilder is now only used to pull the
18536 TypeBuilder for it.
18538 My theory is that I can get rid of the TypeBuilder completely from
18539 the EmitContext, and have typecasts where it is used (from
18540 DeclSpace to where it matters).
18542 The only pending problem is that the code that implements Aliases
18543 is on TypeContainer, and probably should go in DeclSpace.
18545 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18546 lookups here, instead of doing that at parse time. This means
18547 that our grammar will not introduce `LocalVariableReferences' as
18548 expressions at this point. That solves the problem of code like
18552 static void Main ()
18556 This is only half the fix. The full fix requires parameters to
18557 also be handled in this way.
18559 * class.cs (Property.DefineMethod): When implementing an interface
18560 method, set newslot, when implementing an abstract method, do not
18561 set the flag (before we tried never setting it, or always setting
18562 it, which is the difference).
18563 (Indexer.DefineMethod): same.
18564 (Method.DefineMethod): same.
18566 * ecore.cs: Only set the status used flag if we get back a Field.
18568 * attribute.cs: Temporary hack, so Paolo can keep working.
18570 2002-03-08 Ravi Pratap <ravi@ximian.com>
18572 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18573 the unmanaged type in the case we have a MarshalAs attribute.
18575 (Resolve): Handle the case when we are parsing the special MarshalAs
18576 attribute [we need to store the unmanaged type to use later]
18578 * typemanager.cs (marshal_as_attr_type): Built in type for the
18579 MarshalAs Attribute.
18581 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18582 on parameters and accordingly set the marshalling info.
18584 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18586 * class.cs: Optimizing slightly by removing redundant code after
18587 we switched to the `NoTypes' return value.
18588 (Property.DefineMethod): use NoTypes here too.
18590 This fixes the bug I introduced in my last batch of changes.
18592 2002-03-05 Ravi Pratap <ravi@ximian.com>
18594 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18596 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18597 Enums since those are types too.
18599 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18601 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18602 thanks to a call during the lookup process.
18604 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18606 * statement.cs (Foreach): Lots of work to accomodate a particular
18607 kind of foreach statement that I had not kept in mind. It is
18608 possible to have foreachs on classes that provide a GetEnumerator
18609 method that return objects that implement the "pattern" for using
18610 a foreach, there is no need to support GetEnumerator
18613 This is needed to compile nant.
18615 * decl.cs: Only report 114 if the member is not `Finalize' and if
18616 the warning level is at least 2.
18618 * class.cs: Moved the compare function from Method to
18621 (MethodSignature.InheritableMemberSignatureCompare): Add new
18622 filter function that is used to extract inheritable methods from a
18625 (Method.Define): Use the new `inheritable_method_signature_filter'
18628 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18631 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18633 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18635 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18637 * expression.cs: Pass location information to
18638 ConvertImplicitStandard.
18640 * class.cs: Added debugging code to track return values from
18643 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18645 * expression.cs (Is.DoResolve): If either side of the `is' is an
18646 interface, do not flag the warning.
18648 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18651 * report.cs: Allow for --fatal to be used with --probe.
18653 * typemanager.cs (NoTypes): Move the definition for the empty Type
18656 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18658 (TypeContainer.DefineProxy): New function used to proxy to parent
18659 implementations when implementing interfaces.
18660 (TypeContainer.ParentImplements): used to lookup if our parent
18661 implements a public function that is required by an interface.
18662 (TypeContainer.VerifyPendingMethods): Hook this up.
18664 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18665 `modules' and `assemblies' arraylists into arrays. We only grow
18666 these are the very early start up of the program, so this improves
18667 the speedof LookupType (nicely measured).
18669 * expression.cs (MakeByteBlob): Replaced unsafe code with
18670 BitConverter, as suggested by Paolo.
18672 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18673 folding of string concatenation, but if either side is a string,
18674 and the other is not, then return null, and let the runtime use
18675 the concatenation on the string plus the object (using
18676 `Object.ToString').
18678 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18680 Constant Folding has been implemented now.
18682 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18683 the error instead on types that are not supported in one's
18686 * constant.cs (Constant and all children): New set of functions to
18687 perform implict and explicit conversions.
18689 * ecore.cs (EnumConstant): Implement the new functions to perform
18690 conversion by proxying to the child expression.
18692 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18693 own separate setting that can not be turned off from the command
18694 line using --unchecked or --checked and is only controlled using
18695 the checked/unchecked statements and expressions. This setting is
18696 used by the constant folder to flag errors.
18698 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18699 ConstantCheckState as well.
18701 During Resolve, they also have to flag the state, because the
18702 constant folder runs completely in the Resolve phase.
18704 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18707 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18709 * cfold.cs: New file, this file contains the constant folder.
18711 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18712 argument to track whether we are using the resulting address to
18713 load or store a value and provide better error messages.
18715 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18716 new AddressOf arguments.
18718 * statement.cs (Foreach.EmitCollectionForeach): Update
18720 * expression.cs (Argument.Emit): Call AddressOf with proper
18721 arguments to track usage.
18723 (New.DoEmit): Call AddressOf with new arguments.
18725 (Unary.Emit): Adjust AddressOf call.
18727 2002-03-01 Ravi Pratap <ravi@ximian.com>
18729 * cs-parser.jay (member_access): Change the case for pre-defined types
18730 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18733 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18736 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18737 essentially like methods and apply attributes like MethodImplOptions to them too.
18739 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18742 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18743 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18746 * Update code everywhere accordingly.
18748 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18750 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18752 2002-02-28 Ravi Pratap <ravi@ximian.com>
18754 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18755 try performing lookups against those instead of jumping straight into using
18756 the 'using' clauses.
18758 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18760 (LookupType): Perform lookups in implicit parents too.
18762 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18763 sequence as RootContext.LookupType.
18765 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18766 the various cases of namespace lookups into this method.
18768 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18770 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18771 in positional arguments)
18773 * class.cs (Operator): Update the AllowedModifiers to contain
18776 * cs-parser.jay: Update operator declaration to allow for the
18777 operator body to be empty.
18779 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18782 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18784 * class.cs (Method.Emit): Label parameters.
18786 * driver.cs: Return 1 or 0 as the program exit code.
18788 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18790 * expression.cs: Special case the `null' object when trying to
18791 auto-compute the type, as anything can be explicitly converted to
18794 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18795 spotting this Paolo.
18797 (Expression.ImplicitNumericConversion): Perform comparissions of
18798 the type using the underlying type in the case of an enumeration
18799 rather than using the enumeration type for the compare.
18801 Cope with the underlying == type case, which is not possible to
18804 (Expression.ConvertNumericExplicit): Perform comparissions of
18805 the type using the underlying type in the case of an enumeration
18806 rather than using the enumeration type for the compare.
18808 * driver.cs: If the user does not supply an extension, assume .exe
18810 * cs-parser.jay (if_statement): Rewrote so that we can track the
18811 location for the if statement.
18813 * expression.cs (Binary.ConstantFold): Only concat strings when
18814 the operation is "+", not everything ;-)
18816 * statement.cs (Statement.EmitBoolExpression): Take a location
18818 (If, While, Do): Track location.
18820 * expression.cs (Binary.ResolveOperator): In the object + string
18821 case, I was missing a call to ConvertImplicit
18823 2002-02-25 Ravi Pratap <ravi@ximian.com>
18825 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18826 Location arguments. Ensure we use RootContext.LookupType to do our work
18827 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18829 * interface.cs (PopulateMethod): Handle the type of the parameter being
18832 * expression.cs (Invocation.BetterFunction): Handle the case when we
18833 have a params method with no fixed arguments and a call is made with no
18836 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18838 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18839 the verbatim-string-literal
18841 * support.cs (InternalParameters.ParameterModifier): handle null
18843 (InternalParameters.ParameterType): ditto.
18845 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18846 duplicating the name of the variable parameter.
18847 (GetParameterByName): Fix bug where we were not looking up array
18848 paramters if they were the only present (thanks Paolo!).
18849 (GetParameterInfo): We only have an empty set of types if both
18850 fixed and array are set to null.
18851 (GetParameterInfo-idx): Handle FixedParameter == null
18853 * cs-parser.jay: Handle the case where there is no catch
18854 statements (missing null test).
18856 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18858 * driver.cs (MainDriver): Be conservative on our command line
18861 Catch DirectoryNotFoundException when calling GetFiles.
18863 (SplitPathAndPattern): Used to split the input specification into
18864 a path and a pattern that we can feed to Directory.GetFiles.
18866 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18868 * statement.cs (Fixed): Implement the last case of the Fixed
18869 statement (string handling).
18871 * expression.cs (StringPtr): New class used to return a char * to
18872 a string; Used by the Fixed statement.
18874 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18876 * expression.cs (Binary.ResolveOperator): Remove redundant
18877 MemberLookup pn parent type.
18878 Optimize union call, we do not need a union if the types are the same.
18879 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18882 Specialize the use of MemberLookup everywhere, instead of using
18883 the default settings.
18885 (StackAlloc): Implement stackalloc keyword.
18887 * cs-parser.jay: Add rule to parse stackalloc.
18889 * driver.cs: Handle /h, /help, /?
18891 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18892 before we supported unsafe code.
18894 * makefile: add --unsafe to the self compilation of mcs.
18896 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18898 * expression.cs (PointerArithmetic): New class that is used to
18899 perform pointer arithmetic.
18900 (Binary.Resolve): Handle pointer arithmetic
18901 Handle pointer comparission.
18902 (ArrayPtr): Utility expression class that is used to take the
18903 address of an array.
18905 (ElementAccess): Implement array access for pointers
18907 * statement.cs (Fixed): Implement fixed statement for arrays, we
18908 are missing one more case before we are done.
18910 * expression.cs (Indirection): Implement EmitAssign and set the
18911 ExprClass to Variable. This allows pointer dereferences to be
18912 treated as variables, and to have values assigned to them.
18914 * ecore.cs (Expression.StoreFromPtr): New utility function to
18915 store values dereferencing.
18917 2002-02-20 Ravi Pratap <ravi@ximian.com>
18919 * expression.cs (Binary.ResolveOperator): Ensure that we are
18920 not trying to operate on a void type - this fixes the reported
18923 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18924 the parent implementation is sealed.
18926 * ../errors/cs0239.cs : Add.
18928 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18930 * typemanager.cs (unverifiable_code_type): Corresponds to
18931 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18932 which have unsafe code in them.
18934 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18937 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18939 * cs-tokenizer.cs: Add support for @"litreal strings"
18941 Make tokenizer accept pre-processor directives
18942 on any column (remove the old C-like limitation).
18944 * rootcontext.cs (EmitCode): Emit any global attributes.
18945 (AddGlobalAttributes): Used to keep track of assembly attributes.
18947 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18949 * cs-parser.jay: Add support for global attributes.
18951 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18953 * expression.cs (Indirection): New helper class. Unary will
18954 create Indirection classes to be able to implement the
18955 IMemoryLocation interface on it.
18957 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18959 * cs-parser.jay (fixed_statement): reference the right statement.
18961 * statement.cs (Fixed.Emit): Finish implementing the fixed
18962 statement for the &x case.
18964 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18966 * class.cs (Property.Define, Method.Define): Remove newslot when
18969 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18970 wrong. NewSlot should only be used if the `new' keyword is present.
18972 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18973 locating our system dir. Sorry about this.
18975 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18977 * driver.cs (GetSystemDir): Compute correctly the location of our
18978 system assemblies. I was using the compiler directory instead of
18979 the library directory.
18981 2002-02-13 Ravi Pratap <ravi@ximian.com>
18983 * expression.cs (BetterFunction): Put back in what Miguel commented out
18984 since it is the correct fix. The problem is elsewhere ;-)
18986 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18987 parameters of the parms method are themselves compatible or not !
18989 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18990 to check that a class implements an interface before saying that an implicit
18991 conversion was allowed. Use ImplementsInterface to do the checking.
18993 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18995 * class.cs (Method.Define): Track whether we are an explicit
18996 implementation or not. And only call DefineMethodOverride if we
18997 are an explicit implementation.
18999 (Property.DefineMethod): Ditto.
19001 2002-02-11 Ravi Pratap <ravi@ximian.com>
19003 * expression.cs (BetterFunction): Catch hideous bug which was
19004 preventing us from detecting ambiguous calls due to implicit casts i.e
19007 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19009 * support.cs (Pair): Remove un-needed method. I figured why I was
19010 getting the error in cs-parser.jay, the variable in a foreach loop
19011 is readonly, and the compiler does not really treat this as a variable.
19013 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19014 instead of EQUALS in grammar.
19016 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19018 * expression.cs (Unary.DoResolve): Check whether the argument is
19021 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19023 * support.cs: Api for Pair to set a value. Despite the fact that
19024 the variables are public the MS C# compiler refuses to compile
19025 code that accesses the field if the variable is part of a foreach
19028 * statement.cs (Fixed): Begin implementation of the fixed
19031 (Block.AddVariable): Return the VariableInfo on success and null
19032 on failure instead of true/false.
19034 * cs-parser.jay (foreach): Catch errors on variables already
19035 defined (we were ignoring this value before) and properly unwind
19036 the block hierarchy
19038 (fixed_statement): grammar for the fixed statement.
19040 2002-01-25 Miguel de Icaza <miguel@ximian.com>
19042 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19043 pointer types to be incretemented.
19045 (SizeOf): Implement.
19047 * cs-parser.jay (pointer_member_access): Implement
19048 expr->IDENTIFIER production.
19050 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19051 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19054 (Unary): Implement indirection.
19056 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19057 use in non-unsafe context).
19059 (SimpleName.DoResolve): Check for pointers in field access on safe
19062 (Expression.LoadFromPtr): Factor the load-indirect code in this
19063 function. This was duplicated in UnboxCast and ParameterReference
19065 2002-01-24 Miguel de Icaza <miguel@ximian.com>
19067 * expression.cs (ComposedCast): report an error if a pointer cast
19068 is used in a safe region.
19070 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19071 pointer type casts in unsafe context.
19073 * codegen.cs (EmitContext): Set up IsUnsafe.
19075 * cs-parser.jay (non_expression_type): Add productions for pointer
19078 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19079 code. We should not use force into static mode if the method is
19080 not virtual. Fixes bug in MIS
19082 * statement.cs (Do.Emit, While.Emit, For.Emit,
19083 Statement.EmitBoolExpression): Add support to Do and While to
19084 propagate infinite loop as `I do return' semantics.
19086 Improve the For case to also test for boolean constants.
19088 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19089 to the list of attributes we can add.
19091 Remove `EmitContext' argument.
19093 * class.cs (Method.Define): Apply parameter attributes.
19094 (Constructor.Define): Apply parameter attributes.
19095 (MethodCore.LabelParameters): Move here the core of labeling
19098 * support.cs (ReflectionParameters.ParameterModifier,
19099 InternalParameters.ParameterModifier): Use IsByRef on the type and
19100 only return the OUT bit for these parameters instead of in/out/ref
19103 This is because I miss-understood things. The ParameterInfo.IsIn
19104 and IsOut represent whether the parameter has the [In] and [Out]
19107 2002-01-22 Miguel de Icaza <miguel@ximian.com>
19109 * ecore.cs (FieldExpr.Emit): Release temporaries.
19111 * assign.cs (LocalTemporary.Release): new function.
19113 * codegen.cs (EmitContext.GetTemporaryStorage,
19114 EmitContext.FreeTemporaryStorage): Rework the way we deal with
19115 temporary storage. Now we can "put back" localbuilders when we
19118 2002-01-21 Miguel de Icaza <miguel@ximian.com>
19120 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19121 need to make a copy of the variable to generate verifiable code.
19123 2002-01-19 Miguel de Icaza <miguel@ximian.com>
19125 * driver.cs: Compute dynamically the system directory.
19127 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19128 Slower, but more generally useful. Used by the abstract
19129 registering implementation.
19131 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19132 the rules for the special rule on Type/instances. First check if
19133 we have the same name, and if so, try that special static path
19134 rather than the instance path.
19136 2002-01-18 Miguel de Icaza <miguel@ximian.com>
19138 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19141 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19142 Enum, ValueType, Delegate or Array for non-corlib compiles.
19144 * cs-tokenizer.cs: Catch long identifiers (645)
19146 * typemanager.cs (IndexerPropetyName): Ravi never tested this
19149 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19150 fix, we were returning too early, so we were not registering
19151 pending methods from abstract classes.
19153 Do not register pending methods if the class is abstract.
19155 * expression.cs (Conditional.DoResolve): Report circular implicit
19156 conversions when we neecd to compute it for conditional
19159 (Is.DoResolve): If the expression is always of the provided type,
19160 flag warning 183. If the expression can not ever be of the
19161 provided type flag warning 184.
19163 * class.cs: Catch 169 as well.
19165 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19168 2002-01-18 Nick Drochak <ndrochak@gol.com>
19170 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19172 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19174 * interface.cs: (PopulateMethod): Check for pointers being defined
19175 only if the unsafe context is active.
19176 (PopulateProperty): ditto.
19177 (PopulateIndexer): ditto.
19179 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19180 specified. If pointers are present, make sure that they are
19181 present in an unsafe context.
19182 (Constructor, Constructor.Define): ditto.
19183 (Field, Field.Define): ditto.
19184 (Property, Property.Define): ditto.
19185 (Event, Event.Define): ditto.
19187 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19188 hashtable if there are classes or structs defined.
19190 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19191 code, as the constant resolution moved.
19193 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19194 the metadata, so we can flag error 133.
19196 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19197 pointer is being declared in an unsafe context.
19199 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19201 * modifiers.cs (Modifiers.Check): Require a Location argument.
19202 Report error 227 for Unsafe use.
19204 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19206 * statement.cs (For.Emit): If the test is null, then report that
19207 we do `return', as we wont reach anything afterwards.
19209 (Switch.SwitchGoverningType): Track the expression that matched
19212 * driver.cs: Allow negative numbers as an error code to flag.
19214 * cs-parser.jay: Handle 1551.
19216 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19218 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19220 * cs-parser.jay: Report 1518 (type declaration can only contain
19221 class, struct, interface, enum or delegate)
19223 (switch_label): Report 1523 (keywords `case' or `default' must
19226 (opt_switch_sections): Report 1522 (empty switch)
19228 * driver.cs: Report 1515 (response file specified multiple times)
19229 Report 1516 (Source file specified multiple times).
19231 * expression.cs (Argument.Resolve): Signal 1510
19233 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19234 access not allowed in static code)
19236 2002-01-11 Ravi Pratap <ravi@ximian.com>
19238 * typemanager.cs (IsPointerType): Utility method which we are going
19241 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19242 the object type, so we take care of that.
19244 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19246 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19247 added to non-params parameters :-)
19249 * typemanager.cs (CSharpName): Include 'void' type too.
19251 (void_ptr_type): Include in the set of core types.
19253 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19256 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19259 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19260 completely forgotten about it.
19262 2002-01-10 Ravi Pratap <ravi@ximian.com>
19264 * cs-parser.jay (pointer_type): Add. This begins our implementation
19265 of parsing rules for unsafe code.
19267 (unsafe_statement): Implement.
19269 (embedded_statement): Modify to include the above.
19271 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19273 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19274 if the current context is an unsafe one.
19276 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19277 are handled differently, we need separate rules for them.
19279 (local_variable_declaration): Update to use local_variable_pointer_type
19280 to allow variable declarations of unmanaged pointer types.
19282 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19283 in unsafe contexts.
19285 * ../errors/cs0214.cs : Add.
19287 2002-01-16 Nick Drochak <ndrochak@gol.com>
19289 * makefile: remove 'response' file when cleaning.
19291 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19293 * cs-parser.jay: Report 1524.
19295 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19297 * typemanager.cs (RegisterMethod): drop checking if we have
19298 registered this from here
19300 2002-01-12 Miguel de Icaza <miguel@ximian.com>
19302 * class.cs (Method.EmitDestructor): Implement calling our base
19305 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19306 value of InFinally.
19308 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19309 this routine and will wrap the call in a try/catch block. Deal
19312 2002-01-11 Miguel de Icaza <miguel@ximian.com>
19314 * ecore.cs (Expression.MemberLookup): instead of taking a
19315 parameter `same_type' that was used to tell whether we could
19316 access private members we compute our containing type from the
19319 (FieldExpr): Added partial support for volatile fields. This does
19320 not work for volatile fields exposed from assemblies, as I can not
19321 figure out how to extract the modreq from it.
19323 Updated all the source files to use this.
19325 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19326 because it is referenced by MemberLookup very often.
19328 2002-01-09 Ravi Pratap <ravi@ximian.com>
19330 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19331 TypeBuilder.GetCustomAttributes to retrieve what we need.
19333 Get rid of redundant default_member_attr_type as this is the same as
19334 default_member_type which already exists.
19336 * interface.cs, attribute.cs : Update accordingly.
19338 2002-01-08 Miguel de Icaza <miguel@ximian.com>
19340 * typemanager.cs: Enable IndexerPropertyName again. It does not
19341 work for TYpeBuilders though. Ravi, can you please fix this?
19343 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19345 * expression.cs (Argument.Emit): Handle the case of ref objects
19346 being passed to ref functions;
19348 (ParameterReference.EmitLoad): Loads the content of the pointer
19349 without dereferencing.
19351 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19353 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19355 2002-01-08 Ravi Pratap <ravi@ximian.com>
19357 * class.cs (Indexer.DefineMethod): Incorporate the interface
19358 type in the name of the method if we are doing explicit interface
19361 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19363 (BetterConversion): Fix extremely trivial bug where we were referring to
19364 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19367 * ../errors/bug16.cs : Add although we have fixed it.
19369 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19371 * expression.cs (BaseIndexer): Begin implementation.
19373 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19375 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19376 production directly to remove a shift/reduce, and implement
19377 explicit interface implementation.
19379 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19380 after a floating point suffix.
19382 * expression.cs (DoNumericPromotions): Improved the conversion for
19383 uint/uint. If we have a constant, we avoid doing a typecast to a
19386 * class.cs (Indexer): Implement explicit interface implementation
19389 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19391 * class.cs: make the default instance constructor public and hidebysig.
19393 2001-01-03 Ravi Pratap <ravi@ximian.com>
19395 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19396 so we can call it from elsewhere.
19398 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19399 we emit it internally if the class has a defined indexer; otherwise the user
19400 emits it by decorating the class definition with the DefaultMemberAttribute.
19402 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19403 attribute is not used on a type which defines an indexer.
19405 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19406 character when we skip whitespace.
19408 * ../errors/cs0646.cs : Add.
19410 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19412 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19415 * makefile: Add practical target `mcs3.exe' which builds the third
19416 generation compiler.
19418 * expression.cs (New): Fix structures constructor calling.
19420 * class.cs (Property, Method, Indexer): Emit Final flag on the
19421 method if we are an interface implementation and we are not
19424 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19425 whether this property is referencing a `base' method.
19427 * expression.cs (Invocation.EmitCall): take an extra argument:
19428 is_base, this is used to determine whether the `call' or
19429 `callvirt' opcode should be used.
19432 * delegate.cs: update EmitCall.
19434 * class.cs (Method.Define): Set NewSlot for the cases where we are
19435 not implementing an interface method.
19437 (Property.Define): ditto.
19439 2002-01-02 Miguel de Icaza <miguel@ximian.com>
19441 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19442 'r'. Allows mcs to parse itself fully.
19444 2002-01-02 Ravi Pratap <ravi@ximian.com>
19446 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19447 of the number of initializers that require the InitializeArray method.
19449 (CheckIndices): Store the Expression in all cases - not the plain value. Also
19450 update the above field where necessary.
19452 (MakeByteBlob): Update accordingly.
19454 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
19457 (EmitDynamicInitializers): Update in accordance with the new optimization.
19459 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19460 same OpCode applies.
19462 * cs-parser.jay : Fix some glaring errors I introduced.
19464 2002-01-01 Ravi Pratap <ravi@ximian.com>
19466 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19467 so that we can check for name clashes there too.
19469 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19470 for interface indexers.
19472 * interfaces.cs (Define): Emit the default member attribute.
19474 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19475 variable was being referred to while setting the value ;-)
19477 2002-01-01 Miguel de Icaza <miguel@ximian.com>
19479 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19480 byte-by-byte information when we know the data is zero.
19482 Make the block always a multiple of 4, because
19483 DefineInitializedData has a bug.
19485 * assign.cs: Fix, we should assign from the temporary, not from
19488 * expression.cs (MakeByteBlob): Fix my incorrect code.
19490 2001-12-31 Miguel de Icaza <miguel@ximian.com>
19492 * typemanager.cs (EnumToUnderlying): This function is used to get
19493 the underlying type from an enumeration, because it does not
19496 * constant.cs: Use the I4_S form for values between -128 and 127.
19498 * statement.cs (Block.LookupLabel): Looks up a label.
19499 (Block): Drop support for labeled blocks.
19501 (LabeledStatement): New kind of statement that represents a label
19504 (Goto): Finally implement this bad boy.
19506 * cs-parser.jay: Update to reflect new mechanism to implement
19509 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19511 * codegen.cs (EmitContext.This): a codegen property that keeps the
19512 a single instance of this instead of creating many different this
19515 * delegate.cs (Delegate.DoResolve): Update to use the property;
19517 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19519 * expression.cs (BaseAccess.DoResolve): Ditto.
19521 2001-12-29 Ravi Pratap <ravi@ximian.com>
19523 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19524 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19526 (InitCoreTypes): Update accordingly.
19528 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19529 so we can quickly store the state.
19531 (ApplyAttributes): Set the correct implementation flags
19532 for InternalCall methods.
19534 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19536 * expression.cs (EmitCall): if a method is not virtual, then do
19537 not use callvirt on it.
19539 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19540 user defined stuff) requires the use of stobj, which takes an
19541 address on the stack instead of an array and an index. So emit
19542 the Ldelema operation for it.
19544 (EmitStoreOpcode): Use stobj for valuetypes.
19546 (UnaryMutator.EmitCode): Use the right 1 value depending on
19547 whether we are dealing with int64/uint64, float or doubles.
19549 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19550 constructors that I implemented last night.
19552 (Constructor.IsDefault): Fix to work properly for static
19555 * cs-parser.jay (CheckDef): report method signature errors.
19556 Update error number 103 to be 132.
19558 * decl.cs: New AdditionResult enumeration value: MethodExists.
19559 Although we do this check for methods later on in the semantic
19560 analysis, catching repeated default constructors is so easy that
19561 we catch these here.
19563 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19566 (ParameterReference.EmitAssign, Emit): handle
19569 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19570 (ArrayAccess.EmitStoreOpcode): ditto.
19572 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19574 * expression.cs (MakeByteBlob): Complete all the missing types
19575 (uint, short, ushort, byte, sbyte)
19577 * class.cs: Only init instance field initializers on instance
19580 Rename `constructors' to instance_constructors.
19582 (TypeContainer.AddConstructor): Only add constructors to the list
19583 if it is not static.
19585 Make sure that we handle default_static_constructor independently
19586 everywhere where we handle instance_constructors
19588 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19590 * class.cs: Do not lookup or create a base initializer for a
19591 static constructor.
19593 (ConstructorInitializer.Resolve): use the proper type to lookup
19596 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19598 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19601 * decl.cs: CloseType is now an virtual method, the default
19602 implementation just closes this type.
19604 2001-12-28 Ravi Pratap <ravi@ximian.com>
19606 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19607 to PreserveSig by default. Also emit HideBySig on such methods.
19609 Basically, set the defaults to standard values.
19611 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19612 argument, if candidate is better, it can't be worse than the best !
19614 (Invocation): Re-write bits to differentiate between methods being
19615 applicable in their expanded form and their normal form - for params
19618 Get rid of use_standard everywhere as only standard conversions are allowed
19619 in overload resolution.
19621 More spec conformance.
19623 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19625 * driver.cs: Add --timestamp, to see where the compiler spends
19628 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19629 `this' in static code.
19631 (SimpleName.DoResolve): Implement in terms of a helper function
19632 that allows static-references to be passed upstream to
19635 (Expression.ResolveWithSimpleName): Resolve specially simple
19636 names when called by MemberAccess to implement the special
19639 (Expression.ImplicitReferenceConversion): Handle conversions from
19640 Null to reference types before others, as Null's type is
19643 * expression.cs (Invocation.EmitCall): Handle the special case of
19644 calling methods declared on a reference type from a ValueType
19645 (Base classes System.Object and System.Enum)
19647 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19648 the left hand side is a TypeExpr, not on every enumeration.
19650 (Binary.Resolve): If types are reference types, then do a cast to
19651 object on operators != and == of both arguments.
19653 * typemanager.cs (FindMembers): Extract instance and static
19654 members if requested.
19656 * interface.cs (PopulateProperty): Use void_type instead of null
19657 as the return type for the setter method.
19659 (PopulateIndexer): ditto.
19661 2001-12-27 Ravi Pratap <ravi@ximian.com>
19663 * support.cs (ReflectionParameters): Fix minor bug where we
19664 were examining the wrong parameter for the ParamArray attribute.
19666 Cope with requests for the type of the parameter at position
19667 greater than the params parameter's. We now return the element
19668 type of the params array as that makes more sense.
19670 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19671 accordingly as we no longer have to extract the element type
19674 (Invocation.OverloadResolve): Update.
19676 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19678 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19679 against IEnumerator, test whether the return value is a descendant
19680 of the IEnumerator interface.
19682 * class.cs (Indexer.Define): Use an auxiliary method to implement
19683 the other bits of the method definition. Begin support for
19684 explicit interface implementation.
19686 (Property.DefineMethod): Use TypeManager.void_type instead of null
19687 for an empty return value.
19689 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19691 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19692 dealing with a FieldExpr which is composed of a FieldBuilder, in
19693 the code path we did extract the constant, but we should have
19694 obtained the underlying value to be able to cast it (otherwise we
19695 end up in an infinite loop, this is what Ravi was running into).
19697 (ArrayCreation.UpdateIndices): Arrays might be empty.
19699 (MemberAccess.ResolveMemberAccess): Add support for section
19700 14.5.4.1 that deals with the special case of E.I when E is a type
19701 and something else, that I can be a reference to a static member.
19703 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19704 handle a particular array type to create byte blobs, it is just
19705 something we dont generate byteblobs for.
19707 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19710 * location.cs (Push): remove the key from the hashtable that we
19711 are about to add. This happens for empty files.
19713 * driver.cs: Dispose files after we have parsed them.
19715 (tokenize): new function that only runs the tokenizer on its
19716 input, for speed testing.
19718 2001-12-26 Ravi Pratap <ravi@ximian.com>
19720 * class.cs (Event.Define): Define the private field only if there
19721 are no accessors defined.
19723 * expression.cs (ResolveMemberAccess): If there is no associated
19724 field with the event, that means we have an event defined with its
19725 own accessors and we should flag error cs0070 since transforming
19726 ourselves into a field is not valid in that case.
19728 * ecore.cs (SimpleName.DoResolve): Same as above.
19730 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19731 and charset to sane values.
19733 2001-12-25 Ravi Pratap <ravi@ximian.com>
19735 * assign.cs (DoResolve): Perform check on events only if they
19736 are being accessed outside the declaring type.
19738 * cs-parser.jay (event_declarations): Update rules to correctly
19739 set the type of the implicit parameter etc.
19741 (add_accessor, remove_accessor): Set current local parameters.
19743 * expression.cs (Binary): For delegate addition and subtraction,
19744 cast the return value from the method into the appropriate delegate
19747 2001-12-24 Ravi Pratap <ravi@ximian.com>
19749 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19750 of these as the workaround is unnecessary.
19752 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19753 delegate data - none of that is needed at all.
19755 Re-write bits to extract the instance expression and the delegate method
19758 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19761 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19762 of attaching attributes instead of duplicating code everywhere.
19764 * everywhere : Update code to do attribute emission using the above method.
19766 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19768 * expression.cs (IsParamsMethodApplicable): if there are not
19769 parameters, return immediately.
19771 * ecore.cs: The 0 literal can be implicity converted to an enum
19774 (SimpleName.DoResolve): First lookup the type, then lookup the
19777 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19778 want to get its address. If the InstanceExpression is not
19779 addressable, store the result in a temporary variable, then get
19782 * codegen.cs: Only display 219 errors on warning level or above.
19784 * expression.cs (ArrayAccess): Make it implement the
19785 IMemoryLocation interface.
19787 (Binary.DoResolve): handle the operator == (object a, object b)
19788 and operator != (object a, object b) without incurring into a
19789 BoxedCast (because 5 != o should never be performed).
19791 Handle binary enumerator operators.
19793 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19794 value type, otherwise use Ldelem_ref.
19796 Use precomputed names;
19798 (AddressOf): Implement address of
19800 * cs-parser.jay (labeled_statement): Fix recursive block
19801 addition by reworking the production.
19803 * expression.cs (New.DoEmit): New has a special case:
19805 If we are dealing with a ValueType, we have a few
19806 situations to deal with:
19808 * The target of New is a ValueType variable, that is
19809 easy, we just pass this as the variable reference
19811 * The target of New is being passed as an argument,
19812 to a boxing operation or a function that takes a
19815 In this case, we need to create a temporary variable
19816 that is the argument of New.
19819 2001-12-23 Ravi Pratap <ravi@ximian.com>
19821 * rootcontext.cs (LookupType): Check that current_type is not null before
19822 going about looking at nested types.
19824 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19825 not implement the IAssignMethod interface any more.
19827 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19828 where we tranform them into FieldExprs if they are being resolved from within
19829 the declaring type.
19831 * ecore.cs (SimpleName.DoResolve): Do the same here.
19833 * assign.cs (DoResolve, Emit): Clean up code considerably.
19835 * ../errors/bug10.cs : Add.
19837 * ../errors/cs0070.cs : Add.
19839 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19841 * assign.cs : Get rid of EventIsLocal everywhere.
19843 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19845 * ecore.cs (ConvertIntLiteral): finished the implementation.
19847 * statement.cs (SwitchLabel): Convert the value we are using as a
19848 key before looking up the table.
19850 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19852 * codegen.cs (EmitTopBlock): Require a Location argument now.
19854 * cs-parser.jay (constructor_declarator): We need to setup
19855 current_local_parameters before we parse the
19856 opt_constructor_initializer, to allow the variables to be bound
19857 to the constructor arguments.
19859 * rootcontext.cs (LookupType): First lookup nested classes in our
19860 class and our parents before we go looking outside our class.
19862 * expression.cs (ConstantFold): Extract/debox the values at the
19865 * rootcontext.cs (EmitCode): Resolve the constants first before we
19866 resolve the types. This is not really needed, but it helps debugging.
19868 * statement.cs: report location.
19870 * cs-parser.jay: pass location to throw statement.
19872 * driver.cs: Small bug fix.
19874 * report.cs: Updated format to be 4-zero filled digits.
19876 2001-12-22 Ravi Pratap <ravi@ximian.com>
19878 * expression.cs (CheckIndices): Fix minor bug where the wrong
19879 variable was being referred to ;-)
19881 (DoEmit): Do not call EmitStaticInitializers when the
19882 underlying type is System.Object.
19884 2001-12-21 Ravi Pratap <ravi@ximian.com>
19886 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19887 and do the usual workaround for SRE.
19889 * class.cs (MyEventBuilder.EventType): New member to get at the type
19890 of the event, quickly.
19892 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19894 * assign.cs (Assign.DoResolve): Handle the case when the target
19895 is an EventExpr and perform the necessary checks.
19897 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19900 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19902 (EventExpr): Set the type in the constructor itself since we
19903 are meant to be born fully resolved.
19905 (EventExpr.Define): Revert code I wrote earlier.
19907 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19908 instance expression is null. The instance expression is a This in that case
19909 or a null, depending on whether it is a static method or not.
19911 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19912 refers to more than one method.
19914 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19915 and accordingly flag errors.
19917 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19919 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19921 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19923 * location.cs (ToString): Provide useful rutine.
19925 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19927 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19928 objects, return the actual integral boxed.
19930 * statement.cs (SwitchLabel): define an ILLabel for each
19933 (Switch.CheckSwitch): If the value is a Literal, extract
19934 the underlying literal.
19936 Also in the unused hashtable we had, add the SwitchLabel so we can
19937 quickly look this value up.
19939 * constant.cs: Implement a bunch of new constants. Rewrite
19940 Literal based on this. Made changes everywhere to adapt to this.
19942 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19943 dereferencing array only once, and also copes with enumrations.
19945 bytes are two bytes wide, not one.
19947 (Cast): Perform constant conversions.
19949 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19950 wrappers to the literals here.
19952 * expression.cs (DoNumericPromotions): long literals can converted
19953 to ulong implicity (this is taken care of elsewhere, but I was
19954 missing this spot).
19956 * ecore.cs (Expression.Literalize): Make the return type Literal,
19957 to improve type checking.
19959 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19961 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19963 * literal.cs: Revert code from ravi that checked the bounds. The
19964 bounds are sane by the definition of the type itself.
19966 * typemanager.cs: Fix implementation of ImplementsInterface. We
19967 need to actually look up in our parent hierarchy for interfaces
19970 * const.cs: Use the underlying type for enumerations
19972 * delegate.cs: Compute the basename for the delegate creation,
19973 that should fix the delegate test case, and restore the correct
19974 Type Lookup semantics in rootcontext
19976 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19977 referencing a nested type with the Reflection API is using the "+"
19980 * cs-parser.jay: Do not require EOF token at the end.
19982 2001-12-20 Ravi Pratap <ravi@ximian.com>
19984 * rootcontext.cs (LookupType): Concatenate type names with
19985 a '.' instead of a '+' The test suite passes again.
19987 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19988 field of the enumeration.
19990 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19991 the case when the member is an EventExpr.
19993 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19994 static has an associated instance expression.
19996 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19998 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20000 * class.cs (Event.Define): Register event and perform appropriate checks
20003 We define the Add and Remove methods even if the use provides none because
20004 in that case, we provide default implementations ourselves.
20006 Define a private field of the type of the event. This is done by the CSC compiler
20007 and we should be doing it too ;-)
20009 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20010 More methods we use in code we generate.
20012 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20015 (InitCoreTypes): Update accordingly for the above.
20017 * class.cs (Event.Emit): Generate code for default accessors that we provide
20019 (EmitDefaultMethod): Do the job in the above.
20021 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20024 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20026 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20027 builders even if we were missing one.
20029 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20030 pass the Basename as our class name instead of the Name. The
20031 basename will be correctly composed for us.
20033 * parameter.cs (Paramters): Now takes a Location argument.
20035 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20036 make all the code call directly LookupType in RootContext and take
20037 this chance to pass the Location information everywhere.
20039 * Everywhere: pass Location information.
20041 2001-12-19 Miguel de Icaza <miguel@ximian.com>
20043 * class.cs (Constructor.Define): Updated way of detecting the
20044 length of the parameters.
20046 (TypeContainer.DefineType): Use basename as the type name for
20049 (TypeContainer.Define): Do not recursively define types here, as
20050 definition is taken care in order by the RootContext.
20052 * tree.cs: Keep track of namespaces in a per-file basis.
20054 * parameter.cs (Parameter.ComputeSignature): Update to use
20057 (Parameters.GetSignature): ditto.
20059 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20060 instead of a TypeContainer.
20062 (Interface.SemanticAnalysis): Use `this' instead of our parent to
20063 resolve names. Because we need to be resolve in our context, not
20066 * driver.cs: Implement response files.
20068 * class.cs (TypeContainer.DefineType): If we are defined, do not
20069 redefine ourselves.
20071 (Event.Emit): Emit the code for add/remove handlers.
20072 (Event.Define): Save the MethodBuilders for add/remove.
20074 * typemanager.cs: Use pair here too.
20076 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20077 DictionaryEntry requires the first argument to be non-null.
20079 (enum_declaration): Compute full name for registering the
20082 (delegate_declaration): Instead of using
20083 formal_parameter_list, use opt_formal_parameter_list as the list
20086 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20087 (EventParsing): New property that controls whether `add' and
20088 `remove' are returned as tokens or identifiers (for events);
20090 2001-12-19 Ravi Pratap <ravi@ximian.com>
20092 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20093 use MyEventBuilder only and let it wrap the real builder for us.
20095 (MyEventBuilder): Revamp constructor etc.
20097 Implement all operations that we perform on EventBuilder in precisely the same
20100 (FindMembers): Update to use the EventBuilder member.
20102 (Event.Emit): Update accordingly.
20104 2001-12-18 Ravi Pratap <ravi@ximian.com>
20106 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20107 by calling the appropriate methods.
20109 (GetCustomAttributes): Make stubs as they cannot possibly do anything
20112 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20114 2001-12-17 Ravi Pratap <ravi@ximian.com>
20116 * delegate.cs (Delegate.Populate): Check that the return type
20117 and various parameters types are indeed accessible.
20119 * class.cs (Constructor.Define): Same here.
20121 (Field.Define): Ditto.
20123 (Event.Define): Ditto.
20125 (Operator.Define): Check that the underlying Method defined itself
20126 correctly - so it's MethodBuilder should not be null.
20128 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20129 expression happens to be null.
20131 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20132 members but as of now we don't seem to be able to do anything really useful with it.
20134 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20135 not the EventBuilder.
20137 2001-12-18 Miguel de Icaza <miguel@ximian.com>
20139 * cs-tokenizer.cs: Add support for defines.
20140 Add support for #if, #elif, #else, #endif
20142 (eval_var): evaluates a variable.
20143 (eval): stubbed for evaluating functions.
20145 * cs-parser.jay: Pass the defines information
20147 * driver.cs: Add --define command line option.
20149 * decl.cs: Move MemberCore here.
20151 Make it the base class for DeclSpace. This allows us to catch and
20152 report 108 and 109 for everything now.
20154 * class.cs (TypeContainer.Define): Extract all the members
20155 before populating and emit the warning 108 (new keyword required
20156 to override) instead of having each member implement this.
20158 (MemberCore.Define): New abstract method, we will be using this in
20159 the warning reporting engine in Populate.
20161 (Operator.Define): Adjust to new MemberCore protocol.
20163 * const.cs (Const): This does not derive from Expression, it is a
20164 temporary object we use to create fields, it is a MemberCore.
20166 * class.cs (Method.Define): Allow the entry point to be in a
20169 * driver.cs: Rewrite the argument handler to clean it up a bit.
20171 * rootcontext.cs: Made it just an auxiliary namespace feature by
20172 making everything static.
20174 * driver.cs: Adapt code to use RootContext type name instead of
20177 * delegate.cs: Remove RootContext argument.
20179 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20182 * class.cs (Event.Define): The lookup can fail.
20184 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20186 * expression.cs: Resolve the this instance before invoking the code.
20188 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20190 * cs-parser.jay: Add a production in element_access that allows
20191 the thing to become a "type" reference. This way we can parse
20192 things like "(string [])" as a type.
20194 Note that this still does not handle the more complex rules of
20198 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20200 * ecore.cs: (CopyNewMethods): new utility function used to
20201 assemble the list of methods from running FindMembers.
20203 (MemberLookup): Rework FindMembers so that
20205 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20207 * class.cs (TypeContainer): Remove Delegates who fail to be
20210 * delegate.cs (Populate): Verify that we dont get null return
20211 values. TODO: Check for AsAccessible.
20213 * cs-parser.jay: Use basename to emit error 574 (destructor should
20214 have the same name as container class), not the full name.
20216 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20217 possible representation.
20219 Also implements integer type suffixes U and L.
20221 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20223 * expression.cs (ArrayCreation.DoResolve): We need to do the
20224 argument resolution *always*.
20226 * decl.cs: Make this hold the namespace. Hold the root context as
20228 (LookupType): Move here.
20230 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20232 * location.cs (Row, Name): Fixed the code, it was always returning
20233 references to the first file.
20235 * interface.cs: Register properties defined through interfaces.
20237 * driver.cs: Add support for globbing on the command line
20239 * class.cs (Field): Make it derive from MemberCore as well.
20242 2001-12-15 Ravi Pratap <ravi@ximian.com>
20244 * class.cs (Event::Define): Check that the type of the event is a delegate
20245 type else flag error #66.
20247 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20250 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20251 values of EntryPoint, CharSet etc etc.
20253 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20255 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20256 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20257 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20258 which needs this to do its work.
20260 * ../errors/cs0066.cs : Add.
20262 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20264 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20267 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20268 clears out the parameters field.
20269 (MemberSignatureCompare): Cleanup
20271 (MemberCore): New base class used to share code between MethodCore
20274 (RegisterRequiredImplementations) BindingFlags.Public requires
20275 either BindingFlags.Instace or Static. Use instance here.
20277 (Property): Refactored code to cope better with the full spec.
20279 * parameter.cs (GetParameterInfo): Return an empty array instead
20282 * class.cs (Property): Abstract or extern properties have no bodies.
20284 * parameter.cs (GetParameterInfo): return a zero-sized array.
20286 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20287 method modifier validation to the typecontainer so we can reuse
20288 this on properties.
20290 (MethodCore.ParameterTypes): return an empty sized array of types.
20292 (Property.Define): Test property modifier validity.
20294 Add tests for sealed/override too.
20296 (Method.Emit): abstract or extern methods have no bodies.
20298 2001-12-14 Ravi Pratap <ravi@ximian.com>
20300 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20303 (Method::Define, ::Emit): Modify accordingly.
20305 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20307 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20309 * makefile: Pass in /unsafe.
20311 2001-12-13 Miguel de Icaza <miguel@ximian.com>
20313 * class.cs (MakeKey): Kill routine.
20315 * class.cs (TypeContainer.Define): Correctly define explicit
20316 method implementations (they require the full interface name plus
20319 * typemanager.cs: Deply the PtrHashtable here and stop using the
20320 lame keys. Things work so much better.
20322 This of course broke everyone who depended on `RegisterMethod' to
20323 do the `test for existance' test. This has to be done elsewhere.
20325 * support.cs (PtrHashtable): A hashtable that avoid comparing with
20326 the object stupid Equals method (because, that like fails all over
20327 the place). We still do not use it.
20329 * class.cs (TypeContainer.SetRequiredInterface,
20330 TypeContainer.RequireMethods): Killed these two routines and moved
20331 all the functionality to RegisterRequiredImplementations.
20333 (TypeContainer.RegisterRequiredImplementations): This routine now
20334 registers all the implementations required in an array for the
20335 interfaces and abstract methods. We use an array of structures
20336 which can be computed ahead of time to reduce memory usage and we
20337 also assume that lookups are cheap as most classes will not
20338 implement too many interfaces.
20340 We also avoid creating too many MethodSignatures.
20342 (TypeContainer.IsInterfaceMethod): Update and optionally does not
20343 clear the "pending" bit if we find that there are problems with
20346 (TypeContainer.VerifyPendingMethods): Update to report errors of
20347 methods that look like implementations but are not.
20349 (TypeContainer.Define): Add support for explicit interface method
20352 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20354 * typemanager.cs: Keep track of the parameters here instead of
20355 being a feature of the TypeContainer.
20357 * class.cs: Drop the registration of parameters here, as
20358 InterfaceMethods are also interface declarations.
20360 * delegate.cs: Register methods with the TypeManager not only with
20361 the TypeContainer. This code was buggy.
20363 * interface.cs: Full registation here.
20365 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20367 * expression.cs: Remove reducer for binary expressions, it can not
20370 * const.cs: Put here the code that used to go into constant.cs
20372 * constant.cs: Put here the code for constants, this is a new base
20373 class for Literals.
20375 * literal.cs: Make Literal derive from Constant.
20377 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20379 * statement.cs (Return.Emit): Report error 157 if the user
20380 attempts to return from a finally block.
20382 (Return.Emit): Instead of emitting a return, jump to the end of
20385 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20386 LocalBuilder to store the result of the function. ReturnLabel is
20387 the target where we jump.
20390 2001-12-09 Radek Doulik <rodo@ximian.com>
20392 * cs-parser.jay: remember alias in current namespace
20394 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20397 * class.cs (LookupAlias): lookup alias in my_namespace
20399 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20401 (LookupAlias): lookup alias in this and if needed in parent
20404 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20408 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20409 making things static. I need this to avoid passing the
20410 TypeContainer when calling ParameterType.
20412 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20413 that did string manipulation to compute the type and then call
20414 GetType. Use Parameter.ParameterType instead.
20416 * cs-tokenizer.cs: Consume the suffix for floating values.
20418 * expression.cs (ParameterReference): figure out whether this is a
20419 reference parameter or not. Kill an extra variable by computing
20420 the arg_idx during emission.
20422 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20423 function that returns whether a parameter is an out/ref value or not.
20425 (Parameter.ParameterType): The type of the parameter (base,
20426 without ref/out applied).
20428 (Parameter.Resolve): Perform resolution here.
20429 (Parameter.ExternalType): The full type (with ref/out applied).
20431 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20432 support for expressions on the using statement.
20434 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20436 * statement.cs (Using.EmitLocalVariableDecls): Split the
20437 localvariable handling of the using statement.
20439 (Block.EmitMeta): Keep track of variable count across blocks. We
20440 were reusing slots on separate branches of blocks.
20442 (Try.Emit): Emit the general code block, we were not emitting it.
20444 Check the type of the declaration to be an IDisposable or
20445 something that can be implicity converted to it.
20447 Emit conversions if required.
20449 * ecore.cs (EmptyExpression): New utility class.
20450 (Expression.ImplicitConversionExists): New utility function.
20452 2001-12-06 Miguel de Icaza <miguel@ximian.com>
20454 * statement.cs (Using): Implement.
20456 * expression.cs (LocalVariableReference): Support read only variables.
20458 * statement.cs: Remove the explicit emit for the Leave opcode.
20459 (VariableInfo): Add a readonly field.
20461 2001-12-05 Miguel de Icaza <miguel@ximian.com>
20463 * ecore.cs (ConvCast): new class used to encapsulate the various
20464 explicit integer conversions that works in both checked and
20465 unchecked contexts.
20467 (Expression.ConvertNumericExplicit): Use new ConvCast class to
20468 properly generate the overflow opcodes.
20470 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20472 * statement.cs: The correct type for the EmptyExpression is the
20473 element_type, not the variable type. Ravi pointed this out.
20475 2001-12-04 Ravi Pratap <ravi@ximian.com>
20477 * class.cs (Method::Define): Handle PInvoke methods specially
20478 by using DefinePInvokeMethod instead of the usual one.
20480 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20481 above to do the task of extracting information and defining the method.
20483 2001-12-04 Ravi Pratap <ravi@ximian.com>
20485 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20486 of the condition for string type.
20488 (Emit): Move that here.
20490 (ArrayCreation::CheckIndices): Keep string literals in their expression
20493 (EmitDynamicInitializers): Handle strings appropriately.
20495 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20497 * codegen.cs (EmitContext): Replace multiple variables with a
20498 single pointer to the current Switch statement.
20500 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20503 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20507 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20510 (Foreach.Emit): Foreach on arrays was not setting
20511 up the loop variables (for break/continue).
20513 (GotoCase): Semi-implented.
20515 2001-12-03 Ravi Pratap <ravi@ximian.com>
20517 * attribute.cs (CheckAttribute): Handle system attributes by using
20518 Attribute.GetAttributes to examine information we need.
20520 (GetValidPlaces): Same here.
20522 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20524 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20526 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20528 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20530 (Method::Emit): Handle the case when we are a PInvoke method.
20532 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20534 * expression.cs: Use ResolveWithSimpleName on compound names.
20536 2001-12-02 Ravi Pratap <ravi@ximian.com>
20538 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20539 before trying to reduce it.
20541 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20543 * constant.cs (LookupConstantValue): Implement.
20545 (EmitConstant): Use the above in emitting the constant.
20547 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20548 that are user-defined by doing a LookupConstantValue on them.
20550 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20553 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20555 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20557 (BaseAccess.DoResolve): Implement.
20559 (MemberAccess.DoResolve): Split this routine into a
20560 ResolveMemberAccess routine that can be used independently
20562 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20564 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20565 As that share bits of the implementation. Is returns a boolean,
20566 while As returns the Type that is being probed.
20568 2001-12-01 Ravi Pratap <ravi@ximian.com>
20570 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20571 instead of a Literal - much easier.
20573 (EnumInTransit): Remove - utterly useless :-)
20575 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20577 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20579 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20580 chain when we have no associated expression.
20582 2001-11-30 Ravi Pratap <ravi@ximian.com>
20584 * constant.cs (Define): Use Location while reporting the errror.
20586 Also emit a warning when 'new' is used and there is no inherited
20589 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20592 (LookupEnumValue): Implement to lookup an enum member's value and define it
20595 (Populate): Re-write accordingly to use the above routine.
20597 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20599 * expression.cs (This): Fix prototype for DoResolveLValue to
20600 override the base class DoResolveLValue.
20602 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20605 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20606 (we need to load the address of the field here). This fixes
20609 (FieldExpr.DoResolveLValue): Call the DoResolve
20610 function to initialize the Instance expression.
20612 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20613 correctly the GetEnumerator operation on a value type.
20615 * cs-parser.jay: Add more simple parsing error catches.
20617 * statement.cs (Switch): Add support for string switches.
20618 Handle null specially.
20620 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20622 2001-11-28 Ravi Pratap <ravi@ximian.com>
20624 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20626 (declare_local_constant): New helper function.
20628 * statement.cs (AddConstant): Keep a separate record of constants
20630 (IsConstant): Implement to determine if a variable is a constant.
20632 (GetConstantExpression): Implement.
20634 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20636 * statement.cs (IsVariableDefined): Re-write.
20638 2001-11-27 Ravi Pratap <ravi@ximian.com>
20640 * class.cs (TypeContainer::FindMembers): Look for constants
20641 in the case when we are looking for MemberTypes.Field
20643 * expression.cs (MemberAccess::DoResolve): Check that in the
20644 case we are a FieldExpr and a Literal, we are not being accessed
20645 by an instance reference.
20647 * cs-parser.jay (local_constant_declaration): Implement.
20649 (declaration_statement): Implement for constant declarations.
20651 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20653 * statement.cs (Switch): Catch double defaults.
20655 (Switch): More work on the switch() statement
20656 implementation. It works for integral values now, need to finish
20660 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20662 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20663 integer literals into other integer literals. To be used by
20666 2001-11-24 Ravi Pratap <ravi@ximian.com>
20668 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20671 (EmitDynamicInitializers): Cope with the above since we extract data
20672 directly from ArrayData now.
20674 (ExpectInitializers): Keep track of whether initializers are mandatory
20677 (Bounds): Make it a hashtable to prevent the same dimension being
20678 recorded for every element in that dimension.
20680 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20683 Also fix bug which was causing the indices to be emitted in the reverse
20686 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20688 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20689 unfinished. They do not work, because the underlying code is
20692 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20694 * cs-parser.jay: Remove bogus fixme.
20696 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20697 on Switch statement.
20699 2001-11-23 Ravi Pratap <ravi@ximian.com>
20701 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20704 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20705 parameter. Apparently, any expression is allowed.
20707 (ValidateInitializers): Update accordingly.
20709 (CheckIndices): Fix some tricky bugs thanks to recursion.
20711 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20712 I was being completely brain-dead.
20714 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20715 and re-write acordingly.
20717 (DelegateInvocation): Re-write accordingly.
20719 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20721 (MakeByteBlob): Handle types more correctly.
20723 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20724 initialization from expressions but it is incomplete because I am a complete
20727 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20729 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20730 on If. Basically, we have to return `true' (ie, we do return to
20731 our caller) only if both branches of the if return.
20733 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20734 short-circuit operators, handle them as short circuit operators.
20736 (Cast.DoResolve): Resolve type.
20737 (Cast.Cast): Take an expression as the target type.
20739 * cs-parser.jay (cast_expression): Remove old hack that only
20740 allowed a limited set of types to be handled. Now we take a
20741 unary_expression and we resolve to a type during semantic
20744 Use the grammar productions from Rhys to handle casts (this is
20745 not complete like Rhys syntax yet, we fail to handle that corner
20746 case that C# has regarding (-x), but we will get there.
20748 2001-11-22 Ravi Pratap <ravi@ximian.com>
20750 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20751 field which is an array type.
20753 * cs-parser.jay (declare_local_variables): Support array initialization too.
20755 * typemanager.cs (MakeKey): Implement.
20757 (everywhere): Use the above appropriately.
20759 * cs-parser.jay (for_statement): Update for array initialization while
20760 declaring variables.
20762 * ecore.cs : The error message was correct, it's the variable's names that
20763 were misleading ;-) Make the code more readable.
20765 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20766 the correct type etc.
20768 (ConvertExplicit): Handle Enum types by examining the underlying type.
20770 2001-11-21 Ravi Pratap <ravi@ximian.com>
20772 * parameter.cs (GetCallingConvention): Always return
20773 CallingConventions.Standard for now.
20775 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20777 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20778 and `r' after calling DoNumericPromotions.
20780 * ecore.cs: Fix error message (the types were in the wrong order).
20782 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20783 BindingFlags.Instance as well
20785 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20786 implicit int literal conversion in an empty cast so that we
20787 propagate the right type upstream.
20789 (UnboxCast): new class used to unbox value types.
20790 (Expression.ConvertExplicit): Add explicit type conversions done
20793 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20794 the target type before applying the implicit LongLiterals to ULong
20797 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20799 * cs-parser.jay (for_statement): Reworked the way For works: now
20800 we declare manually any variables that are introduced in
20801 for_initializer to solve the problem of having out-of-band code
20802 emition (that is what got for broken).
20804 (declaration_statement): Perform the actual variable declaration
20805 that used to be done in local_variable_declaration here.
20807 (local_variable_declaration): Do not declare anything, just pass
20808 the information on a DictionaryEntry
20810 2001-11-20 Ravi Pratap <ravi@ximian.com>
20812 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20813 re-write of the logic to now make it recursive.
20815 (UpdateIndices): Re-write accordingly.
20817 Store element data in a separate ArrayData list in the above methods.
20819 (MakeByteBlob): Implement to dump the array data into a byte array.
20821 2001-11-19 Ravi Pratap <ravi@ximian.com>
20823 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20826 * constant.cs (Define): Implement.
20828 (EmitConstant): Re-write fully.
20830 Pass in location info.
20832 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20835 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20836 DictionaryEntry since we need location info too.
20838 (constant_declaration): Update accordingly.
20840 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20841 code into another method : UpdateIndices.
20843 2001-11-18 Ravi Pratap <ravi@ximian.com>
20845 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20846 some type checking etc.
20848 2001-11-17 Ravi Pratap <ravi@ximian.com>
20850 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20851 bits to provide dimension info if the user skips doing that.
20853 Update second constructor to store the rank correctly.
20855 2001-11-16 Ravi Pratap <ravi@ximian.com>
20857 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20858 and try to implement.
20860 * ../errors/cs0150.cs : Add.
20862 * ../errors/cs0178.cs : Add.
20864 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20866 * statement.cs: Implement foreach on multi-dimensional arrays.
20868 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20869 name of the params argument.
20871 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20872 initializing the array.
20874 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20875 we can use this elsewhere.
20877 * statement.cs: Finish implementation of foreach for single
20880 * cs-parser.jay: Use an out-of-band stack to pass information
20881 around, I wonder why I need this.
20883 foreach_block: Make the new foreach_block the current_block.
20885 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20886 function used to return a static Parameters structure. Used for
20887 empty parameters, as those are created very frequently.
20889 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20891 2001-11-15 Ravi Pratap <ravi@ximian.com>
20893 * interface.cs : Default modifier is private, not public. The
20894 make verify test passes again.
20896 2001-11-15 Ravi Pratap <ravi@ximian.com>
20898 * support.cs (ReflectionParameters): Fix logic to determine
20899 whether the last parameter is a params one. Test 9 passes again.
20901 * delegate.cs (Populate): Register the builders we define with
20902 RegisterParameterForBuilder. Test 19 passes again.
20904 * cs-parser.jay (property_declaration): Reference $6 instead
20905 of $$ to get at the location.
20907 (indexer_declaration): Similar stuff.
20909 (attribute): Ditto.
20911 * class.cs (Property): Register parameters for the Get and Set methods
20912 if they exist. Test 23 passes again.
20914 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20915 call to EmitArguments as we are sure there aren't any params arguments.
20916 Test 32 passes again.
20918 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20919 IndexOutOfRangeException.
20921 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20922 Test 33 now passes again.
20924 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20926 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20927 broke a bunch of things. Will have to come up with a better way
20928 of tracking locations.
20930 * statement.cs: Implemented foreach for single dimension arrays.
20932 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20934 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20935 an error. This removes the lookup from the critical path.
20937 * cs-parser.jay: Removed use of temporary_loc, which is completely
20940 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20942 * support.cs (ReflectionParameters.ParameterModifier): Report
20943 whether the argument is a PARAMS argument or not.
20945 * class.cs: Set the attribute `ParamArrayAttribute' on the
20946 parameter argument.
20948 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20949 and cons_param_array_attribute (ConstructorInfo for
20950 ParamArrayAttribute).,
20952 * codegen.cs: Emit the return using the `Return' statement, that
20953 way we can report the error correctly for missing return values.
20955 * class.cs (Method.Emit): Clean up.
20957 * expression.cs (Argument.Resolve): Take another argument: the
20958 location where this argument is used. Notice that this is not
20959 part of the "Argument" class as to reduce the size of the
20960 structure (we know the approximate location anyways).
20962 Test if the argument is a variable-reference, if not, then
20963 complain with a 206.
20965 (Argument.Emit): Emit addresses of variables.
20967 (Argument.FullDesc): Simplify.
20969 (Invocation.DoResolve): Update for Argument.Resolve.
20971 (ElementAccess.DoResolve): ditto.
20973 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20974 method should be virtual, as this method is always virtual.
20976 (NewDelegate.DoResolve): Update for Argument.Resolve.
20978 * class.cs (ConstructorInitializer.DoResolve): ditto.
20980 * attribute.cs (Attribute.Resolve): ditto.
20982 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20984 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20986 * expression.cs (ParameterReference): Drop IStackStorage and implement
20987 IAssignMethod instead.
20989 (LocalVariableReference): ditto.
20991 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20992 IAssignMethod instead.
20994 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20996 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20997 enumerations that are used in heavily used structures derive from
20998 byte in a laughable and pathetic attempt to reduce memory usage.
20999 This is the kind of pre-optimzations that you should not do at
21000 home without adult supervision.
21002 * expression.cs (UnaryMutator): New class, used to handle ++ and
21003 -- separatedly from the other unary operators. Cleans up the
21004 code, and kills the ExpressionStatement dependency in Unary.
21006 (Unary): Removed `method' and `Arguments' from this class, making
21007 it smaller, and moving it all to SimpleCall, so I can reuse this
21008 code in other locations and avoid creating a lot of transient data
21009 strucutres when not required.
21011 * cs-parser.jay: Adjust for new changes.
21013 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21015 * enum.cs (Enum.Populate): If there is a failure during
21018 * cs-parser.jay (opt_enum_base): we used to catch type errors
21019 here, but this is really incorrect. The type error should be
21020 catched during semantic analysis.
21022 2001-12-11 Ravi Pratap <ravi@ximian.com>
21024 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21025 current_local_parameters as expected since I, in my stupidity, had forgotten
21028 * attribute.cs (GetValidPlaces): Fix stupid bug.
21030 * class.cs (Method::Emit): Perform check on applicability of attributes.
21032 (Constructor::Emit): Ditto.
21034 (Field::Emit): Ditto.
21036 (Field.Location): Store location information.
21038 (Property, Event, Indexer, Operator): Ditto.
21040 * cs-parser.jay (field_declaration): Pass in location for each field.
21042 * ../errors/cs0592.cs : Add.
21044 2001-11-12 Ravi Pratap <ravi@ximian.com>
21046 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21048 (InitCoreTypes): Update accordingly.
21050 (RegisterAttrType, LookupAttr): Implement.
21052 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21053 info about the same.
21055 (Resolve): Update to populate the above as necessary.
21057 (Error592): Helper.
21059 (GetValidPlaces): Helper to the above.
21061 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21063 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21065 2001-11-12 Ravi Pratap <ravi@ximian.com>
21067 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21069 * ../errors/cs0617.cs : Add.
21071 2001-11-11 Ravi Pratap <ravi@ximian.com>
21073 * enum.cs (Emit): Rename to Populate to be more consistent with what
21074 we expect it to do and when exactly it is called.
21076 * class.cs, rootcontext.cs : Update accordingly.
21078 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21079 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21081 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21083 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21084 of a fieldinfo using the above, when dealing with a FieldBuilder.
21086 2001-11-10 Ravi Pratap <ravi@ximian.com>
21088 * ../errors/cs0031.cs : Add.
21090 * ../errors/cs1008.cs : Add.
21092 * ../errrors/cs0543.cs : Add.
21094 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21097 (FindMembers): Implement.
21099 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21100 enums and delegates too.
21102 (enum_types): Rename to builder_to_enum.
21104 (delegate_types): Rename to builder_to_delegate.
21106 * delegate.cs (FindMembers): Implement.
21108 2001-11-09 Ravi Pratap <ravi@ximian.com>
21110 * typemanager.cs (IsEnumType): Implement.
21112 * enum.cs (Emit): Re-write parts to account for the underlying type
21113 better and perform checking etc.
21115 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21116 of the underlying type.
21118 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21121 * enum.cs (error31): Helper to report error #31.
21123 * cs-parser.jay (enum_declaration): Store location of each member too.
21125 * enum.cs (member_to_location): New hashtable.
21127 (AddEnumMember): Update location hashtable.
21129 (Emit): Use the location of each member while reporting errors.
21131 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21133 * cs-parser.jay: A for_initializer if is a
21134 local_variable_declaration really ammount to have an implicit
21135 block with the variable declaration and no initializer for for.
21137 * statement.cs (For.Emit): Cope with null initializers.
21139 This fixes the infinite loop on for initializers.
21141 2001-11-08 Miguel de Icaza <miguel@ximian.com>
21143 * enum.cs: More cleanup.
21145 * ecore.cs: Remove dead code.
21147 * class.cs (Property.Emit): More simplification.
21148 (Event.Emit): ditto.
21150 Reworked to have less levels of indentation.
21152 2001-11-08 Ravi Pratap <ravi@ximian.com>
21154 * class.cs (Property): Emit attributes.
21164 * enum.cs (Emit): Ditto.
21166 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21169 * class.cs (Field, Event, etc.): Move attribute generation into the
21170 Emit method everywhere.
21172 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21173 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21174 as we had no way of defining nested enums !
21176 * rootcontext.cs : Adjust code accordingly.
21178 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21180 2001-11-07 Ravi Pratap <ravi@ximian.com>
21182 * expression.cs (EvalConstantExpression): Move into ecore.cs
21184 * enum.cs (Enum): Rename some members and make them public and readonly
21185 according to our convention.
21187 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21190 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21192 (Enum::Emit): Write a simple version for now which doesn't try to compute
21193 expressions. I shall modify this to be more robust in just a while.
21195 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21197 (TypeContainer::CloseType): Create the Enum types too.
21199 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21201 * expression.cs (EvalConstantExpression): Get rid of completely.
21203 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21204 user-defined values and other cases.
21206 (IsValidEnumLiteral): Helper function.
21208 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21209 out there in the case we had a literal FieldExpr.
21211 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21213 (Literalize): Revamp a bit to take two arguments.
21215 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21217 2001-11-06 Ravi Pratap <ravi@ximian.com>
21219 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21221 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21223 (Resolve): Use the above to ensure we have proper initializers.
21225 2001-11-05 Ravi Pratap <ravi@ximian.com>
21227 * expression.cs (Expression::EvalConstantExpression): New method to
21228 evaluate constant expressions.
21230 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21232 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21234 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21237 (Binary.ResolveOperator): Handle operator != (object a, object b)
21238 and operator == (object a, object b);
21240 (Binary.DoNumericPromotions): Indicate whether the numeric
21241 promotion was possible.
21243 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21246 Made the ArrayAccess implement interface IAssignMethod instead of
21247 IStackStore as the order in which arguments are passed reflects
21250 * assign.cs: Instead of using expr.ExprClass to select the way of
21251 assinging, probe for the IStackStore/IAssignMethod interfaces.
21253 * typemanager.cs: Load InitializeArray definition.
21255 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21256 static data that can be used to initialize arrays.
21258 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21260 * expression.cs: Handle operator== and operator!= for booleans.
21262 (Conditioal.Reduce): Implement reducer for the ?: operator.
21264 (Conditional.Resolve): Implement dead code elimination.
21266 (Binary.Resolve): Catch string literals and return a new
21267 concatenated string.
21269 (Unary.Reduce): Implement reduction of unary expressions.
21271 * ecore.cs: Split out the expression core handling here.
21273 (Expression.Reduce): New method used to perform constant folding
21274 and CSE. This is needed to support constant-expressions.
21276 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21277 targets, and optimize for !x.
21279 2001-11-04 Ravi Pratap <ravi@ximian.com>
21281 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21282 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21283 set custom atttributes.
21285 * literal.cs (Literal::GetValue): New abstract method to return the actual
21286 value of the literal, cast as an object.
21288 (*Literal): Implement GetValue method.
21290 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21291 expressions to the arraylist but objects of type Argument.
21293 * class.cs (TypeContainer::Emit): Emit our attributes too.
21295 (Method::Emit, Constructor::Emit): Ditto.
21297 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21298 to be ignoring earlier.
21300 2001-11-03 Ravi Pratap <ravi@ximian.com>
21302 * attribute.cs (AttributeSection::Define): Implement to do the business
21303 of constructing a CustomAttributeBuilder.
21305 (Attribute): New trivial class. Increases readability of code.
21307 * cs-parser.jay : Update accordingly.
21309 (positional_argument_list, named_argument_list, named_argument): New rules
21311 (attribute_arguments): Use the above so that we are more correct.
21313 2001-11-02 Ravi Pratap <ravi@ximian.com>
21315 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21316 to perform all checks for a method with a params parameter.
21318 (Invocation::OverloadResolve): Update to use the above method and therefore
21319 cope correctly with params method invocations.
21321 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
21324 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21325 constructors in our parent too because we can't afford to miss out on
21328 * attribute.cs (AttributeSection): New name for the class Attribute
21330 Other trivial changes to improve readability.
21332 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21333 use the new class names.
21335 2001-11-01 Ravi Pratap <ravi@ximian.com>
21337 * class.cs (Method::Define): Complete definition for params types too
21339 (Indexer::Define): Ditto.
21341 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21342 Cope everywhere with a request for info about the array parameter.
21344 2001-11-01 Ravi Pratap <ravi@ximian.com>
21346 * tree.cs (RecordNamespace): Fix up to check for the correct key.
21348 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
21349 local_variable_type to extract the string corresponding to the type.
21351 (local_variable_type): Fixup the action to use the new helper method.
21353 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21356 * expression.cs : Clean out code which uses the above.
21358 2001-10-31 Ravi Pratap <ravi@ximian.com>
21360 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21361 and bale out if necessary by returning a false.
21363 (RegisterProperty): Ditto.
21365 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21366 and print out appropriate error messages.
21368 * interface.cs (everywhere): Ditto.
21370 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21371 location to constructor.
21373 * class.cs (Property, Event, Indexer): Update accordingly.
21375 * ../errors/cs111.cs : Added.
21377 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21378 of a method, as laid down by the spec.
21380 (Invocation::OverloadResolve): Use the above method.
21382 2001-10-31 Ravi Pratap <ravi@ximian.com>
21384 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21385 now take a TypeContainer and a Parameters object.
21387 (ParameterData): Modify return type of ParameterModifier method to be
21388 Parameter.Modifier and not a string.
21390 (ReflectionParameters, InternalParameters): Update accordingly.
21392 * expression.cs (Argument::GetParameterModifier): Same here.
21394 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21395 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21396 symbol in it at all so maybe this is only for now.
21398 2001-10-30 Ravi Pratap <ravi@ximian.com>
21400 * support.cs (InternalParameters): Constructor now takes an extra argument
21401 which is the actual Parameters class.
21403 (ParameterDesc): Update to provide info on ref/out modifiers.
21405 * class.cs (everywhere): Update call to InternalParameters to pass in
21406 the second argument too.
21408 * support.cs (ParameterData): Add ParameterModifier, which is a method
21409 to return the modifier info [ref/out etc]
21411 (InternalParameters, ReflectionParameters): Implement the above.
21413 * expression.cs (Argument::ParameterModifier): Similar function to return
21414 info about the argument's modifiers.
21416 (Invocation::OverloadResolve): Update to take into account matching modifiers
21419 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21420 a new SetFormalParameters object which we pass to InternalParameters.
21422 2001-10-30 Ravi Pratap <ravi@ximian.com>
21424 * expression.cs (NewArray): Merge into the ArrayCreation class.
21426 2001-10-29 Ravi Pratap <ravi@ximian.com>
21428 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21429 NewUserdefinedArray into one as there wasn't much of a use in having
21432 * expression.cs (Argument): Change field's name to ArgType from Type.
21434 (Type): New readonly property which returns the proper type, taking into
21435 account ref/out modifiers.
21437 (everywhere): Adjust code accordingly for the above.
21439 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21440 whether we are emitting for a ref or out parameter.
21442 * expression.cs (Argument::Emit): Use the above field to set the state.
21444 (LocalVariableReference::Emit): Update to honour the flag and emit the
21447 * parameter.cs (Attributes): Set the correct flags for ref parameters.
21449 * expression.cs (Argument::FullDesc): New function to provide a full desc.
21451 * support.cs (ParameterData): Add method ParameterDesc to the interface.
21453 (ReflectionParameters, InternalParameters): Implement the above method.
21455 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21458 (Invocation::FullMethodDesc): Ditto.
21460 2001-10-29 Miguel de Icaza <miguel@ximian.com>
21462 * cs-parser.jay: Add extra production for the second form of array
21465 * expression.cs (ArrayCreation): Update to reflect the above
21468 * Small changes to prepare for Array initialization.
21470 2001-10-28 Miguel de Icaza <miguel@ximian.com>
21472 * typemanager.cs (ImplementsInterface): interface might be null;
21473 Deal with this problem;
21475 Also, we do store negative hits on the cache (null values), so use
21476 this instead of calling t.GetInterfaces on the type everytime.
21478 2001-10-28 Ravi Pratap <ravi@ximian.com>
21480 * typemanager.cs (IsBuiltinType): New method to help determine the same.
21482 * expression.cs (New::DoResolve): Get rid of array creation code and instead
21483 split functionality out into different classes.
21485 (New::FormArrayType): Move into NewBuiltinArray.
21487 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21490 (NewBuiltinArray): New class to handle creation of built-in arrays.
21492 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21493 account creation of one-dimensional arrays.
21495 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21497 (NewUserdefinedArray::DoResolve): Implement.
21499 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21501 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21502 we maintain inside the TypeManager. This is necessary to perform lookups on the
21505 (LookupType): Update to perform GetType on the module builders too.
21507 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21509 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21511 2001-10-23 Ravi Pratap <ravi@ximian.com>
21513 * expression.cs (New::DoResolve): Implement guts of array creation.
21515 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21517 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21519 * expression.cs: Fix bug I introduced lsat night that broke
21522 (Expression.Resolve): Report a 246 error (can not resolve name)
21523 if we find a SimpleName in the stream.
21525 (Expression.ResolveLValue): Ditto.
21527 (Expression.ResolveWithSimpleName): This function is a variant of
21528 ResolveName, this one allows SimpleNames to be returned without a
21529 warning. The only consumer of SimpleNames is MemberAccess
21531 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21533 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21534 might arrive here. I have my doubts that this is correct.
21536 * statement.cs (Lock): Implement lock statement.
21538 * cs-parser.jay: Small fixes to support `lock' and `using'
21540 * cs-tokenizer.cs: Remove extra space
21542 * driver.cs: New flag --checked, allows to turn on integer math
21545 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21546 Threading.Monitor.Exit
21548 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21550 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21551 Expression Class to be IndexerAccess.
21553 Notice that Indexer::DoResolve sets the eclass to Value.
21555 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21557 * class.cs (TypeContainer::Emit): Emit code for indexers.
21559 * assign.cs (IAssignMethod): New interface implemented by Indexers
21560 and Properties for handling assignment.
21562 (Assign::Emit): Simplify and reuse code.
21564 * expression.cs (IndexerAccess, PropertyExpr): Implement
21565 IAssignMethod, clean up old code.
21567 2001-10-22 Ravi Pratap <ravi@ximian.com>
21569 * typemanager.cs (ImplementsInterface): New method to determine if a type
21570 implements a given interface. Provides a nice cache too.
21572 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21575 (ConvertReferenceExplicit): Ditto.
21577 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21578 various methods, with correct names etc.
21580 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21581 Operator.UnaryNegation.
21583 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21584 we have a unary plus or minus operator.
21586 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21589 * everywhere : update accordingly.
21591 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21594 * class.cs (Method::Define): For the case where we are implementing a method
21595 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21596 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21598 2001-10-21 Ravi Pratap <ravi@ximian.com>
21600 * interface.cs (FindMembers): Implement to work around S.R.E
21603 * typemanager.cs (IsInterfaceType): Implement.
21605 (FindMembers): Update to handle interface types too.
21607 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21608 use IsAssignableFrom as that is not correct - it doesn't work.
21610 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21611 and accordingly override EmitStatement.
21613 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21614 using the correct logic :-)
21616 2001-10-19 Ravi Pratap <ravi@ximian.com>
21618 * ../errors/cs-11.cs : Add to demonstrate error -11
21620 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21622 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21623 then pass this as a hint to ResolveLValue.
21625 * expression.cs (FieldExpr): Add Location information
21627 (FieldExpr::LValueResolve): Report assignment to readonly
21630 (Expression::ExprClassFromMemberInfo): Pass location information.
21632 (Expression::ResolveLValue): Add new method that resolves an
21635 (Expression::DoResolveLValue): Default invocation calls
21638 (Indexers): New class used to keep track of indexers in a given
21641 (IStackStore): Renamed from LValue, as it did not really describe
21642 what this did. Also ResolveLValue is gone from this interface and
21643 now is part of Expression.
21645 (ElementAccess): Depending on the element access type
21647 * typemanager.cs: Add `indexer_name_type' as a Core type
21648 (System.Runtime.CompilerServices.IndexerNameAttribute)
21650 * statement.cs (Goto): Take a location.
21652 2001-10-18 Ravi Pratap <ravi@ximian.com>
21654 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21655 if two delegates are compatible.
21657 (NewDelegate::DoResolve): Update to take care of the case when
21658 we instantiate a delegate from another delegate.
21660 * typemanager.cs (FindMembers): Don't even try to look up members
21661 of Delegate types for now.
21663 2001-10-18 Ravi Pratap <ravi@ximian.com>
21665 * delegate.cs (NewDelegate): New class to take care of delegate
21668 * expression.cs (New): Split the delegate related code out into
21669 the NewDelegate class.
21671 * delegate.cs (DelegateInvocation): New class to handle delegate
21674 * expression.cs (Invocation): Split out delegate related code into
21675 the DelegateInvocation class.
21677 2001-10-17 Ravi Pratap <ravi@ximian.com>
21679 * expression.cs (New::DoResolve): Implement delegate creation fully
21680 and according to the spec.
21682 (New::DoEmit): Update to handle delegates differently.
21684 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21685 because of which we were printing out arguments in reverse order !
21687 * delegate.cs (VerifyMethod): Implement to check if the given method
21688 matches the delegate.
21690 (FullDelegateDesc): Implement.
21692 (VerifyApplicability): Implement.
21694 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21695 delegate invocations too.
21697 (Invocation::Emit): Ditto.
21699 * ../errors/cs1593.cs : Added.
21701 * ../errors/cs1594.cs : Added.
21703 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21705 2001-10-16 Ravi Pratap <ravi@ximian.com>
21707 * typemanager.cs (intptr_type): Core type for System.IntPtr
21709 (InitCoreTypes): Update for the same.
21711 (iasyncresult_type, asynccallback_type): Ditto.
21713 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21716 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21719 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21720 the builders for the 4 members of a delegate type :-)
21722 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21725 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21727 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21729 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21731 * statement.cs (Break::Emit): Implement.
21732 (Continue::Emit): Implement.
21734 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21735 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21736 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21737 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21740 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21741 properties that track the label for the current loop (begin of the
21742 loop and end of the loop).
21744 2001-10-15 Ravi Pratap <ravi@ximian.com>
21746 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21747 use of emitting anything at all.
21749 * class.cs, rootcontext.cs : Get rid of calls to the same.
21751 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21753 (Populate): Define the constructor correctly and set the implementation
21756 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21759 (AddDelegateType): Implement.
21761 (IsDelegateType): Implement helper method.
21763 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21765 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21766 and accordingly handle it.
21768 * delegate.cs (Populate): Take TypeContainer argument.
21769 Implement bits to define the Invoke method. However, I still haven't figured out
21770 how to take care of the native int bit :-(
21772 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21773 Qualify the name of the delegate, not its return type !
21775 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21778 (StandardConversionExists): Checking for array types turns out to be recursive.
21780 (ConvertReferenceExplicit): Implement array conversion.
21782 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21784 2001-10-12 Ravi Pratap <ravi@ximian.com>
21786 * cs-parser.jay (delegate_declaration): Store the fully qualified
21787 name as it is a type declaration.
21789 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21792 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21793 as TypeContainer::DefineType.
21795 (Populate): Method in which all the definition of the various methods (Invoke)
21798 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21801 (CloseDelegate): Finally creates the delegate.
21803 * class.cs (TypeContainer::DefineType): Update to define delegates.
21804 (Populate, Emit and CloseType): Do the same thing here too.
21806 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21807 delegates in all these operations.
21809 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21811 * expression.cs: LocalTemporary: a new expression used to
21812 reference a temporary that has been created.
21814 * assign.cs: Handle PropertyAccess back here, so that we can
21815 provide the proper semantic access to properties.
21817 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21818 a few more explicit conversions.
21820 * modifiers.cs: `NEW' modifier maps to HideBySig.
21822 * expression.cs (PropertyExpr): Make this into an
21823 ExpressionStatement, and support the EmitStatement code path.
21825 Perform get/set error checking, clean up the interface.
21827 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21828 them into toplevel access objects.
21830 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21832 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21835 * typemanager.cs: Keep track here of our PropertyBuilders again to
21836 work around lameness in SRE.
21838 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21840 * expression.cs (LValue::LValueResolve): New method in the
21841 interface, used to perform a second resolution pass for LValues.
21843 (This::DoResolve): Catch the use of this in static methods.
21845 (This::LValueResolve): Implement.
21847 (This::Store): Remove warning, assigning to `this' in structures
21850 (Invocation::Emit): Deal with invocation of
21851 methods on value types. We need to pass the address to structure
21852 methods rather than the object itself. (The equivalent code to
21853 emit "this" for structures leaves the entire structure on the
21854 stack instead of a pointer to it).
21856 (ParameterReference::DoResolve): Compute the real index for the
21857 argument based on whether the method takes or not a `this' pointer
21858 (ie, the method is static).
21860 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21861 value types returned from functions when we need to invoke a
21862 method on the sturcture.
21865 2001-10-11 Ravi Pratap <ravi@ximian.com>
21867 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21868 defining the type in the Modulebuilder or Typebuilder. This is to take
21869 care of nested types which need to be defined on the TypeBuilder using
21870 DefineNestedMethod.
21872 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21873 methods in RootContext, only ported to be part of TypeContainer.
21875 (TypeContainer::GetInterfaceOrClass): Ditto.
21877 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21879 * interface.cs (Interface::DefineInterface): New method. Does exactly
21880 what RootContext.CreateInterface did earlier, only it takes care of nested types
21883 (Interface::GetInterfaces): Move from RootContext here and port.
21885 (Interface::GetInterfaceByName): Same here.
21887 * rootcontext.cs (ResolveTree): Re-write.
21889 (PopulateTypes): Re-write.
21891 * class.cs (TypeContainer::Populate): Populate nested types too.
21892 (TypeContainer::Emit): Emit nested members too.
21894 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21895 instead just use the name argument passed in as it is already fully
21898 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21899 to TypeContainer mapping to see if a type is user-defined.
21901 * class.cs (TypeContainer::CloseType): Implement.
21903 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21904 the default constructor.
21906 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21909 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21911 * interface.cs (CloseType): Create the type here.
21913 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21916 Remove all the methods which are now in TypeContainer.
21918 2001-10-10 Ravi Pratap <ravi@ximian.com>
21920 * delegate.cs (Define): Re-write bits to define the delegate
21923 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21925 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21927 * expression.cs (ImplicitReferenceConversion): handle null as well
21928 as a source to convert to any reference type.
21930 * statement.cs (Return): Perform any implicit conversions to
21931 expected return type.
21933 Validate use of return statement.
21935 * codegen.cs (EmitContext): Pass the expected return type here.
21937 * class.cs (Method, Constructor, Property): Pass expected return
21938 type to EmitContext.
21940 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21942 * expression.cs: Make DoResolve take an EmitContext instead of a
21945 Replaced `l' and `location' for `loc', for consistency.
21947 (Error, Warning): Remove unneeded Tc argument.
21949 * assign.cs, literal.cs, constant.cs: Update to new calling
21952 * codegen.cs: EmitContext now contains a flag indicating whether
21953 code is being generated in a static method or not.
21955 * cs-parser.jay: DecomposeQI, new function that replaces the old
21956 QualifiedIdentifier. Now we always decompose the assembled
21957 strings from qualified_identifier productions into a group of
21960 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21962 * rootcontext.cs: Deal with field-less struct types correctly now
21963 by passing the size option to Define Type.
21965 * class.cs: Removed hack that created one static field.
21967 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21969 * statement.cs: Moved most of the code generation here.
21971 2001-10-09 Ravi Pratap <ravi@ximian.com>
21973 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21976 (ElementAccess): Remove useless bits for now - keep checks as the spec
21979 2001-10-08 Ravi Pratap <ravi@ximian.com>
21981 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21982 and start performing checks according to the spec.
21984 2001-10-07 Ravi Pratap <ravi@ximian.com>
21986 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21987 rank_specifiers instead.
21989 (rank_specifiers): Change the order in which the rank specifiers are stored
21991 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21993 * expression.cs (ElementAccess): Implement the LValue interface too.
21995 2001-10-06 Ravi Pratap <ravi@ximian.com>
21997 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21998 except that user defined conversions are not included.
22000 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22001 perform the conversion of the return type, if necessary.
22003 (New::DoResolve): Check whether we are creating an array or an object
22004 and accordingly do the needful.
22006 (New::Emit): Same here.
22008 (New::DoResolve): Implement guts of array creation.
22010 (New::FormLookupType): Helper function.
22012 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22014 * codegen.cs: Removed most of the code generation here, and move the
22015 corresponding code generation bits to the statement classes.
22017 Added support for try/catch/finalize and throw.
22019 * cs-parser.jay: Added support for try/catch/finalize.
22021 * class.cs: Catch static methods having the flags override,
22022 virtual or abstract.
22024 * expression.cs (UserCast): This user cast was not really doing
22025 what it was supposed to do. Which is to be born in fully resolved
22026 state. Parts of the resolution were being performed at Emit time!
22030 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22032 * expression.cs: Implicity convert the result from UserCast.
22034 2001-10-05 Ravi Pratap <ravi@ximian.com>
22036 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22037 prevented it from working correctly.
22039 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22040 merely ConvertImplicit.
22042 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22044 * typemanager.cs: Make the LookupTypeContainer function static,
22045 and not per-instance.
22047 * class.cs: Make static FindMembers (the one that takes a Type
22050 * codegen.cs: Add EmitForeach here.
22052 * cs-parser.jay: Make foreach a toplevel object instead of the
22053 inline expansion, as we need to perform semantic analysis on it.
22055 2001-10-05 Ravi Pratap <ravi@ximian.com>
22057 * expression.cs (Expression::ImplicitUserConversion): Rename to
22058 UserDefinedConversion.
22060 (Expression::UserDefinedConversion): Take an extra argument specifying
22061 whether we look for explicit user conversions too.
22063 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22065 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22067 (ExplicitUserConversion): Make it a call to UserDefinedConversion
22068 with the appropriate arguments.
22070 * cs-parser.jay (cast_expression): Record location too.
22072 * expression.cs (Cast): Record location info.
22074 (Expression::ConvertExplicit): Take location argument.
22076 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22077 to determine if we are doing explicit conversions.
22079 (UserCast::Emit): Update accordingly.
22081 (Expression::ConvertExplicit): Report an error if everything fails.
22083 * ../errors/cs0030.cs : Add.
22085 2001-10-04 Miguel de Icaza <miguel@ximian.com>
22087 * modifiers.cs: If the ABSTRACT keyword is present, also set the
22088 virtual and newslot bits.
22090 * class.cs (TypeContainer::RegisterRequiredImplementations):
22091 Record methods we need.
22093 (TypeContainer::MakeKey): Helper function to make keys for
22094 MethodBases, since the Methodbase key is useless.
22096 (TypeContainer::Populate): Call RegisterRequiredImplementations
22097 before defining the methods.
22099 Create a mapping for method_builders_to_methods ahead of time
22100 instead of inside a tight loop.
22102 (::RequireMethods): Accept an object as the data to set into the
22103 hashtable so we can report interface vs abstract method mismatch.
22105 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22107 * report.cs: Make all of it static.
22109 * rootcontext.cs: Drop object_type and value_type computations, as
22110 we have those in the TypeManager anyways.
22112 Drop report instance variable too, now it is a global.
22114 * driver.cs: Use try/catch on command line handling.
22116 Add --probe option to debug the error reporting system with a test
22119 * report.cs: Add support for exiting program when a probe
22120 condition is reached.
22122 2001-10-03 Ravi Pratap <ravi@ximian.com>
22124 * expression.cs (Binary::DoNumericPromotions): Fix the case when
22125 we do a forcible conversion regardless of type, to check if
22126 ForceConversion returns a null.
22128 (Binary::error19): Use location to report error.
22130 (Unary::error23): Use location here too.
22132 * ../errors/cs0019.cs : Check in.
22134 * ../errors/cs0023.cs : Check in.
22136 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22137 case of a non-null MethodInfo object with a length of 0 !
22139 (Binary::ResolveOperator): Flag error if overload resolution fails to find
22140 an applicable member - according to the spec :-)
22141 Also fix logic to find members in base types.
22143 (Unary::ResolveOperator): Same here.
22145 (Unary::report23): Change name to error23 and make first argument a TypeContainer
22146 as I was getting thoroughly confused between this and error19 :-)
22148 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22149 (::FindMostEncompassedType): Implement.
22150 (::FindMostEncompassingType): Implement.
22151 (::StandardConversionExists): Implement.
22153 (UserImplicitCast): Re-vamp. We now need info about most specific
22154 source and target types so that we can do the necessary conversions.
22156 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22157 mathematical union with no duplicates.
22159 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22161 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22162 in order from base classes to child classes, so that we can in
22163 child classes look up in our parent for method names and
22164 attributes (required for handling abstract, virtual, new, override
22165 constructs: we need to instrospect our base class, and if we dont
22166 populate the classes in order, the introspection might be
22167 incorrect. For example, a method could query its parent before
22168 the parent has any methods and would determine that the parent has
22169 no abstract methods (while it could have had them)).
22171 (RootContext::CreateType): Record the order in which we define the
22174 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22176 * class.cs (TypeContainer::Populate): Also method definitions can
22177 fail now, keep track of this.
22179 (TypeContainer::FindMembers): Implement support for
22180 DeclaredOnly/noDeclaredOnly flag.
22182 (Constructor::Emit) Return the ConstructorBuilder.
22184 (Method::Emit) Return the MethodBuilder.
22185 Check for abstract or virtual methods to be public.
22187 * rootcontext.cs (RootContext::CreateType): Register all the
22188 abstract methods required for the class to be complete and the
22189 interface methods that must be implemented.
22191 * cs-parser.jay: Report error 501 (method requires body if it is
22192 not marked abstract or extern).
22194 * expression.cs (TypeOf::Emit): Implement.
22196 * typemanager.cs: runtime_handle_type, new global type.
22198 * class.cs (Property::Emit): Generate code for properties.
22200 2001-10-02 Ravi Pratap <ravi@ximian.com>
22202 * expression.cs (Unary::ResolveOperator): Find operators on base type
22203 too - we now conform exactly to the spec.
22205 (Binary::ResolveOperator): Same here.
22207 * class.cs (Operator::Define): Fix minor quirk in the tests.
22209 * ../errors/cs0215.cs : Added.
22211 * ../errors/cs0556.cs : Added.
22213 * ../errors/cs0555.cs : Added.
22215 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22217 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22218 single integer which is really efficient
22220 2001-10-01 Ravi Pratap <ravi@ximian.com>
22222 * expression.cs (Expression::ImplicitUserConversion): Use location
22223 even in the case when we are examining True operators.
22225 * class.cs (Operator::Define): Perform extensive checks to conform
22226 with the rules for operator overloading in the spec.
22228 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22229 some of the other conversions mentioned in the spec.
22231 * typemanager.cs (array_type): New static member for the System.Array built-in
22234 (cloneable_interface): For System.ICloneable interface.
22236 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22237 we start resolving the tree and populating types.
22239 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22241 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22243 * expression.cs (Expression::ExprClassFromMemberInfo,
22244 Expression::Literalize): Create literal expressions from
22245 FieldInfos which are literals.
22247 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22248 type casts, because they were wrong. The test suite in tests
22251 (ImplicitNumericConversion): ushort to ulong requires a widening
22254 Int32 constant to long requires widening cast as well.
22256 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22257 for integers because the type on the stack is not i4.
22259 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22261 * expression.cs (report118): require location argument.
22263 * parameter.cs: Do not dereference potential null value.
22265 * class.cs: Catch methods that lack the `new' keyword when
22266 overriding a name. Report warnings when `new' is used without
22267 anything being there to override.
22269 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22271 * class.cs: Only add constructor to hashtable if it is non-null
22272 (as now constructors can fail on define).
22274 (TypeManager, Class, Struct): Take location arguments.
22276 Catch field instance initialization in structs as errors.
22278 accepting_filter: a new filter for FindMembers that is static so
22279 that we dont create an instance per invocation.
22281 (Constructor::Define): Catch errors where a struct constructor is
22284 * cs-parser.jay: Pass location information for various new
22287 * delegate.cs (Delegate): take a location argument.
22289 * driver.cs: Do not call EmitCode if there were problesm in the
22290 Definition of the types, as many Builders wont be there.
22292 * decl.cs (Decl::Decl): Require a location argument.
22294 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22295 into integers, and find the most appropiate integer for it.
22297 * literal.cs: Implement ULongLiteral.
22299 * rootcontext.cs: Provide better information about the location of
22300 failure when CreateType fails.
22302 2001-09-29 Miguel de Icaza <miguel@ximian.com>
22304 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22307 * expression.cs (Binary::CheckShiftArguments): Add missing type
22309 (Binary::ResolveOperator): Add type to the logical and and logical
22310 or, Bitwise And/Or and Exclusive Or code paths, it was missing
22313 (Binary::DoNumericPromotions): In the case where either argument
22314 is ulong (and most signed types combined with ulong cause an
22315 error) perform implicit integer constant conversions as well.
22317 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22319 * expression.cs (UserImplicitCast): Method should always be
22321 (Invocation::BetterConversion): Simplified test for IntLiteral.
22323 (Expression::ImplicitNumericConversion): Split this routine out.
22324 Put the code that performs implicit constant integer conversions
22327 (Expression::Resolve): Become a wrapper around DoResolve so we can
22328 check eclass and type being set after resolve.
22330 (Invocation::Badness): Remove this dead function
22332 (Binary::ResolveOperator): Do not compute the expensive argumnets
22333 unless we have a union for it.
22335 (Probe::Emit): Is needs to do an isinst and then
22336 compare against null.
22338 (::CanConvert): Added Location argument. If the Location argument
22339 is null (Location.Null), then we do not report errors. This is
22340 used by the `probe' mechanism of the Explicit conversion. We do
22341 not want to generate an error for something that the user
22342 explicitly requested to be casted. But the pipeline for an
22343 explicit cast first tests for potential implicit casts.
22345 So for now, if the Location is null, it means `Probe only' to
22346 avoid adding another argument. Might have to revise this
22349 (ClassCast): New class used to type cast objects into arbitrary
22350 classes (used in Explicit Reference Conversions).
22352 Implement `as' as well.
22354 Reverted all the patches from Ravi below: they were broken:
22356 * The use of `level' as a mechanism to stop recursive
22357 invocations is wrong. That was there just to catch the
22358 bug with a strack trace but not as a way of addressing
22361 To fix the problem we have to *understand* what is going
22362 on and the interactions and come up with a plan, not
22363 just get things going.
22365 * The use of the type conversion cache that I proposed
22366 last night had an open topic: How does this work across
22367 protection domains. A user defined conversion might not
22368 be public in the location where we are applying the
22369 conversion, a different conversion might be selected
22370 (ie, private A->B (better) but public B->A (worse),
22371 inside A, A->B applies, but outside it, B->A will
22374 * On top of that (ie, even if the above is solved),
22375 conversions in a cache need to be abstract. Ie, `To
22376 convert from an Int to a Short use an OpcodeCast', not
22377 `To convert from an Int to a Short use the OpcodeCast on
22378 the variable 5' (which is what this patch was doing).
22380 2001-09-28 Ravi Pratap <ravi@ximian.com>
22382 * expression.cs (Invocation::ConversionExists): Re-write to use
22383 the conversion cache
22385 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22386 cache all conversions done, not just user-defined ones.
22388 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22389 to determine if a conversion exists instead of acutually trying to
22390 perform the conversion. It's faster too.
22392 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22393 and only then attempt the implicit conversion.
22395 2001-09-28 Ravi Pratap <ravi@ximian.com>
22397 * expression.cs (ConvertImplicit): Use a cache for conversions
22398 already found. Check level of recursion and bail out if necessary.
22400 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22402 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22403 Export standard methods that we expect for string operations.
22405 * statement.cs (Block::UsageWarning): Track usage of variables and
22406 report the errors for not used variables.
22408 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22411 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22413 * codegen.cs: remove unnneded code
22415 * expression.cs: Removed BuiltinTypeAccess class
22417 Fix the order in which implicit conversions are
22420 The previous fixed dropped support for boxed conversions (adding a
22421 test to the test suite now)
22423 (UserImplicitCast::CanConvert): Remove test for source being null,
22424 that code is broken. We should not feed a null to begin with, if
22425 we do, then we should track the bug where the problem originates
22426 and not try to cover it up here.
22428 Return a resolved expression of type UserImplicitCast on success
22429 rather than true/false. Ravi: this is what I was talking about,
22430 the pattern is to use a static method as a "constructor" for
22433 Also, do not create arguments until the very last minute,
22434 otherwise we always create the arguments even for lookups that
22435 will never be performed.
22437 (UserImplicitCast::Resolve): Eliminate, objects of type
22438 UserImplicitCast are born in a fully resolved state.
22440 * typemanager.cs (InitCoreTypes): Init also value_type
22441 (System.ValueType).
22443 * expression.cs (Cast::Resolve): First resolve the child expression.
22445 (LValue): Add new method AddressOf to be used by
22448 Change the argument of Store to take an EmitContext instead of an
22449 ILGenerator, because things like FieldExpr need to be able to call
22450 their children expression to generate the instance code.
22452 (Expression::Error, Expression::Warning): Sugar functions for
22455 (Expression::MemberLookup): Accept a TypeContainer instead of a
22456 Report as the first argument.
22458 (Expression::ResolvePrimary): Killed. I still want to improve
22459 this as currently the code is just not right.
22461 (Expression::ResolveMemberAccess): Simplify, but it is still
22464 (Unary::Resolve): Catch errors in AddressOf operators.
22466 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22467 index to a byte for the short-version, or the compiler will choose
22468 the wrong Emit call, which generates the wrong data.
22470 (ParameterReference::Emit, ::Store): same.
22472 (FieldExpr::AddressOf): Implement.
22474 * typemanager.cs: TypeManager: made public variable instead of
22477 * driver.cs: document --fatal.
22479 * report.cs (ErrorMessage, WarningMessage): new names for the old
22480 Error and Warning classes.
22482 * cs-parser.jay (member_access): Turn built-in access to types
22483 into a normal simplename
22485 2001-09-27 Ravi Pratap <ravi@ximian.com>
22487 * expression.cs (Invocation::BetterConversion): Fix to cope
22488 with q being null, since this was introducing a bug.
22490 * expression.cs (ConvertImplicit): Do built-in conversions first.
22492 2001-09-27 Ravi Pratap <ravi@ximian.com>
22494 * expression.cs (UserImplicitCast::Resolve): Fix bug.
22496 2001-09-27 Ravi Pratap <ravi@ximian.com>
22498 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22499 I had introduced long ago (what's new ?).
22501 * expression.cs (UserImplicitCast::CanConvert): Static method to do
22502 the work of all the checking.
22503 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22504 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22506 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22507 that is the right way.
22509 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22510 overloading resolution. Use everywhere instead of cutting and pasting code.
22512 (Binary::ResolveOperator): Use MakeUnionSet.
22514 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22515 we have to convert to bool types. Not complete yet.
22517 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22519 * typemanager.cs (TypeManager::CSharpName): support ushort.
22521 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22522 to provide an expression that performsn an implicit constant int
22523 conversion (section 6.1.6).
22524 (Expression::ConvertImplicitRequired): Reworked to include
22525 implicit constant expression conversions.
22527 (Expression::ConvertNumericExplicit): Finished.
22529 (Invocation::Emit): If InstanceExpression is null, then it means
22530 that we perform a call on this.
22532 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22534 * expression.cs (Unary::Emit): Remove some dead code.
22535 (Probe): Implement Resolve and Emit for `is'.
22536 (Expression::ConvertImplicitRequired): Attempt to do constant
22537 expression conversions here. Maybe should be moved to
22538 ConvertImplicit, but I am not sure.
22539 (Expression::ImplicitLongConstantConversionPossible,
22540 Expression::ImplicitIntConstantConversionPossible): New functions
22541 that tell whether is it possible to apply an implicit constant
22542 expression conversion.
22544 (ConvertNumericExplicit): Started work on explicit numeric
22547 * cs-parser.jay: Update operator constants.
22549 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22550 (Parameters::GetSignature): Hook up VerifyArgs here.
22551 (Parameters::VerifyArgs): Verifies that no two arguments have the
22554 * class.cs (Operator): Update the operator names to reflect the
22555 ones that the spec expects (as we are just stringizing the
22558 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22559 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22560 previous usage did only work for our methods.
22561 (Expression::ConvertImplicit): Handle decimal implicit numeric
22562 conversions as well.
22563 (Expression::InternalTypeConstructor): Used to invoke constructors
22564 on internal types for default promotions.
22566 (Unary::Emit): Implement special handling for the pre/post
22567 increment/decrement for overloaded operators, as they need to have
22568 the same semantics as the other operators.
22570 (Binary::ResolveOperator): ditto.
22571 (Invocation::ConversionExists): ditto.
22572 (UserImplicitCast::Resolve): ditto.
22574 2001-09-26 Ravi Pratap <ravi@ximian.com>
22576 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22577 operator, return after emitting body. Regression tests pass again !
22579 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22580 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22581 (Invocation::OverloadResolve): Ditto.
22582 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22584 * everywhere : update calls to the above methods accordingly.
22586 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22588 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22590 * expression.cs (ExpressionStatement): New base class used for
22591 expressions that can appear in statements, so that we can provide
22592 an alternate path to generate expression that do not leave a value
22595 (Expression::Emit, and all the derivatives): We no longer return
22596 whether a value is left on the stack or not. Every expression
22597 after being emitted leaves a single value on the stack.
22599 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22600 facilties of ExpressionStatement if possible.
22602 * cs-parser.jay: Update statement_expression.
22604 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22606 * driver.cs: Change the wording of message
22608 2001-09-25 Ravi Pratap <ravi@ximian.com>
22610 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22611 the type of the expression to the return type of the method if
22612 we have an overloaded operator match ! The regression tests pass again !
22613 (Unary::ResolveOperator): Ditto.
22615 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22616 to find "op_Implicit", not "implicit" ;-)
22617 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22618 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22620 * everywhere : Correct calls to the above accordingly.
22622 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22623 (ConvertImplicit): Do user-defined conversion if it exists.
22625 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22627 * assign.cs: track location.
22628 (Resolve): Use implicit conversions on assignment.
22630 * literal.cs: Oops. Not good, Emit of short access values should
22631 pass (Bytes) or the wrong argument will be selected.
22633 * expression.cs (Unary::Emit): Emit code for -expr.
22635 (Unary::ResolveOperator): Handle `Substract' for non-constants
22636 (substract from zero from the non-constants).
22637 Deal with Doubles as well.
22639 (Expression::ConvertImplicitRequired): New routine that reports an
22640 error if no implicit conversion exists.
22642 (Invocation::OverloadResolve): Store the converted implicit
22643 expressions if we make them
22645 2001-09-24 Ravi Pratap <ravi@ximian.com>
22647 * class.cs (ConstructorInitializer): Take a Location argument.
22648 (ConstructorBaseInitializer): Same here.
22649 (ConstructorThisInitializer): Same here.
22651 * cs-parser.jay : Update all calls accordingly.
22653 * expression.cs (Unary, Binary, New): Take location argument.
22654 Update accordingly everywhere.
22656 * cs-parser.jay : Update all calls to the above to take a location
22659 * class.cs : Ditto.
22661 2001-09-24 Ravi Pratap <ravi@ximian.com>
22663 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22664 (Invocation::BetterConversion): Same here
22665 (Invocation::ConversionExists): Ditto.
22667 (Invocation::ConversionExists): Implement.
22669 2001-09-22 Ravi Pratap <ravi@ximian.com>
22671 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22672 Also take an additional TypeContainer argument.
22674 * All over : Pass in TypeContainer as argument to OverloadResolve.
22676 * typemanager.cs (CSharpName): Update to check for the string type and return
22679 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22682 2001-09-21 Ravi Pratap <ravi@ximian.com>
22684 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22685 (Invocation::BetterFunction): Implement.
22686 (Invocation::BetterConversion): Implement.
22687 (Invocation::ConversionExists): Skeleton, no implementation yet.
22689 Okay, things work fine !
22691 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22693 * typemanager.cs: declare and load enum_type, delegate_type and
22696 * expression.cs (Expression::Emit): Now emit returns a value that
22697 tells whether a value is left on the stack or not. This strategy
22698 might be reveted tomorrow with a mechanism that would address
22699 multiple assignments.
22700 (Expression::report118): Utility routine to report mismatches on
22703 (Unary::Report23): Report impossible type/operator combination
22706 (Unary::IsIncrementableNumber): Whether the type can be
22707 incremented or decremented with add.
22708 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22710 (Unary::ResolveOperator): Implement ++, !, ~,
22712 (Invocation::Emit): Deal with new Emit convetion.
22714 * All Expression derivatives: Updated their Emit method to return
22715 whether they leave values on the stack or not.
22717 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22718 stack for expressions that are statements.
22720 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22722 * expression.cs (LValue): New interface. Must be implemented by
22724 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22727 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22728 interface for generating code, simplifies the code.
22730 2001-09-20 Ravi Pratap <ravi@ximian.com>
22732 * expression.cs (everywhere): Comment out return statements in ::Resolve
22733 methods to avoid the warnings.
22735 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22737 * driver.cs (parse): Report error 2001 if we can not open the
22740 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22743 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22746 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22747 otherwise nested blocks end up with the same index.
22749 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22751 * expression.cs: Instead of having FIXMEs in the Resolve
22752 functions, throw exceptions so it is obvious that we are facing a
22755 * cs-parser.jay (invocation_expression): Pass Location information.
22757 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22758 Use a basename for those routines because .NET does not like paths
22761 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22764 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22766 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22767 are loading the correct data types (throws an exception if not).
22768 (TypeManager::InitCoreTypes): Use CoreLookupType
22770 * expression.cs (Unary::ResolveOperator): return the child
22771 expression for expressions which are just +expr.
22772 (Unary::ResolveOperator): Return negative literals for -LITERAL
22773 expressions (otherwise they are Unary {Literal}).
22774 (Invocation::Badness): Take into account `Implicit constant
22775 expression conversions'.
22777 * literal.cs (LongLiteral): Implement long literal class.
22778 (IntLiteral): export the `Value' of the intliteral.
22780 2001-09-19 Ravi Pratap <ravi@ximian.com>
22782 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22784 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22785 instead of 'Operator'
22787 * expression.cs (Binary::ResolveOperator): Update accordingly.
22788 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22791 * cs-parser.jay (unary_expression): Update to use the new names.
22793 * gen-treedump.cs (GetUnary): Same here.
22795 * expression.cs (Unary::Resolve): Implement.
22796 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22797 operators are found instead of making noise ;-)
22798 (Unary::ResolveOperator): New method to do precisely the same thing which
22799 Binary::ResolveOperator does for Binary expressions.
22800 (Unary.method, .Arguments): Add.
22801 (Unary::OperName): Implement.
22802 (Unary::ForceConversion): Copy and Paste !
22804 * class.cs (Operator::Define): Fix a small bug for the case when we have
22807 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22808 for the inbuilt operators. Only overloading works for now ;-)
22810 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22812 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22813 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22815 * expression.cs (This::Emit): Implement.
22816 (This::Resolve): Implement.
22817 (TypeOf:Resolve): Implement.
22818 (Expression::ResolveSimpleName): Add an implicit this to instance
22820 (MemberAccess::Resolve): Deal with Parameters and Fields.
22821 Bind instance variable to Field expressions.
22822 (FieldExpr::Instance): New field used to track the expression that
22823 represents the object instance.
22824 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22826 (FieldExpr::Emit): Implement.
22828 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22829 the last instruction contains a return opcode to avoid generating
22830 the last `ret' instruction (this generates correct code, and it is
22831 nice to pass the peverify output).
22833 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22834 initializer for static and instance variables.
22835 (Constructor::Emit): Allow initializer to be null in the case of
22836 static constructors. Only emit initializer for instance
22839 (TypeContainer::FindMembers): Return a null array if there are no
22842 Also fix the code for the MemberTypes.Method branch, as it was not
22843 scanning that for operators (or tried to access null variables before).
22845 * assign.cs (Assign::Emit): Handle instance and static fields.
22849 * driver.cs: Stop compilation if there are parse errors.
22851 * cs-parser.jay (constructor_declaration): Provide default base
22852 initializer for non-static constructors.
22853 (constructor_declarator): Do not provide a default base
22854 initializers if none was specified.
22855 Catch the fact that constructors should not have parameters.
22857 * class.cs: Do not emit parent class initializers for static
22858 constructors, that should be flagged as an error.
22860 2001-09-18 Ravi Pratap <ravi@ximian.com>
22862 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22863 Move back code into TypeContainer::Populate.
22865 2001-09-18 Ravi Pratap <ravi@ximian.com>
22867 * class.cs (TypeContainer::AddConstructor): Fix the check to
22868 compare against Name, not Basename.
22869 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22871 * cs-parser.jay : Update accordingly.
22873 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22874 for methods, don't forget to look into the operators too.
22875 (RegisterMethodBuilder): Helper method to take care of this for
22876 methods, constructors and operators.
22877 (Operator::Define): Completely revamp.
22878 (Operator.OperatorMethod, MethodName): New fields.
22879 (TypeContainer::Populate): Move the registering of builders into
22880 RegisterMethodBuilder.
22881 (Operator::Emit): Re-write.
22883 * expression.cs (Binary::Emit): Comment out code path to emit method
22884 invocation stuff for the case when we have a user defined operator. I am
22885 just not able to get it right !
22887 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22889 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22892 (Expression::MemberLookup): Provide a version that allows to
22893 specify the MemberTypes and BindingFlags.
22895 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22896 so it was not fetching variable information from outer blocks.
22898 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22899 Beforefieldinit as it was buggy.
22901 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22902 that Ravi put here.
22904 * class.cs (Constructor::Emit): Only emit if block is not null.
22905 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22906 deal with this by semantically definining it as if the user had
22909 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22910 constructors as we now "emit" them at a higher level.
22912 (TypeContainer::DefineDefaultConstructor): Used to define the
22913 default constructors if none was provided.
22915 (ConstructorInitializer): Add methods Resolve and Emit.
22917 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22919 2001-09-17 Ravi Pratap <ravi@ximian.com>
22921 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22922 the default constructor builder with our hashtable for methodbuilders
22925 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22926 and argument_count is 0 in which case we have a match.
22927 (Binary::ResolveOperator): More null checking and miscellaneous coding
22930 2001-09-17 Ravi Pratap <ravi@ximian.com>
22932 * rootcontext.cs (IsNameSpace): Compare against null.
22934 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22936 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22937 and Unary::Operator.
22939 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22942 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22943 we have overloaded operators.
22944 (Binary::ResolveOperator): Implement the part which does the operator overload
22947 * class.cs (Operator::Emit): Implement.
22948 (TypeContainer::Emit): Emit the operators we have too.
22950 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22951 the case when we have a user-defined operator.
22953 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22955 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22957 2001-09-16 Ravi Pratap <ravi@ximian.com>
22959 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22960 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22961 (Constructor::Emit): Implement.
22962 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22963 if we have no work to do.
22964 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22967 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22968 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22970 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22973 2001-09-15 Ravi Pratap <ravi@ximian.com>
22975 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22977 (Tree::RecordNamespace): Method to do what the name says ;-)
22978 (Tree::Namespaces): Property to get at the namespaces hashtable.
22980 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22983 * rootcontext.cs (IsNamespace): Fixed it :-)
22985 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22987 * class.cs (TypeContainer::FindMembers): Add support for
22989 (MethodCore): New class that encapsulates both the shared aspects
22990 of a Constructor and a Method.
22991 (Method, Constructor): Factored pieces into MethodCore.
22993 * driver.cs: Added --fatal which makes errors throw exceptions.
22994 Load System assembly as well as part of the standard library.
22996 * report.cs: Allow throwing exceptions on errors for debugging.
22998 * modifiers.cs: Do not use `parent', instead use the real type
22999 container to evaluate permission settings.
23001 * class.cs: Put Ravi's patch back in. He is right, and we will
23002 have to cope with the
23004 2001-09-14 Ravi Pratap <ravi@ximian.com>
23006 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23007 FamORAssem, not FamANDAssem.
23009 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23011 * driver.cs: Added --parse option that only parses its input files
23014 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23015 incorrect. IsTopLevel is not used to tell whether an object is
23016 root_types or not (that can be achieved by testing this ==
23017 root_types). But to see if this is a top-level *class* (not
23018 necessarly our "toplevel" container).
23020 2001-09-14 Ravi Pratap <ravi@ximian.com>
23022 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23023 parent instead of a direct call to GetType.
23025 2001-09-14 Ravi Pratap <ravi@ximian.com>
23027 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23028 Modifiers.TypeAttr. This should just be a call to that method.
23030 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23031 object so that we can determine if we are top-level or not.
23033 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23036 * enum.cs (Enum::Define): Ditto.
23038 * modifiers.cs (FieldAttr): Re-write.
23040 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23041 (TypeContainer::HaveStaticConstructor): New property to provide access
23042 to precisely that info.
23044 * modifiers.cs (MethodAttr): Re-write.
23045 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23047 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23048 of top-level types as claimed.
23050 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23052 * expression.cs (MemberLookup): Fruitless attempt to lookup
23053 constructors. Maybe I need to emit default constructors? That
23054 might be it (currently .NET emits this for me automatically).
23055 (Invocation::OverloadResolve): Cope with Arguments == null.
23056 (Invocation::EmitArguments): new function, shared by the new
23057 constructor and us.
23058 (Invocation::Emit): Handle static and instance methods. Emit
23059 proper call instruction for virtual or non-virtual invocations.
23060 (New::Emit): Implement.
23061 (New::Resolve): Implement.
23062 (MemberAccess:Resolve): Implement.
23063 (MethodGroupExpr::InstanceExpression): used conforming to the spec
23064 to track instances.
23065 (FieldExpr::Resolve): Set type.
23067 * support.cs: Handle empty arguments.
23069 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23070 SimpleLookup): Auxiliary routines to help parse a qualifier
23073 Update qualifier_identifier rule.
23075 * codegen.cs: Removed debugging messages.
23077 * class.cs: Make this a global thing, this acts just as a "key" to
23078 objects that we might have around.
23080 (Populate): Only initialize method_builders_to_methods once.
23082 * expression.cs (PropertyExpr): Initialize type from the
23085 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23086 Resolve pattern. Attempt to implicitly convert value to boolean.
23089 * expression.cs: Set the type for the int32/int32 argument case.
23090 (Binary::ResolveOperator): Set the return type to boolean for
23091 comparission operators
23093 * typemanager.cs: Remove debugging print code.
23095 (Invocation::Resolve): resolve type.
23097 * class.cs: Allocate a MemberInfo of the correct size, as the code
23098 elsewhere depends on the test to reflect the correct contents.
23100 (Method::) Keep track of parameters, due to System.Reflection holes
23102 (TypeContainer::Populate): Keep track of MethodBuilders to Method
23105 (TypeContainer::FindMembers): Use ArrayList and then copy an array
23106 of the exact size and return that.
23108 (Class::LookupMethodByBuilder): New function that maps
23109 MethodBuilders to its methods. Required to locate the information
23110 on methods because System.Reflection bit us again.
23112 * support.cs: New file, contains an interface ParameterData and
23113 two implementations: ReflectionParameters and InternalParameters
23114 used to access Parameter information. We will need to grow this
23117 * expression.cs (Invocation::GetParameterData): implement a cache
23118 and a wrapper around the ParameterData creation for methods.
23119 (Invocation::OverloadResolve): Use new code.
23121 2001-09-13 Ravi Pratap <ravi@ximian.com>
23123 * class.cs (TypeContainer::EmitField): Remove and move into
23124 (Field::Define): here and modify accordingly.
23125 (Field.FieldBuilder): New member.
23126 (TypeContainer::Populate): Update accordingly.
23127 (TypeContainer::FindMembers): Implement.
23129 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23131 * statement.cs: (VariableInfo::VariableType): New field to be
23132 initialized with the full type once it is resolved.
23134 2001-09-12 Miguel de Icaza <miguel@ximian.com>
23136 * parameter.cs (GetParameterInfo): Use a type cache to compute
23137 things only once, and to reuse this information
23139 * expression.cs (LocalVariableReference::Emit): Implement.
23140 (OpcodeCast::Emit): fix.
23142 (ParameterReference::Resolve): Implement.
23143 (ParameterReference::Emit): Implement.
23145 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23146 that are expressions need to stay as Expressions.
23148 * typemanager.cs (CSharpName): Returns the C# name of a type if
23151 * expression.cs (Expression::ConvertImplicit): New function that
23152 implements implicit type conversions.
23154 (Expression::ImplicitReferenceConversion): Implements implicit
23155 reference conversions.
23157 (EmptyCast): New type for transparent casts.
23159 (OpcodeCast): New type for casts of types that are performed with
23160 a sequence of bytecodes.
23162 (BoxedCast): New type used for casting value types into reference
23163 types. Emits a box opcode.
23165 (Binary::DoNumericPromotions): Implements numeric promotions of
23166 and computation of the Binary::Type.
23168 (Binary::EmitBranchable): Optimization.
23170 (Binary::Emit): Implement code emission for expressions.
23172 * typemanager.cs (TypeManager): Added two new core types: sbyte
23175 2001-09-12 Ravi Pratap <ravi@ximian.com>
23177 * class.cs (TypeContainer::FindMembers): Method which does exactly
23178 what Type.FindMembers does, only we don't have to use reflection. No
23179 implementation yet.
23181 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23182 typecontainer objects as we need to get at them.
23183 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23185 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23186 typecontainer object.
23188 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23189 of just a Report object.
23191 2001-09-11 Ravi Pratap <ravi@ximian.com>
23193 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23195 (TypeContainer::Populate): Now define the delegates of the type too.
23196 (TypeContainer.Delegates): Property to access the list of delegates defined
23199 * delegates.cs (Delegate::Define): Implement partially.
23201 * modifiers.cs (TypeAttr): Handle more flags.
23203 2001-09-11 Ravi Pratap <ravi@ximian.com>
23205 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23207 (Operator::Define): Re-write logic to get types by using the LookupType method
23208 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23209 (Indexer::Define): Ditto.
23210 (Event::Define): Ditto.
23211 (Property::Define): Ditto.
23213 2001-09-10 Ravi Pratap <ravi@ximian.com>
23215 * class.cs (TypeContainer::Populate): Now define operators too.
23216 (TypeContainer.Operators): New property to access the list of operators
23218 (Operator.OperatorMethodBuilder): New member to hold the method builder
23219 for the operator we are defining.
23220 (Operator::Define): Implement.
23222 2001-09-10 Ravi Pratap <ravi@ximian.com>
23224 * class.cs (Event::Define): Make the prefixes of the accessor methods
23225 addOn_ and removeOn_
23227 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23228 of the location being passed in too. Ideally, this should go later since all
23229 error reporting should be done through the Report object.
23231 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23232 (Populate): Iterate thru the indexers we have and define them too.
23233 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23234 for the get and set accessors.
23235 (Indexer::Define): Implement.
23237 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23239 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23240 my previous implementation, did not work.
23242 * typemanager.cs: Add a couple of missing types (the longs).
23244 * literal.cs: Use TypeManager.bool_type instead of getting it.
23246 * expression.cs (EventExpr): New kind of expressions.
23247 (Expressio::ExprClassFromMemberInfo): finish
23249 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23251 * assign.cs: Emit stores to static fields differently.
23253 2001-09-08 Ravi Pratap <ravi@ximian.com>
23255 * Merge in changes and adjust code to tackle conflicts. Backed out my
23256 code in Assign::Resolve ;-)
23258 2001-09-08 Ravi Pratap <ravi@ximian.com>
23260 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23261 instead Report.Error and also pass in the location.
23262 (CSharpParser::Lexer): New readonly property to return the reference
23263 to the Tokenizer object.
23264 (declare_local_variables): Use Report.Error with location instead of plain
23268 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23269 (Operator.CheckBinaryOperator): Ditto.
23271 * cs-parser.jay (operator_declarator): Update accordingly.
23273 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23274 (CheckBinaryOperator): Same here.
23276 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23277 on the name without any prefixes of namespace names etc. This is because we
23278 already might have something already fully qualified like
23279 'System.Console.WriteLine'
23281 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23283 2001-09-07 Ravi Pratap <ravi@ximian.com>
23285 * cs-tokenizer.cs (location): Return a string which also contains
23288 * expression.cs (ElementAccess): New class for expressions of the
23289 type 'element access.'
23290 (BaseAccess): New class for expressions of the type 'base access.'
23291 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23294 * cs-parser.jay (element_access): Implement action.
23295 (base_access): Implement actions.
23296 (checked_expression, unchecked_expression): Implement.
23298 * cs-parser.jay (local_variable_type): Correct and implement.
23299 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23301 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23303 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23304 name and the specifiers.
23306 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23308 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
23309 making them all public ;-)
23311 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23314 2001-09-07 Miguel de Icaza <miguel@ximian.com>
23316 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23318 (FieldExpr, PropertyExprs): New resolved expressions.
23319 (SimpleName::MemberStaticCheck): Perform static checks for access
23320 to non-static fields on static methods. Maybe this should be
23321 generalized for MemberAccesses.
23322 (SimpleName::ResolveSimpleName): More work on simple name
23325 * cs-parser.jay (primary_expression/qualified_identifier): track
23326 the parameter index.
23328 * codegen.cs (CodeGen::Save): Catch save exception, report error.
23329 (EmitContext::EmitBoolExpression): Chain to expression generation
23330 instead of temporary hack.
23331 (::EmitStatementExpression): Put generic expression code generation.
23333 * assign.cs (Assign::Emit): Implement variable assignments to
23334 local variables, parameters and fields.
23336 2001-09-06 Miguel de Icaza <miguel@ximian.com>
23338 * statement.cs (Block::GetVariableInfo): New method, returns the
23339 VariableInfo for a variable name in a block.
23340 (Block::GetVariableType): Implement in terms of GetVariableInfo
23342 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23343 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23345 2001-09-06 Ravi Pratap <ravi@ximian.com>
23347 * cs-parser.jay (operator_declaration): Continue on my quest : update
23348 to take attributes argument.
23349 (event_declaration): Ditto.
23350 (enum_declaration): Ditto.
23351 (indexer_declaration): Ditto.
23353 * class.cs (Operator::Operator): Update constructor accordingly.
23354 (Event::Event): Ditto.
23356 * delegate.cs (Delegate::Delegate): Same here.
23358 * enum.cs (Enum::Enum): Same here.
23360 2001-09-05 Ravi Pratap <ravi@ximian.com>
23362 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23364 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23366 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23367 being passed around as an arraylist.
23368 (Attributes::AddAttribute): Method to add attribute sections.
23370 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23371 (struct_declaration): Update accordingly.
23372 (constant_declaration): Update.
23373 (field_declaration): Update.
23374 (method_header): Update.
23375 (fixed_parameter): Update.
23376 (parameter_array): Ditto.
23377 (property_declaration): Ditto.
23378 (destructor_declaration): Ditto.
23380 * class.cs (Struct::Struct): Update constructors accordingly.
23381 (Class::Class): Ditto.
23382 (Field::Field): Ditto.
23383 (Method::Method): Ditto.
23384 (Property::Property): Ditto.
23385 (TypeContainer::OptAttribute): update property's return type.
23387 * interface.cs (Interface.opt_attributes): New member.
23388 (Interface::Interface): Update to take the extra Attributes argument.
23390 * parameter.cs (Parameter::Parameter): Ditto.
23392 * constant.cs (Constant::Constant): Ditto.
23394 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23395 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23396 the attributes as a parameter.
23397 (InterfaceProperty): Update constructor call.
23398 (InterfaceEvent): Ditto.
23399 (InterfaceMethod): Ditto.
23400 (InterfaceIndexer): Ditto.
23402 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23403 pass the attributes too.
23404 (interface_event_declaration): Ditto.
23405 (interface_property_declaration): Ditto.
23406 (interface_method_declaration): Ditto.
23407 (interface_declaration): Ditto.
23409 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23411 * class.cs (Method::Define): Track the "static Main" definition to
23412 create an entry point.
23414 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23415 EntryPoint if we find it.
23417 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23418 (EmitContext::ig): Make this variable public.
23420 * driver.cs: Make the default output file be the first file name
23421 with the .exe extension.
23423 Detect empty compilations
23425 Handle various kinds of output targets. Handle --target and
23426 rename -t to --dumper.
23428 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23429 methods inherited from Expression return now an Expression. This
23430 will is used during the tree rewriting as we resolve them during
23433 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23434 the spec. Missing entirely is the information about
23435 accessability of elements of it.
23437 (Expression::ExprClassFromMemberInfo): New constructor for
23438 Expressions that creates a fully initialized Expression based on
23439 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23442 (Invocation::Resolve): Begin implementing resolution of invocations.
23444 * literal.cs (StringLiteral): Implement Emit.
23446 2001-09-05 Ravi Pratap <ravi@ximian.com>
23448 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23451 2001-09-04 Ravi Pratap <ravi@ximian.com>
23453 * cs-parser.jay (attribute_arguments): Implement actions.
23454 (attribute): Fix bug in production. Implement action.
23455 (attribute_list): Implement.
23456 (attribute_target): Implement.
23457 (attribute_target_specifier, opt_target_specifier): Implement
23458 (CheckAttributeTarget): New method to check if the attribute target
23460 (attribute_section): Implement.
23461 (opt_attributes): Implement.
23463 * attribute.cs : New file to handle attributes.
23464 (Attribute): Class to hold attribute info.
23466 * cs-parser.jay (opt_attribute_target_specifier): Remove production
23467 (attribute_section): Modify production to use 2 different rules to
23468 achieve the same thing. 1 s/r conflict down !
23469 Clean out commented, useless, non-reducing dimension_separator rules.
23471 * class.cs (TypeContainer.attributes): New member to hold list
23472 of attributes for a type.
23473 (Struct::Struct): Modify to take one more argument, the attribute list.
23474 (Class::Class): Ditto.
23475 (Field::Field): Ditto.
23476 (Method::Method): Ditto.
23477 (Property::Property): Ditto.
23479 * cs-parser.jay (struct_declaration): Update constructor call to
23480 pass in the attributes too.
23481 (class_declaration): Ditto.
23482 (constant_declaration): Ditto.
23483 (field_declaration): Ditto.
23484 (method_header): Ditto.
23485 (fixed_parameter): Ditto.
23486 (parameter_array): Ditto.
23487 (property_declaration): Ditto.
23489 * constant.cs (Constant::Constant): Update constructor similarly.
23490 Use System.Collections.
23492 * parameter.cs (Parameter::Parameter): Update as above.
23494 2001-09-02 Ravi Pratap <ravi@ximian.com>
23496 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23497 (TypeContainer.delegates): New member to hold list of delegates.
23499 * cs-parser.jay (delegate_declaration): Implement the action correctly
23500 this time as I seem to be on crack ;-)
23502 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23504 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23505 tell whether an identifier represents a namespace.
23507 * expression.cs (NamespaceExpr): A namespace expression, used only
23508 temporarly during expression resolution.
23509 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23510 utility functions to resolve names on expressions.
23512 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23514 * codegen.cs: Add hook for StatementExpressions.
23516 * class.cs: Fix inverted test for static flag in methods.
23518 2001-09-02 Ravi Pratap <ravi@ximian.com>
23520 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23521 to make it coincide with MS' number.
23522 (Operator::CheckBinaryOperator): Ditto.
23524 * ../errors/errors.txt : Remove error numbers added earlier.
23526 * ../errors/cs1019.cs : Test case for error # 1019
23528 * ../errros/cs1020.cs : Test case for error # 1020
23530 * cs-parser.jay : Clean out commented cruft.
23531 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23532 used anywhere - non-reducing rule.
23533 (namespace_declarations): Non-reducing rule - comment out.
23535 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23536 with TypeContainer::AddEnum.
23538 * delegate.cs : New file for delegate handling classes.
23539 (Delegate): Class for declaring delegates.
23541 * makefile : Update.
23543 * cs-parser.jay (delegate_declaration): Implement.
23545 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23547 * class.cs (Event::Define): Implement.
23548 (Event.EventBuilder): New member.
23550 * class.cs (TypeContainer::Populate): Update to define all enums and events
23552 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23553 readonly fields for all these cases ?
23555 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23557 * class.cs (Property): Revamp to use the convention of making fields readonly.
23558 Accordingly modify code elsewhere.
23560 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23561 the Define method of the Property class.
23563 * class.cs : Clean up applied patch and update references to variables etc. Fix
23565 (TypeContainer::Populate): Update to define all the properties we have. Also
23566 define all enumerations.
23568 * enum.cs (Define): Implement.
23570 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23572 * cs-parser.jay (overloadable_operator): The semantic value is an
23573 enum of the Operator class.
23574 (operator_declarator): Implement actions.
23575 (operator_declaration): Implement.
23577 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23578 validity of definitions.
23579 (Operator::CheckBinaryOperator): Static method to check for binary operators
23580 (TypeContainer::AddOperator): New method to add an operator to a type.
23582 * cs-parser.jay (indexer_declaration): Added line to actually call the
23583 AddIndexer method so it gets added ;-)
23585 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23586 already taken care of by the MS compiler ?
23588 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23590 * class.cs (Operator): New class for operator declarations.
23591 (Operator::OpType): Enum for the various operators.
23593 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23595 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23596 ostensibly handle this in semantic analysis.
23598 * cs-parser.jay (general_catch_clause): Comment out
23599 (specific_catch_clauses, specific_catch_clause): Ditto.
23600 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23601 (catch_args, opt_catch_args): New productions.
23602 (catch_clause): Rewrite to use the new productions above
23603 (catch_clauses): Modify accordingly.
23604 (opt_catch_clauses): New production to use in try_statement
23605 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23606 and re-write the code in the actions to extract the specific and
23607 general catch clauses by being a little smart ;-)
23609 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23610 Hooray, try and catch statements parse fine !
23612 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23614 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23615 string from the hashtable of variables.
23617 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23618 I end up making that mistake ;-)
23619 (catch_clauses): Fixed gross error which made Key and Value of the
23620 DictionaryEntry the same : $1 !!
23622 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23624 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23626 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23627 when the add and remove accessors are specified.
23629 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23631 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23632 information about indexer_declarator.
23633 (indexer_declarator): Implement actions.
23634 (parsing_indexer): New local boolean used to keep track of whether
23635 we are parsing indexers or properties. This is necessary because
23636 implicit_parameters come into picture even for the get accessor in the
23637 case of an indexer.
23638 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23640 * class.cs (Indexer): New class for indexer declarations.
23641 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23642 (TypeContainer::indexers): New member to hold list of indexers for the
23645 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23647 * cs-parser.jay (add_accessor_declaration): Implement action.
23648 (remove_accessor_declaration): Implement action.
23649 (event_accessors_declaration): Implement
23650 (variable_declarators): swap statements for first rule - trivial.
23652 * class.cs (Event): New class to hold information about event
23654 (TypeContainer::AddEvent): New method to add an event to a type
23655 (TypeContainer::events): New member to hold list of events.
23657 * cs-parser.jay (event_declaration): Implement actions.
23659 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23661 * cs-parser.jay (dim_separators): Implement. Make it a string
23662 concatenating all the commas together, just as they appear.
23663 (opt_dim_separators): Modify accordingly
23664 (rank_specifiers): Update accordingly. Basically do the same
23665 thing - instead, collect the brackets here.
23666 (opt_rank_sepcifiers): Modify accordingly.
23667 (array_type): Modify to actually return the complete type string
23668 instead of ignoring the rank_specifiers.
23669 (expression_list): Implement to collect the expressions
23670 (variable_initializer): Implement. We make it a list of expressions
23671 essentially so that we can handle the array_initializer case neatly too.
23672 (variable_initializer_list): Implement.
23673 (array_initializer): Make it a list of variable_initializers
23674 (opt_array_initializer): Modify accordingly.
23676 * expression.cs (New::NType): Add enumeration to help us
23677 keep track of whether we have an object/delegate creation
23678 or an array creation.
23679 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23680 members to hold data about array creation.
23681 (New:New): Modify to update NewType
23682 (New:New): New Overloaded contructor for the array creation
23685 * cs-parser.jay (array_creation_expression): Implement to call
23686 the overloaded New constructor.
23688 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23690 * class.cs (TypeContainer::Constructors): Return member
23691 constructors instead of returning null.
23693 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23695 * typemanager.cs (InitCoreTypes): Initialize the various core
23696 types after we have populated the type manager with the user
23697 defined types (this distinction will be important later while
23698 compiling corlib.dll)
23700 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23701 on Expression Classification. Now all expressions have a method
23702 `Resolve' and a method `Emit'.
23704 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23705 generation from working. Also add some temporary debugging
23708 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23710 * codegen.cs: Lots of code generation pieces. This is only the
23711 beginning, will continue tomorrow with more touches of polish. We
23712 handle the fundamentals of if, while, do, for, return. Others are
23713 trickier and I need to start working on invocations soon.
23715 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23718 * codegen.cs (EmitContext): New struct, used during code
23719 emission to keep a context. Most of the code generation will be
23722 * cs-parser.jay: Add embedded blocks to the list of statements of
23723 this block. So code generation proceeds in a top down fashion.
23725 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23727 * statement.cs: Add support for multiple child blocks.
23729 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23731 * codegen.cs (EmitCode): New function, will emit the code for a
23732 Block of code given a TypeContainer and its ILGenerator.
23734 * statement.cs (Block): Standard public readonly optimization.
23735 (Block::Block constructors): Link children.
23736 (Block::Child): Child Linker.
23737 (Block::EmitVariables): Emits IL variable declarations.
23739 * class.cs: Drop support for MethodGroups here, delay until
23741 (Method::): Applied the same simplification that I did before, and
23742 move from Properties to public readonly fields.
23743 (Method::ParameterTypes): Returns the parameter types for the
23744 function, and implements a cache that will be useful later when I
23745 do error checking and the semantic analysis on the methods is
23747 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23748 and made a method, optional argument tells whether this is a class
23749 or a structure to apply the `has-this' bit.
23750 (Method::GetCallingConvention): Implement, returns the calling
23752 (Method::Define): Defines the type, a second pass is performed
23753 later to populate the methods.
23755 (Constructor::ParameterTypes): implement a cache similar to the
23756 one on Method::ParameterTypes, useful later when we do semantic
23759 (TypeContainer::EmitMethod): New method. Emits methods.
23761 * expression.cs: Removed MethodGroup class from here.
23763 * parameter.cs (Parameters::GetCallingConvention): new method.
23765 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23767 * class.cs (TypeContainer::Populate): Drop RootContext from the
23770 (Constructor::CallingConvention): Returns the calling convention.
23771 (Constructor::ParameterTypes): Returns the constructor parameter
23774 (TypeContainer::AddConstructor): Keep track of default constructor
23775 and the default static constructor.
23777 (Constructor::) Another class that starts using `public readonly'
23778 instead of properties.
23780 (Constructor::IsDefault): Whether this is a default constructor.
23782 (Field::) use readonly public fields instead of properties also.
23784 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23785 track of static constructors; If none is used, turn on
23786 BeforeFieldInit in the TypeAttributes.
23788 * cs-parser.jay (opt_argument_list): now the return can be null
23789 for the cases where there are no arguments.
23791 (constructor_declarator): If there is no implicit `base' or
23792 `this', then invoke the default parent constructor.
23794 * modifiers.cs (MethodAttr): New static function maps a set of
23795 modifiers flags into a MethodAttributes enum
23796 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23797 MethodAttr, TypeAttr to represent the various mappings where the
23798 modifiers are used.
23799 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23801 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23803 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23806 * interface.cs (PopulateIndexer): Implemented the code generator
23807 for interface indexers.
23809 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23811 * interface.cs (InterfaceMemberBase): Now we track the new status
23814 (PopulateProperty): Implement property population. Woohoo! Got
23815 Methods and Properties going today.
23817 Removed all the properties for interfaces, and replaced them with
23818 `public readonly' fields.
23820 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23822 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23823 initialize their hashtables/arraylists only when they are needed
23824 instead of doing this always.
23826 * parameter.cs: Handle refs and out parameters.
23828 * cs-parser.jay: Use an ArrayList to construct the arguments
23829 instead of the ParameterCollection, and then cast that to a
23832 * parameter.cs: Drop the use of ParameterCollection and use
23833 instead arrays of Parameters.
23835 (GetParameterInfo): Use the Type, not the Name when resolving
23838 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23840 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23841 and instead use public readonly fields.
23843 * class.cs: Put back walking code for type containers.
23845 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23847 * class.cs (MakeConstant): Code to define constants.
23849 * rootcontext.cs (LookupType): New function. Used to locate types
23852 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23854 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23855 this System.Reflection code is. Kudos to Microsoft
23857 * typemanager.cs: Implement a type cache and avoid loading all
23858 types at boot time. Wrap in LookupType the internals. This made
23859 the compiler so much faster. Wow. I rule!
23861 * driver.cs: Make sure we always load mscorlib first (for
23862 debugging purposes, nothing really important).
23864 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23865 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23867 * rootcontext.cs: Lookup types on their namespace; Lookup types
23868 on namespaces that have been imported using the `using' keyword.
23870 * class.cs (TypeContainer::TypeAttr): Virtualize.
23871 (Class::TypeAttr): Return attributes suitable for this bad boy.
23872 (Struct::TypeAttr): ditto.
23873 Handle nested classes.
23874 (TypeContainer::) Remove all the type visiting code, it is now
23875 replaced with the rootcontext.cs code
23877 * rootcontext.cs (GetClassBases): Added support for structs.
23879 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23881 * interface.cs, statement.cs, class.cs, parameter.cs,
23882 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23883 Drop use of TypeRefs, and use strings instead.
23885 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23889 * class.cs (Struct::Struct): set the SEALED flags after
23890 checking the modifiers.
23891 (TypeContainer::TypeAttr): new property, returns the
23892 TypeAttributes for a class.
23894 * cs-parser.jay (type_list): Oops, list production was creating a
23895 new list of base types.
23897 * rootcontext.cs (StdLib): New property.
23898 (GetInterfaceTypeByName): returns an interface by type name, and
23899 encapsulates error handling here.
23900 (GetInterfaces): simplified.
23901 (ResolveTree): Encapsulated all the tree resolution here.
23902 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23905 * driver.cs: Add support for --nostdlib, to avoid loading the
23906 default assemblies.
23907 (Main): Do not put tree resolution here.
23909 * rootcontext.cs: Beginning of the class resolution.
23911 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23913 * rootcontext.cs: Provide better error reporting.
23915 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23917 * rootcontext.cs (CreateInterface): Handle the case where there
23918 are no parent interfaces.
23920 (CloseTypes): Routine to flush types at the end.
23921 (CreateInterface): Track types.
23922 (GetInterfaces): Returns an array of Types from the list of
23923 defined interfaces.
23925 * typemanager.c (AddUserType): Mechanism to track user types (puts
23926 the type on the global type hash, and allows us to close it at the
23929 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23931 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23932 RecordInterface instead.
23934 * cs-parser.jay: Updated to reflect changes above.
23936 * decl.cs (Definition): Keep track of the TypeBuilder type that
23937 represents this type here. Not sure we will use it in the long
23938 run, but wont hurt for now.
23940 * driver.cs: Smaller changes to accomodate the new code.
23942 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23945 * rootcontext.cs (CreateInterface): New method, used to create
23946 the System.TypeBuilder type for interfaces.
23947 (ResolveInterfaces): new entry point to resolve the interface
23949 (CodeGen): Property, used to keep track of the code generator.
23951 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23953 * cs-parser.jay: Add a second production for delegate_declaration
23956 (enum_body): Put an opt_comma here instead of putting it on
23957 enum_body or enum_member_declarations so we can handle trailing
23958 commas on enumeration members. Gets rid of a shift/reduce.
23960 (type_list): Need a COMMA in the middle.
23962 (indexer_declaration): Tell tokenizer to recognize get/set
23964 * Remove old targets.
23966 * Re-add the parser target.
23968 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23970 * cs-parser.jay: Add precendence rules for a number of operators
23971 ot reduce the number of shift/reduce conflicts in the grammar.
23973 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23975 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23978 Get rid of old crufty code.
23980 * rootcontext.cs: Use this to keep track of the parsed
23981 representation and the defined types available to the program.
23983 * gen-treedump.cs: adjust for new convention.
23985 * type.cs: Split out the type manager, and the assembly builder
23988 * typemanager.cs: the type manager will live here now.
23990 * cil-codegen.cs: And the code generator here.
23992 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23994 * makefile: Fixed up for easy making.
23996 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23998 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24001 (unary_expression): Expand pre_increment_expression and
24002 post_decrement_expression to reduce a shift/reduce.
24004 2001-07-11 Simon Cozens
24006 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24008 Improve allow_keyword_as_indent name.
24010 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24012 * Adjustments for Beta2.
24014 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24016 * decl.cs: Added `Define' abstract method.
24017 (InTransit): new property, used to catch recursive definitions.
24019 * interface.cs: Implement `Define'.
24021 * modifiers.cs: Map Modifiers.constants to
24022 System.Reflection.TypeAttribute flags.
24024 * class.cs: Keep track of types and user-defined types.
24025 (BuilderInit): New method for creating an assembly
24026 (ResolveType): New function to launch the resolution process, only
24027 used by interfaces for now.
24029 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24030 that are inserted into the name space.
24032 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24034 * ARGH. I have screwed up my tree so many times due to the use of
24035 rsync rather than using CVS. Going to fix this at once.
24037 * driver.cs: Objetify driver. Load assemblies, use assemblies to
24040 2001-06-07 Miguel de Icaza <miguel@ximian.com>
24042 * Experiment successful: Use System.Type rather that our own
24045 2001-05-25 Miguel de Icaza <miguel@ximian.com>
24047 * cs-parser.jay: Removed nsAliases from here.
24049 Use new namespaces, handle `using XXX;'
24051 * namespace.cs: Reimplemented namespace handling, use a recursive
24052 definition of the class. Now we can keep track of using clauses
24053 and catch invalid using clauses.
24055 2001-05-24 Miguel de Icaza <miguel@ximian.com>
24057 * gen-treedump.cs: Adapted for all the renaming.
24059 * expression.cs (Expression): this class now has a Type property
24060 which returns an expression Type.
24062 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24063 `Type', as this has a different meaning now in the base
24065 2001-05-22 Miguel de Icaza <miguel@ximian.com>
24067 * interface.cs, class.cs: Removed from all the sources the
24068 references to signature computation, as we can not do method
24069 signature computation during the parsing time, as we are not
24070 trying to solve at that point distinguishing:
24074 void a (NS.Blah x) {}
24077 Which depending on the context might be valid or not, as we do not
24078 know if Blah is the same thing as NS.Blah at that point.
24080 * Redid everything so the code uses TypeRefs now instead of
24081 Types. TypeRefs are just temporary type placeholders, that need
24082 to be resolved. They initially have a pointer to a string and the
24083 current scope in which they are used. This is used later by the
24084 compiler to resolve the reference to an actual Type.
24086 * DeclSpace is no longer a CIR.Type, and neither are
24087 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
24088 are all DeclSpaces, but no Types.
24090 * type.cs (TypeRefManager): This implements the TypeRef manager,
24091 which keeps track of all the types that need to be resolved after
24092 the parsing has finished.
24094 2001-05-13 Miguel de Icaza <miguel@ximian.com>
24096 * ARGH. We are going to have to store `foreach' as a class rather
24097 than resolving it, as we need to verify error 1579 after name
24098 resolution. *OR* we could keep a flag that says `This request to
24099 IEnumerator comes from a foreach statement' which we can then use
24100 to generate the error.
24102 2001-05-10 Miguel de Icaza <miguel@ximian.com>
24104 * class.cs (TypeContainer.AddMethod): we now add methods to the
24105 MethodGroup instead of the method hashtable.
24107 * expression.cs: Add MethodGroup abstraction, which gets us one
24108 step closer to the specification in the way we handle method
24111 * cs-parser.jay (primary_expression): qualified_identifier now
24112 tried to match up an identifier to a local variable reference or
24113 to a parameter reference.
24115 current_local_parameters is now a parser global variable that
24116 points to the current parameters for the block, used during name
24119 (property_declaration): Now creates an implicit `value' argument to
24122 2001-05-09 Miguel de Icaza <miguel@ximian.com>
24124 * parameter.cs: Do not use `param' arguments as part of the
24125 signature, per the spec.
24127 2001-05-08 Miguel de Icaza <miguel@ximian.com>
24129 * decl.cs: Base class for classes, structs and interfaces. This
24130 is the "Declaration Space"
24132 * cs-parser.jay: Use CheckDef for checking declaration errors
24133 instead of having one on each function.
24135 * class.cs: Factor out some code for handling error handling in
24136 accordance to the "Declarations" section in the "Basic Concepts"
24137 chapter in the ECMA C# spec.
24139 * interface.cs: Make all interface member classes derive from
24140 InterfaceMemberBase.
24142 2001-05-07 Miguel de Icaza <miguel@ximian.com>
24144 * Many things: all interfaces are parsed and generated in
24145 gen-treedump. Support for member variables, constructors,
24146 destructors, properties, constants is there.
24148 Beginning of the IL backend, but very little done, just there for
24151 2001-04-29 Miguel de Icaza <miguel@ximian.com>
24153 * cs-parser.jay: Fix labeled statement.
24155 * cs-tokenizer.cs (escape): Escape " and ' always.
24156 ref_line, ref_name: keep track of the line/filename as instructed
24157 by #line by the compiler.
24160 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24162 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24163 to match the values in System.CodeDOM.
24165 Divid renamed to Divide.
24167 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24169 (Statements.set): remove.
24171 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24174 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24175 falseStatements always have valid values.
24177 * cs-parser.jay: Use System.CodeDOM now.