1 2006-08-02 Raja R Harinath <rharinath@novell.com>
3 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4 declspaces for doppelgangers too.
5 (UsingEntry): Implement IResolveContext.
6 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
7 'this' as the resolve context.
8 (LocalAliasEntry): Likewise.
10 Implement parts of #77403
11 * roottypes.cs (RootDeclSpace): New. Used to represent the
12 toplevel declaration space. Each namespace declaration introduces
13 a "partial" root declaretion space.
14 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
15 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
16 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
17 from 'current_namespace.SlaveDeclSpace'.
18 (namespace_declaration): Likewise.
19 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
20 check. It can't happen now.
21 * decl.cs (DeclSpace.LookupType): Likewise.
22 * driver.cs (MainDriver): Sanity check.
24 2006-08-01 Raja R Harinath <rharinath@novell.com>
26 * decl.cs (DeclSpace.FindNestedType): Remove.
27 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
28 LookupTypeContainer to get the container of the nested type.
29 * class.cs (TypeContainer.FindNestedType): Make non-override.
31 2006-07-31 Raja R Harinath <rharinath@novell.com>
33 * decl.cs (DeclSpace.PartialContainer): Move field from ...
34 * class.cs (TypeContainer.PartialContainer): ... here.
35 (TypeContainer.AddBasesForPart): New helper.
36 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
38 * cs-parser.jay (current_class): Convert to DeclSpace.
39 (struct_declaration, interface_declaration, class_declaration):
40 Use AddBasesForPart instead of .Bases directly.
41 * const.cs, iterators.cs: Update to changes.
43 2006-07-28 Raja R Harinath <rharinath@novell.com>
45 * class.cs (TypeContainer.AddMemberType): Rename from
47 (TypeContainer.AddMember): Rename from AddToMemberContainer.
48 (AddTypeContainer): New. Combine AddClassOrStruct and
50 (AddPartial): Update. Add 'is_partial' argument.
51 * roottypes.cs: Update to changes.
52 * cs-parser.jay (push_current_class): New helper for handling
53 current_container and current_class.
54 (struct_declaration, interface_declaration, class_declaration):
57 2006-07-26 Raja R Harinath <rharinath@novell.com>
59 * roottypes.cs: Rename from tree.cs.
61 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
62 * tree.cs (Tree, ITreeDump): Remove types.
63 * rootcontext.cs (tree, Tree): Remove fields.
64 (root, ToplevelTypes): New.
65 * *.cs: Update to rename.
67 * tree.cs (Tree.RecordDecl): Remove.
68 (RootTypes.AddToTypeContainer): Record the toplevel type in its
70 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
72 2006-07-23 Raja R Harinath <harinath@gmail.com>
74 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
75 DoFlowAnalysis and OmitStructFlowAnalysis here.
76 (ec.With): Rename from WithUnsafe and generalize.
77 (ec.WithCheckState): Remove. All users can be handled by 'With'.
78 (ec.WithFlowAnalyis): New.
79 * ecore.cs, expression.cs, statement.cs: Update.
81 2006-07-22 Raja R Harinath <harinath@gmail.com>
83 * statement.cs (Block.ResolveMeta): Simplify slightly.
85 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
86 multiple boolean fields. Convert InUnsafe, constant_check_state,
88 (CheckState, ConstantCheckState): Update.
89 (InUnsafe): New read-only property.
90 (FlagsHandle): Rename from CheckStateHandle and convert to handle
92 (WithUnsafe): New helper similar to WithCheckState.
93 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
94 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
96 2006-07-21 Raja R Harinath <rharinath@novell.com>
98 Make comparisons use the same IL irrespective of whether they're
99 in a 'checked' or 'unchecked' context: one of the issues in #78899
100 * codegen.cs (EmitContext.CheckState): Make read-only property.
101 (EmitContext.ConstantCheckState): Likewise.
102 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
103 helper that implement a save/restore stack for CheckState
104 values. This is the only way to change check-state.
105 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
106 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
107 (CheckedExpr.EmitBranchable): New forwarding method.
108 (UnCheckedExpr): Likewise.
109 * statement.cs (Block.ResolveMeta): Use WithCheckState.
110 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
111 (Checked.Resolve, checked.DoEmit): Likewise.
113 2006-07-21 Martin Baulig <martin@ximian.com>
115 * generic.cs (TypeManager.InferType): When inferring an array
116 type, also allow IList<T> and ICollection<T>. Fixes #78900.
118 2006-07-21 Martin Baulig <martin@ximian.com>
120 * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
121 and allow IList`1 and all its base interfaces.
123 * convert.cs (Convert.ImplicitReferenceConversion): Allow
124 converting from an array-type of T to IList<T>.
126 2006-07-21 Martin Baulig <martin@ximian.com>
128 * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
130 2006-07-20 Miguel de Icaza <miguel@novell.com>
132 * anonymous.cs: Cache the resolved anonymous delegate, and return
133 this so that the ResolveTopBlock is only triggered once, not
136 Currently we trigger ResolvetopBlock twice due to a first pass of
137 argument check compatibility, and a second pass that does the
140 2006-07-16 Marek Safar <marek.safar@seznam.cz>
143 * driver.cs (MainDriver): When a file extension is missing,
146 2006-07-15 Marek Safar <marek.safar@seznam.cz>
148 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
150 * rootcontext.cs (Reset): Add helper_classes.
152 2006-07-15 Marek Safar <marek.safar@seznam.cz>
155 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
158 2006-07-13 Miguel de Icaza <miguel@novell.com>
160 * statement.cs (Lock): Handle expressions of type
161 TypeManager.null_type specially. Fixes #78770
163 2006-07-08 Marek Safar <marek.safar@seznam.cz>
165 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
168 2006-07-08 Marek Safar <marek.safar@seznam.cz>
170 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
171 for accessors as well.
172 * ecore.cs (EventExpr): Add AccessorTable.
174 2006-07-03 Martin Baulig <martin@ximian.com>
176 * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
177 instances of value types.
179 * convert.cs (Convert.ExplicitConversion): Correctly handle
180 object->nullable conversions.
182 2006-07-01 Marek Safar <marek.safar@seznam.cz>
185 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
186 for CS0122 where appropriate.
187 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
189 (Filter): Assembly can be null in the case of top level attributes.
191 2006-06-28 Raja R Harinath <rharinath@novell.com>
194 * generic.cs (TypeManager.InferParamsTypeArguments): If there are
195 no arguments, return 'false': nothing can be inferred.
197 2006-06-25 Marek Safar <marek.safar@seznam.cz>
201 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
202 is done at global level.
204 2006-06-24 Marek Safar <marek.safar@seznam.cz>
206 A fix for #77002, Implemented TypeForwarder support.
208 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
209 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
211 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
212 * typemanager.cs (): Add type_forwarder_attr_type.
214 2006-06-24 Marek Safar <marek.safar@seznam.cz>
216 * report.cs: Add CS0469 warning.
218 2006-06-22 Martin Baulig <martin@ximian.com>
221 (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
222 for interfaces; fixes #78686, which is a modification of #78380
223 with interfaces instead of classes.
225 2006-06-21 Martin Baulig <martin@ximian.com>
227 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
228 the `try'-block, so we also report CS0016 etc. there.
230 2006-06-21 Martin Baulig <martin@ximian.com>
232 * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
233 handle SetAssigned() and SetMemberIsUsed() for generic types;
236 2006-06-21 Martin Baulig <martin@ximian.com>
239 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
241 2006-06-21 Martin Baulig <martin@ximian.com>
243 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
244 also report CS1686 for parameters.
246 2006-06-21 Martin Baulig <martin@ximian.com>
248 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
249 instead of an error if the value is not implicitly convertible to
250 the switch types; fixes #77964.
252 2006-06-21 Raja R Harinath <rharinath@novell.com>
255 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
256 FieldBuilder is null.
259 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
260 'left' and 'right' before error-checking.
262 2006-06-19 Martin Baulig <martin@ximian.com>
265 (Convert.ImplicitConversionStandard): Cleanup and correctly
266 implement nullable conversions.
267 (Convert.ImplicitStandardConversionExists): Likewise.
268 (Convert.ExplicitConversion): Likewise.
270 2006-06-19 Martin Baulig <martin@ximian.com>
273 (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
274 methods; make the ctors protected.
276 2006-06-19 Martin Baulig <martin@ximian.com>
278 Fixed #78380; added gtest-273.cs.
281 (Expression.ResolveAsBaseTerminal): Move the constraint checking
282 into ResolveAsTypeTerminal().
285 (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
286 TypeManager.FindMembers() to check for the default ctor.
288 2006-06-18 Marek Safar <marek.safar@seznam.cz>
290 * generic.cs: Fixed NullableInfo accessibility.
292 2006-06-16 Martin Baulig <martin@ximian.com>
295 (Constraints.InflatedConstraints.inflate): Correctly inflate
296 generic types; fixes #78400.
298 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
300 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
302 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
303 (FieldExpr.DoResolve): likewise.
304 (PropertyExpr.InstanceResolve): likewise.
305 (EventExpr.InstanceResolve): likewise.
307 2006-06-15 Martin Baulig <martin@ximian.com>
310 (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
311 argument; always allow a `null' label if true.
312 (Switch.SwitchGoverningType): Take an `Expression expr' argument.
313 (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
314 we have a `null' label and mark the new `null_target' label;
315 default to the `default' label.
316 (Switch.Resolve): Add support for nullable types. Fixes #78630.
318 2006-06-15 Martin Baulig <martin@ximian.com>
320 * class.cs (Operator.Define): Allow an implicit/explicit operator
321 to convert to/from a nullable value of the enclosing type.
323 * generic.cs (TypeManager.IsNullableTypeOf): New public method.
324 (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
327 (Convert.ImplicitStandardConversionExists): Add support for lifted
328 implicit/explicit conversions.
329 (Convert.ImplicitConversionStandard): Likewise.
331 2006-06-13 Martin Baulig <martin@ximian.com>
333 * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
334 type arguments and create a ConstructedType if necessary. Fixes #78400.
336 2006-06-04 Marek Safar <marek.safar@seznam.cz>
338 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
339 attribute applicable tests for attribute argument.
341 2006-06-02 Raja R Harinath <rharinath@novell.com>
344 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
345 (Binary.OverloadResolve_PredefinedIntegral): New.
346 (Binary.OverloadResolve_PredefinedFloating): New.
347 (Binary.OverloadResolve_PredefinedString): New.
348 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
349 Follow the standard more closely, and treat numeric promotions in
350 terms of overload resolution.
351 (Binary.CheckShiftArguments): Simplify.
353 2006-06-01 Raja R Harinath <rharinath@novell.com>
355 * flowanalysis.cs (MyBitVector): Simplify representation.
356 (MyBitVector.Clone): Avoid allocating BitArray.
357 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
358 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
359 (*): Update. Change all references to MyBitVector.And and
360 MyBitVector.Or to &= and |=.
362 2006-05-31 Raja R Harinath <rharinath@novell.com>
364 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
365 Use bne.un instead of ceq+brfalse.
368 * typemanager.cs (IsUnmanagedType): Disallow generic types and
371 2006-05-29 Raja R Harinath <rharinath@novell.com>
374 * cs-parser.jay (formal_parameter_list): Extend the pattern below
375 to param arguments too.
377 2006-05-26 Miguel de Icaza <miguel@novell.com>
379 * cs-parser.jay: Catch another parsing form for arglist being
380 followed by other arguments. Fixes #78313.
382 2006-05-25 Raja R Harinath <rharinath@novell.com>
385 * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
386 also when one of the operands is a null literal.
387 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
388 to improve clarity, and generate slightly better code.
390 2006-05-24 Raja R Harinath <rharinath@novell.com>
392 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
393 checking of out parameters to ...
394 (FlowBranchingToplevel.Merge): ... here.
395 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
396 set, propagate the origin upward, and only complain if there was
398 (FlowBranchingException.AddContinueOrigin): Likewise.
399 (FlowBranchingException.AddReturnOrigin): Likewise.
400 (FlowBranchingException.AddGotoOrigin): Likewise.
402 2006-05-23 Raja R Harinath <rharinath@novell.com>
404 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
405 unreachable, skip it.
406 (FlowBranchingException.Merge): Always propagate jumps, even if
407 the finally block renders subsequent code unreachable.
409 2006-05-18 Raja R Harinath <rharinath@novell.com>
412 * statement.cs (Goto.Resolve): Move responsibility for resolving
413 'goto' to FlowBranching.AddGotoOrigin.
414 (Goto.SetResolvedTarget): New. Callback to set the
415 LabeledStatement that's the target of the goto.
416 (Goto.DoEmit): Use Leave instead of Br when crossing an
417 unwind-protect boundary.
418 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
419 LookupLabel and adjust to new semantics.
420 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
421 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
422 Goto.SetResolvedTarget to update target.
423 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
424 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
425 AddBreakOrigin & co. Delay propagation until ...
426 (FlowBranchingException.Merge): ... this.
428 * statement.cs (Block.Resolve): Always depend on flow-branching to
429 determine unreachability. Kill workaround that originally emitted
430 only one statement after an "unreachable" label (see infloop in
433 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
434 This is still "wrong", but anything better would probably need a
435 multi-pass algorithm.
436 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
437 usage vector. Force current usage vector to be reachable, to
438 optimistically signify backward jumps.
439 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
441 (FlowBranchingLabeled.Merge): New. If no backward jump was
442 detected, return the original salted-away usage vector instead,
443 updated with appropriate changes. Print unreachable warning if
445 * statement.cs (Block.Resolve): Don't print unreachable warning on
448 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
450 * driver.cs: Pass filename without path to AssemblyBuilder's
451 AddResourceFile. Fixes bug #78407.
453 2006-05-17 Raja R Harinath <rharinath@novell.com>
455 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
456 * flowanalysis.cs (FlowBranchingLabeled): ... here.
457 (FlowBranching.MergeChild): Overwrite
458 reachability information from Labeled branchings too.
460 2006-05-16 Raja R Harinath <rharinath@novell.com>
462 * statement.cs (Goto.Resolve): Merge jump origins here ...
463 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
465 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
466 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
467 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
468 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
470 * statement.cs (Goto.Resolve): ... not here.
471 (Goto.Emit): Remove CS1632 check.
473 2006-05-14 Marek Safar <marek.safar@seznam.cz>
475 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
478 2006-05-11 Raja R Harinath <rharinath@novell.com>
480 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
481 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
482 (FlowBranchingException.Label): Likewise.
484 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
486 (MyBitVector.Or): Use it to avoid losing information (Count).
487 (FlowBranching.MergeOrigins): Likewise.
489 * flowanalysis.cs (UsageVector.IsDirty): Remove.
490 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
491 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
492 (UsageVector.ToString): Simplify.
493 (UsageVector.MergeSiblings): Move here from ...
494 (FlowBranching.Merge): ... here.
495 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
498 2006-05-10 Raja R Harinath <rharinath@novell.com>
500 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
501 null bitvector is treated as all-true.
503 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
504 (MyBitVector): Rationalize invariants. 'vector != null' implies
505 that we have our own copy of the bitvector. Otherwise,
506 'InheritsFrom == null' implies all inherited bits are true.
508 2006-05-09 Marek Safar <marek.safar@seznam.cz>
510 * statement.cs (LocalInfo): Add IsConstant.
511 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
512 local variable for constants.
514 2006-05-09 Raja R Harinath <rharinath@novell.com>
516 * flowanalysis.cs (MyBitVector.Empty): New.
517 (MyBitVector): Don't allow InheritedFrom to be null.
518 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
519 (UsageVector, FlowBranching): Update to changes.
521 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
522 recursion. The 'Parent == null' condition isn't sufficient for
524 (FlowBranching.AddBreakOrigin): Likewise.
525 (FlowBranching.AddContinueOrigin): Likewise.
526 (FlowBranching.AddReturnOrigin): Likewise.
527 (FlowBranching.StealFinallyClauses): Likewise.
528 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
529 (FlowBranching.CheckOutParameters): Likewise.
530 (FlowBranchingToplevel): Terminate all the above recursions here.
531 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
532 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
534 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
536 (FlowBranchingToplevel): New. Empty for now.
537 (FlowBranching.MergeTopBlock): Update.
538 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
539 branching for the anonymous delegate.
540 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
542 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
543 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
544 information at the start of the merge. Reorganize.
546 2006-05-07 Marek Safar <marek.safar@seznam.cz>
548 * class.cs (MethodData.Define): Method cannot implement interface accessor.
550 2006-05-07 Marek Safar <marek.safar@seznam.cz>
552 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
553 to newly introduced ctor.
555 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
556 message to one place.
557 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
560 2006-05-07 Marek Safar <marek.safar@seznam.cz>
562 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
564 * ecore.cs (Expression.ResolveAsConstant): Updated.
566 * statement.cs (ResolveMeta): Updated.
568 2006-05-06 Marek Safar <marek.safar@seznam.cz>
570 * cs-parser.jay: __arglist cannot be used in initializer.
572 2006-05-06 Marek Safar <marek.safar@seznam.cz>
575 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
578 2006-05-05 Raja R Harinath <rharinath@novell.com>
580 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
581 (LabeledStatement): Add 'name' parameter.
582 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
583 (Block.AddLabel): Update to changes.
584 * cs-parser.jay (labeled_statement): Likewise.
586 * flowanalysis.cs (BranchingType.Labeled): New.
587 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
588 (FlowBranchingLabeled): New. Does nothing for now, but will
589 eventually handle 'goto' flows.
590 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
591 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
592 that's terminated ...
593 (Block.Resolve): ... here.
595 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
596 (UsageVector.MergeFinallyOrigins): Likewise.
597 (FlowBranching.InTryOrCatch): Likewise.
598 (FlowBranching.AddFinallyVector): Likewise.
599 (FlowBranchingException): Update to changes.
602 * statement.cs (Return.Resolve): Move error checking to ...
603 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
604 (FlowBranchingException): Handle return origins like break and
606 (FlowBranching.UsageVector.CheckOutParameters): Remove.
608 2006-05-04 Marek Safar <marek.safar@seznam.cz>
611 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
614 2006-05-04 Marek Safar <marek.safar@seznam.cz>
617 * class.cs (MethodData.Define): Do public accessor check only when method
618 implements an interface.
620 2006-05-04 Raja R Harinath <rharinath@novell.com>
622 Remove special handling of 'break'
623 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
624 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
625 (UsageVector.Break): Remove.
626 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
628 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
630 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
631 UsageVector.Breaks (). Don't set NeedsReturnLabel.
633 2006-05-03 Marek Safar <marek.safar@seznam.cz>
636 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
637 be the interface member.
639 2006-05-03 Marek Safar <marek.safar@seznam.cz>
642 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
643 for emitting small (int) values.
645 2006-05-03 Raja R Harinath <rharinath@novell.com>
648 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
649 control-flow passes through the 'finally' after merging-in all the
650 control-flows from 'try' and the 'catch' clauses.
652 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
653 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
654 always true at the only non-recursive entry point.
655 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
656 FlowBranchingBreakable.
657 (FlowBranchingLoop): Remove.
658 * statement.cs (Return.DoResolve): Update to changes.
661 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
662 (FlowBranching.CreateBranching): Handle it: create a
663 FlowBranchingContinuable.
664 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
665 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
666 except that it handles the 'continue' command.
667 (FlowBranching.UsageVector.MergeOrigins): Rename from
669 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
670 except that it overrides AddContinueOrigin.
671 (FlowBranchingException): Override AddContinueOrigin, similar to
673 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
674 Create a new branching around the embedded statement.
675 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
676 control flow after the embedded statement.
677 (Continue.Resolve): Move all error checking to AddContinueOrigin.
679 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
680 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
681 FlowBranchingBreakable.
682 (FlowBranchingSwitch): Remove.
685 * statement.cs (Break.Resolve): Simplify. Move responsibility for
686 error reporting to ...
687 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
688 Rename from 'AddBreakVector'. Add new location argument. Return
689 a bool indicating whether the 'break' crosses an unwind-protect.
690 (FlowBranchingException.AddBreakOrigin): Add.
691 (FlowBranchingException.Merge): Propagate 'break's to surrounding
692 flowbranching after updating with the effects of the 'finally'
694 (FlowBranchingBreakable): New common base class for
695 FlowBranchingLoop and FlowBranchingSwitch.
697 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
699 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
701 2006-05-02 Raja R Harinath <rharinath@novell.com>
703 * statement.cs (Do.Resolve): If the loop is infinite, set the
705 (While.Resolve, For.Resolve): Set a barrier after the embedded
706 statement. There's no direct control flow that goes from the end
707 of the embedded statement to the end of the loop.
708 * flowanalysis.cs (FlowBranching.Infinite): Remove.
709 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
710 above ensure that the reachability is correctly computed.
712 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
713 (UsageVector.MergeBreakOrigins): If the current path is
714 unreachable, treat it as if all parameters/locals are initialized.
715 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
716 infinite loops before merging-in break origins.
718 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
719 (Reachability.Reachable): Split part into ...
720 (Reachability.Unreachable): ... this. Simplify.
721 (Reachability.IsUnreachable): Use 'Unreachable' instead.
723 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
724 (Reachability.SetThrowsSometimes): Likewise.
725 (FlowBranchingBlock.MergeTopBlock): Don't compare against
726 TriState.Always, use corresponding property.
727 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
728 (Block.Resolve): Likewise. Remove some redundant checks.
730 2006-05-02 Raja R Harinath <harinath@gmail.com>
732 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
733 (Reachability.Meet): Don't bother checking AlwaysThrows --
734 barrier is always set.
735 (FlowBranchingBlock.Merge): Likewise.
737 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
739 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
740 defined, so it's references should also compile only for NET_2_0
741 (as occurs in mcs version)
743 2006-05-01 Raja R Harinath <harinath@gmail.com>
745 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
746 checks for unreachable.
748 2006-05-01 Marek Safar <marek.safar@seznam.cz>
751 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
753 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
754 whether field is really assigned.
756 2006-04-30 Raja R Harinath <harinath@gmail.com>
758 * flowanalysis.cs (Reachability): Make 4-argument constructor
760 (Reachability.Meet): Rename from 'And'. Remove static variant.
761 (Reachability.Always): Rename from the highly misleading
762 'Reachability.Never'.
763 (FlowBranching.Merge): Update to changes. Mark an impossible
764 situation with a 'throw'.
765 (*): Update to changes.
767 2006-04-29 Raja R Harinath <harinath@gmail.com>
769 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
771 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
772 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
773 (*): Update to changes.
774 * statement.cs: Update to changes.
776 2006-04-28 Marek Safar <marek.safar@seznam.cz>
779 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
781 2006-04-28 Raja R Harinath <harinath@gmail.com>
783 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
786 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
787 argument to two arguments: an usage-vector and a bool. Move call
788 to FlowBranching.Merge () ...
789 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
791 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
792 handling of loop and switch reachability to ...
793 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
795 2006-04-27 Raja R Harinath <harinath@gmail.com>
797 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
798 handling to FlowBranchingLoop.InLoop.
799 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
801 2006-04-26 Marek Safar <marek.safar@seznam.cz>
804 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
805 anonymous method is allowed from AnonymousContainer here.
807 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
809 2006-04-24 Raja R Harinath <rharinath@novell.com>
812 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
814 2006-04-23 Marek Safar <marek.safar@seznam.cz>
817 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
818 (DoubleConstant.Reduce): Ditto.
820 2006-04-23 Raja R Harinath <rharinath@novell.com>
822 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
823 Remove 'lvalue_right_side' argument. Move parts to ...
824 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
825 (LocalVariable.DoResolveLValue): ... these.
827 2006-04-21 Raja R Harinath <rharinath@novell.com>
830 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
831 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
832 (LocalVariableReference.DoResolveBase): Use it to implement new
834 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
835 (Argument.Resolve): Simplify. Move CS1510 check ...
836 * ecore.cs (Expression.ResolveLValue): ... here.
837 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
838 (PropertyExpr.DoResolveLValue): Likewise.
839 (FieldExpr.Report_AssignToReadonly): Likewise.
840 (FieldExpr.DoResolve): Add 'out_access' argument. Use
841 LValueMemberAccess or LValueMemberOutAccess on instance depending
843 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
844 DoResolve as appropriate.
846 2006-04-20 Raja R Harinath <rharinath@novell.com>
849 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
850 implicit conversions on 'out' and 'ref' arguments.
852 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
853 improve clarity. Remove dead code.
856 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
857 (Catch.Resolve): Resolve VarBlock if it exists.
859 2006-04-19 Miguel de Icaza <miguel@novell.com>
861 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
862 twice, this was some residual code, the enumerator was emitted
863 properly in the two branche of if later.
867 Thanks to Martin for finding the source of the problem
869 2006-04-19 Raja R Harinath <rharinath@novell.com>
871 * expression.cs (Cast.ResolveLValue): Remove. The result of a
872 cast is never an lvalue.
873 (Cast.DoResolve, Cast.ResolveRest): Combine.
874 (Argument.Emit): Simplify slightly. Move 'Expr is
875 IMemoryLocation' check ...
876 (Argument.Resolve): ... here.
877 (Argument.Error_LValueRequired): Remove. Inline into only user.
879 Simplifications. Fix cs0191-2.cs
880 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
881 CS1649 and CS1651 to ...
882 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
883 the actual selection of the error code and message to a lookup
884 table. Add a dummy return value to simplify callsites.
885 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
886 readonly fields of other instances of the same type. Move CS0197
888 * expression.cs (Argument.Resolve): ... here. Simplify code.
889 Ensure that ec.InRefOutArgumentResolving is only set during LValue
890 resolution of an out or ref argument. The code simplification
891 above uses this invariant.
893 2006-04-18 Raja R Harinath <rharinath@novell.com>
895 Possibly fix #77752. Fix cs1690-[4-7].cs.
896 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
897 CheckMarshallByRefAccess. Drop parameter.
898 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
900 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
902 * report.cs (AllWarnings): Add CS1690.
903 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
905 (LocalVariableReference.DoResolveBase): Update.
907 2006-04-09 Marek Safar <marek.safar@seznam.cz>
909 * class.cs (MethodOrOperator): Moved common parts from method class.
910 detect obsolete attributes.
911 (Method.Define): Simplified as it reuses code from base.
912 (Constructor.ValidAttributeTargets): Fixed issue found during
914 (Destructor.ValidAttributeTargets): Fixed issue found during
916 (Operator): Finished refactoring set off by #78020. Operator class is now
917 ordinary method class.
919 * anonymous.cs: Updated.
921 2006-04-09 Marek Safar <marek.safar@seznam.cz>
923 * class.cs (Constructor.Emit): Don't emit the attributes twice.
925 2006-04-09 Marek Safar <marek.safar@seznam.cz>
927 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
928 detect obsolete attributes.
929 (Method.CreateEmitContext): Moved to MethodOrOperator.
931 2006-04-09 Marek Safar <marek.safar@seznam.cz>
934 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
935 customized exception to make crash detection easier.
936 (MethodOrOperator): Started to work on new base class for methods and
938 (Method): Derives from MethodOrOperator.
939 (Constructor.Emit): Emits its own attributes.
940 (AbstractPropertyEventMethod.Emit): Ditto.
941 (Operator): Derives from MethodOrOperator, will refactor fully in extra
943 (Operator.Emit): It's temporary more tricky than should be.
945 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
947 * report.cs (InternalErrorException): Add ctor with inner exception.
949 2006-04-08 Marek Safar <marek.safar@seznam.cz>
952 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
955 2006-04-07 Marek Safar <marek.safar@seznam.cz>
958 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
961 2006-04-06 Marek Safar <marek.safar@seznam.cz>
963 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
964 attribute is present and Guid not.
965 (Interface.ApplyAttributeBuilder): Ditto.
967 * attribute.cs: Add error message.
969 2006-04-06 Marek Safar <marek.safar@seznam.cz>
973 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
974 sources (it's composite) so hold them in extra array as they are used in
975 Emit phase only. It worked in the previous versions by mistake.
976 (Attribute.Emit): Emit attribute for more owners when exist.
978 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
979 it has now different behaviour.
981 2006-04-04 Marek Safar <marek.safar@seznam.cz>
983 * constant.cs (Constant.IsDefaultInitializer): New method.
987 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
988 re-initialize default values. It saves KBs almost for every assembly.
989 Thanks Zoltan for the idea.
990 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
991 (ArrayCreation.DoResolve): Resolve only once.
992 (ArrayCreation.Emit): Emit static initializer only when it is faster.
993 (ArrayCreation.GetAttributableValue): Cope with optimized values.
995 2006-04-03 Zoltan Varga <vargaz@gmail.com>
997 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1000 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1002 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1003 in an embedded statement too.
1005 2006-04-01 Raja R Harinath <rharinath@novell.com>
1008 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1012 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1015 * report.cs (SymbolRelatedToPreviousError): Drop generic type
1016 arguments before checking whether a type is reflected or not.
1019 * expression.cs (Invocation.IsApplicable): Ensure a generic method
1020 definition doesn't take part in overload resolution.
1021 (Invocation.IsParamsMethodApplicable): Likewise.
1022 (Invocation.OverloadResolve): When replacing a reflected override
1023 method with its base definition, ensure that type arguments are
1026 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1030 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1033 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1035 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1037 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1040 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1041 LocalTemporary change.
1043 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1045 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1046 initializers optimization.
1047 (ClassOrStruct.TypeAttr): Moved from modifiers.
1048 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1049 (FieldBase.ResolveInitializer): Resolves initializer.
1050 (FieldBase.HasDefaultInitializer): New property.
1052 * cs-parser.jay: Removed message.
1054 * expression.cs (CompilerGeneratedThis): New specialization.
1056 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1058 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1060 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1062 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1064 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1065 be now EnumConstants only.
1067 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1069 * attribute.cs, driver.cs: Reset more caches.
1071 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1073 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1075 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1077 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1078 for easier reuse. Updated all overrides.
1079 (IntegralConstant): New base class for all integral constants.
1080 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1081 of the constant range, report custom error.
1082 (UIntConstant.Reduce): Fixed uint conversion.
1084 * ecore.cs, literal.cs: Reduce updates.
1086 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1090 * class.cs (Constructor.Define): Removed extra if for default ctors.
1091 A patch from Atsushi Enomoto.
1093 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1095 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1096 GetAttributableValue.
1098 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1101 * convert.cs (ImplicitConversionRequired): Error message moved to
1104 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1105 automatic implicit conversion of an output value.
1106 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1108 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1110 (TypeOf.GetAttributableValue): Add extra handling for object type.
1112 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1113 special error message.
1115 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1117 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1119 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1120 compatible with MS runtime.
1122 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1124 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1125 attribute arguments here.
1127 * class.cs (Indexer.Define): The check was moved to attribute class.
1129 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1131 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1133 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1135 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1137 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1140 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1142 * doc-bootstrap.cs : fix build.
1144 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1146 * expression.cs (StringConcat.Append): Issue a warning when empty string
1149 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1151 * assign.cs (CompoundAssign.ResolveSource): Removed.
1153 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1156 * class.cs (TypeContainer.FindMethods): Removed.
1157 (TypeContainer.CheckMemberUsage): Made static.
1159 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1161 * constant.cs (CheckRange): Removed unused type argument.
1162 (CheckUnsigned): Removed unused type argument.
1164 * cs-parser.jay: Updated after MemberAccess clean up.
1165 Uses Length for empty string test.
1167 * cs-tokenizer.cs: Uses Length for empty string test.
1168 (IsCastToken): Made static.
1169 (is_hex): Made static.
1170 (real_type_suffix): Made static.
1172 * decl.cs (SetupCache): Made static.
1173 (OnGenerateDocComment): Removed unused ds argument.
1175 * delegate.cs (VerifyDelegate): Removed unused argument.
1177 * doc.cs: Uses Length for empty string test.
1179 * driver.cs: Uses Length for empty string test.
1181 * enum.cs (IsValidEnumType): Made static
1183 * expression.cs (EnumLiftUp): Removed unused argument.
1184 (ResolveMethodGroup): Ditto.
1185 (BetterConversion): Ditto.
1186 (GetVarargsTypes): Ditto.
1187 (UpdateIndices): Ditto.
1188 (ValidateInitializers): Ditto.
1189 (MemberAccess.ctor): Ditto.
1190 (GetIndexersForType): Ditto.
1192 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1194 * iterators.cs: Updated after MemberAccess clean up.
1196 * location.cs: Uses Length for empty string test.
1198 * namespace.cs: Uses Length for empty string test.
1200 * report.cs (CheckWarningCode): Made static.
1202 * statement.cs (LabeledStatement): Removed unused argument.
1204 * typemanager.cs (FilterNone): Removed.
1206 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1208 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1211 * class.cs: Updated.
1213 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1215 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1217 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1221 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1223 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1224 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1225 Add more error reporting; Fixed issue with params.
1227 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1229 * cs-parser.jay: AnonymousMethod requires host container.
1231 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1233 2006-03-18 Raja R Harinath <harinath@gmail.com>
1235 * class.cs: Change 'TypeContainer ds' constructor argument to
1236 'DeclSpace parent'. Some classes were missed below due to
1237 different naming convention.
1239 * class.cs (MemberCore.Parent): Delete. This makes the
1240 ParentContainer changes below enforceable by the compiler.
1242 Treat pointers to enclosing declaration space as 'DeclSpace', not
1244 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1245 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1247 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1249 (Block.AddThisVariable): Likewise.
1250 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1251 (AbstractPropertyEventMethod.Emit): Likewise.
1252 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1253 (GetMethod.Define, SetMethod.Define): Likewise.
1254 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1255 (DelegateMethod.EmitMethod): Likewise.
1257 Fix regression test-partial-13.cs.
1258 Rationalize use of PartialContainer. Ensure that the partial
1259 class semantics can be tied to type-correctness, i.e., any
1260 violation will cause a compile error.
1261 * class.cs, const.cs: Access all fields that belong to class
1262 TypeContainer via ParentContainer. Arguments of EmitContexts and
1263 Resolve()-like functions still use 'Parent'.
1265 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1266 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1267 (PropertyMethod.CheckModifiers): Remove unused argument.
1268 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1271 2006-03-28 Raja R Harinath <rharinath@novell.com>
1273 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1275 2006-03-17 Raja R Harinath <harinath@gmail.com>
1277 Make semantics of PartialContainer simpler.
1278 * decl.cs (DeclSpace.IsPartial): Remove.
1279 * class.cs (TypeContainer.IsPartial): Likewise.
1280 (TypeContainer..ctor): Set PartialContainer to point to self.
1281 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1282 (TypeContainer.FindNestedType): Likewise.
1283 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1285 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1287 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1289 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1291 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1294 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1296 * class.cs (Operator.Define): An error for base conversion was not
1299 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1301 A fix for #77593, #77574.
1303 * class.cs (MethodCore.CheckBase): Another if for operator.
1305 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1309 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1310 reporting, it's more tricky than I thought.
1312 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1314 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1317 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1318 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1321 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1324 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1328 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1329 (Event.Define): ditto
1330 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1332 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1333 Removed redundant code and set NewSlot for Invoke method too.
1335 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1336 (Parameters.MergeGenerated): New method. Use this method when you merge
1337 compiler generated argument with user arguments.
1339 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1341 * attribute.cs (ResolveAsTypeTerminal): Removed.
1343 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1344 specialization for predefined types; 30% speed up.
1345 Finally placed obsolete check to right place.
1346 (Expression.ResolveType): Removed.
1348 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1349 Updated after ResolveType was removed.
1351 * expression.cs (Cast.ctor): Check void cast.
1352 (Binary.ResolveAsTypeTerminal): Is never type.
1353 (Conditional.ResolveAsTypeTerminal): Is never type.
1355 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1357 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1359 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1361 2006-03-23 Martin Baulig <martin@ximian.com>
1363 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1364 type check if either of the types is an open generic type.
1366 2006-03-23 Martin Baulig <martin@ximian.com>
1369 (Convert.ExplicitTypeParameterConversion): New method; implement
1370 explicit type parameter conversions.
1372 2006-03-23 Martin Baulig <martin@ximian.com>
1374 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1375 blindly allow all conversions if we do not have any constraints.
1377 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1379 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1380 these two separated members to simplify the code.
1381 (Attribute.Resolve): Refactored to use new fields and methods.
1382 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1383 implemented obsolete attribute checking.
1384 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1385 implemented obsolete checking again. It look line never ending quest ;-)
1386 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1388 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1390 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1392 *class.cs (Property.Define): Add RegisterProperty call.
1394 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1395 argument groups (only 2).
1397 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1398 encoding expression to arguments.
1399 (Expression.ExprClassToResolveFlags): Just turned to property.
1401 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1402 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1403 optimized as well as implemented support for zero-length attributes.
1405 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1406 Add caching of PropertyInfo's.
1408 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1410 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1411 error multiple times.
1413 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1415 New partial class implementation.
1416 A fix for #77027, #77029, #77403
1418 * attribute.cs (Attributable): Made attributes protected.
1420 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1421 the replacements of ClassPart and PartialContainer.
1422 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1423 (TypeContainer.AddInterface): Ditto.
1424 (TypeContainer.AddPartial): The main method for partial classes. It checks
1425 for errors and merges ModFlags and attributes. At the end class is added to
1427 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1429 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1430 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1431 from the rest of partial classes.
1432 (TypeContainer.GetClassBases): Simplified.
1433 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1435 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1436 (TypeContainer.HasExplicitLayout): Uses Flags now.
1437 (PartialContainer): Removed.
1438 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1439 (StaticClass): Was merged with Class.
1440 (Class.GetClassBases): class and static class bases are verified here.
1441 (Class.TypeAttr): Added static attributes when class is static.
1442 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1443 (MemberBase): In some cases we need to call parent container for partial
1444 class. It should be eliminated but it's not easy now.
1446 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1448 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1449 partial classed to accumulate class comments.
1450 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1452 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1454 * driver.cs (MainDriver): Tree.GetDecl was removed.
1456 * modifiers.cs (Modifiers): Add partial modifier.
1458 * tree.cs (Tree.decl): Removed.
1459 (RootTypes): Started to use this class more often for root types
1462 2006-03-23 Raja R Harinath <rharinath@novell.com>
1464 * generic.cs (TypeParameter.UpdateConstraints): Update
1465 'constraints' if null.
1467 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1471 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1472 external interface does not have an attribute.
1474 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1476 Another prerequisites for new partial classs implementation.
1478 * attribute.cs (Attribute.Equal): Implemented.
1479 (Attribute.Emit): Changed as attributes can be applied more than twice.
1480 (Attributes.Emit): Check for duplicate attributes here.
1482 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1483 as a parameter, clean-up.
1485 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1489 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1490 contains obsolete attribute check which can in some cases look for base
1491 type of current class which is not initialized yet.
1492 (TypeContainer.BaseType): Replacement of ptype.
1494 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1496 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1498 First of prerequisites for new partial classs implemention.
1500 * attribute.cs (Attributable): Extended by ResolveContext;
1501 Attributes finally have correct context for resolving in all cases.
1502 (AttachTo): Attribute owner is assigned here.
1504 * codegen.cs (IResolveContext): Introduce new interface to hold
1505 all information needed in resolving phase.
1506 (EmitContext): Implements IResolveContext; more clean-up needed here.
1508 * decl.cs (MemberCore): Implemented IResolveContext.
1510 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1511 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1512 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1513 Refactored to use new IResolveContext instead of EmitContext; cleanup
1515 2006-03-22 Raja R Harinath <rharinath@novell.com>
1517 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1518 mcs to keep code differences small.
1519 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1520 * typemanager.cs (parameter_default_value_attribute_type): New.
1521 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1524 2006-03-22 Martin Baulig <martin@ximian.com>
1527 (Nullable.NullableLiteral): Derive from `NullLiteral'.
1530 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1531 instead of the normal `NullLiteral'.
1533 2006-03-21 Martin Baulig <martin@ximian.com>
1536 * generic.cs (TypeManager.InferType): If `pt' is a generic
1537 parameter, don't check whether `pt == at'.
1539 2006-03-20 Raja R Harinath <rharinath@novell.com>
1542 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1543 (TypeParameter.Resolve): Update to change.
1544 (ConstraintChecker.CheckConstraints): Resolve type-argument
1545 constraints before use.
1547 2006-03-16 Martin Baulig <martin@ximian.com>
1550 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1551 and don't have any instance constructors, also lookup in the base class.
1552 (TypeManager.IsNullableValueType): New public method.
1554 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1555 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1556 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1558 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
1559 instead of just TypeManager.IsNullableType() to determine whether
1560 a lifted operator exists.
1561 (UnaryMutator.DoResolve): Likewise.
1562 (Conditional.DoResolve): Likewise.
1563 (Binary.DoResolve): A lifted operator only exists if both operands
1564 are valuetypes and at least one of them is a nullable type.
1566 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1568 * iterator.cs : yield break is allowed in try statement which has
1569 catch clauses. Fixed bug #77767.
1571 2006-03-12 Martin Baulig <martin@ximian.com>
1573 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
1574 private IsSignatureEqual() to compare types; see the comment in
1575 that method; fixes #77674.
1577 2006-03-10 Raja R Harinath <rharinath@novell.com>
1579 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
1580 (Expression.ResolveAsTypeTerminal): Likewise.
1581 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
1582 * expression.cs, generic.cs, iterators.cs: Likewise.
1583 * parameter.cs, statement.cs, typemanager.cs: Likewise.
1585 2006-03-09 Martin Baulig <martin@ximian.com>
1587 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1588 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1590 2006-03-09 Martin Baulig <martin@ximian.com>
1592 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1593 `prepared' flag is set.
1595 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1596 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1597 issues; see gtest-254.cs.
1599 2006-03-07 Martin Baulig <martin@ximian.com>
1601 * generic.cs (TypeManager.InferType): Allow infering
1602 `IEnumerable<T>' with an array of T; see gtest-251.cs.
1604 2006-03-06 Martin Baulig <martin@ximian.com>
1607 (TypeManager.InferType): Fix gtest-250.cs.
1610 (TypeManager.IsSubclassOf): Also check the base class.
1613 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1616 2006-03-01 Raja R Harinath <rharinath@novell.com>
1619 * expression.cs (ParameterReference.DoResolveBase): Change return
1621 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1625 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1628 * typemanager.cs (GetFullNameSignature): Don't nullref on
1629 protected accessors.
1631 2006-02-16 Martin Baulig <martin@ximian.com>
1634 (TypeManager.GetGenericFieldDefinition): New public method; use it
1635 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1637 2006-02-14 Martin Baulig <martin@ximian.com>
1639 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1641 2006-02-14 Martin Baulig <martin@ximian.com>
1644 (TypeManager.DropGenericMethodArguments): New public method; don't
1645 use GetGenericMethodDefinition() on something which is not a
1648 2006-02-14 Martin Baulig <martin@ximian.com>
1651 (ConstraintChecker.CheckConstraints): If a type parameter has the
1652 `struct' constraint, the type must be a non-nullable valuetype.
1654 2006-02-10 Martin Baulig <martin@ximian.com>
1657 (TypeManager.IsOverride): Make this work for instantiated methods
1658 in a generic class; fixes #77509.
1659 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1660 rather than calling it directly; fixes #77488.
1662 2006-02-08 Martin Baulig <martin@ximian.com>
1664 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1665 reporting into CheckConstraint() so we can use the correctly
1668 2006-02-08 Martin Baulig <martin@ximian.com>
1670 * expression.cs (BaseAccess): Add support for generic methods.
1672 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1673 the new MethodGroupExpr.
1675 2006-02-07 Martin Baulig <martin@ximian.com>
1677 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1678 also reference types; fixes #77483.
1680 2006-02-07 Martin Baulig <martin@ximian.com>
1683 (TypeManager.IsGenericMethod): We now return whether something is
1684 an instantiated generic method (and not a generic method def).
1685 (TypeManager.IsGenericMethodDefinition): New public method.
1688 (TypeManager.CSharpSignature): Only include type arguments for
1689 "real" generic methods, not for any instantiated method.
1690 (TypeManager.GetMethodName): Likewise, but also allow generic
1691 method definitions here.
1693 2006-02-06 Miguel de Icaza <miguel@novell.com>
1695 * codegen.cs (EmitScopeInitFromBlock): check here the
1696 capture_context, there is no need to make two calls to the
1699 * anonymous.cs: Add some debugging messages that might help me
1700 track other instances of this problem in the future (the
1701 regression of test 467).
1703 * cs-parser.jay: track the variable block, as we need to initalize
1704 any captured variables declared in this block for the "catch"
1705 portion of the "Try" statement.
1707 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1708 scope initialization for captured variables.
1710 Also, move the emit for the variables after the block location has
1713 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1715 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1717 2006-02-06 Martin Baulig <martin@ximian.com>
1719 * class.cs (TypeContainer.DefineType): If we're a struct, pass
1720 `TypeManager.value_type' as parent type to
1721 ModuleBuilder.DefineType(). Fixes #77358.
1723 2006-02-02 Miguel de Icaza <miguel@novell.com>
1725 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1726 commit yesterday, the initialization for the roots is necessary.
1727 What is not necessary is the scope activation.
1729 2006-02-02 Raja R Harinath <rharinath@novell.com>
1731 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1732 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1734 (Argument.Resolve): Remove CS0206 checks.
1736 2006-02-01 Miguel de Icaza <miguel@novell.com>
1738 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1739 scopes for all the roots, the scopes will now be emitted when the
1740 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1742 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1743 code. This reduces a lot of existing cruft.
1745 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1746 that the ScopeInfo is generated as we enter the scope, not at the
1747 time of use, which is what we used to do before.
1749 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1750 every time a Block is about to be emitted if we have a
1753 2006-02-01 Raja R Harinath <rharinath@novell.com>
1755 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1756 attribute for mscorlib too.
1758 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1760 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1762 * typemanager.cs (cons_param_array_attribute): Make private.
1763 (Reset): Set it to null.
1764 (InitCoreHelpers): Don't initialize it.
1765 (ConsParamArrayAttribute): New. Initialize it as needed.
1766 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1768 2006-01-31 Miguel de Icaza <miguel@novell.com>
1770 * expression.cs: There might be errors reported during the
1771 selection of applicable methods. If there are errors, do not
1772 continue execution as it will lead the compiler to crash.
1774 2006-01-30 Miguel de Icaza <miguel@novell.com>
1776 * expression.cs: Member access is not allowed on anonymous
1777 methods. Fixes #77402.
1779 2006-01-30 Raja R Harinath <rharinath@novell.com>
1782 * cs-parser.jay (VariableDeclaration): Don't set
1783 current_array_type to null.
1784 (field_declaration, event_declaration, declaration_statement):
1785 Set it to null here.
1787 2006-01-29 Raja R Harinath <harinath@gmail.com>
1790 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1792 2006-01-28 Raja R Harinath <harinath@gmail.com>
1794 * typemanager.cs (GenericParameterPosition): New.
1797 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1799 * doc.cs : To process "include" elements, first we should create
1800 another list than XmlNodeList, because it could result in node
1801 removal, which could result in that the XmlNodeList gives up
1804 2006-01-25 Miguel de Icaza <miguel@novell.com>
1806 * expression.cs: Introduce an error report that we were not
1807 catching before. Gonzalo ran into it.
1809 2006-01-23 Miguel de Icaza <miguel@novell.com>
1811 A fix for bug: #76957
1813 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1814 ComputeMethodHost before creating the method, this is a new
1817 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1818 that this method references (RegisterScope). The actual scope
1819 where the method is hosted is computed with the ComputeMethodHost
1820 before we create the method.
1822 Moved the Deepest routine here.
1824 (AnonymousContainer.ComputeMethodHost): New routine used to
1825 compute the proper ScopeInfo that will host the anonymous method.
1827 (ScopeInfo): Deal with multiple roots. The problem was that we
1828 did not have a unique root where all ScopeInfos could be hanged
1829 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1832 Remove AdjustMethodScope which is now computed at the end. Remove
1833 LinkScope which did a partial link, instead link all ScopeInfos
1834 before code generation from the new "LinkScopes" routine.
1836 Simplify all the Add* routines as they no longer need to maintain
1837 the tree, they just need to record that they are using variables
1840 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1841 routines to produce the forest of ScopeInfo trees.
1843 * class.cs (TypeContainer.AppendMethod): This is just like
1844 AddMethod, but ensures that an interface implementation method
1845 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1846 methods, but at the end.
1848 We use this functionality to ensure that the generated MoveNext
1849 method in the iterator class is resolved/emitted before the
1850 enumerator methods created.
1852 This is required because the MoveNext method computes the right
1853 ScopeInfo for the method. And the other methods will eventually
1854 need to resolve and fetch information computed from the anonymous
1858 2006-01-23 Raja R Harinath <rharinath@novell.com>
1860 Improve implementation of section 14.4.2.2 (Better function member).
1861 * expression.cs (Invocation.MoreSpecific): Compare all type
1862 arguments before deciding if one type is more specific than
1863 another. Handle array types too. Return the more specific type.
1864 (Invocation.BetterFunction): Add more tie-breaking rules from
1865 section 14.4.2.2. Perform "more specific" check after
1866 other tie-breaking rules. Compare all parameter types before
1867 choosing the "more specific" method.
1869 2006-01-21 Raja R Harinath <harinath@gmail.com>
1870 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1873 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1875 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1876 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1878 2006-01-18 Martin Baulig <martin@ximian.com>
1880 * class.cs (TypeContainer.AddToMemberContainer): Use
1881 `symbol.MemberName.MethodName' instead of just `symbol.Name';
1884 2006-01-18 Martin Baulig <martin@ximian.com>
1886 Fix #76417: a generic class may now have methods which may unify
1887 for some type parameter substitutions.
1889 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1890 for methods which may unify anymore.
1892 * expression.cs (Invocation.MoreSpecific): New private static
1893 method; checks whether one method is more specific than another
1894 according to 14.4.2.2 of the spec.
1895 (Invocation.BetterFunction): Implement the tie-breaking rules from
1896 14.4.2.2 of the spec: if two methods unify for some type parameter
1897 substitution, we need to pick the more specific one.
1899 2006-01-18 Raja R Harinath <rharinath@novell.com>
1901 Fix #76656, cs0231-2.cs.
1902 * cs-parser.jay (formal_parameter_list): Make error case catch
1904 (parenthesized_expression_0): Add CS1026 check.
1905 (invocation_expression): Remove unused { $$ = lexer.Location }.
1907 2006-01-17 Raja R Harinath <rharinath@novell.com>
1910 * cs-parser.jay (statement_expression): Don't list out the
1911 individual statement-expressions. Convert syntax error into
1914 2006-01-16 Raja R Harinath <rharinath@novell.com>
1917 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1918 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1919 CheckIntermediateModification.
1920 (FieldExpr.DoResolve): Add new two-argument version that
1921 allows us to resolve the InstanceExpression as an lvalue.
1922 The one-argument variant is now just a wrapper.
1923 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1924 Resolve the lhs as an lvalue if the it has a value type.
1925 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1926 from Assign.DoResolve.
1927 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1928 resolved as an lvalue.
1929 (PropertyExpr.DoResolve): Update.
1930 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1931 has a value type. Move CS1612 check here from
1932 CheckIntermediateModification.
1933 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1934 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1935 'right_side' of a ResolveLValue on an 'out' argument.
1936 (EmptyExpression.LValueMemberAccess): New. Used as the
1937 'right_side' of a propagated ResolveLValue on a value type.
1938 (LocalVariableReference.DoResolveBase): Recognize
1939 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1941 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1942 EmptyExpression.Null.
1944 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1946 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1947 Type.IsGenericParameter(). Fixed bug #77183.
1948 * doc.cs : it is now identical to doc.cs in mcs.
1950 2006-01-16 Martin Baulig <martin@ximian.com>
1952 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1954 2006-01-16 Martin Baulig <martin@ximian.com>
1956 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1957 ctors; fixes #77250.
1959 2006-01-12 Miguel de Icaza <miguel@novell.com>
1961 This fixes the problem where we used ldfld instead of ldflda to
1962 load the "THIS" pointer on captured parameters, when THIS is a
1963 value type. See bug #77205.
1965 * iterators.cs (CapturedThisReference.Emit): Pass false to
1966 EmitThis (we do not need the address).
1968 * codegen.cs (EmitThis): it needs to know whether we need the
1969 address of `this' or not. This is used by value types.
1971 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1972 every other call passes false.
1974 2006-01-12 Raja R Harinath <rharinath@novell.com>
1977 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1979 * expression.cs (Invocation.OverloadResolve): Update.
1980 (Invocation.DoResolve): Avoid double resolution of invocation.
1982 2006-01-11 Raja R Harinath <rharinath@novell.com>
1985 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1986 unary negation of floating point types as 0-expr; negation cannot
1987 overflow in floating point types.
1990 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1991 on operands of 'void' type.
1994 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1995 and ExclusiveOr for boolean constants too.
1997 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1999 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2001 2006-01-12 Miguel de Icaza <miguel@novell.com>
2003 * cs-tokenizer.cs (Position): New class used to save and restore
2004 the position state in the tokenizer. Before this patch the save
2005 and restore was not complete enough so the line and columns would
2006 start to drift and the debugger and stack traces will get the
2009 2006-01-10 Martin Baulig <martin@ximian.com>
2012 (TypeParameter.InflateConstraints): New public method.
2014 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2015 constraints; fixes #77042.
2017 2006-01-10 Martin Baulig <martin@ximian.com>
2019 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2020 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2023 2006-01-09 Raja R Harinath <rharinath@novell.com>
2026 * expression.cs (Invocation.OverloadResolve): Replace reflected
2027 override methods with their base virtual methods, rather than
2029 * typemanager.cs (TypeManager.GetOverride): New.
2031 2005-12-21 Miguel de Icaza <miguel@novell.com>
2033 * driver.cs: Report the case of no source files and no -out:
2036 2005-12-20 Raja R Harinath <rharinath@novell.com>
2039 * expression.cs (ComposedCast.GetSignatureForError): Define.
2041 2006-01-05 Jb Evain <jbevain@gmail.com>
2043 * class.cs (Property.Define, Indexer.Define): do not tag the
2044 properties as SpecialName | RTSpecialName.
2046 2006-01-04 Miguel de Icaza <miguel@novell.com>
2048 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2049 doing a low-level comparission of parameter types. It was lacking
2050 a check for __argslist.
2052 2005-12-30 Miguel de Icaza <miguel@novell.com>
2054 * expression.cs (ParameterReference.DoResolveBase): Allow
2055 reference parameters if they are local to this block.
2057 This allows the ref and out parameters of a delegate to be used in
2058 an anonymous method, for example:
2060 delegate void set (out int x);
2062 set s = delegate (out int x){
2066 This is used by functionality introduced late in the C# language.
2068 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2069 method that take ref and out parameters.
2071 Fixes #77119 which was a late change in the spec.
2073 2005-12-23 Miguel de Icaza <miguel@novell.com>
2075 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2076 parent if its the same scope. Fixes #77060.
2078 2005-12-22 Marek Safar <marek.safar@seznam.cz>
2080 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2082 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2084 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2085 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
2086 that doesn't contain the full public key. This is a update of the
2087 friend assemblies in .Net 2.0 release.
2089 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2093 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2094 ListDictionary, to contain the ExternAliasEntry entries (in
2095 addition to the NamespaceEntry.aliases hashtable). This field is
2096 shared between the original entry and its doppelganger (bodyless
2098 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2099 extern_aliases field.
2100 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2101 lookup in extern_aliases.
2103 2005-12-16 Raja R Harinath <rharinath@novell.com>
2106 * class.cs (TypeContainer.Mark_HasEquals): New.
2107 (TypeContainer.Mark_HasGetHashCode): New.
2108 (ClassPart): Override them.
2109 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2111 * generic.cs (GenericMethod.DefineMembers): Update to changes.
2112 (TypeParameter.TypeParameter): Change type of 'parent' argument to
2116 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2117 'parent' argument to the base constructor.
2119 Remove all mention of TypeContainer from decl.cs.
2120 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2121 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2122 (DeclSpace.DeclSpace): Likewise.
2123 (DeclSpace.DefineMembers): Remove unused argument.
2124 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2125 debugging check -- we don't care if the debug code throws an
2126 InvalidCastException instead of an InternalErrorException.
2127 * class.cs (TypeContainer.DefineMembers): Update to changes.
2128 (TypeContainer.DoDefineMembers): Likewise.
2129 (TypeContainer.GetMethods): Likewise.
2130 (PropertyMember.Define): Likewise.
2131 (MemberBase.Parent): New property that forwards to
2132 MemberCore.Parent, but ensures that we get a TypeContainer.
2133 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2134 (RootContext.PopulateTypes): Likewise. Remove special case code
2135 for !RootContext.StdLib: DefineMembers is idempotent.
2137 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2139 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2141 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2143 * doc.cs : The search for referenced namespace was insufficient to
2144 get global one as it used to do. Fixed bug #76965.
2146 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2148 * doc.cs : check name in cref in the last phase that whether it is
2151 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2153 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2156 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2158 * doc.cs : so it turned out that we cannot skip override check for
2159 interface members. Fixed bug #76954.
2161 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2163 * cs-tokenizer.cs : fixed bug #75984:
2164 - #warning and #error should not be handled when the source line
2166 - #line is not checked strictly when the source line is disabled.
2167 - #define and #undef is on the other hand checked strictly at any
2170 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2172 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2175 2005-12-15 Raja R Harinath <rharinath@novell.com>
2177 * generic.cs (TypeManager.IsGeneric): Remove unused method.
2179 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2182 2005-12-14 Martin Baulig <martin@ximian.com>
2184 * typemanager.cs (TypeManager.GetFullName): Make this public;
2185 `Type.Fullname' now never returns null.
2187 * class.cs (Method.Define): Use TypeManager.GetFullName() for
2188 explicit interface implementations; we're now using the same
2189 naming convention than csc does.
2191 2005-12-14 Miguel de Icaza <miguel@novell.com>
2193 * convert.cs (ExplicitConversionCore): Check the return value from
2194 ExplicitConversionCore which can return null on failure. Fixes #76914
2196 2005-12-09 Raja R Harinath <rharinath@novell.com>
2198 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2199 instead of IsGenericInstance.
2200 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
2201 code that's now covered by the more general test.
2202 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2204 * generic.cs (DropGenericTypeArguments): New. Captures the common
2205 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2206 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2207 * generic.cs, report.cs, typemanager.cs: Likewise.
2209 2005-12-08 Martin Baulig <martin@ximian.com>
2211 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2213 * typemanager.cs (TypeManager.CSharpSignature): Include type
2214 arguments in the signature of a generic method.
2216 2005-12-07 Martin Baulig <martin@ximian.com>
2218 Add support for custom attributes on type parameters.
2220 * cs-parser.jay (type_arguments): Added `opt_attributes'.
2222 * generic.cs (TypeParameterName): New public class; we use this
2223 instead of a `string' to store the name of a type parameter, so we
2224 can also have `Attributes'.
2225 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2226 array instead of a `string[]' array.
2227 (TypeParameter.ctor): We now also take an `Attributes' argument.
2228 (TypeParameter.EmitAttributes): New public method; emit our
2229 `OptAttributes' here.
2230 (GenericMethod.EmitAttributes): New public method; emit the custom
2231 attributes on all our type parameters.
2233 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2234 our type parameters.
2235 (MethodData.Define): If we're a generic method, call
2236 EmitAttributes() on it.
2238 2005-12-07 Martin Baulig <martin@ximian.com>
2241 (ConstraintChecker): New public abstract class; move the
2242 constraint checking here from `ConstructedType' and also do
2243 constraint checking for generic methods here.
2245 * expression.cs (Invocation.OverloadResolve): Use
2246 ConstraintChecker.CheckConstraints() if we resolved to a generic
2249 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2251 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2253 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2255 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2256 (FieldBase.Initializer): Initializer is now optional.
2257 (EventField.Define): Only event field can have initializer.
2259 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2261 * const.cs (Const): Reuse initializer.
2263 * cs-parser.jay: Updated after FieldBase changes.
2264 Added current_array_type to simplify array initializers.
2266 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2268 * expression.cs, iterators.cs: Updated.
2270 * namespace.cs (NamespaceEntry): Made UsingFound private.
2272 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2274 * parameterCollection.cs: Obsolete, removed.
2275 * parser.cs: Obsolete, removed.
2277 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2280 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2282 * enum.cs (Enum.Define): Set obsolete context here.
2284 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2287 - FindDocumentedMember() now expects 1) paramList as null
2288 when "we don't have to check the number of parameters" and
2289 2) Type.EmptyTypes when "there is no arguments".
2290 - Introduced FoundMember struct to hold the exact type which was
2291 used to find the documented member (the above change broke
2292 test-xml-044; it might be better just to use DeclaringType than
2293 what MS does, like this change does, but it depends on usage.)
2295 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2297 * doc.cs : documented member might be from DeclaringType for nested
2298 types. Fixed bug #76782.
2300 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2302 * anonymous.cs: Have the param code handle leaving copies on the
2303 stack etc. Allows anonymous params to take part in the assignment
2304 code (++, +=, etc). Fixes bug #76550
2306 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2307 it down to the anon code.
2309 * iterators.cs: Use dummy var here
2311 * codegen.cs: Handle new vars
2313 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2316 * class.cs (MethodData.Define): Set proper Obsolete context.
2318 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2320 (FieldExpr.DoResolve): Ditto.
2322 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2325 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2326 parent is not obsolete.
2328 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2330 * doc.cs : (FindDocumentedMember) find parameterless members first
2331 and get CS0419 in the early stage. Fixed first case of bug #76727.
2333 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2336 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2337 no error was reported.
2339 *expression.cs (Binary.DoResolve): left can be null.
2341 2005-12-06 Raja R Harinath <rharinath@novell.com>
2343 * class.cs (MethodCore.CheckGenericOverride): Delete unused
2344 abstract method and all overrides.
2345 * support.cs (ParameterData.GenericConstraints): Delete.
2346 (ReflectionParameters.type_params): Delete.
2347 (ReflectionParameters.ReflectionParameters): Make private.
2348 (ReflectionParameters.GetConstaints): New factory method.
2349 * generic.cs (TypeParameterDefineType): Use it.
2350 (TypeManager.GetTypeParameterConstraints): Likewise.
2352 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2355 * class.cs (MethodData.Emit): Parameters should be labeled first.
2357 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2360 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2362 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2364 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2366 * class.cs (MethodCore): Parameter clean up.
2367 (IMethodData): Added ParameterInfo.
2368 (MethodData): Parameter clean up.
2369 (Indexer.Define): Parameter clean up.
2381 * typemanager.cs: Parameter clean up.
2383 * delegate.cs (Define): Get rid of duplicated code.
2385 * expression.cs (ParameterReference): Removed useless parameters
2387 (Invocation): Ditto.
2389 * parameter.cs (ParamsParameter): New class, params specialization.
2390 (ArglistParameter): Attemp to separate arglist.
2391 (Parameter): Refactored to be reusable and faster.
2392 (Parameter.Modifier): Made understandable.
2393 (Parameters): Changed to be used as a class for `this' assembly
2394 parameters. Refactored to use new specialized classes.
2396 * support.cs (ParameterData): Added Types property.
2397 (InternalParameters): Deleted.
2399 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2401 * doc.cs : the previous patch does not actually fix the bug.
2402 PropertyInfo override check is now implemented and really fixed it.
2403 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2405 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2407 * doc.cs : apply "override filter" also to properties.
2410 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2412 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2413 no need to check overrides. For classes, omit those results from
2414 interfaces since they must exist in the class. Fixed bug #76726.
2416 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2418 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2419 with different parameters. Fixed the second problem in #76685.
2421 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2423 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2424 get expected 'protected' access in CheckValidFamilyAccess()).
2427 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2429 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2430 Fixed bug #76705. CS1569 was incorrectly commented out.
2432 2005-11-23 Martin Baulig <martin@ximian.com>
2434 * generic.cs (Constraints.Define): Removed.
2435 (TypeParameter.DefineConstraints): Removed.
2436 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2437 on the GenericTypeParameterBuilder here.
2439 2005-11-23 Martin Baulig <martin@ximian.com>
2441 * typemanager.cs (TypeManager.GetProperty): Make this public.
2443 * generic.cs (Nullable.NullableInfo.ctor): Use
2444 TypeManager.GetProperty() rather than using reflection directly.
2446 2005-11-17 Martin Baulig <martin@ximian.com>
2448 * expression.cs (Indexers.GetIndexersForType): Added support for
2449 generic parameters; fixes #76587.
2451 2005-11-17 Martin Baulig <martin@ximian.com>
2454 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2455 inherit the scope from our parent. Fixes #76653.
2457 2005-11-15 Martin Baulig <martin@ximian.com>
2459 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2460 instead of `ScopeTypeBuilder' to refer to the "current" type.
2461 (AnonymousMethod.CreateScopeType): Correctly create the helper
2462 class if we're inside a generic type definition.
2464 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2466 * doc.cs : use Invocation.IsOverride() to do real override check.
2467 * expression.cs : made Invocation.IsOverride() internal.
2469 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2471 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2472 TypeBuilder.FindMembers() and filter overriden base members out.
2475 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2477 * doc.cs : ref/out parameters are represented as '@' (instead of
2478 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2480 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2482 * doc.cs : when there was no '.' in cref to methods in doc comment,
2483 then parameters were missing in the output. Fixed bug #76691.
2485 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2487 * driver.cs : don't output docs when there is an error.
2490 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2493 Now it should detect indexers. Fixed primary concern in bug #76685.
2494 Fixed CS0419 message to not show the identical member signature in
2497 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2499 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2500 instead of Type.FindMembers() since it does not handle events.
2503 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2505 * codegen.cs: Fixed typo (speficied -> specified).
2507 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2510 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2512 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2514 * attribute.cs: Changed error message.
2516 * cs-tokenizer.cs: One more check.
2518 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2520 * statement.cs (Block.Resolve): Ignore empty statement.
2522 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2524 * report.cs: Made error/warning methods more strict to avoid
2527 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2528 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2529 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2530 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2532 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2534 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
2535 Use the more explicit AssemblyName.FullName instead of
2536 AssemblyName.Name to report errors.
2538 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2540 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2543 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2553 * report.cs: Fixed error reporting and typos.
2555 * generic.cs (TypeParameter.GetSignatureForError): New method.
2556 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2558 * typemanager.cs (GetFullName): Refactored.
2560 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2562 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2563 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2565 * class.cs (TypeContainer.IsComImport): New property.
2566 (Constructor.Define): Create proper ctor for ComImport types.
2568 * expression.cs (New.CheckComImport): Fixed.
2570 2005-11-07 Miguel de Icaza <miguel@novell.com>
2572 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2573 that a parameter has been captured does not mean that we do not
2574 have to do the rest of the processing. This fixes the second part
2575 of #76592. If there was another anonymous method capturing
2576 values in the past, the Scope would never be set for the second
2577 method that captured the same parameter.
2579 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2580 properly manipulate the stack. Second part of fix for #76592.
2582 * expression.cs (New): Add support for invoking "new" on
2583 interfaces that have been flagged with the ComImport attribute and
2584 the CoClass. Fixes #76637
2586 * statement.cs (Try.DoEmit): When a variable is captured, do not
2587 try to emit the vi.LocalBuilder variable as it has been captured.
2588 Create a temporary variable and store the results on the
2589 FieldBuilder. Fixes #76642
2591 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2593 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2595 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2597 * expression.cs (Binary.DoResolve): Added && optimalization.
2599 * typemanager.cs (AddUserType): Removed useless argument.
2601 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2603 * statement.cs (Block.variables): Uses ListDictionary.
2605 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2608 * class.cs (PartialContainer.EmitType): Customized to emit
2609 security attributes.
2610 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2611 for partial classes.
2613 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2616 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2617 access has to be fixed.
2619 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2621 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2624 * ecore.cs (NullCast.Reduce): Implemented.
2626 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2629 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2631 (Foreach.Resolve): Catch null properly.
2633 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2635 * cs-tokenizer.cs: Warning text fix.
2637 * driver.cs: AllWarningNumbers exposed on public interface.
2639 * report.cs (): Reviewed warning numbers.
2640 (IsValidWarning): Use binary search.
2642 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2644 * driver.cs: Implemeted resource visibility.
2645 (Resources): New class for code sharing between /res: and
2648 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2650 decl.cs (CurrentTypeParameters): Fixed to be public.
2652 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2654 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2656 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2658 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2660 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
2662 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2664 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2666 Add friend assembly access support.
2667 * typemanager.cs: assembly_internals_vis_attrs
2668 cache for friend assembly access.
2669 (TypeManager.IsFriendAssembly): New method for
2670 checking friend assembly access.
2671 (TypeManager.Error_FriendAccessNameNotMatching): New
2673 (TypeManager.CompareKeyTokens): Likewise.
2674 (TypeManager.Filter): Handle friend accessible
2677 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2678 friend accessible types.
2680 * ecore.cs (Expression.IsAccessorAccessible): Handle
2681 friend accessible properties.
2683 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2686 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2689 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2692 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2695 * ecore.cs (NullCast): Child is contant only.
2697 * literal.cs (NullLiteral.Reduce): null can be converted to any
2700 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2702 * driver.cs: Use Encoding.Default as default code page instead
2705 2005-10-27 Raja R Harinath <rharinath@novell.com>
2708 * expression.cs (Invocation.Error_InvalidArguments): Handle
2709 __arglist parameters.
2710 (Invocation.VerifyArgumentsCompat): Likewise.
2711 * support.cs (ReflectionParameters.GetSignatureForError): Print
2712 __arglist parameters.
2713 (InternalParamters.GetSignatureForError): Likewise.
2714 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2716 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2718 * attribute.cs (GetPropertyValue): Made public.
2720 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2722 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2724 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2727 * driver.cs: Reflect method name change.
2729 * statement.cs (Try.Resolve): Warn when try has both general
2732 * typemanager.cs: runtime_compatibility_attr_type new predefined
2735 2005-10-26 Raja R Harinath <harinath@gmail.com>
2738 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2739 treat it as an empty parameter list.
2741 2005-10-26 Raja R Harinath <rharinath@novell.com>
2744 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2745 ResolveAsTypeStep silent.
2746 * statement.cs (Block.AddConstant): Mark block as used.
2747 (Block.ResolveMeta): Avoid piling on error messages
2748 if a constant initializer resolution fails.
2750 2005-10-25 Raja R Harinath <rharinath@novell.com>
2752 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2754 (NamespaceEntry.VerifyAllUsing): New.
2755 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2756 behaviour. Delegates actual resolution of alias to ...
2757 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2758 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2760 * driver.cs (Driver.MainDriver): Update.
2762 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2763 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2765 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2767 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2768 RootNamespace.DefineNamespacesForAll.
2770 2005-10-24 Raja R Harinath <harinath@gmail.com>
2772 * typemanager.cs (assemblies, external_aliases, modules)
2773 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2774 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2775 overhead. Move resposibility ...
2776 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2777 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2779 2005-10-23 Raja R Harinath <harinath@gmail.com>
2781 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2782 cached_namespaces. Improve usage.
2783 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2784 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2785 Move from GlobalRootNamespace and simplify.
2786 (RootNamespace.Global): Make instance variable.
2787 (RootNamespace.RootNamespace): Add "alias name" parameter.
2788 (GlobalRootNamespace): Simplify drastically.
2789 (Namespace.Lookup): Don't use GetNamespace.
2790 * typemanager.cs (GetRootNamespace): Rename from
2791 ComputeNamespaceForAlias.
2792 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2794 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2796 * anonymous.cs (AnonymousContainer): Don't crash when container
2799 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2801 * expression.cs (Binary.DoResolve): Warn when comparing same
2804 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2807 * expression.cs (Binary.DoResolve): It looks like there are no
2808 convetsion rules in enum context.
2810 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2812 Add support for extern alias qualifiers.
2813 * typemanager.cs: Move some LookupTypeReflection code
2814 to namespace.cs, to have cleaner code. Added some methods
2815 to help us keep track of the extern aliased references.
2816 * driver.cs: Add suport for extern alias assemblies on command
2817 line and check for their warnings/errors. Also keep track of the
2818 extern aliased assemblies.
2819 * namespace.cs: Move the global functionality of Namespace
2820 to GlobalRootNamespace/RootNamespace. Now the global namespace
2821 is GlobalRootNamespace.Globa. Also the code moved from
2822 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2823 Finally added LocalAliasEntry (AliasEntry before) and
2824 ExternAliasEntry, to handle alias statements.
2825 * cs-parser.jay: Add support in the grammar for extern alias
2827 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2828 Update callings to Namespace (now in GlobalRootNamespace).
2830 2005-10-25 Martin Baulig <martin@ximian.com>
2832 * convert.cs (ImplicitTypeParameterConversion): Make base
2833 interfaces actually work; fixes #76557.
2835 2005-10-25 Martin Baulig <martin@ximian.com>
2838 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2839 all the type parameters; fixes #76551.
2841 2005-10-25 Martin Baulig <martin@ximian.com>
2846 (GenericMethod.ctor): Added `Expression return_type' and
2847 `Parameters parameters' arguments.
2848 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2849 parameter and return types to check their constraints if they're
2852 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2855 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2856 constraints of a generic type if `ec.ResolvingGenericMethod'.
2858 * class.cs (MethodCore.DoDefineParameters): Set
2859 `ec.ResolvingGenericMethod' if we're a generic method.
2860 (MemberBase.MemberType): Likewise.
2862 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2864 * typemanager.cs (TypeManager): Added
2865 TypeManager.internals_visible_attr_type to cache
2866 S.R.CompilerServices.InternalsVisibleToAttribute.
2868 * codegen.cs (AssemblyClass): Added checks for
2869 InternalsVisibleToAttribute in new method
2870 CheckInternalsVisibleAttribute () and also cache the
2871 AssemblyName in AssemblyClass.Name.
2873 2005-10-24 Martin Baulig <martin@ximian.com>
2876 (TypeManager.ExpandInterfaces): Added overloaded version which
2877 just takes a `Type[]' array.
2880 (Constraints.Resolve): Don't expand the interfaces here; ie. we
2881 just use the interfaces which were explicitly specified and not
2882 the interfaces they inherit. Fixes #76482.
2883 (TypeParameter.FindMembers): Expand the interfaces here.
2885 2005-10-21 Martin Baulig <martin@ximian.com>
2888 (Constraints.Resolve): Also resolve the actual types here.
2889 (Constraints.ResolveTypes): Just check the constraints here.
2890 Fixes #76363; see gtest-218.cs.
2892 2005-10-21 Martin Baulig <martin@ximian.com>
2895 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2896 instead of a `BoxedCast'; fixes gtest-217.cs.
2898 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
2900 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2901 1) "new()" is specified as generic parameter constraint and 2) the
2902 type is TypeBuilder and 3) the type is abstract even if it has a
2903 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2905 2005-10-20 Martin Baulig <martin@ximian.com>
2908 (GenericConstraints.TypeParameter): New public property.
2909 (TypeParameter.ctor): Also take a `DeclSpace' argument.
2910 (TypeParameter.DeclSpace): New public property.
2911 (TypeParameter.DefineType): Inflate the constraints if our
2912 `DeclSpace' is an `Iterator'.
2914 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
2916 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
2917 GenericMethod argument to compare methods' generic type arguments.
2920 2005-10-19 Martin Baulig <martin@ximian.com>
2922 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2923 not ResolveType() when resolving the base type, so we're not
2924 checking the constraints here.
2925 (TypeContainer.ResolveType): Call ResolveType() on our base_type
2928 2005-10-19 Martin Baulig <martin@ximian.com>
2930 * generic.cs (ConstructedType.CheckConstraints): Committing
2931 untested fix for #76441.
2933 2005-10-18 Raja R Harinath <rharinath@novell.com>
2936 * class.cs (TypeContainer.DefineType): Move updating of
2937 topological sort earlier in the code.
2938 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2940 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2943 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2945 * constant.cs (Constant.TryReduce): Moved from Cast class.
2946 (Reduce): Made little bit more OO and fixed missing conversions.
2948 * ecore.cs (Reduce): Implemented.
2949 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2951 * literal.cs (Reduce): Implemented.
2953 * class.cs: Reverted Miguel's wrong commit.
2955 2005-10-14 Miguel de Icaza <miguel@novell.com>
2957 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2959 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2961 * cs-parser.jay, expression.cs : CS0214 was missing error location
2962 for constants. Fixed bug #76404.
2964 2005-10-10 Raja R Harinath <rharinath@novell.com>
2966 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2968 (PropertyExpr.EmitCall): Likewise.
2969 * expression.cs (Invocation.EmitArguments): Handle case where
2971 (Invocation.EmitCall): Avoid allocating temporary variable if
2972 there are no arguments.
2974 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2977 * convert.cs (ExplicitConversionCore): Fixed object->enum
2980 2005-10-07 Raja R Harinath <rharinath@novell.com>
2983 * convert.cs (ImplicitConversionStandard): Move conversion of
2984 void* to arbitrary pointer types ...
2985 (ExplicitConversionStandard): .. here.
2986 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2987 error to always print typenames.
2989 2005-10-07 Raja R Harinath <rharinath@novell.com>
2991 * convert.cs (GetConversionOperator): Rename from
2992 GetConversionOperators. Move operator selection code from ...
2993 (UserDefinedConversion): ... here.
2995 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2997 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3000 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3002 * assign.cs (Assign.DoResolve): Error method changed.
3004 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3006 * const.cs (ResolveValue): Reset in_transit immediately.
3008 * constant.cs: Error method changed.
3010 * convert.cs: Removed useless location parameter.
3011 (ExplicitNumericConversion): Don't do double enum check.
3012 (ExplicitConversionCore): Renamed from ExplicitConversion.
3013 (ExplicitUnsafe): Extracted from ExplicitConversion.
3014 (ExplicitConversion): Uses for error reporting.
3016 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3018 (ResolveBoolean): Uses common error method.
3019 (CastToDecimal): Get rid of ec.
3020 (CastFromDecimal): Optimized.
3021 (ConvCast): Get rid of ec.
3023 * enum.cs (ResolveValue): Reset in_transit immediately.
3024 (Emit): Return after first error.
3026 * expression.cs: Convert changes.
3028 * literal.cs: Error method changed.
3030 * statement.cs: Error method changed.
3032 2005-10-06 Raja R Harinath <rharinath@novell.com>
3034 Fix gtest-131.cs and gtest-211.cs.
3035 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3036 Only emit code for a label if it is used. Unreachable code can
3037 violate ECMA evaluation stack invariants.
3039 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3041 * anonymous.cs: Implemented ExprClassName.
3043 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3046 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3049 * class.cs (StaticClass.DefineContainerMembers): Report protected
3052 * codegen.cs: if(ed) PRODUCTION.
3054 * convert.cs (Error_CannotImplicitConversion): Better error
3057 * cs-parser.jay: More error checks.
3059 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3061 * driver.cs (CSCParseOption): Enabled wrong option check.
3063 * ecore.cs (Expression.ExprClassName): Turned to property.
3064 (MemberExpr.CheckIntermediateModification): For checking boxed
3065 value types modification.
3067 * statement.cs (Fixed.Resolve): Expression type must be
3068 convertible to fixed type.
3069 (CollectionForeach.GetEnumeratorFilter,TryType):
3070 Small refactoring for easier error checking.
3072 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3074 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3077 * class.cs (GeneratedBaseInitializer): New class for customization
3078 compiler generated initializers.
3079 (MemberBase.DoDefine): Check Obsolete attribute here.
3080 (FieldMember.DoDefine): Ditto.
3082 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3085 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3086 (MemberCore.GetObsoleteAttribute): Removed argument.
3087 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3088 (MemberCore.CheckObsoleteType): New helper.
3092 * statement.cs: Updates after MemberCore changes.
3094 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3095 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3097 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3098 obsolete attribute for compiler construct.
3099 (As.DoResolve): Cache result.
3101 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3103 2005-10-01 Miguel de Icaza <miguel@novell.com>
3105 * expression.cs (Probe): instead of having a "Type probe_type"
3106 keep the extra information as a TypeExpr probe_type_expr since the
3107 "As" operator needs to perform some type checks.
3109 * (As.DoResolve): If the type is a type parameter, ensure that it
3110 is constrained by a class.
3112 2005-09-22 Miguel de Icaza <miguel@novell.com>
3114 * statement.cs (Lock): Use the TemporaryVariable class instead of
3115 manually using local variables as those do not work when variables
3118 * ecore.cs: Moved the TemporaryVariable class from being a nested
3119 class inside Foreach to be a public class that can be employed in
3122 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3124 * cs-parser.jay: interface_accessors replaced by
3125 accessor_declarations.
3127 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3130 * statement.cs (GotoCase.Resolve): Convert null constant to
3132 (SwitchLabel.ResolveAndReduce): Ditto.
3133 (SwitchLabel.NullStringCase): Custom null stamp.
3134 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3136 typemanager.cs (CSharpSignature): Don't skip first argument
3139 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3141 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3142 expression.cs, iterators.cs, literal.cs: Store constants and
3145 * class.cs (MemberBase.ShortName): Pass location.
3147 * cs-parser.jay: Some location fixes.
3149 * ecore.cs (Expression.Location): Made virtual.
3151 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3154 * const.cs (Const.ResolveValue): Check for assigning non-null
3155 value to reference type.
3157 2005-09-26 Raja R Harinath <rharinath@novell.com>
3160 * expression.cs (This.VerifyFixed): In a value type T, the type of
3161 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3162 value type R, 'this' is treated as a value parameter.
3164 2005-09-05 Miguel de Icaza <miguel@novell.com>
3166 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3167 if the underlying types are the same, otherwise we need to produce
3168 code that will do the proper cast.
3170 This was exposed by Marek's constant rewrite which produced
3171 invalid code for the call site:
3174 void Method (X v) {}
3178 This fixes test-49.cs
3180 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3182 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3183 Type/Object should be allowed as well. Fixed bug #75968.
3185 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3187 * expression.cs : (Binary.DoResolve): when one is enum constant and
3188 another is constant 0, then return enum one *as enum type*.
3191 2005-10-04 Martin Baulig <martin@ximian.com>
3193 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3194 `SetMemberIsUsed()' work for generics, too.
3196 2005-10-04 Martin Baulig <martin@ximian.com>
3198 * expression.cs (DelegateInvocation.EmitStatement): Make this work
3199 for corlib. Fixes #75691.
3201 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3204 * driver.cs: Fix compilation files with full root path.
3206 2005-09-25 Miguel de Icaza <miguel@novell.com>
3208 * report.cs (SymbolRelatedToPreviousError): Format the output so
3209 it does not use an open parenthesis that is never closed.
3211 * driver.cs: Follow coding guidelines
3213 2005-09-18 Miguel de Icaza <miguel@novell.com>
3215 * driver.cs: Set InEmacs based on the environment variable EMACS.
3217 * location.cs (InEmacs): in this mode, do not report column
3218 location as it confuses Emacs.
3220 2005-10-03 Raja R Harinath <rharinath@novell.com>
3222 * support.cs (SeekableStreamReader.Position): Don't error out when
3223 the requested position is just beyond the end of the current
3226 2005-09-28 Raja R Harinath <rharinath@novell.com>
3228 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3229 try to keep in sync with the byte count of the underlying Stream.
3230 However, this limits us to a window size of 2048 characters: i.e.,
3231 the maximum lookahead of our lexer/parser can be 2048 characters.
3233 2005-09-22 Martin Baulig <martin@ximian.com>
3235 * driver.cs: Removed a debugging FIXME.
3237 2005-09-21 Raja R Harinath <rharinath@novell.com>
3239 * cs-parser.jay (type_arguments): Add CS1644 check.
3240 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3242 2005-09-15 Raja R Harinath <rharinath@novell.com>
3244 * Makefile (PROGRAM): Make profile specific.
3245 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3246 the current directory.
3249 * expression.cs (Invocation.EmitCall): Remove optimization on
3250 this_call since it doesn't handle 'this' being a value type.
3252 2005-09-05 Geoff Norton <gnorton@customerdna.com>
3254 * driver.cs: Ensure file handles are closed after parsing
3256 2005-09-05 Miguel de Icaza <miguel@novell.com>
3258 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3259 if the underlying types are the same, otherwise we need to produce
3260 code that will do the proper cast.
3262 This was exposed by Marek's constant rewrite which produced
3263 invalid code for the call site:
3266 void Method (X v) {}
3270 This fixes test-49.cs
3272 2005-09-05 Martin Baulig <martin@ximian.com>
3274 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3275 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3277 * cs-parser.jay (delegate_declaration): Small fix for #75852.
3279 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3281 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3282 to be a pointer type due to the spec 25.2, so check if declaring
3283 type is generic type definition. Fixed bug #75772.
3285 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3288 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3289 both types are not defined by methods.
3290 * expression.cs : (Invocation.IsApplicable): it should work when
3291 the argument type is equal to the parameter type, not only when
3292 ImplicitConversionExists() returns true.
3294 2005-09-02 Raja R Harinath <rharinath@novell.com>
3296 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3300 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3301 flow-branching for LocalVariableReferences in case we were invoked
3302 from a MemberAccess.
3303 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3305 (LocalVariableReference.DoResolveBase): ... this.
3306 (MemberAccess.Resolve): Do the check that was disabled during
3309 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3312 (PartialContainer.Create): check abstract/sealed/static strictly
3313 but abstract/sealed can exist only at one side. Fixed bug #75883.
3315 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3318 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3319 specified, don't default to UnmanagedType.I4.
3321 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3323 * expression.cs : conditional operator should check possibly
3324 incorrect assign expression. Fixed bug #75946.
3326 2005-08-30 Raja R Harinath <rharinath@novell.com>
3329 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3330 (ScopeInfo.EmitScopeType): Use it to construct field names from
3331 names of captured locals.
3334 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3335 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3336 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3337 (ExplicitConversion): Remove enum cases already handled by
3338 implicit conversion. Move implicit conversion check to the beginning.
3339 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3340 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3341 Don't treat System.Enum as a struct.
3343 2005-08-30 Jb Evain <jbevain@gmail.com>
3345 * attribute.cs: handles as expression in parameters.
3347 2005-08-30 Raja R Harinath <rharinath@novell.com>
3350 * class.cs (TypeContainer.VerifyClsName): Don't use a
3351 PartialContainer when verifying CLS compliance.
3352 (AbstractPropertyEventMethod): Set Parent here, ...
3353 (PropertyMethod): ... not here.
3355 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3357 * attribute.cs : escaped attribute name should not be allowed to be
3358 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3360 2005-08-29 Raja R Harinath <rharinath@novell.com>
3363 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3364 when converting a long constant to unsigned long.
3365 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3366 detect where IsApplicable and VerifyArgumentsCompat disagree.
3368 2005-08-29 Raja R Harinath <rharinath@novell.com>
3369 and Carlos Alberto Cortez <carlos@unixmexico.org>
3372 * class.cs (TypeContainer.CanElideInitializer): New helper.
3373 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3374 can safely emitting the initializer of a field.
3376 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3378 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3379 allowed inside a switch (without loop). Fixed bug #75433.
3381 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3383 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3384 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3386 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3388 * driver.cs : kinda reverting the default encoding changes (not exact
3389 revert since I noticed that "codepage:reset" might not work fine).
3391 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3393 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3394 Location. Now getter and setter store location correctly.
3395 (errors/cs0111-12.cs now reports the expected location.)
3397 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3399 * driver.cs : Use default encoding on the environment.
3400 Removed (now that) extra parameter for SeekableStreamReader.
3401 * support.cs : (SeekableStreamReader) third .ctor() argument for
3402 StreamReader is not required (always true). preamble size could
3403 be acquired in simpler and safe way.
3405 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3407 * cs-parser.jay: report CS0642 at warning level 3
3408 and report CS0642 for an if else statement also
3409 fixes bug #74745. Patch by John Luke (and a bit
3411 Removed extra CS0642 warning check for "while",
3413 * statement.cs: In Block.Resolve(), CS0642 check
3414 is reimplemented to check a sequence of an empty
3415 statement and a block.
3417 Both fix bug #66777.
3419 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3421 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3422 detection until I fix it.
3424 * cs-tokenizer.cs: Changed error message.
3426 * cs-parser.jay: Fixed 2 error locations.
3428 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3429 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3432 * enum.cs (GetSignatureForError): Fixed.
3434 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3438 * typemanager.cs (RegisterProperty): Removed.
3440 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3442 2005-08-24 Raja R Harinath <rharinath@novell.com>
3445 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3446 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3448 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3450 * expression.cs : tiny fix is required for not warning positive ulong.
3453 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3455 * expression.cs : add CS0652 check for constant and integral
3456 expression. Fixed bug #53974.
3458 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3460 * expression.cs : in DoNumericPromotions(), check if there is implicit
3461 conversion overload for string (to check CS0034). Fixed bug #52492.
3463 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3465 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3467 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3469 * ecore.cs : report location when it is *not* Null.
3471 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3477 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3478 correctly. Fixed bug #75721.
3480 2005-08-23 Raja R Harinath <rharinath@novell.com>
3482 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3483 loop that performs 'min (pos, char_count)'.
3486 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3487 converted value in Operator.OnesComplement.
3489 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3491 * anonymous.cs: If the anon method is pulled into a helper class,
3492 it needs to be `internal' not `private'. Fixes runtime behavior on
3495 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3498 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3501 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3503 The big constants rewrite
3504 Fix #75746, #75685 and more
3505 As a side effect saved 1MB for MWF ;-)
3507 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3508 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3509 enum based for corlib compilation.
3511 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3514 * class.cs (FixedField.Define): Use ResolveAsConstant.
3516 * const.cs (IConstant): Interface constants and enums.
3517 (Const.ResolveValue): New method for constant resolvning.
3518 (ExternalConstant): Constants from imported assemblies.
3520 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3521 conversion; like enums.
3522 (Constant.ToType): Converts this constant to different type.
3523 (Constant.Increment): Adds 1.
3525 * convert.cs (ImplicitConversionRequired): Simplified.
3527 * cs-parser.jay: Create EnumMember directly.
3529 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3531 * doc.cs (GenerateEnumDocComment): Removed.
3533 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3534 (ConvertIntLiteral): Removed.
3535 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3537 * enum.cs (EnumMember): Implement IConstant.
3538 (Enum.IsValidEnumConstant): Removed.
3539 (Enum.GetNextDefaultValue): Removed.
3540 (Enum.FindMembers): Updated.
3541 (Enum.GenerateDocComment): Iterate enum members.
3543 * expression.cs (Cast.TryReduce): Handle enums correctly.
3544 (New.Constantify): Made public.
3545 (MemberAccess.DoResolve): Removed contant specific if(s).
3547 * literal.cs (NullLiteral): Implement new abstract methods.
3549 * statement.cs (GotoCase.Resolve): Use new constant methods.
3550 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3552 * typemanager.cs (LookupEnum): Removed.
3553 (IsEnumType): Fixed to work with corlib.
3554 (RegisterConstant): Removed.
3555 (LookupConstant): Removed.
3556 (GetConstant): Changed to work with IConstant.
3558 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3560 * location.cs : Fixed overflown (>255) column number.
3562 2005-08-03 Raja R Harinath <rharinath@novell.com>
3564 First cut of the qualified-alias-member feature.
3565 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3567 * cs-parser.jay (DOUBLE_COLON): New token.
3568 (namespace_or_type_name): Add rule for recognizing
3569 qualified-alias-members.
3570 (primary_expression): Likewise.
3571 (element_access): Allow QualifiedAliasMember as a possible
3572 type-bearing expression.
3573 (local_variable_type, local_variable_pointer_type): Likewise.
3574 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3575 aliases in the current and enclosing namespace declarations.
3576 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3577 * decl.cs (MemberName.is_double_colon): New.
3578 (MemberName.MemberName): Add new constructor for alias-member.
3579 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3580 * expression.cs (QualifiedAliasMember): New expression type.
3582 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3584 * location.cs : it borked when no argument was specified.
3586 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3588 * location.cs : tiny ToString() format fix.
3590 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3592 * statement.cs : oops, it was missing.
3594 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3596 A set of fixes for precise line/column location.
3599 "token" field now holds a file/line "delta", a line number offset
3600 from the segment, and a column number. See also:
3601 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3602 December/009508.html
3603 Removed static IsNull. Use instance IsNull property instead.
3605 For some tokens it stores Location. For Identifier it stores
3606 LocatedToken which is a pair of string name and location.
3607 Column numbers are adjusted only at getChar().
3609 Use Location.ToString() for reporting (it now contains column).
3611 Largely modified to use LocatedToken instead of
3612 string (IDENTIFIER), and to acquire Location from some tokens.
3613 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3614 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3616 Now MemberName holds Location. DeclSpace.ctor() receives Location
3617 as a parameter. Removed extra parameters to all derived classes.
3618 Replaced Location.IsNull() with instance property.
3619 * assign.cs, expression.cs :
3620 Added .ctor() overload that omits Location.
3622 Added "nameEscaped" flag that indicates the identifier was escaped
3623 in the source file. This fixes bug #57047.
3625 2005-09-02 Martin Baulig <martin@ximian.com>
3627 * class.cs: Make CS3005 a warning, not an error.
3629 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3631 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3632 New method, looking for lo-case imported cls type.
3634 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3637 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3639 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3641 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3643 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3645 Optimized to save 3.5 MB for SWF compilation.
3647 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3649 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3650 (PartialContainer.Create): Moved logic AddToContainer.
3651 (PartialContainer.MarkForDuplicationCheck): Shares name.
3653 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3656 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3658 (Namespace.GetSignatureForError): New method.
3660 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3661 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3663 2005-08-01 Raja R Harinath <rharinath@novell.com>
3666 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3667 member lookup rather than qualifier_type, since qualifier_type can
3670 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3672 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3675 2005-07-31 Miguel de Icaza <miguel@novell.com>
3677 * statement.cs: Copy the local exception into the exception
3678 captured local. Fixes 75674
3680 2005-07-31 Raja R Harinath <harinath@gmail.com>
3683 * expression.cs (Invocation.OverloadResolve): Don't report error
3684 CS1501 if error CS1502 has been reported.
3685 (New.DoResolve): Delegate CS1501 reporting to
3686 Invocation.OverloadResolve.
3689 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3690 invariant-meaning-in-block property in an enclosing block if
3693 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3695 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3696 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3697 (Switch.CheckSwitch): Just save 50kb for SWF.
3699 2005-07-27 Martin Baulig <martin@ximian.com>
3701 * anonymous.cs (CaptureContext.AddField): Added
3702 `AnonymousContainer am' argument; compute its toplevel scope if
3703 it's not already computed. Fixes #75649.
3705 2005-07-26 Raja R Harinath <rharinath@novell.com>
3708 * class.cs (Constructor.Emit): Reset block to null if the block
3711 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3713 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3715 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3717 * class.cs (MethodData.Define): Check whether accessor implementing
3718 interface is public.
3720 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3722 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3725 * namespace.cs (LookupType): Moved same type check to...
3727 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3730 2005-07-21 Raja R Harinath <rharinath@novell.com>
3732 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3733 already found a typebuilder.
3734 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3735 MemberNames, not strings.
3737 * const.cs (Error_ExpressionMustBeConst):
3738 Rename from Error_EpressionMustBeConst.
3739 * const.cs, class.cs, statement.cd: Update.
3741 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3745 * const.cs (Const.LookupConstantValue): Report missing contant expression
3747 (Error_EpressionMustBeConstant): Only one error method.
3749 * class.cs, statement.c: Updated.
3751 2005-07-20 Raja R Harinath <rharinath@novell.com>
3753 * statement.cs (Block.Flags): Add back HasVarargs.
3754 (Block.flags): Make protected.
3755 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3757 * typemanager.cs (types, typecontainers, user_types): Remove.
3758 (UserTypes, TypeContainers): Likewise.
3759 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3760 (CleanUp, Reset): Update.
3761 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3762 (GetNestedType): Use Type.GetNestedType.
3763 (CoreLookupType): Take two arguments, the namespace and the
3764 basename of the type. Update to use the Namespace.Lookup
3766 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3767 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3768 string concatenation and substring matches.
3769 * class.cs, enum.cs, delegate.cs: Update to changes.
3771 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3773 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3774 Expression and made virtual.
3776 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3777 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3779 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3781 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3784 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3787 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3790 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3791 AssemblyCultureAttribute is not used on executable.
3794 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3796 2005-07-16 Raja R Harinath <rharinath@novell.com>
3799 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3800 New. Reports CS0252/CS0253.
3801 Mostly taken from preliminary patch by Duncak Mak.
3802 (Binary.DoResolveOperator): Store results of operator lookup.
3803 Use them to detect if we need to warn about unintended reference
3806 2005-07-15 Raja R Harinath <rharinath@novell.com>
3809 * namespace.cs (Namespace.Lookup): Add back location parameter.
3810 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3811 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3813 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3814 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3815 (Namespace.LookupType): ... this.
3816 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3818 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3819 purported to handle pointers.
3820 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3823 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3825 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3828 2005-07-15 Raja R Harinath <rharinath@novell.com>
3830 * namespace.cs (Namespace.Lookup): Drop location parameter.
3831 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3832 (NamespaceEntry.Lookup): ... this.
3833 (NamespaceEntry.Error_AmbiguousTypeReference):
3834 Move here from DeclSpace.
3835 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3837 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3838 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3839 Move to NamespaceEntry.
3840 * delegate.cs, expression.cs: Update to changes.
3842 2005-08-31 Martin Baulig <martin@ximian.com>
3844 Committing a patch from Atsushi Enomoto for #75850.
3846 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3847 Prefer a generic enumerator over a non-generic one.
3849 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3851 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3852 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3854 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3856 * driver.cs : reverting default encoding change as well as mcs.
3858 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3860 * driver.cs, support.cs : merged r48826.
3862 > could you integrate your mcs changes to gmcs otherwise
3863 > gmcs cannot compile some files.
3865 2005-08-20 Martin Baulig <martin@ximian.com>
3867 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3868 scope if we don't already have it.
3870 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3871 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3874 2005-07-31 Miguel de Icaza <miguel@novell.com>
3876 * statement.cs: Copy the local exception into the exception
3877 captured local. Fixes 75674
3879 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3881 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3884 2005-08-12 Martin Baulig <martin@ximian.com>
3886 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3887 for nested types here to avoid hitting the cache too early.
3889 2005-08-09 Miguel de Icaza <miguel@novell.com>
3891 * enum.cs: On the new compiler CLS error 3005 is now a warning not
3894 2005-08-03 Martin Baulig <martin@ximian.com>
3896 Make iterators in generic methods work; see gtest-191.cs.
3899 (Constraints.Resolve): Protect against being called twice.
3902 (TypeContainer.GetClassBases): Make this `protected virtual'.
3904 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3905 (Iterator.GetClassBases): Override this and compute the base
3907 (Iterator.DefineNestedTypes): If we're a generic method, all our
3908 method type parameters become class type parameters on the proxy
3912 (ToplevelBlock.Parameters): Make this a property, not a field.
3913 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3915 2005-08-03 Martin Baulig <martin@ximian.com>
3917 * typemanager.cs (TypeManager.IsSubclassOf): Use
3918 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3919 (TypeManager.GetFullName_recursed): Improved.
3921 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3924 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3925 Private accessor case, using TypeManager.IsPrivateAccessible instead of
3926 invocation_type == mi.DeclaringType, since the first one also checks
3927 other condition used by generic instances.
3929 2005-07-27 Martin Baulig <martin@ximian.com>
3931 * anonymous.cs (CaptureContext.AddField): Added
3932 `AnonymousContainer am' argument; compute its toplevel scope if
3933 it's not already computed. Fixes #75649.
3935 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3937 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3938 CheckAttributeType and refactored.
3939 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3940 ResolveAsTypeTerminal error handling.
3941 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3943 (GetSignatureForError): Print errors in same way.
3946 * codegen.cs: Reflect attribute GetSignatureForError change.
3949 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3951 * namespace.cs (UsingEntry): Refactored to make fields private.
3954 statement.cs: Error_UnexpectedKind has extra parameter.
3956 2005-07-14 Raja R Harinath <rharinath@novell.com>
3958 * ecore.cs (IAlias): Remove.
3959 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3960 that implement the interface.
3961 * namespace.cs (Namespace): Likewise.
3962 (Namespace.declspaces): Renamed from 'defined_names'.
3963 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3964 DeclSpace instead of an IAlias.
3965 * tree.cs (Tree.AddDecl): Update.
3967 2005-07-12 Raja R Harinath <rharinath@novell.com>
3969 * statement.cs (Block.Flags); Remove HasVarargs.
3970 (Block.HasVarargs): Move to ToplevelBlock.
3971 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3972 (Block.Variables): Make protected. Initialize variable hashtable
3974 (Block.AddVariable): Update.
3975 (Block.Resolve): Update to changes.
3976 (ToplevelBlock.HasVarargs): New boolean.
3977 (ToplevelBlock.ThisVariable): Move here from Block.
3978 (ToplevelBlock.AddThisVariable): Likewise.
3979 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3980 * expression.cs (This.ResolveBase): Update to changes.
3981 (ArglistAccess.DoResolve): Likewise.
3983 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3986 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3988 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3989 not used and not used & assigned.
3990 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3992 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3995 * expression.cs (Is.DoResolve): null is never provided type.
3997 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4000 * cs-parser.jay: Less strict event error rule to catch more errors.
4002 2005-07-11 Martin Baulig <martin@ximian.com>
4004 * generic.cs (ConstructedType.CheckConstraints): Improve the check
4005 for the constructor constraint: we do not only have to check
4006 whether the class has a public constructor, but also ensure that
4007 it's parameterless. Fixes #75492.
4009 2005-07-11 Martin Baulig <martin@ximian.com>
4011 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4012 between type parameters if they either have the reference type
4013 constraint or the class constraint.
4015 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
4017 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4019 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4022 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4023 (ExtractSecurityPermissionSet): Cope with self referencing security
4024 attributes properly.
4026 * driver.cs (SetOutputFile): Made public property OutputFile.
4028 2005-07-07 Raja R Harinath <rharinath@novell.com>
4031 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4032 has_nonstatic_fields. Make into a FieldBase pointer.
4033 (TypeContainer.AddField): Add CS0282 check.
4034 (TypeContainer.EmitType): Update.
4036 2005-07-06 Miguel de Icaza <miguel@novell.com>
4038 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4039 compare if they start with __.
4041 2005-07-06 Raja R Harinath <rharinath@novell.com>
4043 * statement.cs (Switch.SwitchGoverningType): Only look at
4044 UserCasts that don't need implicit standard conversions to one of
4045 the allowed switch types (Fixes test-322.cs).
4046 (LocalInfo.Resolve): Re-enable sanity-test.
4048 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4050 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4052 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4054 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4056 2005-07-06 Raja R Harinath <rharinath@novell.com>
4059 * ecore.cs (SimpleName.GetSignatureForError): Add.
4060 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4061 (MemberAccess.GetSignatureForError): Add.
4063 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4065 The big error and warning messages review.
4095 * typemanager.cs: Updated.
4097 * class.cs: (MethodCore.SetYields): Moved here to share.
4098 (PropertyMethod.Define): Moved iterator setup here.
4100 * iterators.cs: Add orig_method to have full access to parent
4103 2005-07-05 Raja R Harinath <rharinath@novell.com>
4105 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4106 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4107 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4108 variable of struct type.
4109 * expression.cs (Unary.ResolveOperator): Update to change.
4110 (Indirection.VerifyFixed): Likewise.
4111 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4112 (ParameterReference.VerifyFixed): Value parameters are fixed.
4113 (This.VerifyFixed): Treat 'this' as a value parameter.
4114 * statement.cs (LocalInfo.IsFixed): Remove.
4116 2005-07-01 Martin Baulig <martin@ximian.com>
4118 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4119 `ec.EmitThis ()' to get the correct scope.
4121 2005-07-01 Martin Baulig <martin@ximian.com>
4123 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4124 instance is a ParameterReference; fixes #75299.
4126 2005-06-30 Raja R Harinath <rharinath@novell.com>
4129 * expression.cs (Indexers.map): Remove.
4130 (Indexers.Append): Filter out inaccessible setters and getters.
4131 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4134 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4136 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4137 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4138 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4139 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4141 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4144 * class.cs (FieldBase.GetInitializerExpression): One more field
4147 2005-06-28 Miguel de Icaza <miguel@novell.com>
4149 * pending.cs: Do not define a proxy if the base method is virtual,
4150 it will be picked up by the runtime (bug 75270).
4152 2005-07-08 Martin Baulig <martin@ximian.com>
4154 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4155 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4157 2005-07-07 Martin Baulig <martin@ximian.com>
4159 * generic.cs (ConstructedType.CheckConstraint): Use
4160 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4161 called recursively; fixes #75329.
4163 2005-07-06 Martin Baulig <martin@ximian.com>
4165 * generic.cs (TypeManager.InferTypeArguments): Added support for
4166 anonymous methods; fixes #75461.
4168 2005-07-01 Martin Baulig <martin@ximian.com>
4170 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4171 `ec.EmitThis ()' to get the correct scope.
4173 2005-07-01 Martin Baulig <martin@ximian.com>
4175 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4176 instance is `This'; fixes #75299.
4178 2005-06-30 Martin Baulig <martin@ximian.com>
4180 * class.cs (Indexer): Implement IIteratorContainer; added support
4181 for iterators in indexers.
4184 (EmitContext.CurrentIterator): Make this a property, not a field.
4186 * anonymous.cs (AnonymousContainer.Iterator): New public property.
4188 2005-06-28 Miguel de Icaza <miguel@novell.com>
4190 * pending.cs: Do not define a proxy if the base method is virtual,
4191 it will be picked up by the runtime (bug 75270).
4193 2005-06-28 Martin Baulig <martin@ximian.com>
4195 * cs-parser.jay (interface_method_declaration): Avoid a
4196 reduce/reduce conflict by moving some of the code into a separate
4197 `interface_method_declaration_body' rule; fixes #75368.
4199 2005-06-28 Martin Baulig <martin@ximian.com>
4201 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4202 array check after the check for TypeBuilder's.
4204 2005-06-21 Raja R Harinath <rharinath@novell.com>
4206 * convert.cs (FindMostEncompassedType): Add two trivial special
4207 cases (number_of_types == 0 || number_of_types == 1).
4208 (FindMostEncompasingType): Likewise.
4210 2005-06-17 Raja R Harinath <rharinath@novell.com>
4212 Some cleanups preparing for the fix of #75283.
4213 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4215 (EventExpr.InstanceResolve): Likewise.
4216 (EventExpr.DoResolve): Remove redundant checks.
4218 2005-06-08 Miguel de Icaza <miguel@novell.com>
4220 * class.cs: Small fix.
4222 2005-06-08 Raja R Harinath <rharinath@novell.com>
4225 * class.cs (GetPartialBases): Fix return value check of
4228 2005-06-07 Raja R Harinath <rharinath@novell.com>
4230 Ensure that partial classes are registered in their enclosing
4231 namespace. Initial part of fix of #75160.
4232 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4233 Register declspace with namespace here, not in
4234 DeclSpace.RecordDecl.
4235 * cs-parser.jay: Pass namespace to RecordDecl.
4236 * class.cs (PartialContainer.Create): Likewise.
4237 (ClassPart.DefineType): New sanity-check. Throws an exception if
4239 * decl.cs (Declspace.RecordDecl): Remove.
4240 * namespace.cs (NamespaceEntry.DefineName): Remove.
4242 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4244 * rootcontext.cs: Reset TargetExt as well.
4246 2005-06-03 Raja R Harinath <rharinath@novell.com>
4248 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4251 2005-06-02 Raja R Harinath <rharinath@novell.com>
4253 Fix #75080, cs0119.cs.
4254 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4256 (Expression.Resolve): ... this. Use it. Remove bogus code
4257 allowing ExprClass.Type and ExprClass.Namespace for
4258 ResolveFlags.VariableOrValue.
4259 (Expression.Resolve) [1-argument variant]: Change default resolve
4260 flags based on language version.
4261 (Expression.Error_UnexpectedKind): Use a simple string array
4262 rather than an ArrayList.
4263 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4265 (TypeOfVoid.DoResolve): Likewise.
4266 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4267 flags argument -- it always has the same value.
4269 2005-05-31 Raja R Harinath <rharinath@novell.com>
4272 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4273 Use it in the error message.
4274 * assign.cs, expression.cs, statement.cs: Update.
4276 2005-05-30 Raja R Harinath <rharinath@novell.com>
4279 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4280 the "almostMatchedMember" case too.
4281 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4282 that failed the accessibility checks to 'almost_match'.
4284 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4286 * attribute.cs: Use internal MethodBuilder methods to set
4287 ExactSpelling and SetLastError on PInvoke methods, instead
4288 of passing them via charset. Fixes #75060.
4290 2005-05-27 Raja R Harinath <rharinath@novell.com>
4292 * parameter.cs (Parameter): Remove TODO comment.
4293 (Parameter.DefineParameter): Remove Location parameter.
4294 (Parameters.LabelParameters): Likewise.
4295 * class.cs (Constructor.Emit): Update to change.
4296 (MethodData.Emit): Likewise.
4297 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4298 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4300 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4303 Removed Parameters.Location and added Parameter.Location instead.
4304 Removed Location parameter from Emit() and GetSignature().
4311 Modified all related calls.
4313 2005-06-21 Martin Baulig <martin@ximian.com>
4315 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4316 left-hand side is not a nullable type; fixes #75328.
4318 2005-06-21 Martin Baulig <martin@ximian.com>
4321 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4322 (TypeManager.GetFullNameSignature): Likewise.
4324 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4325 `source.FullName' and `target.FullName' to check whether there are
4326 two conflicting definitions.
4328 2005-06-21 Martin Baulig <martin@ximian.com>
4330 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4331 a BoxedCast - also for reference types - to be compatible with csc.
4333 2005-06-21 Martin Baulig <martin@ximian.com>
4335 * expression.cs (MemberAccess.DoResolve): Add support for nested
4336 types in a generic instance; fixes #75320.
4338 2005-06-20 Martin Baulig <martin@ximian.com>
4340 * generic.cs (TypeManager.InferType): Also walk the class
4341 hierarchy for generic instances; fixes #75261.
4343 2005-06-17 Martin Baulig <martin@ximian.com>
4345 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4346 to make things work for corlib.
4348 2005-06-15 Martin Baulig <martin@ximian.com>
4350 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4351 obsolete `SecurityAction' values.
4353 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4355 * rootcontext.cs: Reset TargetExt as well.
4357 2005-06-09 Martin Baulig <martin@ximian.com>
4359 * delegate.cs (Delegate.VerifyMethod): Added
4360 `MethodGroupExpr old_mg' argument; inherit its
4361 `HasTypeParameters'; fix #75085.
4363 2005-06-09 Martin Baulig <martin@ximian.com>
4365 * expression.cs (Invocation.OverloadResolve): Correctly handle
4366 generic methods for the SetMemberIsUsed(); fix #75064.
4368 2005-06-09 Martin Baulig <martin@ximian.com>
4370 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4373 2005-06-08 Martin Baulig <martin@ximian.com>
4375 * cs-parser.jay (nullable_type_or_conditional): If we put the
4376 nullable back and our `type' is a `ComposedCast', remove the
4377 nullable from it. Fixes #75156.
4379 * expression.cs (ComposedCast.RemoveNullable): New public method.
4381 2005-06-08 Martin Baulig <martin@ximian.com>
4383 The big Iterators rewrite :-)
4385 * iterators.cs: Rewrite this to use the anonymous methods framework.
4387 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4388 before the TypeContainers; see 2test-21.cs.
4391 (TypeContainer.DefineType): Don't create a new EmitContext if we
4392 already have one (this only happens if we're an Iterator).
4393 (TypeContainer.Define): Also call Define() on all our iterators.
4394 (Method.CreateEmitContext): Added support for iterators.
4397 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4398 (AnonymousContainer.CreateMethodHost): Moved here from
4399 AnonymousMethod and made abstract.
4400 (AnonymousContainer.CreateScopeType): New abstract method.
4401 (AnonymousContainer.IsIterator): New public property.
4402 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4403 get the ScopeTypeBuilder rather than manually defining it here.
4404 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4407 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4408 before RootContext.DefineTypes().
4410 * codegen.cs (EmitContext.RemapToProxy): Removed.
4411 (EmitContext.CurrentAnonymousMethod): Changed type from
4412 AnonymousMethod -> AnonymousContainer.
4413 (EmitContext.ResolveTopBlock): Protect from being called twice.
4414 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4415 (EmitContext.EmitThis): Removed the iterators hacks; use the
4416 anonymous methods framework for that.
4419 (ToplevelBlock.Container): Make this a property, not a field.
4420 (ToplevelBlock.ReParent): New public method; move the
4421 ToplevelBlock into a new container.
4422 (Foreach.TemporaryVariable): Simplify.
4424 2005-06-05 Martin Baulig <martin@ximian.com>
4426 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4427 (Block.AddTemporaryVariable): New public method; creates a new
4428 `LocalInfo' for a temporary variable.
4429 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4431 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4432 non-iterator variables.
4434 2005-06-05 Martin Baulig <martin@ximian.com>
4436 * statement.cs (Foreach.TemporaryVariable): Create the
4437 LocalBuilder in the Emit phase and not in Resolve since in some
4438 situations, we don't have an ILGenerator during Resolve; see
4439 2test-19.cs for an example.
4441 2005-06-04 Martin Baulig <martin@ximian.com>
4443 The big Foreach rewrite - Part II.
4445 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4446 with `PropertyInfo ienumerator_getcurrent'.
4448 * codegen.cs (VariableStorage): Removed.
4451 (Foreach): Derive from Statement, not ExceptionStatement.
4452 (Foreach.CollectionForeach): New nested class. Moved all the code
4453 dealing with collection foreach here.
4454 (Foreach.ForeachHelperMethods): Removed.
4455 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4457 2005-05-23 Martin Baulig <martin@ximian.com>
4459 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4460 don't need to. Fix #75014.
4462 2005-05-26 Raja R Harinath <rharinath@novell.com>
4464 Improve user-defined conversion handling.
4465 * convert.cs (GetConversionOperators): Rewrite. Return only the
4466 applicable operators.
4467 (AddConversionOperators): New. Helper for GetConversionOperators.
4468 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4469 there is only one most encompassed/encompassing type.
4470 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4471 "applicable operator" handling.
4472 (UserConversion): Move cache here from GetConversionOperators.
4473 Directly cache the chosen operator, rather than the whole
4475 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4476 case. Allow conversion of decimal to sbyte and byte too.
4477 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4478 New static methods. Used to avoid allocating EmptyExpressions in
4481 2005-05-24 Duncan Mak <duncan@novell.com>
4483 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4484 another class, used in Convert.ExplicitNumericConversion.
4485 (CastToDecimal): New class, similar to above, but casts to
4486 System.Decimal, used in Convert.ImplicitNumericConversion and also
4487 in explicit convesion from double/float to decimal.
4489 * convert.cs (ImplicitNumericConversion): Handle implicit
4490 conversions to System.Decimal.
4491 (ExplicitNumericConversion): handle explicit conversions to
4496 2005-05-20 Miguel de Icaza <miguel@novell.com>
4498 * typemanager.cs: Do not throw an exception in the TypeBuilder
4499 case, we take care of it on the TypeCode.
4501 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4503 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4506 * cs-parser.jay: Catch more lexical errors.
4508 * report.cs: Add one more Error method.
4511 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4513 2005-05-20 Martin Baulig <martin@ximian.com>
4515 * class.cs (TypeContainer.CircularDepException): Removed.
4516 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4517 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4518 (CS0146) and interface (CS0529) dependencies here.
4520 2005-05-20 Martin Baulig <martin@ximian.com>
4522 * expression.cs (New.DoResolve): Move the CS0712 check above the
4523 CS0144 check; otherwise it can never be reached.
4525 2005-05-20 Martin Baulig <martin@ximian.com>
4527 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4529 2005-05-20 Martin Baulig <martin@ximian.com>
4531 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4533 * typemanager.cs (TypeManager.IsAttributeType): New public method.
4535 2005-05-19 Martin Baulig <martin@ximian.com>
4538 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4539 to disable error reporting.
4541 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4542 here since we don't want to report an error; see the new test-336.cs.
4544 2005-05-19 Raja R Harinath <rharinath@novell.com>
4546 * statement.cs (ToplevelBlock.GetParameterReference)
4547 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4548 Move here from class Block.
4549 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4550 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4552 2005-05-18 Martin Baulig <martin@ximian.com>
4557 (FlowBranching.Reachability): Add non-static public And() and Or()
4559 (FlowBranchingSwitch): New class; do the `break_origins' thing
4560 like in FlowBranchingLoop.
4561 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4562 reachability, not just locals and parameters.
4563 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4564 switch; MergeBreakOrigins() now takes care of that.
4566 2005-05-18 Martin Baulig <martin@ximian.com>
4568 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4569 a loop and may leave it, reset the barrier; fixes #74974.
4571 2005-05-16 Raja R Harinath <rharinath@novell.com>
4573 Fix test-382.cs. Emit values of decimal constants.
4574 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4576 (TypeContainer.AddField): ... this.
4577 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4578 with initializers to include 'Const's.
4579 (ClassPart.RegisterFieldForInitialization): Forward to
4581 * const.cs (Const.Const): Pass initializer to base class.
4582 (Const.Define): In case of decimal constants, register them for
4583 initialization in a static constructor.
4585 2005-05-14 Martin Baulig <martin@ximian.com>
4587 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4588 do not call ResolveUnreachable() on unreachable statements in
4589 here, see the comment in the source code.
4591 2005-05-13 Raja R Harinath <rharinath@novell.com>
4594 * expression.cs (BinaryResolveOperator): If one of the operands of
4595 an equality comparison is 'null' and the other is a pointer type,
4596 convert the null to a NullPointer.
4597 * convert.cs (ImplicitReferenceConversion): If the expression is a
4598 NullLiteral and the target type is a pointer type, return a
4599 NullPointer instead.
4600 (ImplicitConversionStandard): Likewise.
4602 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4604 * cs-parser.jay: Set readonly context based on special constructs.
4606 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4607 readonly variable error handling.
4609 * rootcontext.cs (EmitCode): Don't verify members when error
4612 * statement.cs (LocalInfo): Add reaodnly context information.
4613 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4615 2005-05-17 Martin Baulig <martin@ximian.com>
4617 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4620 2005-05-13 Martin Baulig <martin@ximian.com>
4622 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4623 handle unreachable blocks.
4625 2005-05-13 Martin Baulig <martin@ximian.com>
4628 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4629 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4632 2005-05-13 Martin Baulig <martin@ximian.com>
4634 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4635 instance variable, not a local. Fix #74873.
4636 (Block.ResolveUnreachable): Set it to true here.
4638 2005-05-12 Martin Baulig <martin@ximian.com>
4640 * cs-parser.jay (property_declaration): Pass the `current_class',
4641 not the `current_container' to Property's .ctor. Fixes #74912.
4643 2005-05-11 Martin Baulig <martin@ximian.com>
4645 * typemanager.cs (Closure): Copy this from MCS and merge all the
4646 GMCS-specific changes into it.
4648 2005-05-12 Raja R Harinath <harinath@gmail.com>
4651 * typemanager.cs (unmanaged_enclosing_types): New.
4652 (IsUnmanagedType): Avoid infloops by using
4653 'unmanaged_enclosing_types' to talk with recursive invocations.
4655 2005-05-11 Duncan Mak <duncan@novell.com>
4657 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4658 continuing to process for 'arg'.
4659 (handle_preprocessing_directive): Check the argument of the #endif
4660 directive and report error CS1025 if there are any trailing
4663 According to the C# spec, having even whitespace after the #endif
4664 directive is illegal; however, because we call arg.TrimEnd ()
4665 beforehand, we have the same behavior as csc, allowing whitespace
4666 after the directive.
4670 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4674 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4675 (Constructor.GetObsoleteAttribute): Implemented correctly.
4677 2005-05-10 Martin Baulig <martin@ximian.com>
4679 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4680 resolve the type; fixes #74864.
4681 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4682 in DoResolve(); fixes #74862.
4684 2005-05-10 Martin Baulig <martin@ximian.com>
4686 * support.cs (ReflectionParameters.ParameterModifier): Use
4687 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4688 and `ParameterAttributes.In'. Fixes #74884.
4690 2005-05-10 Martin Baulig <martin@ximian.com>
4692 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4693 the cache if we're just looking for `MemberTypes.NestedType' in a
4696 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4697 constraints if we're still resolving the type tree.
4698 (Expression.MemberLookup): If we're resolving the type tree, only
4699 look for `MemberTypes.NestedType' since we're only interested in
4702 * class.cs (TypeContainer.DefineType): Don't resolve the type
4703 parameters here; do this later in ResolveType() after the type
4704 tree has been resolved.
4705 (TypeContainer.ResolveType): New public method; this is called
4706 after the type tree is resolved and before the types are being
4707 populated. We resolve the generic constraints here.
4708 (TypeContainer.DoDefineMember): Check the constraints on our base
4709 class and interfaces.
4711 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4712 set the `ResolvingTypeTree' flag on the EmitContext.
4714 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4716 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4718 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4720 * expression.cs (Argument.GetParameterModifier): Turned to property.
4721 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4723 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4726 2005-05-09 Raja R Harinath <rharinath@novell.com>
4729 * decl.cs (MemberCache.AddMethods): Register override methods,
4730 rather than non-override methods.
4731 * typemanager.cs (RegisterOverride): New.
4732 (IsOverride): Update.
4734 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4736 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4738 2005-05-06 Martin Baulig <martin@ximian.com>
4741 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4742 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4744 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4748 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4749 recursive declaration.
4751 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4753 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4755 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4757 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4759 2005-05-05 Raja R Harinath <rharinath@novell.com>
4762 * decl.cs (DeclSpace.FamilyAccessible):
4763 Use TypeManager.IsNestedFamilyAccessible.
4765 Fix reopened #64812.
4766 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4769 2005-05-04 Raja R Harinath <rharinath@novell.com>
4770 Abin Thomas <projectmonokochi@rediffmail.com>
4771 Anoob V E <projectmonokochi@rediffmail.com>
4772 Harilal P R <projectmonokochi@rediffmail.com>
4775 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4776 allow access to all static members.
4778 2005-05-04 Martin Baulig <martin@ximian.com>
4780 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4782 2005-05-04 Martin Baulig <martin@ximian.com>
4786 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4787 section at the end; make things work if `default' is not the last
4790 2005-05-04 Martin Baulig <martin@ximian.com>
4794 * statement.cs (Switch): Replaced the `got_default' field with a
4795 `default_section' one.
4796 (Switch.CheckSwitch): Set `default_section' here.
4797 (Switch.Resolve): If we're a constant switch and the constant is
4798 not found, use the default section.
4800 2005-05-03 Martin Baulig <martin@ximian.com>
4802 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4804 * statement.cs (Foreach.ArrayForeach): New nested class.
4805 (Foreach.TemporaryVariable): New nested class.
4806 (Foreach.EmitArrayForeach): Removed; this is now in the new
4809 2005-05-03 Raja R Harinath <rharinath@novell.com>
4811 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4813 (VerifyPendingMethods): Revert change below.
4815 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4816 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4817 that used to trigger warning -28. Remove warning -28.
4818 * expression.cs (Invocation.OverloadResolve): Use
4819 TypeManager.IsOverride to distinguish override methods.
4822 * pending.cs (VerifyPendingMethods): If a base type implements the
4823 requested interface, don't bother checking individual methods of
4824 the base type. As a side-effect, this prevents the creation of
4825 unnecessary proxies.
4827 2005-05-02 Martin Baulig <martin@ximian.com>
4831 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4832 Also `And' the locals if the old vector is null.
4833 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4834 null; in this case we basically reset all the variables.
4836 2005-05-02 Martin Baulig <martin@ximian.com>
4840 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4841 Added `FlowBranching branching' argument; always `and' the
4842 variables instead of `or'ing them unless we're an infinite loop.
4844 * statement.cs (While.Resolve): Create a new sibling unless we're
4847 2005-05-02 Martin Baulig <martin@ximian.com>
4851 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4852 arguments; use it instead of creating a new TopLevelBlock.
4853 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4854 our ConstructorInitializer.
4857 (TopLevelBlock.TopLevelBranching): New public property.
4858 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4859 and create our `TopLevelBranching'.
4861 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4862 anonymous method host, use `block.TopLevelBranching' rather than
4863 creating a new branching.
4865 2005-04-20 Miguel de Icaza <miguel@novell.com>
4867 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4868 a ScopeInfo, if any of the current children is a child of the new
4869 entry, move those children there.
4871 2005-04-30 Martin Baulig <martin@ximian.com>
4873 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4874 at the beginning of a SwitchSection. Fix #73335.
4876 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4879 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4881 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4882 (FieldExpr.DoResolve): Obsolete members are ignored for field
4885 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4887 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4888 of arrays detection.
4890 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4892 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4894 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4897 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4899 * cs-parser.jay: Use the prefered version of -unsafe in error
4902 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4904 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4907 2005-04-20 John Luke <john.luke@gmail.com>
4909 * driver.cs: fix typo in error message, --outout to --output
4911 2005-04-30 Martin Baulig <martin@ximian.com>
4913 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4914 handle the .NET 2.x security attributes.
4916 2005-04-30 Martin Baulig <martin@ximian.com>
4919 (TypeManager.ExpandInterfaces): Don't add things twice.
4922 (TypeContainer.VerifyClsCompliance): Allow generic instances.
4924 2005-04-29 Martin Baulig <martin@ximian.com>
4926 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4928 * anonymous.cs: Added support for anonymous generic methods.
4930 2005-04-29 Martin Baulig <martin@ximian.com>
4932 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4935 2005-04-29 Martin Baulig <martin@ximian.com>
4937 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4939 * expression.cs (New.DoResolve): Fix the CS0304 check.
4941 2005-04-29 Martin Baulig <martin@ximian.com>
4943 * typemanager.cs (TypeManager.GetFullName): Updated to the new
4946 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4947 explicit interface implementation, compare the interface types.
4948 (MethodData.Define): Use the new naming scheme from the latest
4950 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4952 * decl.cs (MemberName.GetMemberName): Removed.
4953 (MemberName.MethodName, FullName): New properties.
4955 2005-04-25 Raja R Harinath <rharinath@novell.com>
4957 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4959 2005-04-22 Martin Baulig <martin@ximian.com>
4961 * generic.cs (GenericMethod): Create the EmitContext in the
4962 `Define()'; in `Define(MethodBuilder)', create the type parameters
4963 before calling `Define()'. Fixes #73933.
4965 2005-04-22 Martin Baulig <martin@ximian.com>
4968 (Constraints.Resolve): Make things work wrt. the new type lookup system.
4969 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4971 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4972 ConstructedType, check its constraints.
4974 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4976 * codegen.cs (InRefOutArgumentResolving): New field.
4978 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4979 fields outside contructor.
4981 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4983 2005-04-19 Miguel de Icaza <miguel@novell.com>
4985 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4986 parameter code was not completed ever, so it was not as up-to-date
4987 as local variables. Must finish it.
4989 The bug fix was to compare the Toplevel of the block, not the
4990 current block. Thanks for Ben for pointing this out.
4992 2005-04-19 Raja R Harinath <rharinath@novell.com>
4994 * decl.cs (AddMethods): Use the declaring type of the problem
4995 method to determine if we want to squash a warning.
4997 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4999 * attribute.cs: Removed debug output.
5001 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5003 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5006 2005-04-18 Raja R Harinath <rharinath@novell.com>
5009 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5010 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5011 all null comparisons against reference types.
5013 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5016 * class.cs (TypeContainer.CircularDepException) New nested
5018 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5019 (TypeContainer.DefineType): Removed error, reset InTransit before
5021 (Class.DefineType): Throw exception when is in Transit.
5022 Catch exception and report error.
5023 (Struct.DefineType): Throw exception when is in Transit.
5024 Catch exception and report error.
5025 (Interface.DefineType): Throw exception when is in Transit.
5026 Catch exception and report error.
5028 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5029 handle nested exception handlers.
5031 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5034 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5035 InFinally and InCatch storage.
5037 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5038 (Catch.Resolve): Set and Restore ec.InCatch.
5039 (Try.Resolve): Set and Restore ec.InFinally.
5040 (Try.HasCatch): True when try has catch.
5042 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5044 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5045 for the same event member, so exclude such cases from warning 419.
5048 2005-04-16 Miguel de Icaza <miguel@novell.com>
5050 * expression.cs (Binary.ResolveOperator): Apply patch from John
5051 Luke to fix bug 59864: operators &, | and ^ on enumerations
5052 require that the same enum type on both sides.
5054 * driver.cs: Add warnings to old flag usage, this is to assist
5055 people who produce Makefiles and hope that the Makefiles will be
5058 * class.cs (TypeContainer.EmitType): Moved the definition of the
5059 special $PRIVATE$ field from the resolve phase to the Emit phase.
5060 During resolve we do not know if we are a struct with
5061 HasExplicitLayout, we know this only after the attributes for the
5064 Set the FieldOffset to zero on the dummy field that we create for
5065 the class. Fixes 74590.
5067 2005-04-16 Raja R Harinath <rharinath@novell.com>
5070 * ecore.cs (PropertyExpr.resolved): New.
5071 (DoResolve): Use it to handle a case of double resolution here.
5072 Handle a case of identical-name-and-type-name.
5073 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5074 resolution by storing the results of expression resolution back
5075 into the "probes" array.
5077 2005-04-15 Raja R Harinath <rharinath@novell.com>
5079 Fix cs0208-7.cs and cs0208-8.cs.
5080 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5081 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5082 error reporting to point out the reason a struct is not unmanaged.
5084 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5086 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5087 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5089 2005-04-13 Raja R Harinath <rharinath@novell.com>
5092 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5093 IdenticalNameAndTypeName here.
5094 (EventExpr.InstanceResolve): Likewise.
5096 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5098 C# 2.0 DefaultCharSetAttribute implementation
5100 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5101 which allows us to set GlobalNamespace for every resolve.
5102 (Attribute.ResolveArguments): Cut from Resolve.
5103 (Attribute.GetCharSetValue): Returns CharSet named argument.
5104 (Attribute.DefinePInvokeMethod): Gets default charset from
5106 (GlobalAttribute.ResolveAsTypeStep): Override.
5107 (GlobalAttribute.ResolveArguments): Override.
5109 * class.cs (TypeAttr): Is protected.
5111 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5112 (ModuleClass.DefaultCharSetType): New memeber.
5113 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5115 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5116 charset from module.
5118 * delegate.cs (TypeAttr): Override.
5119 (Delegate.DefineType): Use this TypeAttr.
5121 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5122 at very early stage (before types are defined) to resolve model
5123 module attributes. It will probably not work with corlib but it
5126 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5127 charset from module.
5129 * typemanager.cs (default_charset_type): New type.
5131 2005-04-13 Raja R Harinath <rharinath@novell.com>
5133 * decl.cs (MemberCache.AddMethods): Don't warn if
5134 System.Object.Finalize has buggy MethodAttributes.
5136 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5139 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5141 * doc.cs : detect ambiguous reference to overloaded members.
5142 Fixed bug #71603. MS 1.1 csc does not detect it.
5144 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5146 * doc.cs : delegates must not be referenced with parameters.
5149 2005-04-12 Miguel de Icaza <miguel@novell.com>
5151 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5153 2005-04-10 Miguel de Icaza <miguel@novell.com>
5155 * driver.cs (MainDriver): Stop processing if the CLS stage found
5158 (CompilerCallableEntryPoint.InvokeCompiler): Always
5159 reset after execution; Take a TextWriter argument for the
5162 * report.cs: Use the error stream instead of hardcoding stderr.
5164 2005-04-09 Miguel de Icaza <miguel@novell.com>
5166 * class.cs: Reduce code paths to test, too small of an
5167 optimization to make it worth the extra testing. Always perform
5170 2005-04-08 Raja R Harinath <rharinath@novell.com>
5173 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5174 operators that had errors reported on them.
5176 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5178 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5180 (Attribute.Resolve): Add named argument type checking.
5182 * class.cs (FixedField.Define): Use IsPrimitiveType
5184 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5186 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5187 unsafe parameter types.
5189 * statement.cs (Using.ResolveExpression): Add better error description.
5191 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5193 2005-04-08 Raja R Harinath <rharinath@novell.com>
5196 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5197 AttributeUsageAttribute in the emitcontext of the attribute class,
5198 not in the emitcontext of the attributable entity it was attached to.
5199 * cs-parser.jay: Use 'current_class', not 'current_container',
5200 when creating a GlobalAttribute.
5202 2005-04-08 Alp Toker <alp@atoker.com>
5204 * pending.cs: The fix to #58413 failed to compile methods implementing
5205 interfaces with/without params modifiers and vice versa, even though
5206 params modifiers aren't part of the signature. Make the modifier check
5207 less strict as in csc.
5209 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5210 Anoob V E <projectmonokochi@rediffmail.com>
5211 Harilal P R <projectmonokochi@rediffmail.com>
5214 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5215 modifiers of pending methods.
5216 (PendingImplementation.PendingImplementation): Initialize it.
5217 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5218 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5219 with ParameterData. Add check for modifiers.
5220 * class.cs (MethodData.Define): Update to changes.
5222 2005-04-07 Raja R Harinath <rharinath@novell.com>
5224 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5226 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5228 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5231 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5234 * typemanager.cs: Registered RequiredAttributeAttribute.
5236 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5238 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5239 Warning CS0169 is back at level 3.
5240 (IMethodData.SetMemberIsUsed): New method.
5242 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5243 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5245 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5247 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5249 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5252 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5255 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5256 to avoid the problems with nested types.
5258 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5259 Anoob V.E <projectmonokochi@rediffmail.com>
5260 Harilal P.R <projectmonokochi@rediffmail.com>
5261 Raja R Harinath <rharinath@novell.com>
5264 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5266 * typemanager (GetConstructor): Make public.
5268 2005-04-05 John Luke <john.luke@gmail.com>
5269 Raja R Harinath <rharinath@novell.com>
5272 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5273 struct too. Return false quicker in a few cases.
5274 (VerifyUnManaged): Use it.
5276 2005-04-05 Raja R Harinath <rharinath@novell.com>
5279 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5280 not 'unreachable_seen'.
5282 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5284 * attribute.cs (Attribute.GetValue): Removed unused.
5286 * codegen.cs (CodeGen.TrimExt): Removed unused.
5288 * cs-parser.jay (output): Removed unused.
5290 * cs-tokenizer.cs (hex_digits): Removed unused.
5292 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5294 * expression.cs (Indirection.LoadExprValue): Removed unused.
5295 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5297 * iterators.cs (Iterator.param_types): Removed unused.
5299 * statement.cs (Goto.block): Removed unused.
5300 (ToplevelBlock.did): Removed unused.
5301 (Switch.ResolveConstantSwitch): Removed unused.
5303 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5305 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5308 2005-04-19 Martin Baulig <martin@ximian.com>
5310 Merged r42462 from MCS and made it work for GMCS.
5312 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5314 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5316 2005-04-01 Raja R Harinath <rharinath@novell.com>
5318 Fix #74232 and cs0208-3.cs.
5319 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5320 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5321 unmanaged type. Don't use FieldBuilders when 't' is a
5322 TypeBuilder. Use ModFlags and MemberType fields.
5323 * class.cs (MemberBase.member_type): Rename from MemberType.
5324 (MemberBase.MemberType): New property. Determines member_type on
5326 (MemberBase.DoDefine): Don't initialize MemberType here.
5327 (FieldMember.Define): Likewise.
5329 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5332 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5333 Attributes are emitted there.
5335 2005-04-01 Raja R Harinath <rharinath@novell.com>
5337 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5338 keyword in 'partial enum' too.
5339 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5341 Report from Kamil Skalski <nazgul@omega.pl>.
5344 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5345 have partial containers too.
5347 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5348 in block' checks to Block.CheckInvariantMeaningInBlock.
5349 * statement.cs (Block.GetKnownVariableInfo): Make private.
5350 (Block.IsVariableUsedInChildBlock): Remove.
5351 (Block.IsVariableUsedInBlock): Likewise.
5352 (Block.CheckInvariantMeaningInBlock): New. Show location of
5353 conflicting declaration.
5354 (Block.AddVariable): Make error messages less long-winded and more
5355 specific. Show location of conflicting declaration.
5356 * parameter.cs (Parameters.Location): New readonly property.
5358 2005-03-31 Raja R Harinath <rharinath@novell.com>
5360 Clean up semantics of invoking ResolveMemberAccess.
5361 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5362 can have an instance, ensure that we pass in a non-TypeExpression
5363 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5364 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5365 argument. Update to changes and simplify.
5366 (FieldExpr.Emitinstance): Remove CS0120 check.
5367 (PropertyExpr.EmitInstance): Likewise.
5368 * expression.cs (Argument.Resolve): Likewise.
5369 (Invocation.DoResolve): Update to changes in semantics of
5372 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5375 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5378 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5380 2005-03-31 Raja R Harinath <rharinath@novell.com>
5382 Fix difference in behaviour with commandline invocation.
5383 * driver.cs (Driver.Reset): New.
5384 (CompilerCallableEntryPoint): Call it.
5386 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5387 variable" warnings if the boolean expression failed to resolve.
5389 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5391 * attribute.cs: Fix the union of several permissions when some of them
5392 are unrestricted (so the result isn't an unrestricted permission set).
5395 2005-03-30 Raja R Harinath <rharinath@novell.com>
5397 * ecore.cs (MemberExpr): New class. Convert from interface
5399 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5400 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5402 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5403 (MethodGroupExpr.IsExplicitImpl): Remove.
5404 (Expression.GetFieldFromEvent): Remove.
5405 (SimpleName.MemberStaticCheck): Remove.
5406 (SimpleName.DoSimpleNameResolve): Update to changes.
5407 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5408 (MemberAccess.IdenticalNameAndTypeName): Remove.
5409 (MemberAccess.error176): Move to MemberExpr.
5410 (MemberAccess.DoResolve): Update to changes.
5411 (BaseAccess.DoResolve): Likewise.
5413 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5415 C# 2.0 Conditional attribute class implementation
5417 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5418 Analyzes class whether it has attribute which has ConditionalAttribute
5419 and its condition is not defined.
5421 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5422 (Class.IsExcluded): New method. Search for at least one defined
5423 condition in ConditionalAttribute of attribute class.
5425 2005-03-30 Raja R Harinath <rharinath@novell.com>
5427 * ecore.cs (PropertyExpr): Derive from Expression, not
5428 ExpressionStatement.
5429 (PropertyExpr.EmitStatement): Remove.
5431 2005-03-29 Raja R Harinath <rharinath@novell.com>
5434 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5435 internal field "value__" of an enum be private. The examples for
5436 "value__" that I found on MSDN all used FieldAttributes.Private.
5438 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5439 Don't mention IL method attribute names.
5441 Fix #47991. Remove a TODO.
5442 * statement.cs (Block.Toplevel): Make into a field.
5443 (Block.Parameters): Move into ToplevelBlock.
5444 (Block.known_variables): Rename from child_variable_names.
5445 (Block.Block): Remove variants that take Parameters. Initialize
5446 'Toplevel' with the immediately surrounding toplevel block.
5447 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5448 LocalInfo parameter.
5449 (Block.GetKnownVariableInfo): New.
5450 (Block.IsVariableNameUsedInChildBlock): Update.
5451 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5452 the block, even though it may not be in scope.
5453 (Block.AddVariable): Remove Parameters parameter. Use
5454 Toplevel.Parameters instead.
5455 (Block.AddConstant): Remove Parameters parameter.
5456 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5457 (Block.IsParamaterReference): Likewise.
5458 (Block.IsLocalParameter): Likewise. Simplify a lot.
5459 (ToplevelBlock.Parameters): New. Moved from Block.
5460 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5461 initialize Parameters to a non-null value.
5462 * cs-parser.jay: Update to changes.
5463 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5464 simple names that mean different things in the same block. Use
5465 Block.IsVariableNameUsedInBlock.
5467 2005-03-28 Raja R Harinath <rharinath@novell.com>
5469 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5471 2005-03-26 Raja R Harinath <harinath@acm.org>
5474 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5475 fails to resolve, ensure that the LHS is still resolved as an
5478 2005-03-25 Raja R Harinath <harinath@acm.org>
5480 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5482 (Enum.current_ec): Remove.
5483 (Enum.LookupEnumValue): Remove EmitContext argument.
5484 Just uses the one created during DefineType.
5485 (Enum.FindMembers): Update.
5486 * expression.cs (MemberAccess.DoResolve): Update.
5488 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5490 * assign.cs (Assign.DoResolve): Check for CS1717 when
5491 source and target are same (uses Equals).
5493 * expression.cs (LocalVariableReference, ParameterReference,
5494 This): Implemented Equals, GetHashCode.
5496 * statement.cs (Block.GetParameterReference): Removed useless
5499 2005-03-22 Raja R Harinath <rharinath@novell.com>
5502 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5503 blocks before deciding whether the error is cs0136 or cs0128.
5505 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5506 (using_alias_directive, using_namespace_directive): Pass
5507 MemberName, not an expression to Namespace.UsingAlias and
5509 (MakeName): Use the MemberName of the namespace.
5510 * namespace.cs (Namespace.MemberName): New.
5511 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5512 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5514 * decl.cs (MemberName.Name): Make readonly.
5515 (MemberName.FromDotted): New "constructor".
5516 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5517 (MemberCore.Name): Compute from MemberName on demand.
5518 (MemberCore.SetMemberName): Provide a way to change the
5520 (MemberCore.AddToContainer): Don't take a fullname parameter.
5521 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5522 fully qualified name of the container to the member name.
5523 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5524 only if the type is a member of the root container.
5525 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5526 MemberName.Left rather than searching for an embedded ".".
5527 (PartialContainer.CreatePart): Update to changes in RootContext.
5528 (MemberBase.ShortName): Turn into a property. Use
5529 MemberCore.SetMemberName.
5530 (MemberBase.ExplicitInterfaceName): Remove.
5531 (MemberBase.UpdateMemberName): Remove.
5532 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5533 (PropertyBase.SetMemberName): New override.
5534 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5535 (Tree.GetDecl): New.
5536 (Tree.AllDecls): Rename from Decls.
5537 * attribute.cs, enum.cs, report.cs: Update to changes.
5538 * driver.cs (MainDriver): Use MemberName.FromDotted on
5539 RootContext.MainClass.
5541 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5543 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5546 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5548 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5550 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5551 property accessor modifiers.
5553 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5554 fixed buffer attribute (CS1716).
5555 (PropertyMethod.HasCustomAccessModifier): When property accessor
5556 has custom modifier.
5558 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5560 (PropertyExpr.DoResolveLValue): Add CS0272.
5562 2005-03-17 Miguel de Icaza <miguel@novell.com>
5564 * convert.cs: When converting to a pointer, use the proper Conv.U
5565 or Conv.I depending on the source data type.
5567 * cs-tokenizer.cs: Make the size for large decimal constants,
5570 2005-03-17 Martin Baulig <martin@ximian.com>
5572 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5573 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5575 2005-03-17 Martin Baulig <martin@ximian.com>
5577 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5578 to bool so we can return an error condition.
5579 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5582 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5584 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5587 2005-03-16 Raja R Harinath <rharinath@novell.com>
5589 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5590 Refactor to avoid traversing the list of assemblies, and to avoid
5591 string concatenation.
5592 * typemanager.cs (guid_attr_type): Remove.
5593 (negative_hits, pointers, references): Remove hashes.
5595 (GetConstructedType): New. Uses type_hash to handle constructed
5596 types (arrays, references, pointers).
5597 (GetReferenceType, GetPointerType): Use it.
5598 (GetNestedType): New. Uses type_hash to handle nested types of
5600 (LookupType, LookupTypeDirect): Remove.
5601 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5602 'types' hash and LookupTypeReflection directly.
5603 (params_string, params_object): Use GetConstructedType.
5604 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5606 (Namespace.Lookup): Use cached_types.
5607 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5608 provided by old TypeManager.LookupType.
5609 * rootcontext.cs (MakeFQN): Remove.
5610 * decl.cs (DeclSpace.MakeFQN): Likewise.
5611 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5612 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5613 TypeManager.GetConstructedType.
5614 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5616 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
5618 * cs-parser.jay: Fix build.
5620 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5622 * class.cs (TypeContainer.CircularDepException) New nested
5623 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5625 * cs-parser.jay: Reports CS1527 for any namespace element.
5627 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5630 * expression.cs (ParameterReference.IsAssigned): Changed error to
5632 (Error_WrongNumArguments): Moved CS0245 detection here.
5634 * statement.cs (Return.Resolve): Add CS1622 report.
5636 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5638 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5640 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5642 * attribute.cs expression.cs: Get rid of some allocations.
5644 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5646 * doc.cs : just eliminate the latest change.
5648 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5650 * doc.cs : commented out the latest change. It breaks xml-030.cs
5652 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5654 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5655 fail. So invoke CreateType() in FindDocumentedType().
5657 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5659 * cs-tokenizer.cs : added IsKeyword().
5660 * doc.cs : Detect keyword incorrectly used as identifier.
5661 Allow identifiers prefixed by @.
5663 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5665 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5666 It caused exception in namespace resolving (again!).
5668 * class.cs (Class.ctor): Removed exit.
5669 (PropertyMethod.ctor): ditto.
5671 * codegen.cs (Codegen.Reset): Reset static data.
5672 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5674 * cs-tokenizer.cs (Cleanup): Removed.
5676 * driver.cs (GetSystemDir): Rewrote to one line command.
5677 It caused problem with unloaded dynamic modules.
5678 (UnixParseOption): Removed Exit.
5679 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5680 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5681 Now can be mcs used as library.
5683 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5686 * location.cs (Reset): Reset static data.
5688 * namespace.cs (Reset): Reset static data.
5690 * report.cs (Report.Reset): Reset static data.
5692 * rootcontext.cs (RootContext.Reset): Reset static data.
5694 * tree.cs (RootTypes.ctor): Use Location.Null
5696 * typemanager.cs (TypeManager.Reset): Reset static data.
5697 (CoreLookupType): Removed Exit.
5698 (TypeHandle.Reset): Reset static data.
5700 2005-03-10 Raja R Harinath <rharinath@novell.com>
5703 * typemanager.cs (ComputeNamespaces): Import namespaces from
5704 referenced modules too.
5706 2005-03-09 Raja R Harinath <rharinath@novell.com>
5708 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5711 2005-03-09 Raja R Harinath <rharinath@novell.com>
5713 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5714 enclosing DeclSpace. This ensures that a name-lookup populates
5715 more caches and there are fewer 'TypeExpression's. Carve out
5716 nested type lookup into ...
5717 (LookupNestedTypeInHierarchy): ... this.
5719 2005-04-15 Martin Baulig <martin@ximian.com>
5721 Merged r41590 from MCS and make it work in the generics land.
5723 * generic.cs (TypeParameter.UpdateConstraints): Removed the
5726 * class.cs (PartialContainer.UpdateConstraints): Removed.
5727 (PartialContainer.CheckConstraints): Removed.
5728 (PartialContainer.SetParameterInfo): Store the constraints here.
5729 (PartialContainer.DefineTypeParameters): New public method;
5730 resolve the type parameter's constraints here. Note that the
5731 PartialContainer doesn't have an EmitContext anymore, so we must
5732 do this in the ClassPart.
5734 2005-03-09 Raja R Harinath <rharinath@novell.com>
5736 Clean up a few partial-class semantics.
5737 Fixes test-357.cs and cs1618-2.cs.
5738 * cs-parser.jay (struct_declaration): Use 'current_class' as
5739 parent of newly-created struct. Remove call to Register ().
5740 Use 'pop_current_class' to complete handing the current struct.
5741 (interface_declaration): Likewise.
5742 (class_declaration): Likewise.
5743 (enum_declaration): Use 'current_class' as parent of newly created
5745 (delegate_declaration): Likewise.
5746 (pop_current_class): New function. This is used to handle closing
5747 up the 'current_class' and 'current_container', and pointing them
5748 to the enclosing class/container.
5749 (CSharpParser): Initialize 'current_class' too.
5750 * decl.cs (MemberCore): Add check for invariant: a partial
5751 container is not a parsed entity, and thus does not enclose any
5753 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5754 (DeclSpace.BaseTypeExpr): Use it.
5755 (DeclSpace.LookupType): Add check for invariant.
5756 * class.cs (TypeContainer): Add check for invariant: a nested
5757 class should have the same NamespaceEntry as its enclosing class.
5758 (TypeContainer.EmitFieldInitializers): Make virtual.
5759 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5761 (TypeContainer.Register): Remove.
5762 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5763 null. Use TypeResolveEmitContext for resolving base types and
5764 interfaces. Move initialization of Parts.TypeBuilder here from
5766 (TypeContainer.DefineNestedTypes): ... here.
5767 (PartialContainer): Take a Namespace not a NamespaceEntry.
5768 (PartialContainer.Create): Don't use Register. Call the
5769 appropriate Add... function directly.
5770 (ClassPart): Take both the PartialContainer and the enclosing
5771 class as constructor arguments.
5772 (ClassPart.EmitFieldInitializers): Override.
5773 (ClassPart.PartFindNestedTypes): Remove.
5774 (FieldBase.GetInitializerExpression): Resolve the initializer
5775 expression in the emit context of the enclosing class.
5776 * tree.cs (RootTypes): Remove Register ().
5778 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5780 * cs-parser.jay: Removed CS0134.
5782 * driver.cs: Removed CS1901.
5784 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5785 for predefined types.
5787 2005-03-07 Duncan Mak <duncan@novell.com>
5789 * codegen.cs (Save): Catch UnauthorizedAccessException as
5790 well. Fixes bug #73454.
5792 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5794 * cs-tokenizer.cs (xtoken): Add CS1035.
5796 * class.cs (MethodData.Define): Add CS0683.
5797 (FieldMember.ctor): Add CS0681.
5799 2005-03-07 Raja R Harinath <rharinath@novell.com>
5801 * ecore.cs (SimpleName.DoResolve): Rename from
5802 SimpleName.DoResolveAllowStatic.
5803 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5804 Pass 'intermediate' flag to MemberStaticCheck.
5805 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5806 of "intermediate" lookups via MemberAccess.
5807 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5808 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5810 2005-03-07 Raja R Harinath <rharinath@novell.com>
5813 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5814 slipped in because of variable names that are identical to a
5815 builtin type's BCL equivalent ('string String;', 'int Int32;').
5816 (PropertyExpr.EmitInstance): Likewise.
5818 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5820 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5822 * report.cs (warning_ignore_table): Made public.
5824 2005-03-04 Raja R Harinath <rharinath@novell.com>
5827 * class.cs (MethodData.Emit): Pass 'container' to
5828 container.GetObsoleteAttribute instead of 'container.Parent'.
5830 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5832 * cs-parser.jay: Add 1534 error test.
5834 * iterators.cs (Yield.CheckContext): Add error 1629.
5835 (Iterator.ctor): Save unsafe modifier.
5836 (MoveNextMethod.DoEmit): Restore unsafe context.
5838 * namespace.cs (UsingAlias): Better error message.
5840 2005-03-03 Dan Winship <danw@novell.com>
5842 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5843 the warning message [#73219]
5845 2005-03-03 Raja R Harinath <rharinath@novell.com>
5847 Fix compile with MCS 1.0.0.0.
5848 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5849 w_restore to not depend on string constant folding.
5851 2005-03-03 Raja R Harinath <rharinath@novell.com>
5853 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5854 CS0246 check to users who passed 'silent = false'.
5855 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5857 (SimpleName.SimpleNameResolve): Update.
5858 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5859 (MemberAccess.IdenticalNameAndTypeName): Update.
5860 * doc.cs (FindDocumentedTypeNonArray): Update.
5862 2005-03-03 Raja R Harinath <rharinath@novell.com>
5864 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5865 * parameters.cs (ComputeAndDefineParameters): Remove.
5866 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5867 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5868 Use GetParameterInfo.
5870 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5872 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5874 2005-03-02 Raja R Harinath <rharinath@novell.com>
5876 Unify DeclSpace.LookupType and DeclSpace.FindType.
5877 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5878 is in charge of defining nested types on demand.
5879 (DeclSpace.LookupType): Use it when the current_type is a
5880 TypeBuilder. Use LookupTypeDirect for reflected types.
5881 (DeclSpace.FindType): Remove.
5882 (DeclSpace.LookupInterfaceOrClass): Likewise.
5883 (DeclSpace.DefineTypeAndParents): Likewise.
5884 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5885 DeclSpace.LookupType.
5886 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5887 * typemanager.cs (LookupType): Simplify.
5888 (AddUserType): Remove type from negative_hits.
5889 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5890 * class.cs (TypeContainer.FindMembers): Move handling of nested
5892 (TypeContainer.FindMembers_NestedTypes): ... here.
5893 (TypeContainer.FindNestedType): Implement override.
5894 (ClassPart.FindNestedType): Delegate to PartialContainer.
5895 (ClassPart.PartFindNestedType): Looks up the nested types of the
5898 2005-04-14 Martin Baulig <martin@ximian.com>
5900 * generic.cs (ConstructedType): Moved all the type lookup and
5901 nested class logic into SimpleName.
5902 (ConstructedType.ResolveConstructedType): Our underlying type is
5903 already fully resolved; all the type lookup stuff is in
5906 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5907 constructed types here instead of in ConstructedType.
5909 * decl.cs (MemberName.GetTypeExpression): Always create a
5910 SimpleName, not a ConstructedType.
5911 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5913 2005-03-02 Martin Baulig <martin@ximian.com>
5915 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5916 static constructor in static classes.
5918 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5920 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5921 sizeParamIndex is not specified.
5923 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5926 * report.cs (WarningMessage.IsEnabled): Missing null check.
5928 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5930 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5931 in the fields and not in the properties.
5933 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5935 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5938 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5940 * attribute.cs: Small refactoring (improved robustness).
5941 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5942 (ValidateGuid): Removed.
5943 (Resolve): Removed referenced to above mentioned.
5944 (GetAttributeUsage): Made private and changed to work without
5946 (GetIndexerAttributeValue): Don't crash.
5947 (GetConditionalAttributeValue): Ditto.
5948 (GetClsCompliantAttributeValue): Ditto.
5949 (ExtractSecurityPermissionSet): All attributes exceptions are
5951 (GetPropertyValue): New helper.
5952 (GetMethodImplOptions): New method.
5953 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5954 some missing properties.
5956 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5957 (Method.ApplyAttributeBuilder): Updated.
5959 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5962 2005-02-28 Raja R Harinath <rharinath@novell.com>
5965 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5966 non-simple types (array, pointer, reference).
5968 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5970 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5972 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5974 (Method.CheckBase): Catch wrong destructor here.
5975 (MethodData.Define): Add errors 550, 668.
5977 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5979 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5981 * pending.cs (VerifyPendingMethods): Add error 551.
5983 * typemanager.cs (CSharpName): Next error report helper.
5985 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5987 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5988 attributes. Removed useless attribute double check.
5989 It saves almost 2MBs for corlib.
5991 2005-02-25 Raja R Harinath <rharinath@novell.com>
5994 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5995 called twice in case of error.
5997 2005-02-23 Chris Toshok <toshok@ximian.com>
5999 Fix compiler portions of #72827.
6000 * statement.cs (Block.Emit): call Begin/EndScope on the
6001 EmitContext instead of the ILGenerator.
6003 * codegen.cs (EmitContext.BeginScope): new method, call
6004 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6006 (EmitContext.BeginScope): same, but EndScope and CloseScope
6008 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6009 offset and call the superclass's OpenScope(int) with it.
6010 (SymbolWriter.CloseScope): get the current il
6011 offset and call superclass's CloseScope(int) with it.
6013 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6015 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6016 CS1677 for out and ref as well.
6018 * class.cs (Method.Define): Add error CS1599 detection.
6020 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6022 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6024 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6026 * support.cs.cs (ModifierDesc): New helper method.
6028 2005-02-23 Raja R Harinath <rharinath@novell.com>
6029 Abin Thomas <projectmonokochi@rediffmail.com>
6030 Anoob V E <projectmonokochi@rediffmail.com>
6031 Harilal P R <projectmonokochi@rediffmail.com>
6034 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6035 MemberLookup (used for error reporting) actually returns a result.
6036 Fix error report number (122, not 112).
6038 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6039 Anoob V E <projectmonokochi@rediffmail.com>
6040 Harilal P R <projectmonokochi@rediffmail.com>
6043 * pending.cs (PendingImplementation.GetAbstractMethods):
6044 Find NonPublic members too.
6046 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6048 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6051 * class.cs (MethodCore.CheckMethodAgainstBase):
6052 Add error 239 report.
6054 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6056 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6058 * class.cs (Operator.Define): Add error 217 report.
6060 2005-02-21 Raja R Harinath <rharinath@novell.com>
6063 * expression.cs (Invocation.IsApplicable): Make public.
6064 (Invocation.IsParamsMethodApplicable): Likewise.
6065 * delegate.cs (Delegate.VerifyApplicability): Don't use
6066 Invocation.VerifyArgumentCompat for parameter applicability
6067 testing. Use Invocation.IsApplicable and
6068 Invocation.IsParamsMethodApplicable.
6070 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6072 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6074 * class.cs (Operator.Define): Add error 217 report.
6076 2005-02-21 Raja R Harinath <rharinath@novell.com>
6078 * namespace.cs (UsingEntry.Resolve): Undo change below.
6080 2005-02-21 Raja R Harinath <rharinath@novell.com>
6083 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6084 disable the error message when the extended MemberLookup also
6086 (Expression.MemberLookupFinal): Update.
6087 (SimpleName.DoSimpleNameResolve): Update.
6088 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6089 Don't use MemberLookupFinal.
6090 (New.DoResolve): Update.
6091 (BaseAccess.CommonResolve): Update.
6093 2005-02-21 Raja R Harinath <rharinath@novell.com>
6096 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6097 occured previously, don't resolve again.
6099 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6102 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6103 argument. Call ResolveAttributeUsage for unresolved.
6104 when types doesn't match ctor arguments.
6106 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6107 for nested attribute classes.
6108 (Class.attribute_usage): Removed.
6109 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6110 for attribute class.
6112 * ecore.cs (IsAttribute): Removed.
6114 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6116 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6118 (attribute_types): Removed.
6119 (EmitCode): Global attributes are emited as the latest.
6121 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6123 * class.cs (EmitFieldInitializers): Don't emit field initializer
6124 for default values when optimilization is on.
6126 * constant.cs (Constant.IsDefaultValue): New property.
6128 * driver.cs: Add /optimize handling.
6132 * literal.cs: Implement new IsDefaultValue property.
6134 * rootcontext.cs (Optimize): New field, holds /optimize option.
6136 2005-02-18 Raja R Harinath <rharinath@novell.com>
6138 Fix crasher in re-opened #72347.
6139 * namespace.cs (Namespace.Lookup): Return null if
6140 DeclSpace.DefineType returns null.
6143 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6145 2005-02-18 Raja R Harinath <rharinath@novell.com>
6147 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6148 now returns null if it cannot resolve to an lvalue.
6149 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6150 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6151 returned null. Remove check for SimpleName.
6152 (EventExpr.DoResolveLValue): New.
6153 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6154 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6156 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6158 (Unary.ResolveOperator): Move CS0211 check ...
6159 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6161 (Unary.DoResolveLValue): Simplify.
6162 (AddressOf.DoResolveLValue): New.
6163 (ArrayAccess.DoResolveLValue): New.
6165 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6167 * attribute.cs (Attribute.Resolve): Add arguments casting for
6168 when types doesn't match ctor arguments.
6170 2005-02-16 Raja R Harinath <rharinath@novell.com>
6172 Fix parts of #63202.
6173 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6174 lookup of operator in base type. Ensure that all checks happen
6175 when the operator resolves to an "op_..." method.
6177 2005-02-15 Raja R Harinath <rharinath@novell.com>
6180 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6181 'ignore_cs0104' parameter. Pass it to ...
6182 (NamespaceEntry.Lookup): ... this.
6183 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6184 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6185 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6186 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6187 Update. Request that cs0104 errors be ignored.
6188 (ComposedCast.ResolveAsTypeStep): Update.
6190 2005-02-14 Raja R Harinath <rharinath@novell.com>
6193 * expression.cs (Invocation.BetterFunction): Remove support for
6194 comparing virtual functions and their overrides.
6195 (Invocation.IsOverride): New.
6196 (Invocation.OverloadResolve): Don't consider 'override' functions
6197 during candidate selection. Store them in a lookaside list.
6198 If the selected method is a 'virtual' function, use the list to
6199 find any overrides that are closer to the LHS type.
6201 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6203 * expression.cs (New.DoResolve): Add complex core type reduction.
6204 (New.Constantify): Converts complex core type syntax like 'new int ()'
6207 2005-02-14 Raja R Harinath <rharinath@novell.com>
6209 * decl.cs (EntryType.EntryType): New constructor to create an
6210 updated copy of a cache entry.
6211 (MemberCache.AddMethods): Use it.
6212 (MemberCache.ClearDeclaredOnly): Remove.
6213 (MemberCache.MemberCache): Update.
6215 2005-02-11 Miguel de Icaza <miguel@novell.com>
6217 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6218 variable. This one is represents the actual low-level declaration
6219 of the method, as opposed to the semantic level `IsStatic'.
6221 An anonymous method which is hosted into a static method might be
6222 actually an instance method. IsStatic would reflect the
6223 container, while MethodIsStatic represents the actual code
6226 * expression.cs (ParameterReference): Use the new MethodIsStatic
6227 instead of IsStatic.
6229 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6230 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6231 set on the current EmitContext.
6233 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6234 resolve our casted expression as an LValue. This triggers the
6235 proper LValue processing that is later required by Assign.
6239 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6241 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6243 C# 2.0 Fixed buffer implementation
6245 * anonymous.cs: Update after RegisterHelperClass renaming.
6247 * attribute.cs (AttributeTester.fixed_buffer_cache):
6248 Cache of external fixed buffers.
6249 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6250 implementation if field is fixed buffer else null.
6253 (TypeContainer.AddField): Accept FieldMember instead of Field.
6254 (FieldBase.IsFieldClsCompliant): Extracted code from
6255 VerifyClsCompliance descendant customization.
6256 (FixedField): New class handles fixed buffer fields.
6257 (FixedFieldExternal): Keeps information about imported fixed
6259 (IFixedField): Make access to internal or external fixed buffer
6262 * cs-parser.jay: Add fixed buffer parsing.
6264 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6267 * expression.cs (Indirection): Extended implementation to accept
6269 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6270 (ElementAccess.MakePointerAccess): Get type as parameter.
6271 (DoResolve): Add fixed buffer field expression conversion.
6272 (DoResolveLValue): Ditto.
6273 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6274 (ArrayPtr): Derives from FixedBufferPtr.
6275 (ArrayPtr.Emit): Add extra emit for array elements.
6277 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6279 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6280 for compiler generated types.
6281 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6283 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6284 and consume less memory.
6285 (Fixed.Resolve): Add fixed buffer case.
6287 * typemanager.cs (compiler_generated_attr_ctor,
6288 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6289 (HasElementType): Add our own implementation to work on every
6292 2005-02-11 Miguel de Icaza <miguel@novell.com>
6294 * anonymous.cs (CaptureContext): Track whether `this' has been
6297 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6298 only captured `this' if it was implicitly done (instance
6299 methods/variables were used).
6301 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6302 `this' must be captured.
6304 2005-01-30 Miguel de Icaza <miguel@novell.com>
6306 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6307 is null it means that there has been no need to capture anything,
6308 so we just create a sibling.
6310 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6312 Just a partial fix. The other half is fairly elusive.
6314 2005-02-10 Raja R Harinath <rharinath@novell.com>
6316 Fix #52586, cs0121-4.cs.
6317 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6318 and return a hashtable.
6319 (MemberCache.ClearDeclaredOnly): New.
6320 (MemberCache.MemberCache): Update to change. Make a deep copy of
6321 the method_hash of a base type too.
6322 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6323 type methods. Overwrite entries with the same MethodHandle so
6324 that the ReflectedType is correct. The process leaves in base
6325 virtual functions and their overrides as distinct entries.
6326 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6327 matters since it was boxed in a ArrayList before.
6328 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6330 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6331 case of a virtual function and its override (choose the overload
6333 (Invocation.OverloadResolve): Avoid 'override' members during
6334 'applicable_type' calculation.
6336 2005-03-28 Raja R Harinath <rharinath@novell.com>
6338 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6339 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6340 GetTypeHandle. It is possible for a reflected type to derive from
6341 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6342 System.Array during mscorlib compilation).
6343 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6344 contain a method_hash, don't create one either. Don't create a
6345 deep copy of the base cache's method_hash.
6346 (MemberCache.SetupCache): Rename back from DeepCopy.
6347 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6348 already initialized. If we see an override function, add its
6349 underlying base virtual function to the member_hash too.
6351 2005-02-09 Raja R Harinath <rharinath@novell.com>
6353 Combine two near-redundant caches.
6354 * typemanager.cs (method_params): Rename from method_internal_params.
6355 (TypeManager.GetParameterData): New. Replace
6356 Invocation.GetParameterData.
6357 (TypeManager.LookupParametersByBuilder): Remove.
6358 * expression.cs (Invocation.method_parameter_cache): Remove.
6359 (Invocation.GetParameterData): Remove.
6361 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6364 2005-02-08 Raja R Harinath <rharinath@novell.com>
6367 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6368 TypeManager.multicast_delegate_type is null, resolve it by looking
6369 up "System.MulticastDelegate".
6370 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6372 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6373 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6374 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6377 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6378 (LabeledStatement.AddReference): New. Set 'referenced'.
6379 (Goto.Resolve): Use it.
6381 2005-02-05 John Luke <john.luke@gmail.com>
6383 * driver.cs: remove duplicate -doc line in Usage ()
6385 2005-02-04 Raja R Harinath <rharinath@novell.com>
6387 * location.cs (Location.AddFile): Fix CS2002 error report.
6389 2005-02-02 Martin Baulig <martin@ximian.com>
6391 * delegate.cs (Delegate.DefineType): Report an internal error if
6392 TypeManager.multicast_delegate_type is null. See bug #72015 for
6395 2005-02-02 Raja R Harinath <rharinath@novell.com>
6397 Fix a crasher in a variant of #31984.
6398 * const.cs (Constant.CheckBase): New override that defers the
6399 new-or-override check in case the base type hasn't been populated
6401 (Constant.Define): Ensure the new-or-override check is performed.
6403 2005-02-01 Duncan Mak <duncan@ximian.com>
6405 * const.cs (LookupConstantValue): Check that `ce' is not null
6406 before calling GetValue ().
6408 2005-02-01 Raja R Harinath <rharinath@novell.com>
6410 Fix test-334.cs (#69519).
6411 * cs-parser.jay (using_alias_directive): Pass in an expression to
6412 NamespaceEntry.UsingAlias.
6413 (using_namespace_directive): Pass in an expression to
6414 NamespaceEntry.Using.
6415 (namespace_name): Don't flatten to a string.
6416 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6417 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6419 (NamespaceEntry.UsingEntry): Likewise.
6420 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6422 (NamespaceEntry.LookupForUsing): Remove.
6423 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6425 (NamespaceEntry.Lookup): Remove support for dotted names.
6427 2005-02-01 Raja R Harinath <rharinath@novell.com>
6429 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6431 (NamespaceEntry.ImplicitParent): Compute on demand.
6432 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6433 parallels the current.
6434 (NamespaceEntry.LookupForUsing): Use it.
6435 (NamespaceEntry.Lookup): If the current namespace-entry is
6436 implicit, don't search aliases and using tables.
6438 2005-02-01 Raja R Harinath <rharinath@novell.com>
6441 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6443 (TypeContainer.BaseCache): Compute on demand.
6444 (TypeContainer.FindMembers): Define constants and types if they're
6445 not already created.
6446 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6448 * const.cs (Constant.Define): Make idempotent.
6450 2005-01-29 Miguel de Icaza <miguel@novell.com>
6452 * pending.cs: Produce better code (no nops produced by using Ldarg
6455 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6456 i - 1' it should be arg + 1.
6460 2005-01-28 Raja R Harinath <rharinath@novell.com>
6462 * attribute.cs (Attribute.CheckAttributeType): Make private
6464 (Attribute.ResolveType): Make virtual.
6465 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6466 handling of RootContext.Tree.Types.
6468 2005-01-27 Raja R Harinath <rharinath@novell.com>
6470 Update attribute-handling to use the SimpleName/MemberAccess
6472 * cs-parser.jay (attribute): Pass in an expression to the
6473 constructors of Attribute and GlobalAttribute.
6474 * attribute.cs (Attribute): Take an expression for the name.
6475 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6476 passed in attribute name expression.
6477 (Attribute.CheckAttributeType): Use it.
6478 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6479 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6480 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6481 argument to prevent error messages if the lookup fails.
6483 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6485 * expression.cs (Indirection): Implemented IVariable interface
6486 to support indirection in AddressOf operator.
6487 (PointerArithmetic.Emit): Add optimalization for case where
6488 result can be precomputed.
6490 2005-01-26 Martin Baulig <martin@ximian.com>
6492 * class.cs (TypeContainer.AttributeTargets): Return the correct
6493 AttributeTargets depending on our `Kind' instead of throwing an
6494 exception; fixes #71632.
6496 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6499 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6502 2005-03-17 Martin Baulig <martin@ximian.com>
6504 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6505 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6507 2005-03-17 Martin Baulig <martin@ximian.com>
6509 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6510 to bool so we can return an error condition.
6511 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6514 2005-03-17 Martin Baulig <martin@ximian.com>
6516 * generic.cs (TypeMananager.IsIEnumerable): New public method.
6518 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6519 converting from an array-type of T to `IEnumerable<T>'.
6521 2005-03-16 Martin Baulig <martin@ximian.com>
6523 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6524 (Nullable.LiftedUnaryMutator): New public class.
6526 * expression.cs (UnaryMutator.DoResolve): Added support for
6529 2005-03-14 Martin Baulig <martin@ximian.com>
6531 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6533 2005-03-14 Martin Baulig <martin@ximian.com>
6535 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6536 the comparision operators `<', `>', `<=' and `>='.
6538 2005-03-13 Martin Baulig <martin@ximian.com>
6541 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6542 avoid confusion with the `NullLiteral'.
6543 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6545 2005-03-13 Martin Baulig <martin@ximian.com>
6547 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6548 comparing arbitrary types with the null literal.
6550 2005-03-13 Martin Baulig <martin@ximian.com>
6552 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6553 boolean operators '&&', '||', '&' and '|'.
6554 (Nullable.OperatorTrueOrFalse): New public class.
6556 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6557 instead of a `StaticCallExpr'; added support for nullables.
6559 2005-03-10 Martin Baulig <martin@ximian.com>
6562 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
6563 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
6565 2005-03-07 Martin Baulig <martin@ximian.com>
6567 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
6568 it work if `expr' is not an IMemoryLocation.
6569 (Nullable.Lifted): Implement IMemoryLocation.
6570 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
6573 2005-03-05 Martin Baulig <martin@ximian.com>
6575 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
6576 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
6577 (Nullable): Added support for lifted unary and binary operators.
6579 * expression.cs (Unary.DoResolve): Added support for nullable types.
6580 (Binary.DoResolve): Likewise.
6581 (Conditional.DoResolve): Likewise.
6583 2005-03-02 Martin Baulig <martin@ximian.com>
6585 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6587 * class.cs (ClassPart.SetParameterInfo): Override this.
6588 (PartialContainer.SetParameterInfo): Override this.
6589 (TypeContainer.CheckConstraints): New protected method.
6590 (PartialContainer.CheckConstraints): Override this and check
6591 whether the same contraints were specified in all parts of a
6592 partial generic type definition.
6593 (PartialContainer.UpdateConstraints): New public method.
6595 * generic.cs (TypeParameter.UpdateConstraints): New public method.
6597 2005-03-02 Martin Baulig <martin@ximian.com>
6599 Committing a patch from Carlos Alberto Cortez to fix #72887.
6601 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6602 casts from `T []' to `int []'.
6604 2005-03-02 Martin Baulig <martin@ximian.com>
6606 * generic.cs (TypeManager.IsEqual): Make this symmetric.
6608 * expression.cs (Binary.ResolveOperator): When resolving a
6609 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6610 `=='. Fixes #71866. See gen-127.cs.
6612 2005-03-02 Martin Baulig <martin@ximian.com>
6614 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6615 static constructor in static classes.
6617 2005-03-02 Martin Baulig <martin@ximian.com>
6620 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6621 (Nullable.LiftedConversion): Added support for user-defined
6624 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6626 * cs-parser.jay: Use ComposedCast everywhere instead of
6627 NullableType, so we don't need to check for NullableType
6629 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6630 case where we'll be resolved into a `parenthesized_expression_0'
6634 (Convert.UserDefinedConversion): Added nullable conversions.
6636 2005-02-28 Martin Baulig <martin@ximian.com>
6638 * generic.cs (TypeManager.IsNullableType): New static method.
6639 (Nullable): New abstract class.
6640 (Nullable.NullLiteral): New public class.
6641 (Nullable.LiftedConversion): New public class.
6643 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6644 `builtin_types opt_nullable'.
6647 (Convert.ImplicitConversionStandard): Added nullable conversions.
6648 (Convert.ExplicitConversionStandard): Likewise.
6649 (Convert.ExplicitConversion): Likewise.
6651 2005-02-26 Martin Baulig <martin@ximian.com>
6653 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6654 begin with a "?", for instance "?[]". Don't do a type lookup if
6657 2005-02-25 Martin Baulig <martin@ximian.com>
6659 The first part of Nullable Types :-)
6661 * generic.cs (NullableType): New public class.
6662 (NullCoalescingOperator): New public class.
6663 (TypeArguments.Resolve): Add a CS0306 check.
6665 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6666 (opt_nullable): New rule.
6667 (type): Added `opt_nullable' to `namespace_or_type_name',
6668 `builtin_types' and `pointer_type'.
6669 (array_type): Added `opt_nullable'.
6670 (opt_rank_specifier_or_nullable): New rule; this is the
6671 combination of `opt_rank_specifier' and `opt_nullable'.
6672 (opt_error): New rule; catch errors here.
6673 (nullable_type_or_conditional): New rule; we use this to check for
6674 nullable and still detect the conditional operator.
6675 (local_variable_type): Use `opt_rank_specifier_or_nullable'
6676 instead `opt_rank_specifier'.
6678 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6681 2005-02-24 Martin Baulig <martin@ximian.com>
6683 * README, README.Changes: Removed; they're old and obsolete.
6685 2005-02-22 Martin Baulig <martin@ximian.com>
6687 * generic.cs (TypeParameter.Resolve): If resolving the constraints
6688 returned an error, set `constraints' to null to avoid a crash
6690 (TypeParameter.ResolveType): Likewise.
6692 2005-02-22 Martin Baulig <martin@ximian.com>
6695 (Constraints.ResolveTypes): Protect against being called twice.
6696 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6697 (TypeParameter.ResolveType): New public method; calls
6698 constraints.ResolveTypes().
6699 (TypeParameter.DefineType): Moved constraints.ResolveType() out
6700 into the new ResolveType().
6701 (GenericMethod.Define): Call ResolveType() on all our
6704 2005-02-21 Martin Baulig <martin@ximian.com>
6707 (TypeManager.generic_nullable_type): New static public field.
6708 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6711 (RootContext.ResolveCore): Resolve "System.Nullable`1".
6713 2005-02-15 Martin Baulig <martin@ximian.com>
6715 * generic.cs (ConstructedType.Constraints): Correctly check
6716 constraints if the argument type is a type parameter; fixes
6719 2005-02-02 Martin Baulig <martin@ximian.com>
6721 * delegate.cs (Delegate.DefineType): Report an internal error if
6722 TypeManager.multicast_delegate_type is null. See bug #72015 for
6725 2005-01-29 Miguel de Icaza <miguel@novell.com>
6727 * pending.cs: Produce better code (no nops produced by using Ldarg
6730 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6731 i - 1' it should be arg + 1.
6735 2005-01-26 Martin Baulig <martin@ximian.com>
6737 * cs-parser.jay (indexer_declarator): Don't report an error if we
6738 have type parameters since we can be an explicit interface
6739 implementation; fixes #71449.
6741 2005-01-26 Martin Baulig <martin@ximian.com>
6743 * class.cs (TypeContainer.AttributeTargets): Return the correct
6744 AttributeTargets depending on our `Kind' instead of throwing an
6745 exception; fixes #71632.
6747 2005-01-26 Martin Baulig <martin@ximian.com>
6749 * delegate.cs (Delegate.DefineType): Correctly define our type
6750 parameters. Fixes #71483.
6752 2005-01-25 Raja R Harinath <rharinath@novell.com>
6755 * expression.cs (MemberAccess.DoResolve): Don't complain with
6756 cs0572 when the LHS of a member access has identical name and type
6759 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6762 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6764 Create custom PermissionSet only for PermissionSetAttribute.
6766 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6769 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6770 delegates in static class.
6772 2005-01-24 Martin Baulig <martin@ximian.com>
6774 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6775 merging an implicit block, just use its reachability.
6777 * statement.cs (Block.Resolve): Make the unreachable code check
6778 work wrt. implicit blocks; see test-337 from #63842.
6780 2005-01-21 Alp Toker <alp@atoker.com>
6782 * cs-parser.jay: destructor_declaration's container is PartialContainer
6783 not Class when partial types are used, so use Kind prop instead of
6786 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6788 * cs-parser.jay: Improve error reporting when an interface
6791 2005-01-20 Dick Porter <dick@ximian.com>
6793 * support.cs: SeekableStreamReader fix from Sandor Dobos
6794 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6795 chars are read. Fixes bug 70369.
6797 2005-01-20 Raja R Harinath <rharinath@novell.com>
6799 * cs-parser.jay (catch_clause): Simplify current_block handling
6802 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6804 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6805 code with ImplicitStandardConversion to handle the implicit
6806 conversion of method groups into valid delegate invocations.
6808 The problem is that in parameter handling we were using this code
6809 path. Fixes bug #64698
6811 2005-01-19 Raja R Harinath <rharinath@novell.com>
6813 * cs-parser.jay: Fix several infelicities.
6814 - Avoid assigning to the parser value stack. Code like
6815 '$3 = null' is unclean. Synthesize a value for the code block
6817 - Avoid using oob_stack for storing location information. Use ...
6818 (_mark_): ... this. New (empty) rule. Saves the current location
6820 (foreach_statement): Avoid using oob_stack for current_block
6821 handling. Use technique used in for_statement and
6822 using_statement. Synthesize a value for the code block to store
6823 additional intermediate information.
6825 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6827 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6828 of a different type is only allowed to private fields of a
6829 containing type, not on fields of a base class.
6831 See test-174.cs and error cs0122-9.cs
6833 2005-01-13 Raja R Harinath <rharinath@novell.com>
6835 Fix test-335.cs (bug #58126).
6836 * cs-parser.jay (argument): Split out non-expression parts of the
6837 rule into 'non_simple_argument'.
6838 (invocation_expression): Support parenthesized invocations with
6839 multiple arguments, and with single non-simple arguments.
6841 2005-01-13 Raja R Harinath <rharinath@novell.com>
6843 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6846 2005-01-12 Raja R Harinath <rharinath@novell.com>
6848 Fix cs0038-1.cs, cs1640-6.cs.
6849 * ecore.cs (Expression.Resolve): Remove special-case for
6850 SimpleName in error-handling.
6851 (Expression.almostMatchedMembers): Relax access permission to
6853 (Expression.MemberLookupFailed): Handle duplicates in
6854 almostMatchedMembers list.
6855 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6856 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6857 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6858 overload if the passed in MemberInfo is a MethodBase.
6860 2005-01-25 Martin Baulig <martin@ximian.com>
6863 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6865 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6868 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6869 for non-CAS & merge permission sets properly.
6871 2005-01-11 Raja R Harinath <rharinath@novell.com>
6873 Improve standard-compliance of simple name and member access
6874 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6875 * ecore.cs (FullNamedExpression): New abstract base class
6876 for Namespaces and TypeExpressions.
6877 (ResolveFlags.SimpleName): Remove.
6878 (SimpleName): Remove support for dotted names.
6879 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6880 DeclSpace.FindType and DeclSpace.LookupType.
6881 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6882 (Expression.ExprClassName): Make member function.
6883 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6884 a namespace. Remove creation of dotted "SimpleName"s.
6885 (MemberAccess.DoResolve): Likewise.
6886 * decl.cs (DeclSpace.Cache): Make private.
6887 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6888 (DeclSpace.FindType): Update.
6889 (DeclSpace.LookupType): Move here from RootContext. Return a
6890 FullNamedExpression.
6891 * namespace.cs (Namespace): Derive from FullNamedExpression
6892 so that it can be part of expression resolution.
6893 (Namespace.Lookup): Return an FullNamedExpression.
6894 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6896 * rootcontext.cs (NamespaceLookup): Remove.
6897 (LookupType): Move to DeclSpace.
6898 * attribute.cs (CheckAttributeType): Update.
6899 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6900 (FindDocumentedTypeNonArray): Likewise.
6902 2005-01-11 Raja R Harinath <rharinath@novell.com>
6904 Fix cs0509.cs, cs1632.cs.
6905 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6906 is the same as IsInterface.
6907 (TypeContainer.GetClassBases): Likewise.
6908 * statement.cs (LabeledStatement.ig): New field.
6909 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6911 (LabeledStatement.DoEmit): Check that the label was created with
6912 the same ILGenerator.
6914 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6917 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6918 accessors to its properties.
6920 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6921 from accessors to property.
6923 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6926 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6929 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6931 * attribute.cs: Check for null and empty strings.
6933 I have lost another battle to Paolo.
6935 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6938 * class.cs (PropertyMethod): Set Parent field in ctors.
6939 (SetMethod.InternalParameters): Add unsafe switch hack.
6940 Override MarkForDuplicationCheck where it is appropriate.
6942 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6943 It says whether container allows members with the same name.
6945 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6946 Removed is_method parameter.
6948 2005-01-06 Duncan Mak <duncan@ximian.com>
6950 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6951 because the previous change led to incorrect reporting of CS1032
6952 ("Cannot define/undefine preprocessor symbols after first token in
6953 file"). Instead of using `tokens_seen' as the only flag that
6954 triggers CS1040, introduce `comments_seen'. This new flag is used
6955 to signify having seen comments on the current line, so it is
6956 unset after a newline.
6958 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6960 * doc.cs : When searching for a type, find nested type too.
6961 This fixes bug #71040.
6963 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6966 - Warn missing member comment on those classes which also does not
6967 have doc comments. Fixed bug #71041.
6968 - Don't warn missing doc comment on default constructor.
6971 2005-01-06 Duncan Mak <duncan@ximian.com>
6973 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6974 comments, set `tokens_seen' to true. This allows us to detect
6975 misplaced preprocessor directives (i.e. not at the beginning of
6976 the a line, nor after whitespaces). In that case, report error
6977 CS1040. This fixes bug #56460.
6979 * cs-parser.jay (interface_member_declaration): Add checks for
6980 IsExplicitImpl, and report CS0541 error if an interface member is
6981 defined as an explicit interface declaration.
6983 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6986 * class.cs (PropertyMethod): Set Parent field in ctors.
6987 (SetMethod.InternalParameters): Add unsafe switch hack.
6989 * decl.cs (MemberCore.Parent): Cannot be readonly.
6991 2005-01-06 Raja R Harinath <rharinath@novell.com>
6993 * decl.cs (DeclSpace.ResolveType): Remove.
6994 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6995 Merge in code from ...
6996 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6997 * class.cs, enum.cs: Update to changes.
6999 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7001 * anonymous.cs: Ensure that we init the scope of our parent if it
7002 has not been initialized yet.
7004 2004-12-30 Duncan Mak <duncan@ximian.com>
7006 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7007 if field.FieldBuilder is null. Fixes #70758.
7009 * convert.cs: Fixed some typos and updated some of the comments.
7010 (ImplicitStandardConversionExists):
7011 (TryImplicitIntConversion): If `target_type' is an interface and
7012 the type of `ic' implements this interface, return true or a new
7013 BoxedCast instead of null. This fixes #70468.
7015 2004-12-29 Duncan Mak <duncan@ximian.com>
7017 * expression.cs (Argument.Emit): Check that Expr is
7018 IMemoryLocation before casting to it, and report CS1510 otherwise.
7022 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7024 * statement.cs (Block.ThisVariable): remove the recursion here, to
7025 make the --profile more sane.
7027 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7029 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7030 assembly, by JB Evain.
7032 2004-12-17 Raja R Harinath <rharinath@novell.com>
7034 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7035 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7036 "parent" refers to enclosing type/class. "base" refers to superclass.
7038 2004-12-17 Raja R Harinath <rharinath@novell.com>
7040 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7041 Ensure that we only have GlobalAttributes.
7042 * attribute.cs (Attribute.Emit): Make non-virtual.
7043 (GlobalAttribute.Emit): Remove.
7044 (Attribute.Resolve): Make virtual.
7045 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7046 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7047 the argument. Don't create one.
7048 (Attribute.GetObsoleteAttribute): Likewise.
7049 (Attribute.GetClsCompliantAttributeValue): Likewise.
7050 * class.cs, decl.cs: Update to changes.
7052 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7054 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7056 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7058 * statement.cs (Foreach.Resolve): Add error 186 report.
7060 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7062 * expression.cs (Conditional.DoResolve): Add warning 429.
7064 * statement.cs (If.Resolve): Add warning 665.
7066 2004-12-16 Raja R Harinath <rharinath@novell.com>
7068 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7069 except when in the parser, and in GlobalAttribute.
7070 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7071 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7072 RootContext.Tree.Types.NamespaceEntry once work is done.
7073 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7074 and resets RootContext.Tree.Types.NamespaceEntry.
7076 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7078 * cs-parser.jay: Don't create a block for every variable.
7080 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7082 * location.cs: Provide extra information.
7084 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7085 variables from the captured environment, it is the ldarg_0.
7087 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7089 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7092 * class.cs: Changed warning level for 169 to avoid developer
7093 displeasure from warning flooding. It will be changed back when they
7094 fix most of current BCL warnings.
7096 * RootContext.cs: Pushed default WarningLevel to 3.
7098 * statement.cs: Removed unused variable.
7100 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7102 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7103 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7104 Add error 502 report.
7105 (StaticClass.DefineType): Add error 441 report.
7106 (Class.AllowedModifiersProp): New virtual property as temporary
7107 extension to AllowedModifiers.
7108 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7109 to share implementation with StaticClass and don't call virtual
7112 * driver.cs (MainDriver): Add error 1558 test.
7114 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7115 report. Moved error 36 test here.
7117 * statement.cs (Throw.Resolve): Add error 724 report.
7119 * typemanager.cs: Add out_attribute_type core type.
7121 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7123 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7125 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7127 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7130 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7132 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7133 Add error 3023 report.
7134 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7136 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7139 2004-12-12 John Luke <john.luke@gmail.com>
7141 * driver.cs (AddArgs): take -- into account when
7142 adding arguments, fixes bug 65710
7144 2004-12-12 Martin Baulig <martin@ximian.com>
7146 * expression.cs (Unary.TryReduceNegative): Added support for
7147 SByteConstant and ByteConstant.
7148 (Unary.Reduce): Check error values from TryReduceNegative().
7150 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7152 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7153 and report exception as error 182.
7155 2004-12-10 Raja R Harinath <rharinath@novell.com>
7157 * driver.cs (Main): Fix message when there are warnings.
7159 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7161 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7163 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7165 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7166 Reduced number of warnings.
7168 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7170 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7172 * driver.cs: Removed message.
7174 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7176 2004-12-08 <vargaz@freemail.hu>
7178 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7180 2004-12-08 Martin Baulig <martin@ximian.com>
7182 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7183 instead of a CS3002 for properties and indexer.
7185 2004-12-08 Martin Baulig <martin@ximian.com>
7187 * decl.cs (MemberName.ToString): Make this work again.
7189 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7191 * attribute.cs (Resolve): Add error 591 detection.
7193 * class.cs (FieldMember.Define): Add error 1547 detection.
7194 (Indexer.Define): Add error 620 detection.
7195 (Operator.Define): Add error 590 detection.
7197 * ecore.cs: Missing argument for error 79.
7199 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7202 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7205 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7208 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7210 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7211 Some operator comments were suppressed.
7212 * doc.cs : Implicit/explicit operator name in doc comments are like
7213 "op_Explicit(type)~returnType", so added suffix handling.
7215 2005-01-21 Alp Toker <alp@atoker.com>
7217 * cs-parser.jay: destructor_declaration's container is PartialContainer
7218 not Class when partial types are used, so use Kind prop instead of 'is'.
7220 2004-12-12 Martin Baulig <martin@ximian.com>
7222 * expression.cs (Unary.TryReduceNegative): Added support for
7223 SByteConstant and ByteConstant.
7224 (Unary.Reduce): Check error values from TryReduceNegative().
7226 2004-12-11 Martin Baulig <martin@ximian.com>
7228 * support.cs (ReflectionParameters.ParameterName): If we have a
7229 `gpd', call `ParameterName' on it.
7231 * parameter.cs (Parameter.GetParameterAttributes): New static method.
7233 * pending.cs (PendingImplementation.DefineProxy): Call
7234 DefineParameter() for all of the MethodBuilder's arguments.
7236 2004-12-09 Martin Baulig <martin@ximian.com>
7238 * doc.cs (DocUtil): Make this a static class.
7240 2004-12-09 Martin Baulig <martin@ximian.com>
7242 * expression.cs (Invocation.InferType): Moved the type inference
7243 implementation into TypeManager.
7245 * generics.cs (TypeManager): Moved the type inference
7246 implementation here.
7248 2004-12-09 Martin Baulig <martin@ximian.com>
7250 * typemanager.cs (TypeManager): Make this a partial class.
7253 (TypeManager): Move the generics part of `TypeManager' here.
7255 2004-12-08 Martin Baulig <martin@ximian.com>
7257 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7258 instead of a CS3002 for properties and indexer. Added CS3024
7259 check for generic interfaces.
7261 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7262 instances are not CLS-compliant.
7264 2004-12-08 Martin Baulig <martin@ximian.com>
7267 (void_pointer_expression): New rule for `void*', `void**' etc.
7268 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
7270 2004-12-08 Martin Baulig <martin@ximian.com>
7272 * expression.cs (Invocation.InferType): Removed the hack for
7273 MethodCore.MayUnify().
7275 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7278 * class.cs (MethodCore.MayUnify): Use
7279 TypeManager.MayBecomeEqualGenericTypes().
7281 2004-12-08 Martin Baulig <martin@ximian.com>
7283 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7284 parameter, box it. Fixes #69233.
7286 2004-12-08 Martin Baulig <martin@ximian.com>
7288 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7289 have the ctor constraint. Fixes #68326.
7291 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7293 * cs-parser.jay : interface comment was not consumed because of
7294 extra opt_semicolon before doc handling.
7296 2004-12-03 Raja R Harinath <rharinath@novell.com>
7298 Fix test-327.cs, test-328.cs, and put in early infrastructure
7299 for eventually fixing #52697.
7300 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7301 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7303 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7304 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7305 (VerifyUsing, error246): Update.
7306 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7307 'NamespaceEntry.LookupNamespaceOrType'.
7309 2004-12-07 Martin Baulig <martin@ximian.com>
7311 * driver.cs: Call it "BETA SOFTWARE" :-)
7313 2004-12-06 Raja R Harinath <rharinath@novell.com>
7315 Fix crash on cs0657-17.cs.
7316 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7317 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7318 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7319 the case where the NamespaceEntry gets overwritten.
7321 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7323 Fixed #69195, #56821
7324 * ecore.cs (ResolveBoolean): Tiny refactoring.
7326 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7327 of right expression resolving when left is false constant and
7328 operator is LogicalAnd OR true constant and operator is LogicalOr.
7330 * statement.cs (ResolveUnreachable): Always reports warning.
7332 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7334 * class.cs: Distinguish between 1721 and 1722 (just a little help
7335 for the programmer).
7337 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7339 * delegate.cs: Only allow this on new versions of the language.
7341 2004-12-02 Duncan Mak <duncan@ximian.com>
7343 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7345 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7346 here as a static method. Take an additional bool out parameter
7347 `must_do_cs1540_check' for signaling to InstanceResolve.
7348 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7349 member field from PropertyExpr class and made it an argument of
7351 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7352 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7353 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7354 and `remove_accessor' as well as InstanceResolve: report CS0122
7359 2004-12-07 Martin Baulig <martin@ximian.com>
7361 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7362 and CS0692 where appropriate.
7364 2004-12-06 Martin Baulig <martin@ximian.com>
7366 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7367 IsDuplicateImplementation() and improved it.
7369 * expression.cs (Invocation.InferTypeArguments): Added
7370 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7371 and removed the "ref" modifier from `infered_types'.
7373 * decl.cs (MemberName.ToString): Removed the exception.
7375 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7377 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7378 comments are allowed.
7380 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7382 * delegate.cs: Add checks for subtypes in paramaters and return values
7383 in VerifyMethod () to add support for Covariance/Contravariance
7386 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7388 * report.cs: Remove extra closing parenthesis.
7390 * convert.cs (Error_CannotImplicitConversion): If the name of the
7391 types are the same, provide some extra information.
7393 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7396 * attribute.cs (Resolve): Improved implementation of params
7397 attribute arguments.
7399 * support.cs (ParameterData): Add HasParams to be faster.
7401 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7403 all things are for /doc support:
7405 * doc.cs: new file that supports XML documentation generation.
7406 * mcs.exe.sources: added doc.cs.
7408 Handle /doc command line option.
7409 Report error 2006 instead of 5 for missing file name for /doc.
7410 Generate XML documentation when required, after type resolution.
7412 Added support for picking up documentation (/// and /** ... */),
7413 including a new XmlCommentState enumeration.
7415 Added lines to fill Documentation element for field, constant,
7416 property, indexer, method, constructor, destructor, operator, event
7417 and class, struct, interface, delegate, enum.
7418 Added lines to warn incorrect comment.
7420 Added Documentation field (passed only when /doc was specified).
7422 Added DocComment, DocCommentHeader, GenerateDocComment() and
7423 OnGenerateDocComment() and some supporting private members for
7424 /doc feature to MemberCore.
7426 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7428 Added overriden DocCommentHeader.
7430 Added overriden DocCommentHeader and GenerateDocComment().
7432 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7434 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7435 unwrapping the enumeration values, chain to
7436 DoConstantNumericPromotions again, so we can promote things to the
7437 fundamental types (takes care of enums that are bytes, sbytes).
7441 2004-12-01 Raja R Harinath <rharinath@novell.com>
7443 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7444 Fix long-standing bug in type-lookup. Use FindType instead of
7445 LookupType when ec.ResolvingTypeTree.
7446 (Attribute.ResolveType, Attribute.Resolve)
7447 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7449 (Attributes.Search): Remove internal version. Update.
7450 (Attributes.SearchMulti): Update.
7451 (Attributes.GetClsCompliantAttribute): Remove.
7452 (Attributes.GetIndexerNameAttribute): Remove.
7453 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7454 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7455 * class.cs (Indexer.Define): Likewise.
7457 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7460 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7461 MarshallByReference members access.
7463 * expression.cs: Use CheckMarshallByRefAccess;
7464 Better error CS0197 message.
7466 * report.cs: Print whole related error message.
7468 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7470 * class (GetClassBases): Better error 60 report.
7471 (EventProperty): Disabled warning 67 detection.
7473 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7476 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7478 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7481 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7484 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7486 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7488 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7490 * attribute.cs (Attribute.Resolve): Refine error reporting and
7491 report a cs0117 if the identifier does not exist, to distinguish
7492 from 0617 which is a miss-use of the actual identifier.
7494 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7495 between cs0070 and cs0079.
7497 * class.cs (MemberBase.DoDefine): When reporting a wrong
7498 accessibility level, we use MethodCore to compare instead of
7499 Method (this was a regression in some refactoring effort).
7501 So now we correctly report cs0056 again.
7503 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7504 testing the target_type (which was known to be object_type) and
7505 not the source type (which is anonymous_method).
7507 Fixed reporting of error cs1660.
7509 * expression.cs (UserCast.Source): Expose the underlying cast.
7511 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7512 allowed types to find a match to int32 first (most common).
7514 In addition, it ignores any ImplicitUserConversions that did an
7515 internal implicit conversion (as the switch statement allows only
7516 one integral conversion to exist).
7518 * class.cs (PartialContainer.Create): rename `name' to
7519 `member_name' for clarity. Then replace the string calls with a
7520 call to MemberName.GetPartialName, as now using
7521 MemberName.ToString is an error (this is due to the side effects
7522 it had, that were fixed in the past).
7524 This will restore the error reporting on a number of partial class
7525 errors that were missusing this (and getting an exception as a
7526 results, which is now just a plain textual warning, because
7527 yyparse debug output would crash otherwise).
7529 2004-11-26 Raja R Harinath <rharinath@novell.com>
7531 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7533 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7535 * rootcontext.cs (LookupType): Make sure to cache lookups that
7536 don't give us a negative result. This saves about 5% of corlib
7539 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7541 * report.cs (AbstractMessage.Print): messages are sent to stderr
7543 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7544 non-interface in the list of interfaces (at this point, either
7545 parent was properly set, or a base class is being listed in the
7546 interfaces section).
7548 This flags error 1722, and resolves the crash from bug 69259.
7550 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7552 * statement.cs (Using.EmitExpressionFinally): make this work right
7553 for valuetypes. Fixes 69926.
7555 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7557 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7558 converted to an enum" here, before we try to change the underlying
7559 type. This code exists, but it is a different code path than the
7560 one used while encoding constants.
7562 (ImplicitReferenceConversionExists): In addition, resynchronized
7563 the code here, so it matches the same code in
7564 ImplicitReferenceConversionExists for the `from any class-type S
7565 to any interface-type T'.
7567 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7569 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7571 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7573 * cs-parser.jay: Use verbosity accordingly.
7575 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7577 * expression.cs (Unary.ResolveOperator): Do not report warning;
7578 AddressOf reads from variable.
7580 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7582 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7586 * attribute.cs (Attributable): Removed CheckTargets.
7587 (Attributes.Emit): Explicit attribute targets are tested here.
7589 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7590 not enabled for interfaces.
7592 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7593 (GetAssemblyName): Ouch next bug there.
7595 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7597 * expression.cs: Error 275 added.
7599 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7601 Fix bug #69177 (Implemented decimal constant support)
7603 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7604 (BinaryFold): Add DecimalConstant.
7606 * const.cs (Define): Decimal constant
7608 (ChangeType): Add decimal type handling.
7609 (LookupConstantValue): Don't set value for decimal type but
7610 emit DecimalConstantAttribute. Needed for constant optimization.
7612 * constant.cs (ToDecimal): New method.
7613 (ConvertToDecimal): New method.
7614 (IntConstant): Implemented ConvertToDecimal.
7615 (DecimalConstant.Emit): Emit optimized version for decimals in
7618 * expression.cs (ResolveOperator): Changed order of constant
7619 reduction to work correctly with native types which have
7620 overloaded operators.
7621 (ResolveMemberAccess): Extract constant value from attribute
7624 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7626 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7627 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7628 (ChangeType): Decimal is special.
7629 (TypeToCoreType): Add decimal type.
7631 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7633 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7636 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7638 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7641 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7643 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7645 * pending.cs (PendingImplementation): Grab only interfaces.
7647 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7649 * statement.cs (ForeachHelperMethods): Add location member and
7650 error 202 detection.
7652 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7654 * expression.cs (DoResolveBase): Fixed wrong warning for out
7657 2004-12-04 Martin Baulig <martin@ximian.com>
7659 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7660 to check whether the conversion is ok.
7662 * typemanager.cs (TypeManager.GetTypeArguments): Just return
7663 `Type.EmptyTypes' if we're not a generic TypeContainer.
7665 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7667 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7668 old bug: when converting from the null literal to a pointer,
7669 return an EmptyCast, not the NullLiteral.
7671 This fixes #69921, the recent null_type changes probably made this
7674 2004-12-03 Martin Baulig <martin@ximian.com>
7676 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7677 method as our child, call AnonymousMethod.Compatible() on it.
7679 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7681 * class.cs (FieldBase): Use an unused bit field from the field to
7682 encode the `has_offset' property from the FieldMember. This saves
7683 a couple of Ks on bootstrap compilation.
7685 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7686 method as our child, return the AnonymousMethod resolved
7689 * expression.cs (New.DoResolve): Allow return values from
7690 NewDelegate to also include AnonymousMethods.
7694 2004-11-29 Raja R Harinath <rharinath@novell.com>
7696 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7698 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7699 System.Runtime.InteropServices._Exception, since it's a base
7700 interface of the core type System.Exception in the net_2_0 profile.
7702 2004-11-27 Martin Baulig <martin@ximian.com>
7704 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7706 2004-11-26 Raja R Harinath <rharinath@novell.com>
7708 * Makefile: Convert to use executable.make.
7709 * gmcs.exe.sources: New.
7711 2004-11-25 Martin Baulig <martin@ximian.com>
7713 * expression.cs (Invocation.InferType): Added support for byref types.
7715 2004-11-25 Martin Baulig <martin@ximian.com>
7717 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7718 in TypeManager.TypeToCoreType().
7720 2004-11-25 Martin Baulig <martin@ximian.com>
7722 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7723 "Dispose" method from the `current_type'.
7724 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7725 DoDefineMembers() instead of using the MethodBuilder; this is
7726 required for generic iterators.
7728 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7730 2004-11-24 Martin Baulig <martin@ximian.com>
7732 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7734 2004-11-20 Martin Baulig <martin@ximian.com>
7736 * expression.cs (Invocation.InferType): Correctly infer generic
7737 instances; see gen-103.cs.
7738 (Invocation.InferTypeArguments): If a generic method doesn't have
7739 any unbound type parameters, we don't need to infer anything.
7741 2004-11-19 Raja R Harinath <rharinath@novell.com>
7743 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7745 2004-11-17 Raja R Harinath <rharinath@novell.com>
7747 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7748 (TypeHandle.GetMemberCache): New.
7749 (TypeHandle.TypeHandle): Update.
7750 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7751 (TypeManager.LookupParentInterfacesCache):
7752 Rename from LookupInterfaceCache. Optimize slightly.
7753 (TypeManager.MemberLookup_FindMembers): Update.
7754 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7756 (AddCacheContents): Rename from AddHashtable.
7757 * class.cs (TypeContainer.parent_container): Remove.
7758 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7759 (TypeContainer.DoDefineMembers): Don't initialize it.
7760 Update to name changes.
7762 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7764 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7765 that factors the code to check access modifiers on override.
7767 (PropertyBase): Use the code here.
7769 Patch from Lluis S'anchez, fixes bug #69361.
7771 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7773 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7774 routine that is used to report the use of a captured variable
7775 whose address has been taken.
7777 There are two checks: one when variables are being captured and
7778 the other check is when the address of a variable is taken.
7780 (because an anonymous methods might be resolved before *or* after
7781 the address has been taken) and
7783 * expression.cs (Conditional.DoResolve): Remove the special
7784 casing that Martin added to trueExpr and falseExpr being both
7785 NullLiteral. We get the right behavior now just by introducing
7786 the null_type into the compiler.
7788 * convert.cs (ExplicitConversion): Change the code to use
7789 null_type instead of testing `expr is NullLiteral'.
7790 (ImplicitConversionStandard): use null_type too.
7791 (ImplicitReferenceConversionExists): use null_type too.
7792 (ImplicitReferenceConversion): use null_type too.
7794 * literal.cs: The type of `NullLiteral' is now null_type instead
7796 (Resolve): Set the type here.
7798 * typemanager.cs: Introduce null_type.
7800 2004-11-18 Martin Baulig <martin@ximian.com>
7803 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7805 2004-11-18 Martin Baulig <martin@ximian.com>
7807 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7809 2004-11-18 Martin Baulig <martin@ximian.com>
7811 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7812 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
7813 call ResolveConstructedType() on it to resolve it without checking
7815 (Constraints.ResolveTypes): Check them here.
7816 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7817 but don't check constraints.
7818 (ConstructedType.ResolveAsTypeTerminal): Override this and also
7819 check constraints here.
7820 (ConstructedType.ResolveConstructedType): New public method. This
7821 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7822 resolve ourselves without checking constraints.
7824 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7826 2004-11-18 Martin Baulig <martin@ximian.com>
7829 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7831 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7833 2004-11-18 Martin Baulig <martin@ximian.com>
7835 * ecore.cs (TypeExpr.ResolveType): Removed.
7836 (Expression.ResolveAsTypeTerminal): We always return a fully
7837 resolved `TypeExpr', so we can just access its `Type'.
7839 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7841 2004-11-17 Martin Baulig <martin@ximian.com>
7843 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7844 sure we don't return any unresolved TypeExpr's.
7845 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7847 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7849 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7850 unresolved `ConstructedType's.
7852 2004-11-17 Martin Baulig <martin@ximian.com>
7854 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7856 2004-11-17 Martin Baulig <martin@ximian.com>
7859 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7861 * decl.cs (DeclSpace.ResolveType): Removed.
7862 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7864 2004-11-17 Martin Baulig <martin@ximian.com>
7866 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7867 direction, like FindMembers() does. Fixes #69546, testcase is in
7870 2004-11-16 Martin Baulig <martin@ximian.com>
7872 This is based on a patch from Marek Safar, see bug #69082.
7873 Fixes bugs #63705 and #67130.
7875 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7876 method; create a MemberCache for an interface type and cache the
7879 * decl.cs (IMemberContainer.ParentContainer): Removed.
7880 (IMemberContainer.ParentCache): New property.
7881 (MemberCache.SetupCacheForInterface): Removed.
7882 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7883 to create a cache for an interface's "parent".
7885 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7888 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7890 * statement.cs: Avoid adding bools to a hashtable.
7892 2004-11-15 Martin Baulig <martin@ximian.com>
7894 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7896 2004-11-11 Martin Baulig <martin@ximian.com>
7898 * typemanager.cs (TypeManager.GetMethodName): New method.
7900 * class.cs (MethodData.Define): Include the generic arity in the
7901 name of an explicit interface; also add it to the method name.
7903 * pending.cs (PendingImplementation.InterfaceMethod): The method
7904 name now includes the generic arity.
7906 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7908 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7909 calling an unsafe method from a safe location.
7911 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7914 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7916 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7918 * namespace.cs (VerifyUsing): use GetPartialName instead of
7921 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7923 * statement.cs (Return.Resolve): Fix regression in typo: if
7924 `in_exc', we have to request a NeedReturnLabel, this was a typo
7925 introduced in the anonymous method check-in. Fixes #69131.
7927 * Indexers were using the ShortName when defining themselves,
7928 causing a regression in the compiler bootstrap when applying the
7929 patch from 2004-11-02 (first part), now they use their full name
7930 and the bug is gone.
7932 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7934 * driver.cs: Strip the path from the names of embedded resources. Fixes
7937 2004-11-04 Raja R Harinath <rharinath@novell.com>
7939 Fix error message regression: cs0104-2.cs.
7940 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7941 (AliasEntry.Resolve): Update.
7942 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7944 (RootContext.LookupType): Update.
7946 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7948 * cs-parser.jay: Add support for handling accessor modifiers
7949 * class: Add support port accessor modifiers and error checking,
7950 define PropertyMethod.Define as virtual (not abstract anymore)
7951 * ecore.cs: Add checking for proeprties access with access modifiers
7952 * iterators.cs: Modify Accessor constructor call based in the modified
7954 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7956 * expression.cs (StringConcat): Handle being called twice,
7957 as when we have a concat in a field init with more than two
7960 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7962 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7963 special case explicit implementations, we should always produce
7964 the .property or .event declaration.
7966 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7967 since it will not return correct data if people use this
7968 unresolved in the presence of using statements (see test-313).
7970 * class.cs (MethodData.Define): If we are an explicit interface
7971 implementation, set the method name to the full name of the
7972 interface plus the name of the method.
7974 Notice that using the method.MethodName.GetFullName() does not
7975 work, as it will only contain the name as declared on the source
7976 file (it can be a shorthand in the presence of using statements)
7977 and not the fully qualifed type name, for example:
7981 class D : ICloneable {
7982 object ICloneable.Clone () {
7986 Would produce a method called `ICloneable.Clone' instead of
7987 `System.ICloneable.Clone'.
7989 * namespace.cs (Alias.Resolve): Use GetPartialName.
7991 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7993 * cs-parser.jay: Add error 1055 report.
7995 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7997 * assign.cs (Assign.DoResolve): Only do the transform of
7998 assignment into a New if the types are compatible, if not, fall
7999 through and let the implicit code deal with the errors and with
8000 the necessary conversions.
8002 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8004 * cs-parser.jay: Add error 1031 report.
8006 * cs-tokenizer.cs: Add location for error 1038.
8008 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8010 * cs-parser.jay: Add error 1016 report.
8012 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8014 * cs-parser.jay: Add errors 1575,1611 report.
8016 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8018 * cs-parser.jay: Add error 1001 report.
8020 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8023 * attribute.cs (GetMarshal): Add method argument for
8024 caller identification.
8026 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8027 agument for GetMarshal and RuntimeMissingSupport.
8029 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8031 * attribute.cs (ExtractSecurityPermissionSet): Removed
8032 TypeManager.code_access_permission_type.
8034 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8036 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8038 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8039 for obsolete use of a variable here. Fixes regression on errors
8040 cs0619-25 and cs0619-26.
8042 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8044 Fix #62358, implemented security attribute encoding.
8046 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8047 Tests permitted SecurityAction for assembly or other types.
8048 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8049 data from SecurityPermissionAttribute to PermisionSet class.
8051 * class.cs (ApplyAttributeBuilder): Added special handling
8052 for System.Security.Permissions.SecurityAttribute based types.
8054 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8055 special handling for System.Security.Permissions.SecurityAttribute
8058 * enum.cs (ApplyAttributeBuilder): Added special handling
8059 for System.Security.Permissions.SecurityAttribute based types.
8061 * parameter.cs (ApplyAttributeBuilder): Added special handling
8062 for System.Security.Permissions.SecurityAttribute based types.
8064 * rootcontext.cs: Next 2 core types.
8066 * typemanager.cs (TypeManager.security_permission_attr_type):
8067 Built in type for the SecurityPermission Attribute.
8068 (code_access_permission_type): Build in type.
8070 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8072 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8073 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8074 all of this information into
8075 EmitContext.EmitCapturedVariableInstance.
8077 * codegen.cs (EmitCapturedVariableInstance): move here the
8078 funcionality of emitting an ldarg.0 in the presence of a
8079 remapping. This centralizes the instance emit code.
8081 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8082 then emit a load of this: it means that we have reached the
8083 topmost ScopeInfo: the one that contains the pointer to the
8084 instance of the class hosting the anonymous method.
8086 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8087 captures to the topmost CaptureContext.
8089 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8091 * expression.cs (LocalVariableReference): Move the knowledge about
8092 the iterators into codegen's EmitCapturedVariableInstance.
8094 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8096 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8097 all code paths return a value from an anonymous method (it is the
8098 same as the 161 error, but for anonymous methods).
8100 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8102 The introduction of anonymous methods in the compiler changed
8103 various ways of doing things in the compiler. The most
8104 significant one is the hard split between the resolution phase
8105 and the emission phases of the compiler.
8107 For instance, routines that referenced local variables no
8108 longer can safely create temporary variables during the
8109 resolution phase: they must do so from the emission phase,
8110 since the variable might have been "captured", hence access to
8111 it can not be done with the local-variable operations from the runtime.
8115 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8116 is a toplevel block.
8118 (ToplevelBlock): A new kind of Block, these are the blocks that
8119 are created by the parser for all toplevel method bodies. These
8120 include methods, accessors and anonymous methods.
8122 These contain some extra information not found in regular blocks:
8123 A pointer to an optional CaptureContext (for tracking captured
8124 local variables and parameters). A pointer to the parent
8127 (Return.Resolve): Catch missmatches when returning a value from an
8128 anonymous method (error 1662).
8129 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8132 (Break.Resolve): ditto.
8134 (SwitchLabel): instead of defining the labels during the
8135 resolution phase, we now turned the public ILLabel and ILLabelCode
8136 labels into methods called GetILLabelCode() and GetILLabel() that
8137 only define the label during the Emit phase.
8139 (GotoCase): Track the SwitchLabel instead of the computed label
8140 (its contained therein). Emit the code by using
8141 SwitchLabel.GetILLabelCode ().
8143 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8144 whether the Local has been captured or not.
8146 (LocalInfo.IsCaptured): New property, used to tell whether the
8147 local has been captured.
8149 * anonymous.cs: Vastly updated to contain the anonymous method
8152 The main classes here are: CaptureContext which tracks any
8153 captured information for a toplevel block and ScopeInfo used to
8154 track the activation frames for various local variables.
8156 Each toplevel block has an optional capture context associated
8157 with it. When a method contains an anonymous method both the
8158 toplevel method and the anonymous method will create a capture
8159 context. When variables or parameters are captured, they are
8160 recorded on the CaptureContext that owns them, for example:
8164 MyDelegate d = delegate {
8169 Here `a' will be recorded as captured on the toplevel
8170 CapturedContext, the inner captured context will not have anything
8171 (it will only have data if local variables or parameters from it
8172 are captured in a nested anonymous method.
8174 The ScopeInfo is used to track the activation frames for local
8175 variables, for example:
8177 for (int i = 0; i < 10; i++)
8178 for (int j = 0; j < 10; j++){
8179 MyDelegate d = delegate {
8184 At runtime this captures a single captured variable `i', but it
8185 captures 10 different versions of the variable `j'. The variable
8186 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8187 recorded on a child.
8189 The toplevel ScopeInfo will also track information like the `this'
8190 pointer if instance variables were referenced (this is necessary
8191 as the anonymous method lives inside a nested class in the host
8192 type of the method).
8194 (AnonymousMethod): Expanded to track the Toplevel, implement
8195 `AnonymousMethod.Compatible' to tell whether an anonymous method
8196 can be converted to a target delegate type.
8198 The routine now also produces the anonymous method content
8200 (AnonymousDelegate): A helper class that derives from
8201 DelegateCreation, this is used to generate the code necessary to
8202 produce the delegate for the anonymous method that was created.
8204 * assign.cs: API adjustments for new changes in
8205 Convert.ImplicitStandardConversionExists.
8207 * class.cs: Adjustments to cope with the fact that now toplevel
8208 blocks are of type `ToplevelBlock'.
8210 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8211 insteda of standard blocks.
8213 Flag errors if params arguments are passed to anonymous methods.
8215 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8216 `CurrentAnonymousMethod' which points to the current Anonymous
8217 Method. The variable points to the AnonymousMethod class that
8218 holds the code being compiled. It is set in the new EmitContext
8219 created for the anonymous method.
8221 (EmitContext.Phase): Introduce a variable and an enumeration to
8222 assist in enforcing some rules about when and where we are allowed
8223 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8224 only one that enfonces this right now).
8226 (EmitContext.HaveCaptureInfo): new helper method that returns
8227 whether we have a CapturedContext initialized.
8229 (EmitContext.CaptureVariable): New method used to register that a
8230 LocalInfo must be flagged for capturing.
8232 (EmitContext.CapturedParameter): New method used to register that a
8233 parameters must be flagged for capturing.
8235 (EmitContext.CapturedField): New method used to register that a
8236 field must be flagged for capturing.
8238 (EmitContext.HaveCapturedVariables,
8239 EmitContext.HaveCapturedFields): Return whether there are captured
8240 variables or fields.
8242 (EmitContext.EmitMethodHostInstance): This is used to emit the
8243 instance for the anonymous method. The instance might be null
8244 (static methods), this (for anonymous methods that capture nothing
8245 and happen to live side-by-side with the current method body) or a
8246 more complicated expression if the method has a CaptureContext.
8248 (EmitContext.EmitTopBlock): Routine that drives the emission of
8249 code: it will first resolve the top block, then emit any metadata
8250 and then emit the code. The split is done so that we can extract
8251 any anonymous methods and flag any captured variables/parameters.
8253 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8254 during this phase, the ILGenerator should not be used as labels
8255 and local variables declared here might not be accessible to any
8256 code that is part of an anonymous method.
8258 Exceptions to this include the temporary variables that are
8259 created by some statements internally for holding temporary
8262 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8265 (EmitContext.TemporaryReturn): This method is typically called
8266 from the Emit phase, and its the only place where we allow the
8267 ReturnLabel to be defined other than the EmitMeta. The reason is
8268 that otherwise we would have to duplicate a lot of logic in the
8269 Resolve phases of various methods that today is on the Emit
8272 (EmitContext.NeedReturnLabel): This no longer creates the label,
8273 as the ILGenerator is not valid during the resolve phase.
8275 (EmitContext.EmitThis): Extended the knowledge in this class to
8276 work in anonymous methods in addition to iterators.
8278 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8279 code is necessary on the stack to access the instance to a local
8280 variable (the variable will be accessed as a field).
8282 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8283 EmitContext.EmitAddressOfParameter): Routines to support
8284 parameters (not completed at this point).
8286 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8287 will also remove the parameters.
8289 * convert.cs (Convert): Define a `ConstantEC' which points to a
8290 null. This is just to prefity some code that uses
8291 ImplicitStandardConversion code and do not have an EmitContext
8294 The idea is to flag explicitly that at that point in time, it is
8295 known that the conversion will not trigger the delegate checking
8296 code in implicit conversions (which requires a valid
8299 Everywhere: pass new EmitContext parameter since
8300 ImplicitStandardConversionExists now requires it to check for
8301 anonymous method conversions.
8303 (Convert.ImplicitStandardConversionExists): If the type of an
8304 expression is the anonymous_method_type, and the type is a
8305 delegate, we invoke the AnonymousMethod.Compatible method to check
8306 whether an implicit conversion is possible.
8308 (Convert.ImplicitConversionStandard): Only do implicit method
8309 group conversions if the language level is not ISO_1.
8311 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8312 MethodInfo for the Invoke method. used by Delegate and
8315 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8316 method conversions if the target type is a delegate.
8318 Removed extra debugging nops.
8320 (LocalVariableReference): Turn the `local_info' into a public
8323 Add `prepared' field, the same hack used for FieldExprs to cope
8324 with composed assignments, as Local variables do not necessarily
8325 operate purely on the stack as they used to: they can be captured
8328 Add `temp' for a temporary result, like fields.
8330 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8332 It now copes with Local variables that are captured and emits the
8333 proper instance variable to load it from a field in the captured
8336 (ParameterReference.DoResolveBase): During the resolve phase,
8337 capture parameters if we are in an anonymous method.
8339 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8340 anonymous method, use the EmitContext helper routines to emit the
8341 parameter reference.
8343 * iterators.cs: Set RemapToProxy to true/false during the
8346 * parameters.cs (GetParameterByName): New helper method.
8348 * typemanager.cs (anonymous_method_type) a new type that
8349 represents an anonyous method. This is always an internal type,
8350 used as a fencepost to test against the anonymous-methodness of an
8353 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8355 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8357 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8359 2004-11-10 Martin Baulig <martin@ximian.com>
8361 * expression.cs (Invocation.BetterFunction): If two methods have
8362 equal parameter types, but only one of them is generic, the
8363 non-generic one wins.
8364 (New.DoResolve): Don't set `is_struct' to false if we're a generic
8365 instance; just use `Type.IsValueType' to determine whether
8366 something is a struct or not.
8367 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8368 so we can be called multiple times.
8370 2004-11-10 Martin Baulig <martin@ximian.com>
8372 * generic.cs (TypeParameter.DefineConstraints): New public method.
8373 (TypeParameter.CheckAccessLevel): Override this and return true.
8374 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8375 override ResolveType() anymore.
8376 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8378 2004-11-10 Martin Baulig <martin@ximian.com>
8380 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8381 call DeclSpace.ResolveNestedType() on it.
8383 2004-11-10 Martin Baulig <martin@ximian.com>
8385 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8386 non-null, call ParameterModifier() on it.
8388 2004-11-10 Martin Baulig <martin@ximian.com>
8391 (Iterators): Added `current_type' and `this_type' fields.
8392 (Iterators.DefineIterator): Create a new EmitContext and store it
8393 in `ec'; compute `this_type'.
8395 2004-11-10 Martin Baulig <martin@ximian.com>
8398 (TypeManager.IsPrivateAccessible): New public method.
8399 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8401 2004-11-10 Martin Baulig <martin@ximian.com>
8403 * class.cs (TypeContainer.DefineType): Call
8404 TypeBuilder.DefineGenericParameters() before resolving the type
8406 (MethodData.parent_method): New protected field.
8407 (MethodData..ctor): Added `MethodInfo parent_method' argument.
8408 (MethodData.Define): Compute `parent_method'.
8411 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8412 (MemberCore.GetClsCompliantAttributeValue): Likewise.
8413 (DeclSpace.ec): New protected field; store the EmitContext here.
8414 (DeclSpace.EmitContext): New public property.
8415 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8416 (DeclSpace.ResolveNestedType): New public method.
8417 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8418 (DeclSpace.NestedAccessible): Added `Type tb' argument.
8419 (DeclSpace.FamilyAccessible): Likewise.
8420 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8421 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8424 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8427 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8428 (Enum.Emit): Don't create a new EmitContext.
8430 2004-10-18 Martin Baulig <martin@ximian.com>
8432 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8433 `Type' directly, but call ResolveType() on it.
8434 (Catch.Resolve): Likewise.
8435 (Foreach.Resolve): Likewise.
8437 2004-10-18 Martin Baulig <martin@ximian.com>
8439 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8440 `Type' directly, but call ResolveType() on it.
8441 (Probe.DoResolve): Likewise.
8442 (ArrayCreation.LookupType): Likewise.
8443 (TypeOf.DoResolve): Likewise.
8444 (SizeOf.DoResolve): Likewise.
8446 2004-10-18 Raja R Harinath <rharinath@novell.com>
8448 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8451 2004-10-17 John Luke <john.luke@gmail.com>
8453 * class.cs (Operator.GetSignatureForError): use CSharpName
8455 * parameter.cs (Parameter.GetSignatureForError): Returns
8456 correct name even if was not defined.
8458 2004-10-13 Raja R Harinath <rharinath@novell.com>
8461 * class.cs (TypeContainer.EmitContext): New property.
8462 (DefineNestedTypes): Create an emitcontext for each part.
8463 (MethodCore.DoDefineParameters): Use container's emitcontext.
8464 Pass type array to InternalParameters.
8465 (MemberBase.DoDefine): Use container's emitcontext.
8466 (FieldMember.Define): Likewise.
8467 (Event.Define): Likewise.
8468 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8469 Pass type array to InternalParameters.
8470 (SetIndexerMethod.GetParameterInfo): Likewise.
8471 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8472 * delegate.cs (Define): Pass emitcontext to
8473 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8474 array to InternalParameters.
8475 * expression.cs (ParameterReference.DoResolveBase): Pass
8476 emitcontext to GetParameterInfo.
8477 (ComposedCast.DoResolveAsTypeStep): Remove check on
8478 ec.ResolvingTypeTree.
8479 * parameter.cs (Parameter.Resolve): Change argument to
8480 EmitContext. Use ResolveAsTypeTerminal.
8481 (Parameter.GetSignature): Change argument to EmitContext.
8482 (Parameters.ComputeSignature): Likewise.
8483 (Parameters.ComputeParameterTypes): Likewise.
8484 (Parameters.GetParameterInfo): Likewise.
8485 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8486 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8487 * support.cs (InternalParameters..ctor): Remove variant that takes
8489 * typemanager.cs (system_intptr_expr): New.
8490 (InitExpressionTypes): Initialize it.
8492 2004-10-12 Chris Toshok <toshok@ximian.com>
8494 * cs-parser.jay: fix location for try_statement and catch_clause.
8496 2004-10-18 Martin Baulig <martin@ximian.com>
8498 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8499 `Type' directly, but call ResolveType() on it.
8500 (MemberBase.DoDefine): Likewise.
8502 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8503 `Type' directly, but call ResolveType() on it.
8504 (ComposedCast.DoResolveAsTypeStep): Likewise.
8506 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8507 `Type' directly, but call ResolveType() on it.
8509 2004-10-17 John Luke <john.luke@gmail.com>
8511 * class.cs (Operator.GetSignatureForError): use CSharpName
8513 * parameter.cs (Parameter.GetSignatureForError): Returns
8514 correct name even if was not defined.
8516 2004-10-13 Raja R Harinath <rharinath@novell.com>
8519 * class.cs (TypeContainer.EmitContext): New property.
8520 (DefineNestedTypes): Create an emitcontext for each part.
8521 (MethodCore.DoDefineParameters): Use container's emitcontext.
8522 Pass type array to InternalParameters.
8523 (MemberBase.DoDefine): Use container's emitcontext.
8524 (FieldMember.Define): Likewise.
8525 (Event.Define): Likewise.
8526 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8527 Pass type array to InternalParameters.
8528 (SetIndexerMethod.GetParameterInfo): Likewise.
8529 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8530 * delegate.cs (Define): Pass emitcontext to
8531 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8532 array to InternalParameters.
8533 * expression.cs (ParameterReference.DoResolveBase): Pass
8534 emitcontext to GetParameterInfo.
8535 (ComposedCast.DoResolveAsTypeStep): Remove check on
8536 ec.ResolvingTypeTree.
8537 * parameter.cs (Parameter.Resolve): Change argument to
8538 EmitContext. Use ResolveAsTypeTerminal.
8539 (Parameter.GetSignature): Change argument to EmitContext.
8540 (Parameters.ComputeSignature): Likewise.
8541 (Parameters.ComputeParameterTypes): Likewise.
8542 (Parameters.GetParameterInfo): Likewise.
8543 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8544 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8545 * support.cs (InternalParameters..ctor): Remove variant that takes
8547 * typemanager.cs (system_intptr_expr): New.
8548 (InitExpressionTypes): Initialize it.
8550 2004-10-12 Chris Toshok <toshok@ximian.com>
8552 * cs-parser.jay: fix location for try_statement and catch_clause.
8554 2004-10-07 Raja R Harinath <rharinath@novell.com>
8556 More DeclSpace.ResolveType avoidance.
8557 * decl.cs (MemberCore.InUnsafe): New property.
8558 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
8559 with newly created EmitContext.
8560 (FieldMember.Define): Likewise.
8561 * delegate.cs (Delegate.Define): Likewise.
8562 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8563 only if normal name-lookup fails.
8564 (TypeExpr.DoResolve): Enable error-checking.
8565 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8566 (SizeOf.DoResolve): Likewise.
8567 (ComposedCast.DoResolveAsTypeStep): Likewise.
8568 (StackAlloc.DoResolve): Likewise.
8569 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8570 (Block.Unsafe): New property.
8571 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8572 (Unsafe): Set 'unsafe' flag of contained block.
8573 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8574 (Fixed.Resolve): Likewise.
8575 (Catch.Resolve): Likewise.
8576 (Using.ResolveLocalVariableDecls): Likewise.
8577 (Foreach.Resolve): Likewise.
8579 2004-10-05 John Luke <john.luke@gmail.com>
8581 * cs-parser.jay: add location to error CS0175
8583 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8585 * ecore.cs (Expression.Constantity): Add support for turning null
8588 * const.cs (Const.Define): Allow constants to be reference types
8589 as long as the value is Null.
8591 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8593 * namespace.cs (NamespaceEntry.Using): No matter which warning
8594 level is set, check if this namespace name has already been added.
8596 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8598 * expression.cs: reftype [!=]= null should always use br[true,false].
8601 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8604 * attribute.cs: Enum conversion moved to
8605 GetAttributeArgumentExpression to be applied to the all
8608 2004-10-01 Raja R Harinath <rharinath@novell.com>
8610 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8611 * class.c (TypeContainer.DefineType): Flag error if
8612 base types aren't accessible due to access permissions.
8613 * decl.cs (DeclSpace.ResolveType): Move logic to
8614 Expression.ResolveAsTypeTerminal.
8615 (DeclSpace.ResolveTypeExpr): Thin layer over
8616 Expression.ResolveAsTypeTerminal.
8617 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8618 Refactor code into NestedAccess. Use it.
8619 (DeclSpace.NestedAccess): New.
8620 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8621 argument to silence errors. Check access permissions.
8622 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8623 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8624 (Cast.DoResolve): Likewise.
8625 (New.DoResolve): Likewise.
8626 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8627 (TypeOf.DoResolve): Likewise.
8629 * expression.cs (Invocation.BetterConversion): Return the Type of
8630 the better conversion. Implement section 14.4.2.3 more faithfully.
8631 (Invocation.BetterFunction): Make boolean. Make correspondence to
8632 section 14.4.2.2 explicit.
8633 (Invocation.OverloadResolve): Update.
8634 (Invocation): Remove is_base field.
8635 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8636 (Invocation.Emit): Likewise.
8638 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8640 * cs-parser.jay: Reverted 642 warning fix.
8642 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8645 * decl.cs (FindMemberWithSameName): Indexer can have more than
8648 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8650 * expression.cs (LocalVariableReference.DoResolveLValue):
8651 Do not report warning 219 for out values.
8652 (EmptyExpression.Null): New member to avoid extra allocations.
8654 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8656 * cs-parser.jay: Fix wrong warning 642 report.
8658 * cs-tokenizer.cs (CheckNextToken): New helper;
8659 Inspect next character if is same as expected.
8661 2004-09-23 Martin Baulig <martin@ximian.com>
8663 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8664 (Convert.ImplicitReferenceConversionExists): Likewise.
8666 2004-11-09 Raja R Harinath <rharinath@novell.com>
8668 * Makefile (DISTFILES): Comment out a few missing files.
8670 2004-10-29 Raja R Harinath <rharinath@novell.com>
8672 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8673 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
8674 (gmcs.exe): Invoke bootstrap-libs.
8675 (clean-local): Clean the net_2_0_bootstrap profile too.
8676 (PROGRAM_INSTALL_DIR): New.
8677 (install-local): Use it.
8679 2004-10-13 Martin Baulig <martin@ximian.com>
8681 * generic.cs (TypeManager.InflatedConstraints): New nested class.
8682 (TypeParameter.DefineType): If we're a method type parameter and
8683 that method is overriding something, "inflate" its constraints.
8685 2004-10-12 Martin Baulig <martin@ximian.com>
8687 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8688 and have type arguments, create and resolve a ConstructedType.
8690 2004-10-12 Martin Baulig <martin@ximian.com>
8692 * decl.cs (MemberCache.FindMemberToOverride): Use
8693 TypeManager.IsEqual() to compare the parameters and Type.Equals()
8694 to compare the invocationType.
8696 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8697 When comparing two type parameters, only do the signature-only
8698 comparision for method type parameters.
8700 2004-10-11 Martin Baulig <martin@ximian.com>
8702 * report.cs: Don't make --fatal abort on warnings, we have
8703 -warnaserror for that.
8705 2004-10-11 Martin Baulig <martin@ximian.com>
8708 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8709 (TypeManager.IsEqual): Call ourself recursively instead of using
8712 2004-10-11 Martin Baulig <martin@ximian.com>
8714 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8715 on our own type parameters, not on the ones we inherit from a containing
8718 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8721 * generic.cs (TypeParameter.Define): We may only be called once.
8723 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8724 instead of TypeManager.IsEqual().
8726 2004-09-28 Martin Baulig <martin@ximian.com>
8729 (GenericConstraints.EffectiveBaseClass): New public property.
8730 (TypeParameter.GenericConstraints): New public property.
8731 (ConstructedType.CheckConstraints): Improved.
8733 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8734 (Convert.TypeParameterConversion): New private method; use this in
8735 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8736 for all conversions related to type parameters.
8738 2004-09-24 Martin Baulig <martin@ximian.com>
8740 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8741 type parameter conversions for type parameters which are known to
8744 2004-09-24 Martin Baulig <martin@ximian.com>
8746 * generic.cs (GenericConstraints): Added `IsReferenceType' and
8747 `IsValueType' properties.
8749 * support.cs (ReflectionConstraints): Use
8750 Type.GetGenericParameterConstraints() instead of the old hack.
8752 2004-09-24 Martin Baulig <martin@ximian.com>
8754 * generic.cs (GenericConstraints): Moved here and made it an
8757 * support.cs (GenericConstraints): Moved to generic.cs.
8759 2004-09-24 Martin Baulig <martin@ximian.com>
8762 (ReflectionConstraints): Un-nested this class and made it public.
8765 (TypeManager.GetTypeParameterConstraints): New public method.
8766 (TypeManager.HasConstructorConstraint): Use the attributes.
8768 2004-09-24 Martin Baulig <martin@ximian.com>
8770 * support.cs (GenericConstraints): Replaced `HasConstructor',
8771 `IsReferenceType' and `IsValueType' with `Attributes'.
8772 (ReflectionParameters.ReflectionConstraints): Removed the Create()
8773 method and made the .ctor public.
8775 * generic.cs (Constraints.Attributes): New public property.
8776 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8777 `IsReferenceType' -> `HasReferenceTypeConstraint' and
8778 `IsValueType' -> `HasValueTypeConstraint'.
8780 2004-09-23 Martin Baulig <martin@ximian.com>
8782 * generic.cs (Constraints): Reflect latest runtime changes.
8784 2004-09-23 Martin Baulig <martin@ximian.com>
8786 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8787 (Convert.ImplicitReferenceConversionExists): Likewise.
8789 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8791 * class.cs (Operator.Define): Add error 448 and 559 report.
8793 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8795 * class.cs (MemberBase.IsTypePermitted): New protected
8796 method for checking error CS0610.
8798 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8800 * class.cs (TypeContainer.HasExplicitLayout): New property
8801 Returns whether container has StructLayout attribute set Explicit.
8802 (FieldMember): New abstract class for consts and fields.
8803 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8804 (Field): Reuse FieldMember.
8806 * const.cs (Const): Reuse FieldMember.
8808 * rootcontext.cs: EmitConstants call moved to class.
8810 2004-09-22 Martin Baulig <martin@ximian.com>
8812 Marek and me just fixed one of our oldest bugs: #28562 :-)
8814 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8816 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8817 we're an EnumConstant, just return that.
8818 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8819 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8820 to get the value which'll actually be written into the attribute.
8821 However, we have to use GetValue() to access the attribute's value
8824 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8826 * constant.cs (Constant.IsNegative): New abstract property
8829 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8830 (StackAlloc.DoResolve): Reused IsNegative.
8832 2004-09-22 Martin Baulig <martin@ximian.com>
8834 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8835 public method; like LookupTypeContainer, but also works for
8838 * report.cs (Report.SymbolRelatedToPreviousError): Use
8839 TypeManager.LookupGenericTypeContainer().
8841 2004-09-22 Martin Baulig <martin@ximian.com>
8843 Thanks to Peter Sestoft for this bug report.
8845 * expression.cs (Conditional): If both the `trueExpr' and the
8846 `falseExpr' is a NullLiteral, return a NullLiteral.
8848 2004-09-22 Martin Baulig <martin@ximian.com>
8850 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8851 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8852 for the "get_Current" call.
8854 2004-09-21 Martin Baulig <martin@ximian.com>
8856 * convert.cs (Convert.ImplicitReferenceConversion): When
8857 converting to an interface type, first check whether we're
8858 converting from a reference type.
8860 2004-09-14 Martin Baulig <martin@ximian.com>
8862 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8864 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8867 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8868 called and is obsolete then this member suppress message
8869 when call is inside next [Obsolete] method or type.
8871 * expression.cs: Use TestObsoleteMethodUsage member.
8873 2004-09-14 Martin Baulig <martin@ximian.com>
8875 * genericparser.cs: Removed.
8877 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8879 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8881 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8883 * attribute.cs (Attribute.Resolve): Add error 653 report.
8885 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8887 (Method.ApplyAttributeBuilder): Add error 685 report.
8888 (Operator.Define): Add error 564 report.
8890 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8892 * expression.cs (Invocation.DoResolve): Add error
8895 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8898 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8900 * class.cs (ConstructorInitializer.Resolve):
8901 Wrong error number (515->516).
8903 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8905 * class.cs (Indexer.Define): Add error 631 report.
8907 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8909 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8911 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8913 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8915 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8917 * cs-parser.jay: Added error CS0241 report.
8919 2004-09-10 Raja R Harinath <rharinath@novell.com>
8921 * cs-parser.jay (fixed_statement): Introduce a scope for the
8922 declaration in the 'fixed' statement.
8924 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8926 * cs-parser.jay: Added CS0230 error report.
8928 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8930 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8932 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8934 * expression.cs (Argument.Resolve): Added error CS0192 and
8937 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8939 C# 2.0 #pragma warning feature
8941 * cs-tokenizer.cs (PreProcessPragma): New method;
8942 Handles #pragma directive.
8944 * report.cs (WarningRegions): New class; Support
8945 class for #pragma warning directive. It tests whether
8946 warning is enabled for a given line.
8948 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8950 * const.cs: Add more descriptive error report, tahnks to
8953 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8955 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8957 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8959 * expression.cs: Apply patch from Ben: Remove dead code from
8960 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8961 as that code just threw an exception anwyays.
8963 * const.cs: Remove the call to the turnintoconstant, for details
8966 * literal.cs: The type of the null-literal is the null type; So
8967 we use a placeholder type (literal.cs:System.Null, defined here)
8970 * expression.cs (Conditional.DoResolve): Remove some old code that
8971 is no longer needed, conversions have been fixed.
8973 (ArrayCreationExpression.DoResolve): Return false if we fail to
8974 resolve the inner expression.
8976 2004-09-07 Raja R Harinath <rharinath@novell.com>
8979 * cs-parser.jay (delegate_declaration): Record a delegate
8980 declaration as a type declaration.
8981 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8983 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8985 * parameter.cs: Do not crash if the type can not be resolved.
8987 * expression.cs: Report errors with unsafe pointers, fixes #64896
8989 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8991 * expression.cs: Pointer arith always needs to do a conv.i
8992 if the operand is a long. fix 65320
8994 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8996 Fixed cs0619-37.cs, cs0619-38.cs
8998 * enum.cs (GetObsoleteAttribute): Removed.
9000 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9001 on Enum member is double staged. The first is tested member
9004 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9006 Fixed #56986, #63631, #65231
9008 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9009 adds member to name container.
9010 (TypeContainer.AddToTypeContainer): New method, adds type to
9012 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9013 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9014 AddOperator): Simplified by reusing AddToMemberContainer.
9015 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9017 (Method.CheckForDuplications): Fixed implementation to test all
9019 (MemberBase): Detection whether member is explicit interface
9020 implementation is now in constructor.
9021 (MemberBase.UpdateMemberName): Handles IndexerName.
9022 (Accessor): Changed to keep also location information.
9023 (AbstractPropertyEventMethod): Is derived from MemberCore.
9024 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9025 will be emited or not.
9026 (PropertyBase.AreAccessorsDuplicateImplementation):
9027 Tests whether accessors are not in collision with some method.
9028 (Operator): Is derived from MethodCore to simplify common
9031 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9033 (DeclSpace.AddToContainer): Adds the member to defined_names
9034 table. It tests for duplications and enclosing name conflicts.
9036 * enum.cs (EnumMember): Clean up to reuse the base structures
9038 2004-09-03 Martin Baulig <martin@ximian.com>
9040 Merged latest changes into gmcs. Please keep this comment in
9041 here, it makes it easier for me to see what changed in MCS since
9042 the last time I merged.
9044 2004-09-03 Martin Baulig <martin@ximian.com>
9046 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9047 into TypeContainer, to make partial classes work again.
9049 2004-09-03 Martin Baulig <martin@ximian.com>
9051 * rootcontext.cs (RootContext.V2): Removed.
9053 2004-03-23 Martin Baulig <martin@ximian.com>
9055 * expression.cs (Invocation.OverloadResolve): Added `bool
9056 may_fail' argument and use it instead of the Location.IsNull() hack.
9058 2004-09-09 Martin Baulig <martin@ximian.com>
9060 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9062 2004-09-09 Martin Baulig <martin@ximian.com>
9064 * generic.cs (TypeParameter.DefineType): Added support for
9065 explicit interface methods.
9067 2004-09-09 Martin Baulig <martin@ximian.com>
9069 * README.Changes: New document. Started to list important changes
9070 between MCS and GMCS here.
9072 2004-09-08 Martin Baulig <martin@ximian.com>
9075 (TypeContainer.CheckRecursiveDefinition): New protected method.
9076 (TypeContainer.DefineType): Move the CS0146 check into
9077 CheckRecursiveDefinition().
9079 2004-09-06 Martin Baulig <martin@ximian.com>
9081 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9082 types for the constructor constraint.
9084 2004-09-03 Martin Baulig <martin@ximian.com>
9086 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9087 into TypeContainer, to make partial classes work again.
9089 2004-09-03 Martin Baulig <martin@ximian.com>
9091 * rootcontext.cs (RootContext.V2): Removed.
9093 2004-03-23 Martin Baulig <martin@ximian.com>
9095 * expression.cs (Invocation.OverloadResolve): Added `bool
9096 may_fail' argument and use it instead of the Location.IsNull() hack.
9098 2004-09-03 Martin Baulig <martin@ximian.com>
9100 Merged latest changes into gmcs. Please keep this comment in
9101 here, it makes it easier for me to see what changed in MCS since
9102 the last time I merged.
9104 2004-09-03 Raja R Harinath <rharinath@novell.com>
9107 * expression.cs (BetterConversion): Don't allow either conversion
9108 to be null. Remove redundant implicit conversion test when 'q ==
9109 null' -- when this function is invoked, we already know that the
9110 implicit conversion exists.
9111 (BetterFunction): Assume that 'best' is non-null. Remove
9112 redundant reimplementation of IsApplicable when 'best' is null.
9113 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9114 number of arguments.
9115 (IsAncestralType): Extract from OverloadResolve.
9116 (OverloadResolve): Make robust to the MethodGroupExpr being
9117 unsorted. Implement all the logic of Section 14.5.5.1, and
9118 support overloading of methods from multiple applicable types.
9119 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9121 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9122 (RealError, Warning): Append type of report to related symbol.
9124 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9126 * enum.cs: Fixed CLS-Compliance checks for enum members.
9127 Error tests cs3008-8.cs, cs3014-8.cs
9129 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9131 Fixed bug #62342, #63102
9132 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9133 like ImplementMethod.
9135 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9137 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9140 2004-09-02 Martin Baulig <martin@ximian.com>
9142 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9143 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9146 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9148 C# 2.0 Static classes implemented
9150 * class.cs (TypeContainer): instance_constructors,
9151 initialized_fields, initialized_static_fields,
9152 default_constructor, base_inteface_types are protected to be
9153 accessible from StaticClass.
9154 (TypeContainer.DefineDefaultConstructor): New virtual method
9155 for custom default constructor generating
9156 (StaticClass): New class to handle "Static classes" feature.
9158 * cs-parser.jay: Handle static keyword on class like instance
9161 * driver.cs: Added "/langversion" command line switch with two
9162 options (iso-1, default).
9164 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9166 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9168 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9170 * delegate.cs: Style.
9172 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9174 * delegate.cs: Add seperate instance expr field for miguel.
9176 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9178 * PointerArithmetic (Resolve): make sure we are not doing
9179 pointer arith on void*. Also, make sure we are resolved
9180 by not setting eclass until resolve.
9182 All callers: Make sure that PointerArithmetic gets resolved.
9184 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9186 * ArrayCreation (LookupType): If the type does not resolve
9187 to an array, give an error.
9189 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9191 * statement.cs (Try.Resolve): Fixed bug #64222
9193 2004-08-27 Martin Baulig <martin@ximian.com>
9196 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9199 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9201 * ecore.cs (Constantify): Get underlying type via
9202 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9203 Windows in special cases.
9205 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9207 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9208 for obtaining also private methods.
9209 (GetRemoveMethod): Used GetRemoveMethod (true)
9210 for obtaining also private methods.
9212 2004-09-02 Martin Baulig <martin@ximian.com>
9214 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9215 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9218 2004-08-27 Martin Baulig <martin@ximian.com>
9221 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9224 2004-08-25 Martin Baulig <martin@ximian.com>
9226 * support.cs (ReflectionParameters..ctor): If this is a generic
9227 method, retrieve and store its type parameters.
9228 (InternalParameters..ctor): Added `TypeParameter[]' argument.
9229 (ReflectionParameters.GenericConstraints): The argument specifies
9230 the type parameter, not the method parameter.
9231 (InternalParameters.GenericConstraints): Likewise.
9233 * generic.cs (TypeParameter.DefineType): Correctly handle
9234 constraints wrt. generic methods in interfaces and their
9237 2004-08-24 Martin Baulig <martin@ximian.com>
9239 * generic.cs (TypeParameter.IsSubclassOf): New public method.
9240 (Constraints.IsSubclassOf): New internal method.
9242 * typemanager.cs (TypeManager.FindMembers): Added special support
9243 for GenericTypeParameterBuilder's.
9244 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9247 2004-08-24 Martin Baulig <martin@ximian.com>
9250 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9251 this for accessibility checks.
9252 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9253 IsNestedFamilyAccessible.
9254 (TypeManager.IsSubclassOf): New method, do what the name actually
9257 2004-08-24 Martin Baulig <martin@ximian.com>
9259 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9260 as a SimpleName, include the generic arity.
9262 2004-08-24 Martin Baulig <martin@ximian.com>
9264 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9265 MethodAttributes.HideBySig for operators.
9267 2004-08-23 Martin Baulig <martin@ximian.com>
9269 Back to the old error reporting system :-)
9271 * report.cs (Message): Removed.
9272 (Report.MessageData, ErrorData, WarningData): Removed.
9273 (Report.Error, Warning): Back to the old system.
9275 2004-08-23 Martin Baulig <martin@ximian.com>
9277 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9279 * class.cs (TypeContainer.ParentContainer): New public virtual
9280 method; replaces the explicit interface implementation.
9281 (ClassPart.ParentContainer): Override.
9283 2004-08-23 Martin Baulig <martin@ximian.com>
9285 * statement.cs (Switch): Added support for constant switches; see
9286 #59428 or test-285.cs.
9288 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9291 * statement.cs (GetEnumeratorFilter): Removed useless
9292 logic because C# specs is strict. GetEnumerator must be
9295 2004-08-22 Martin Baulig <martin@ximian.com>
9297 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9298 a switch and may break, reset the barrier. Fixes #59867.
9300 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9302 CLS-Compliance speed up (~5% for corlib)
9304 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9305 New method. Tests container for CLS-Compliant names
9307 * class.cs (TypeContainer.VerifyClsName): New method.
9308 Checks whether container name is CLS Compliant.
9309 (Constructor): Implements IMethodData.
9311 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9312 low-case table for CLS Compliance test.
9313 (MemberCache.VerifyClsParameterConflict): New method.
9314 Checks method parameters for CS3006 error.
9316 * enum.cs (EnumMember): Is derived from MemberCore.
9317 (Enum.VerifyClsName): Optimized for better performance.
9319 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9321 * report.cs: Renamed Error_T to Error and changed all
9324 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9326 * class.cs (TypeContainer.IndexerArrayList): New inner class
9327 container for indexers.
9328 (TypeContainer.DefaultIndexerName): New constant for default
9329 indexer name. Replaced all "Item" with this constant.
9330 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9332 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9333 DefaultMemberAttribute constructor.
9335 2004-08-05 Martin Baulig <martin@ximian.com>
9337 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9340 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9342 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9343 multi platforms problem.
9345 * compiler.csproj: Included shared files.
9347 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9349 Fix bug 60333, 55971 in the more general way
9350 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9351 Added arg_type argument for constant conversion.
9352 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9354 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9357 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9358 OperatorArrayList, MethodCoreArrayList for typecontainer
9359 containers. Changed class member types to these new types.
9360 (MethodArrayList.DefineMembers): Added test for CS0659.
9362 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9364 * cfold.cs: Synchronize the folding with the code in expression.cs
9365 Binary.DoNumericPromotions for uint operands.
9367 * attribute.cs: Revert patch from Raja, it introduced a regression
9368 while building Blam-1.2.1 (hard to isolate a test case).
9370 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9374 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9376 (MethodCore.parent_method): New member. The method we're overriding
9377 if this is an override method.
9378 (MethodCore.CheckBase): Moved from Method class and made common.
9379 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9381 (MethodCore.CheckForDuplications): New abstract method. For custom
9382 member duplication search in a container
9383 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9384 method and its return type.
9385 (Event.conflict_symbol): New member. Symbol with same name in the
9389 (MemberCache.FindMemberWithSameName): New method. The method
9390 is looking for conflict with inherited symbols.
9392 2004-08-04 Martin Baulig <martin@ximian.com>
9394 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9396 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9398 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9400 * report.cs (Message): New enum for better error, warning reference in
9402 (MessageData): New inner abstract class. It generally handles printing of
9403 error and warning messages.
9404 Removed unused Error, Warning, Message methods.
9406 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9408 Fix for cs0592-8.cs test
9410 (Attributable.ValidAttributeTargets): Made public.
9411 (Attribute.ExplicitTarget): New member for explicit target value.
9412 (Attribute.CheckTargets): Now we translate explicit attribute
9413 target to Target here.
9415 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9417 * ecore.cs (MethodGroupExpr): new IsBase property.
9419 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9421 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9422 rather than an instance expr.
9424 (DelegateCreation.Emit): Use the method group rather than
9425 the instance expression. Also, if you have base.Foo as the
9426 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9428 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9430 (NewDelegate.DoResolve): Only check for the existance of Invoke
9431 if the method is going to be needed. Use MethodGroupExpr.
9433 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9435 * expression.cs: For pointer arith., make sure to use
9436 the size of the type, not the size of the pointer to
9439 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9442 * class.cs (Class): Added error CS0502 test.
9444 2004-08-03 John Luke <jluke@cfl.rr.com>
9445 Raja R Harinath <rharinath@novell.com>
9448 * attribute.cs (Attribute.complained_before): New flag.
9449 (Attribute.ResolveType, Attribute.Resolve),
9450 (Attribute.DefinePInvokeMethod): Set it.
9451 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9453 2004-08-03 Martin Baulig <martin@ximian.com>
9455 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9456 use a user-defined operator; we still need to do numeric
9457 promotions in case one argument is a builtin type and the other
9458 one has an implicit conversion to that type. Fixes #62322.
9460 2004-08-18 Martin Baulig <martin@ximian.com>
9462 * class.cs (Method.Define): Use the correct method name when
9463 creating the MethodBuilder for a generic method.
9465 2004-08-17 Martin Baulig <martin@ximian.com>
9467 * generic.cs (Constraints): Support type parameter constraints.
9469 2004-08-16 Martin Baulig <martin@ximian.com>
9471 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9472 (Token.GENERIC_DIMENSION): New token; this is returned if we
9473 encounter an unbound generic type in a typeof() expression.
9475 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9476 this token is only generated while parsing a typeof() expression.
9477 (typeof_expression): Removed the old unbound_type hack.
9479 * generic.cs (TypeArguments.IsUnbound): New public property.
9481 * decl.cs (MemberName): Added support for unbound types.
9483 2004-08-14 Martin Baulig <martin@ximian.com>
9486 (TypeManager.IsEqualGenericInstance): New static method.
9487 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9488 just used to check accessibility, so follow the rules of 26.1.6.
9490 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9491 ConstructedType instead of a TypeExpression if we have type arguments.
9493 * cs-parser.jay (typeof_expression): Support unbound generic types.
9495 * ecore.cs (UnboundTypeExpression): New public class.
9497 2004-08-12 Martin Baulig <martin@ximian.com>
9499 * typemanager.cs (TypeManager.IsNestedChildOf): Use
9500 TypeManager.IsEqual() rather than `=='.
9502 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9503 generic instances as well.
9505 2004-08-12 Martin Baulig <martin@ximian.com>
9507 * expression.cs (Invocation.InferType): We can only infer method
9508 type parameters. Fixes #62647.
9510 2004-08-11 Martin Baulig <martin@ximian.com>
9512 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9513 before resolving the base classes.
9515 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9517 * Makefile: install .mdb file too.
9519 2004-08-05 Martin Baulig <martin@ximian.com>
9521 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9522 initializer, the current type is just the TypeBuilder, not the
9523 instantiated generic type.
9524 (FieldExpr.IsFieldInitializer): New public property.
9526 2004-08-04 Martin Baulig <martin@ximian.com>
9528 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9530 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9532 2004-08-03 Martin Baulig <martin@ximian.com>
9534 * class.cs (MethodData.Define): If we're an explicit
9535 implementation, remove the generic arity from the type name.
9537 2004-08-03 Martin Baulig <martin@ximian.com>
9539 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9540 use a user-defined operator; we still need to do numeric
9541 promotions in case one argument is a builtin type and the other
9542 one has an implicit conversion to that type. Fixes #62322.
9544 2004-08-02 Martin Baulig <martin@ximian.com>
9546 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9548 (TypeContainer.GetClassBases): Return the unexpanded list of
9549 interfaces; we expand them later.
9550 (TypeContainer.DefineType): After creating the TypeBuilder, call
9551 TypeManager.ExpandInterfaces() to get an expanded and resolved
9554 * ecore.cs (TypeExpr.GetInterfaces): Removed
9556 * generics.cs (Constraints.InterfaceConstraints): Remove.
9557 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
9558 register the interface constraints.
9561 (TypeManager.AddUserType): Removed the `ifaces' argument.
9562 (TypeManager.AddTypeParameter): Likewise.
9563 (TypeManager.AddUserInterface): Removed, was unused.
9564 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
9565 `TypeExpr[]' array for the interfaces.
9566 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
9567 has been defined, returns a list of the resolved interfaces types.
9568 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
9569 (TypeManager.GetExplicitInterfaces): Likewise.
9571 2004-08-02 Martin Baulig <martin@ximian.com>
9573 * expression.cs (Invocation.EmitCall): If we're invoking a method
9574 on a type parameter, use the new `Constrained' prefix opcode.
9576 2004-08-02 Martin Baulig <martin@ximian.com>
9578 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9579 (LocalInfo.IsThis): New public property.
9580 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9582 2004-08-01 Martin Baulig <martin@ximian.com>
9584 * class.cs (TypeContainer.GetClassBases): Don't set the default
9585 here since we may get called from GetPartialBases().
9586 (TypeContainer.DefineType): If GetClassBases() didn't return a
9587 parent, use the default one.
9589 2004-07-30 Martin Baulig <martin@ximian.com>
9591 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9593 * class.cs (SourceMethod): New public class, derive from the
9594 symbol writer's ISourceMethod.
9595 (Method): Use the new symbol writer API.
9597 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9598 as argument and use the new symbol writer.
9601 (SourceFile): Implement the symbol writer's ISourceFile.
9602 (Location.SymbolDocument): Removed.
9603 (Location.SourceFile): New public property.
9605 * symbolwriter.cs: Use the new symbol writer API.
9607 2004-07-30 Raja R Harinath <rharinath@novell.com>
9609 * Makefile (install-local): Remove. Functionality moved to
9612 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9614 * Makefile: Install mcs.exe.config file together with mcs.exe.
9615 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9616 correct runtime version.
9618 2004-07-25 Martin Baulig <martin@ximian.com>
9621 (TypeContainer.RegisterOrder): Removed, this was unused.
9622 (TypeContainer, interface_order): Removed.
9623 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9624 TypeContainer as argument since we can also be called with a
9625 `PartialContainer' for a partial class/struct/interface.
9626 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9627 of checking whether we're an `Interface' - we could be a
9629 (PartialContainer.Register): Override; call
9630 AddClass()/AddStruct()/AddInterface() on our parent.
9632 * cs-parser.jay (interface_member_declaration): Add things to the
9633 `current_container', not the `current_class'.
9635 * rootcontext.cs (RegisterOrder): The overloaded version which
9636 takes an `Interface' was unused, removed.
9638 * typemanager.cs (TypeManager.LookupInterface): Return a
9639 `TypeContainer', not an `Interface'.
9640 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9641 contain a `PartialContainer' for an interface, so check it's
9642 `Kind' to figure out what it is.
9644 2004-07-25 Martin Baulig <martin@ximian.com>
9646 * class.cs (Class.DefaultTypeAttributes): New public constant.
9647 (Struct.DefaultTypeAttributes): Likewise.
9648 (Interface.DefaultTypeAttributes): Likewise.
9649 (PartialContainer.TypeAttr): Override this and add the
9650 DefaultTypeAttributes.
9652 2004-07-25 Martin Baulig <martin@ximian.com>
9654 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9655 we can just use the `Parent' field instead.
9657 2004-07-25 Martin Baulig <martin@ximian.com>
9659 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9661 2004-07-25 Martin Baulig <martin@ximian.com>
9663 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9664 our parts before defining any methods.
9665 (TypeContainer.VerifyImplements): Make this virtual.
9666 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9667 on our PartialContainer.
9669 2004-07-25 Martin Baulig <martin@ximian.com>
9671 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9673 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9674 argument, we can just use the `Parent' field instead.
9677 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9678 (MemberBase.DoDefine): Likewise.
9680 2004-07-24 Martin Baulig <martin@ximian.com>
9682 * decl.cs (MemberCore.Parent): New public field.
9683 (DeclSpace.Parent): Moved to MemberCore.
9685 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9686 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9688 (FieldBase, Field, Operator): Likewise.
9689 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9690 (EventField, Event): Likewise.
9692 2004-07-23 Martin Baulig <martin@ximian.com>
9694 * class.cs (PartialContainer): New public class.
9695 (ClassPart): New public class.
9696 (TypeContainer): Added support for partial classes.
9697 (TypeContainer.GetClassBases): Splitted some of the functionality
9698 out into GetNormalBases() and GetPartialBases().
9700 * cs-tokenizer.cs (Token.PARTIAL): New token.
9701 (Tokenizer.consume_identifier): Added some hacks to recognize
9702 `partial', but only if it's immediately followed by `class',
9703 `struct' or `interface'.
9705 * cs-parser.jay: Added support for partial clases.
9707 2004-07-23 Martin Baulig <martin@ximian.com>
9709 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9710 a `DeclSpace' and also made it readonly.
9711 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9712 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9713 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9715 * cs-parser.jay: Pass the `current_class', not the
9716 `current_container' (at the moment, this is still the same thing)
9717 to a new Method, Property, Event, Indexer or Constructor.
9719 2004-07-23 Martin Baulig <martin@ximian.com>
9721 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9722 and removed the `current_interface' one.
9723 (struct_declaration, class_declaration, interface_declaration):
9724 Set `current_class' to the newly created class/struct/interface;
9725 set their `Bases' and call Register() before parsing their body.
9727 2004-07-23 Martin Baulig <martin@ximian.com>
9729 * class.cs (Kind): New public enum.
9730 (TypeContainer): Made this class abstract.
9731 (TypeContainer.Kind): New public readonly field.
9732 (TypeContainer.CheckDef): New public method; moved here from
9734 (TypeContainer.Register): New public abstract method.
9735 (TypeContainer.GetPendingImplementations): New public abstract
9737 (TypeContainer.GetClassBases): Removed the `is_class' and
9738 `is_iface' parameters.
9739 (TypeContainer.DefineNestedTypes): Formerly known as
9741 (ClassOrStruct): Made this class abstract.
9743 * tree.cs (RootTypes): New public type.
9745 2004-07-20 Martin Baulig <martin@ximian.com>
9747 * tree.cs (Tree.RecordNamespace): Removed.
9748 (Tree.Namespaces): Removed.
9750 * rootcontext.cs (RootContext.IsNamespace): Removed.
9752 * cs-parser.jay (namespace_declaration): Just create a new
9753 NamespaceEntry here.
9755 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
9757 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9758 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9759 entry to make sure it runs in the correct runtime version.
9761 2004-07-18 Martin Baulig <martin@ximian.com>
9763 * generic.cs (ConstructedType.CheckConstraints): Improved
9764 constraints checking.
9766 2004-07-18 Martin Baulig <martin@ximian.com>
9768 * expression.cs (Invocation.BetterMethod): Call
9769 TypeManager.TypeToCoreType() on all types and removed my previous
9770 hack; we're already doig the right thing here.
9772 2004-07-17 Martin Baulig <martin@ximian.com>
9774 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9776 2004-07-16 Martin Baulig <martin@ximian.com>
9778 * iterators.cs: Added generics support.
9780 2004-07-16 Martin Baulig <martin@ximian.com>
9782 * iterators.cs: Rewrote this. We're now using one single Proxy
9783 class for both the IEnumerable and the IEnumerator interface and
9784 `Iterator' derives from Class so we can use the high-level API.
9786 * class.cs (TypeContainer.AddIterator): New method.
9787 (TypeContainer.DoDefineType): New protected virtual method, which
9788 is called from DefineType().
9789 (TypeContainer.DoDefineMembers): Call DefineType() and
9790 DefineMembers() on all our iterators.
9791 (TypeContainer.Emit): Call Emit() on all our iterators.
9792 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9794 * codegen.cs (EmitContext.CurrentIterator): New public field.
9796 2004-07-15 Martin Baulig <martin@ximian.com>
9799 (TypeManager.not_supported_exception_type): New type.
9801 2004-07-14 Martin Baulig <martin@ximian.com>
9804 (TypeManager.generic_ienumerable_type): New type.
9805 (TypeManager.generic_ienumerator_type): New type.
9808 (RootContext.interfaces_first_stage): Added
9809 "System.Collections.Generic.IEnumerator`1" and
9810 "System.Collections.Generic.IEnumerable`1".
9812 2004-07-14 Martin Baulig <martin@ximian.com>
9814 * iterators.cs: Use real error numbers.
9816 2004-07-14 Martin Baulig <martin@ximian.com>
9818 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9819 requires this to be a System.Collection.IEnumerable and not a
9820 class implementing that interface.
9821 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9823 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9825 * class.cs: Fixed previous fix, it broke some error tests.
9827 2004-07-12 Martin Baulig <martin@ximian.com>
9829 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9832 2004-07-14 Martin Baulig <martin@ximian.com>
9834 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9835 an exclamation mark (!) for the generic arity to reflect the
9836 latest spec changes; ie. use "System.Collections.Generic.IList`1".
9838 2004-07-13 Martin Baulig <martin@ximian.com>
9840 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9841 specifiers being part of a type argument.
9843 2004-07-13 Martin Baulig <martin@ximian.com>
9845 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9846 name for generic types.
9848 2004-07-13 Martin Baulig <martin@ximian.com>
9850 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9853 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9855 * assign.cs (LocalTemporary): Add new argument: is_address,If
9856 `is_address' is true, then the value that we store is the address
9857 to the real value, and not the value itself.
9859 * ecore.cs (PropertyExpr): use the new local temporary
9860 stuff to allow us to handle X.Y += z (where X is a struct)
9862 2004-07-08 Martin Baulig <martin@ximian.com>
9864 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9865 not always return, just like we're doing in Using.Resolve().
9867 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9869 * cs-parser.jay (fixed_statement): flag this as Pinned.
9871 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9873 * typemanager.cs (TypeManager): Removed MakePinned method, this
9874 mechanism is replaced with the .NET 2.x compatible mechanism of
9875 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9877 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9878 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9879 `IsFixed' property which has a different meaning.
9881 2004-07-02 Raja R Harinath <rharinath@novell.com>
9883 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9884 visible from inside a nested class, not just the names of the
9885 immediately enclosing class.
9888 2004-06-24 Raja R Harinath <rharinath@novell.com>
9890 * expression.cs (BetterConversion): Remove buggy special-case
9891 handling of "implicit constant expression conversions". At this
9892 point, we already know that the conversion is possible -- we're
9893 only checking to see which is better.
9895 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9897 * cs-parser.jay: Added error CS0210 test.
9899 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9901 * cs-parser.jay: Added error CS0134 test.
9903 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9906 * cs-parser.jay: Added error CS0145 test.
9908 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9910 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9912 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9914 * expression.cs (StackAlloc.Resolve): The argument may not
9915 be a constant; deal with this case.
9917 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9919 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9920 GetIndexerAttributeValue.
9921 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9923 * class.cs (Indexer.Define): Added error tests for CS0415,
9926 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9928 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9931 2004-06-23 Martin Baulig <martin@ximian.com>
9933 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9934 neither return nor throw, reset the barrier as well. Fixes #60457.
9936 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9938 * class.cs : EventAttributes is now set to None by default.
9939 This fixes bug #60459.
9941 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9944 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9945 Don't throw exception but return null (it's sufficient now).
9947 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9949 * typemanager.cs (GetArgumentTypes): Faster implementation.
9951 2004-06-18 Martin Baulig <martin@ximian.com>
9953 * attribute.cs (Attribute.Resolve): Check whether we're an
9954 EmptyCast which a Constant child. Fixes #60333.
9956 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9958 * statement.cs (EmitCollectionForeach): Account for the fact that
9959 not all valuetypes are in areas which we can take the address of.
9960 For these variables, we store to a temporary variable. Also, make
9961 sure that we dont emit a `callvirt' on a valuetype method.
9963 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9965 * expression.cs (StackAlloc.DoReSolve): Added test for
9966 negative parameter (CS0247).
9968 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9971 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9973 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9976 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9979 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9981 Fix bug #58254 & cs1555.cs, cs1556.cs
9982 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9984 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9986 * cs-parser.jay: Added error CS1669 test for indexers.
9988 2004-06-18 Martin Baulig <martin@ximian.com>
9990 * generics.cs (GenericMethod.ctor): Don't take an Attributes
9991 argument. Fixes #60441.
9993 2004-06-16 Ben Maurer <bmaurer@ximian.com>
9994 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9995 The name needs to have the actual name of the method in order
9996 for other tests (such as the one in OverloadResolve for Invoke
9997 on a delegate) to work. As well, it does not really help
9998 error reporting because the method group had multiple methods.
9999 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10000 Make profiling work.
10002 2004-06-13 Martin Baulig <martin@ximian.com>
10004 * cs-parser.jay: Don't allow generic attributes.
10006 2004-06-13 Martin Baulig <martin@ximian.com>
10008 * class.cs (MemberBase.DoDefineBase): New protected method.
10009 (MemberBase.DoDefine): Compute the `flags' in the new
10010 DoDefineBase() which must be called first.
10011 (Method.Define): Call DoDefineBase() first so we have the flags
10012 when defining the generic method.
10014 * cs-parser.jay (interface_method_declaration): Support generic methods.
10016 2004-06-13 Martin Baulig <martin@ximian.com>
10018 * decl.cs (TypeName): Removed.
10019 (MemberName): Removed TypeName and MemberNow; now we just have
10022 * cs-parser.jay: Don't distinguish between type arguments and type
10023 parameters in the grammar and simplified the rules a bit. The
10024 reduce/reduce conflicts are now gone (except the one we inherited
10027 2004-06-11 Martin Baulig <martin@ximian.com>
10029 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10030 call this twice: for params and varargs methods.
10032 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10035 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10037 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10039 * attribute.cs (Attribute.GetValidTargets): Made public.
10042 (AbstractPropertyEventMethod): New class for better code sharing.
10043 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10045 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10047 2004-06-09 Martin Baulig <martin@ximian.com>
10049 * cs-parser.jay: Removed a reduce/reduce conflict.
10051 2004-06-03 Martin Baulig <martin@ximian.com>
10053 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10054 GetSimpleName() and return a SimpleName.
10056 * ecore.cs (SimpleName.Arguments): New public field.
10057 (SimpleName): Added overloaded ctor which takes an additional
10058 TypeArguments argument.
10059 (SimpleName.SimpleNameResolve): Added support for generic methods.
10060 (MethodGroupExpr.ResolveGeneric): New public method. The code was
10061 formerly in MemberAccess.DoResolve(), but we also need it in
10062 SimpleNameResolve().
10064 * expression.cs (MemberAccess.DoResolve): Use the new
10065 MethodGroupExpr.ResolveGeneric().
10067 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10069 * decl.cs: If possible, use lookuptypedirect here. We can only do
10070 this if there is no `.' after the namespace. Avoids using
10071 LookupType, which does lots of slow processing.
10072 (FindNestedType) New method, does what it says :-).
10073 * namespace.cs: use LookupTypeDirect.
10074 * rootcontext.cs: use membercache, if possible.
10075 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10077 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10080 According to the spec,
10082 In a member access of the form E.I, if E is a single identifier,
10083 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10084 field, property, localvariable, or parameter with the same type as
10085 the meaning of E as a type-name (§3.8), then both possible
10086 meanings of E are permitted.
10088 We did not check that E as a simple-name had the same type as E as
10091 This trivial check gives us 5-7% on bootstrap time.
10093 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10095 * expression.cs (Invocation.OverloadResolve): Avoid the
10096 use of hashtables and boxing here by allocating on demand.
10098 2004-05-30 Martin Baulig <martin@ximian.com>
10100 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10101 we're doing a silent lookup. Don't try to lookup nested types in
10102 TypeManager.object_type (thanks to Ben Maurer).
10104 2004-05-30 Martin Baulig <martin@ximian.com>
10106 Committing a patch from Ben Maurer.
10108 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10110 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10112 * convert.cs: add a trivial cache for overload operator resolution.
10114 2004-05-31 Marek Safar <marek.safar@seznam.cz>
10117 (AttributeTester.GetObsoleteAttribute): Returns instance of
10118 ObsoleteAttribute when type is obsolete.
10121 (TypeContainer.VerifyObsoleteAttribute): Override.
10122 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10123 (MethodCode.VerifyObsoleteAttribute): Override.
10124 (MemberBase.VerifyObsoleteAttribute): Override.
10127 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10128 and report proper error.
10131 (Delegate.VerifyObsoleteAttribute): Override.
10134 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10135 and report proper error.
10136 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10139 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10143 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10144 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10145 Added test for ObsoleteAttribute.
10148 (Catch): Derived from Statement.
10150 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10152 * decl.cs: If possible, use lookuptypedirect here. We can only do
10153 this if there is no `.' after the namespace. Avoids using
10154 LookupType, which does lots of slow processing.
10155 (FindNestedType) New method, does what it says :-).
10156 * namespace.cs: use LookupTypeDirect.
10157 * rootcontext.cs: use membercache, if possible.
10158 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10160 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10163 According to the spec,
10165 In a member access of the form E.I, if E is a single identifier,
10166 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10167 field, property, localvariable, or parameter with the same type as
10168 the meaning of E as a type-name (§3.8), then both possible
10169 meanings of E are permitted.
10171 We did not check that E as a simple-name had the same type as E as
10174 This trivial check gives us 5-7% on bootstrap time.
10176 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10178 Fixed bug #59071 & cs0160.cs
10179 * statement.cs (Try.Resolve): Check here whether order of catch
10180 clauses matches their dependencies.
10182 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10185 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10188 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10190 * expression.cs (Invocation.OverloadResolve): Avoid the
10191 use of hashtables and boxing here by allocating on demand.
10193 2004-05-30 Martin Baulig <martin@ximian.com>
10195 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10196 we're doing a silent lookup. Don't try to lookup nested types in
10197 TypeManager.object_type (thanks to Ben Maurer).
10199 2004-05-30 Martin Baulig <martin@ximian.com>
10201 Committing a patch from Ben Maurer.
10203 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10205 2004-05-29 Martin Baulig <martin@ximian.com>
10207 * class.cs (IMethodData.ShouldIgnore): New method.
10209 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10210 `Location' argument, we don't need it anywhere. Use
10211 `IMethodData.ShouldIgnore ()' instead of
10212 `MethodData.GetMethodFlags ()'.
10213 (TypeManager.AddMethod): Removed.
10214 (TypeManager.AddMethod2): Renamed to AddMethod.
10216 2004-05-29 Martin Baulig <martin@ximian.com>
10218 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10220 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10221 converting from a class type S to an interface type and we already
10222 have an object on the stack, don't box it again. Fixes #52578.
10224 2004-05-29 Martin Baulig <martin@ximian.com>
10226 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10227 Added support for `params' parameters. Fixes #59267.
10229 2004-05-29 Martin Baulig <martin@ximian.com>
10231 * literal.cs (NullPointer): Provide a private .ctor which sets
10232 `type' to TypeManager.object_type. Fixes #59048.
10234 2004-05-29 Martin Baulig <martin@ximian.com>
10236 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10237 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10239 * ecore.cs (EventExpr.instance_expr): Make the field private.
10241 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10243 Fixed bug #50080 & cs0214-2.cs
10244 * expression.cs (Cast.DoResolve): Check unsafe context here.
10246 * statement.cs (Resolve.DoResolve): Likewise.
10248 2004-05-26 Martin Baulig <martin@ximian.com>
10250 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10252 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10253 (RootContext.LookupType): Pass down the `silent' flag.
10255 2004-05-25 Martin Baulig <martin@ximian.com>
10258 (MethodGroupExpr.IdenticalTypeName): New public property.
10259 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10260 expression actually refers to a type.
10262 2004-05-25 Martin Baulig <martin@ximian.com>
10264 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10265 for #56176 and made it actually work.
10267 2004-05-25 Martin Baulig <martin@ximian.com>
10269 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10270 (FieldExpr, PropertyExpr): Override and implement
10271 CacheTemporaries. Fixes #52279.
10273 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10275 * location.cs: In the new compiler listing a file twice is a
10276 warning, not an error.
10278 2004-05-24 Martin Baulig <martin@ximian.com>
10280 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10281 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10283 2004-05-24 Martin Baulig <martin@ximian.com>
10285 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10286 walking the `using' list. Fixes #53921.
10288 2004-05-24 Martin Baulig <martin@ximian.com>
10290 * const.cs (Const.LookupConstantValue): Added support for
10291 EmptyCast's; fixes #55251.
10293 2004-05-24 Martin Baulig <martin@ximian.com>
10295 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10296 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10297 which does the CS0135 check. The reason is that we first need to
10298 check whether the variable actually exists.
10300 2004-05-24 Martin Baulig <martin@ximian.com>
10302 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10303 than RootContext.LookupType() to find the explicit interface
10304 type. Fixes #58584.
10306 2004-05-24 Raja R Harinath <rharinath@novell.com>
10308 * Makefile: Simplify. Use executable.make.
10309 * mcs.exe.sources: New file. List of sources of mcs.exe.
10311 2004-05-24 Anders Carlsson <andersca@gnome.org>
10315 Use the invariant culture when doing String.Compare for CLS case
10318 2004-05-23 Martin Baulig <martin@ximian.com>
10320 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10321 don't have any dots. Fixes #52622, added cs0246-8.cs.
10323 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10325 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10327 * class.cs (MemberBase.Define): Reuse MemberType member for
10328 resolved type. Other methods can use it too.
10330 2004-05-23 Martin Baulig <martin@ximian.com>
10332 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10333 the variable also exists in the current block (otherwise, we need
10334 to report a CS0103). Fixes #58670.
10336 2004-05-23 Martin Baulig <martin@ximian.com>
10338 * flowanalysis.cs (Reachability.Reachable): Compute this
10339 on-the-fly rather than storing it as a field.
10341 2004-05-23 Martin Baulig <martin@ximian.com>
10343 * flowanalysis.cs (Reachability.And): Manually compute the
10344 resulting `barrier' from the reachability.
10346 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10349 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10350 instance of ObsoleteAttribute when symbol is obsolete.
10353 (IMethodData): Extended interface for ObsoleteAttribute support.
10355 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10357 * attribute.cs: Fix bug #55970
10359 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10363 (GetObsoleteAttribute): New method. Creates the instance of
10365 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10366 ObsoleteAttribute when member is obsolete.
10367 (AttributeTester.Report_ObsoleteMessage): Common method for
10368 Obsolete error/warning reporting.
10371 (TypeContainer.base_classs_type): New member for storing parent type.
10374 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10375 for this MemberCore.
10377 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10379 * attribute.cs, const.cs: Fix bug #58590
10381 2004-05-21 Martin Baulig <martin@ximian.com>
10383 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10384 out parameters if the end of the method is unreachable. Fixes
10387 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10389 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10390 Hari was right, why extra method.
10392 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10394 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10396 2004-05-20 Martin Baulig <martin@ximian.com>
10398 * delegate.cs: Convert this file to Unix mode - like the original
10401 2004-05-20 Martin Baulig <martin@ximian.com>
10403 * attribute.cs: Convert this file to Unix mode - like the original
10406 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10408 Fix bug #58688 (MCS does not report error when the same attribute
10411 * attribute.cs (Attribute.Emit): Distinction between null and default.
10413 2004-05-19 Raja R Harinath <rharinath@novell.com>
10415 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10416 of a top-level attribute without an attribute target.
10417 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10419 (Attribute.Conditional_GetConditionName),
10420 (Attribute.Obsolete_GetObsoleteMessage): Update.
10421 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10422 part of ScanForIndexerName.
10423 (Attribute.CanIgnoreInvalidAttribute): New function.
10424 (Attribute.ScanForIndexerName): Move to ...
10425 (Attributes.ScanForIndexerName): ... here.
10426 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10427 (Attributes.Search): New internal variant that can choose not to
10428 complain if types aren't resolved. The original signature now
10430 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10431 complaints suppressed.
10432 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10433 only if it not useful.
10434 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10435 top-level for attributes that are shared between the assembly
10436 and a top-level class.
10437 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10438 * class.cs: Update to reflect changes.
10439 (DefineIndexers): Fuse loops.
10440 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10441 a couple more variants of attribute names.
10443 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10445 Fix bug #52585 (Implemented explicit attribute declaration)
10448 (Attributable.ValidAttributeTargets): New abstract method. It gets
10449 list of valid attribute targets for explicit target declaration.
10450 (Attribute.Target): It holds target itself.
10451 (AttributeSection): Removed.
10452 (Attribute.CheckTargets): New method. It checks whether attribute
10453 target is valid for the current element.
10456 (EventProperty): New class. For events that are declared like
10457 property (with add and remove accessors).
10458 (EventField): New class. For events that are declared like field.
10461 * cs-parser.jay: Implemented explicit attribute target declaration.
10463 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10464 Override ValidAttributeTargets.
10467 (ReturnParameter): Class for applying custom attributes on
10469 (ParameterAtribute): New class. Class for applying custom
10470 attributes on the parameter type.
10472 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10474 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10477 (Method): Allow UNSAFE here.
10479 * modifiers.cs: Support unsafe reporting.
10481 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10483 * decl.cs: Fix bug #58478.
10485 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10487 * statement.cs: When checking for unreachable code on an EmptyStatement,
10488 set the location. Fixes bug #58488.
10490 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10492 * driver.cs: Add -pkg handling.
10494 From Gonzalo: UseShelLExecute=false
10496 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10499 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10501 (Attribute.IsClsCompliaceRequired): Moved to base for better
10503 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10504 when attribute is AttributeUsageAttribute.
10505 (Attribute.GetValidTargets): Simplified.
10506 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10507 attribute for this type.
10508 (Attribute.ApplyAttributes): Method renamed to Emit and make
10510 (GlobalAttributeSection): New class for special handling of global
10511 attributes (assembly, module).
10512 (AttributeSection.Emit): New method.
10514 * class.cs: Implemented Attributable abstract methods.
10515 (MethodCore.LabelParameters): Moved to Parameter class.
10516 (Accessor): Is back simple class.
10517 (PropertyMethod): Implemented Attributable abstract class.
10518 (DelegateMethod): Implemented Attributable abstract class.
10519 (Event): New constructor for disctintion between normal Event
10520 and Event with accessors.
10522 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10524 * codegen.cs, const.cs, decl.cs, delegate.cs:
10525 (CommonAssemblyModulClass): Implemented Attributable abstract class
10528 * enum.cs: Implement IAttributeSupport interface.
10529 (EnumMember): New class for emum members. Implemented Attributable
10533 (ParameterBase): Is abstract.
10534 (ReturnParameter): New class for easier [return:] attribute handling.
10536 * typemanager.cs: Removed builder_to_attr.
10538 2004-05-11 Raja R Harinath <rharinath@novell.com>
10541 * attribute.cs (Attribute.GetPositionalValue): New function.
10542 * class.cs (TypeContainer.VerifyMembers): New function.
10543 (TypeContainer.Emit): Use it.
10544 (ClassOrStruct): New base class for Class and Struct.
10545 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10546 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10548 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10549 then each non-static field should have a FieldOffset attribute.
10550 Otherwise, none of the fields should have a FieldOffset attribute.
10551 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10552 and FieldOffset attributes.
10553 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10554 (TypeManager.field_offset_attribute_type): New core types.
10555 (TypeManager.InitCoreTypes): Initialize them.
10557 2004-05-11 Michal Moskal <malekith@pld-linux.org>
10559 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10560 Return correct type.
10563 2004-05-09 Miguel de Icaza <miguel@ximian.com>
10565 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10566 be implicitly converted to ulong.
10568 * expression.cs: The logic for allowing operator &, | and ^ worked
10569 was wrong, it worked before because we did not report an error in
10570 an else branch. Fixes 57895.
10572 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10573 allow volatile fields to be reference types.
10575 2004-05-07 Miguel de Icaza <miguel@ximian.com>
10577 * driver.cs: Add support for /debug-
10579 2004-05-07 Raja R Harinath <rharinath@novell.com>
10581 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
10582 Add a 'complain' parameter to silence errors.
10583 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10584 silently overlooked type-resolutions.
10585 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10586 to reflect changes.
10587 (Attributes.Search): New function.
10588 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10589 (Attributes.GetAttributeFullName): Remove hack.
10590 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10591 Update to reflect changes.
10592 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10593 Use Attributes.Search instead of nested loops.
10595 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10598 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10599 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10600 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10602 * report.cs: (Report.Warning): Renamed to Warning_T because of
10603 parameter collision.
10605 2004-05-05 Raja R Harinath <rharinath@novell.com>
10607 * expression.cs (MemberAccess.ResolveMemberAccess):
10608 Exit with non-zero status after Report.Error.
10609 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10611 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10613 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10615 * support.cs: Don't hang when the file is empty.
10617 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10619 * support.cs: In SeekableStreamReader, compute the preamble size of the
10620 underlying stream. Position changes should take into account that initial
10623 2004-05-03 Todd Berman <tberman@sevenl.net>
10625 * driver.cs: remove unused GetSysVersion function.
10627 2004-05-03 Todd Berman <tberman@sevenl.net>
10629 * driver.cs: Remove the hack from saturday, as well as the hack
10630 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10631 link_paths to get that bit proper.
10633 2004-05-01 Todd Berman <tberman@sevenl.net>
10635 * driver.cs: Try a LoadFrom before a Load, this checks the current
10636 path. This is currently a bug in mono that is be fixed, however, this
10637 provides a workaround for now. This will be removed when the bug
10640 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10642 * CryptoConvert.cs: Updated to latest version. Fix issue with
10643 incomplete key pairs (#57941).
10645 2004-05-01 Todd Berman <tberman@sevenl.net>
10647 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10650 2004-04-30 Jackson Harper <jackson@ximian.com>
10652 * codegen.cs: Open keys readonly.
10654 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10656 * typemanager.cs: don't report cyclic struct layout when a struct
10657 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10658 which has 2 Pango.Rectangle fields.
10660 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10662 * expression.cs: Handle IntPtr comparisons with IL code
10663 rather than a method call.
10665 2004-04-29 Martin Baulig <martin@ximian.com>
10667 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10668 the list of PropertyInfo's in class hierarchy and find the
10669 accessor. Fixes #56013.
10671 2004-04-29 Martin Baulig <martin@ximian.com>
10673 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10675 2004-04-29 Martin Baulig <martin@ximian.com>
10677 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10679 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10681 2004-04-29 Martin Baulig <martin@ximian.com>
10683 * class.cs (ConstructorInitializer.Resolve): Check whether the
10684 parent .ctor is accessible. Fixes #52146.
10686 2004-04-29 Martin Baulig <martin@ximian.com>
10688 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10690 * statement.cs (Using.EmitLocalVariableDecls): Use
10691 TypeManager.idisposable_type, not typeof (IDisposable).
10692 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10694 2004-04-29 Martin Baulig <martin@ximian.com>
10696 * class.cs (Event.Define): Don't emit the field and don't set
10697 RTSpecialName and SpecialName for events on interfaces. Fixes
10700 2004-04-29 Raja R Harinath <rharinath@novell.com>
10702 Refactor Attribute.ApplyAttributes.
10703 * attribute.cs (Attributable): New base class for objects that can
10704 have Attributes applied on them.
10705 (Attribute): Make AttributeUsage fields public.
10706 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10707 (Attribute.IsInternalCall): New property.
10708 (Attribute.UsageAttr): Convert to a public read-only property.
10709 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10710 (Attribute.ResolveType, Attribute.Resolve)
10711 (Attribute.ScanForIndexerName): Update to reflect changes.
10712 (Attribute.CheckAttributeTarget): Re-format.
10713 (Attribute.ApplyAttributes): Refactor, to various
10714 Attributable.ApplyAttributeBuilder methods.
10715 * decl.cs (MemberCore): Make Attributable.
10716 * class.cs (Accessor): Make Attributable.
10717 (MethodData.ApplyAttributes): Use proper attribute types, not
10719 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10720 (TypeContainer.ApplyAttributeBuilder)
10721 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10722 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10723 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10724 (Operator.ApplyAttributeBuilder): New factored-out methods.
10725 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10726 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10727 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10728 * parameter.cs (ParameterBase): New Attributable base class
10729 that can also represent Return types.
10730 (Parameter): Update to the changes.
10732 2004-04-29 Jackson Harper <jackson@ximian.com>
10734 * driver.cs: Prefer the corlib system version when looking for
10735 assemblies in the GAC. This is still a hack, but its a better hack
10738 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10740 * decl.cs, enum.cs: Improved error 3005 reporting.
10742 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10743 (related_symbols): New private member for list of symbols
10744 related to reported error/warning.
10746 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10748 2004-04-29 Martin Baulig <martin@ximian.com>
10750 * ecore.cs (Expression.Constantify): If we're an enum and
10751 TypeManager.TypeToCoreType() doesn't give us another type, use
10752 t.UnderlyingSystemType. Fixes #56178.
10754 2004-04-29 Martin Baulig <martin@ximian.com>
10756 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10757 interfaces and for each interface, only add members directly
10758 declared in that interface. Fixes #53255.
10760 2004-04-28 Martin Baulig <martin@ximian.com>
10762 * expression.cs (ConditionalLogicalOperator): Use a temporary
10763 variable for `left' to avoid that we evaluate it more than once;
10766 2004-04-28 Martin Baulig <martin@ximian.com>
10768 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10771 2004-04-28 Martin Baulig <martin@ximian.com>
10773 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10776 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10777 whether the type is not void (CS1547).
10779 2004-04-28 Martin Baulig <martin@ximian.com>
10781 * expression.cs (Unary.DoResolveLValue): Override this and report
10782 CS0131 for anything but Operator.Indirection.
10784 2004-04-28 Martin Baulig <martin@ximian.com>
10786 Committing a patch from Ben Maurer; see bug #50820.
10788 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10791 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10794 2004-04-28 Martin Baulig <martin@ximian.com>
10796 Committing a patch from Ben Maurer; see bug #50820.
10798 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10801 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10804 2004-04-28 Martin Baulig <martin@ximian.com>
10806 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10807 (Block.AddLabel): Call DoLookupLabel() to only search in the
10810 2004-04-28 Martin Baulig <martin@ximian.com>
10812 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10813 comparing StringConstants and NullLiterals in Equality and Inequality.
10815 2004-04-28 Jackson Harper <jackson@ximian.com>
10817 * driver.cs: Attempt to load referenced assemblies from the
10818 GAC. This is the quick and dirty version of this method that
10819 doesnt take into account versions and just takes the first
10820 canidate found. Will be good enough for now as we will not have more
10821 then one version installed into the GAC until I update this method.
10823 2004-04-28 Martin Baulig <martin@ximian.com>
10825 * typemanager.cs (TypeManager.CheckStructCycles): New public
10826 static method to check for cycles in the struct layout.
10828 * rootcontext.cs (RootContext.PopulateTypes): Call
10829 TypeManager.CheckStructCycles() for each TypeContainer.
10830 [Note: We only need to visit each type once.]
10832 2004-04-28 Martin Baulig <martin@ximian.com>
10834 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10836 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10837 success and added `out object value'. Use a `bool resolved' field
10838 to check whether we've already been called rather than
10839 `ConstantValue != null' since this breaks for NullLiterals.
10841 2004-04-28 Raja R Harinath <rharinath@novell.com>
10843 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10844 setting of this flag, since the 'set' method may be non-public.
10846 2004-04-28 Raja R Harinath <rharinath@novell.com>
10848 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10849 check on current_vector.Block.
10851 2004-04-27 Martin Baulig <martin@ximian.com>
10853 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10854 a field initializer. Fixes #56459.
10856 2004-04-27 Martin Baulig <martin@ximian.com>
10858 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10859 we're not attempting to use an indexer. Fixes #52154.
10861 2004-04-27 Martin Baulig <martin@ximian.com>
10863 * statement.cs (Return): Don't create a return label if we don't
10864 need it; reverts my change from January 20th. Thanks to Ben
10867 2004-04-27 Martin Baulig <martin@ximian.com>
10869 According to the spec, `goto' can only leave a nested scope, but
10872 * statement.cs (Block.LookupLabel): Only lookup in the current
10873 block, don't recurse into parent or child blocks.
10874 (Block.AddLabel): Check in parent and child blocks, report
10875 CS0140/CS0158 if we find a duplicate.
10876 (Block): Removed this indexer for label lookups.
10877 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10878 this already does the error reporting for us.
10881 (FlowBranching.UsageVector.Block): New public variable; may be null.
10882 (FlowBranching.CreateSibling): Added `Block' argument.
10883 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10884 label for the target of a `goto' and check whether we're not
10885 leaving a `finally'.
10887 2004-04-27 Martin Baulig <martin@ximian.com>
10889 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10890 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10893 2004-04-27 Martin Baulig <martin@ximian.com>
10895 * statement.cs (Block.AddLabel): Also check for implicit blocks
10896 and added a CS0158 check.
10898 2004-04-27 Martin Baulig <martin@ximian.com>
10900 * flowanalysis.cs (FlowBranchingLoop): New class.
10901 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10902 UsageVector's instead of an ArrayList.
10903 (FlowBranching.Label): Likewise.
10904 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10905 (FlowBranching.AddBreakVector): New method.
10907 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10909 * attribute.cs: Small regression fix: only convert the type if we
10910 the type is different, fixes System.Drawing build.
10912 2004-04-27 Martin Baulig <martin@ximian.com>
10914 * attribute.cs (Attribute.Resolve): If we have a constant value
10915 for a named field or property, implicity convert it to the correct
10918 2004-04-27 Raja R Harinath <rharinath@novell.com>
10920 * statement.cs (Block.Block): Implicit blocks share
10921 'child_variable_names' fields with parent blocks.
10922 (Block.AddChildVariableNames): Remove.
10923 (Block.AddVariable): Mark variable as "used by a child block" in
10924 every surrounding block.
10925 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10926 been used in a child block, complain about violation of "Invariant
10927 meaning in blocks" rule.
10928 * cs-parser.jay (declare_local_variables): Don't use
10929 AddChildVariableNames.
10930 (foreach_statement): Don't create an implicit block: 'foreach'
10931 introduces a scope.
10933 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10935 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10936 converting from 0L to ulong. Fixes 57522.
10938 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10940 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10941 derived class hides via 'new' keyword field from base class (test-242.cs).
10942 TODO: Handle this in the more general way.
10944 * class.cs (CheckBase): Ditto.
10946 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10948 * decl.cs (caching_flags): New member for storing cached values
10950 (MemberCore.Flags): New enum where bit flags for caching_flags
10952 (MemberCore.cls_compliance): Moved to caching_flags.
10953 (DeclSpace.Created): Moved to caching_flags.
10955 * class.cs: Use caching_flags instead of DeclSpace.Created
10957 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10959 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10960 if we are only a derived class, not a nested class.
10962 * typemanager.cs: Same as above, but do this at the MemberLookup
10963 level (used by field and methods, properties are handled in
10964 PropertyExpr). Allow for the qualified access if we are a nested
10967 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10969 * class.cs: Refactoring.
10970 (IMethodData): New inteface; Holds links to parent members
10971 to avoid member duplication (reduced memory allocation).
10972 (Method): Implemented IMethodData interface.
10973 (PropertyBase): New inner classes for get/set methods.
10974 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10975 (Event): New inner classes for add/remove methods.
10976 (Event.DelegateMethod): Implemented IMethodData interface.
10978 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10979 EmitContext (related to class.cs refactoring).
10981 2004-04-21 Raja R Harinath <rharinath@novell.com>
10983 * delegate.cs (Delegate.VerifyApplicability): If the number of
10984 arguments are the same as the number of parameters, first try to
10985 verify applicability ignoring any 'params' modifier on the last
10989 2004-04-08 Martin Baulig <martin@ximian.com>
10991 Merged latest changes into gmcs. Please keep this comment in
10992 here, it makes it easier for me to see what changed in MCS since
10993 the last time I merged.
10995 2004-04-16 Raja R Harinath <rharinath@novell.com>
10997 * class.cs (TypeContainer.AddIndexer): Use
10998 'ExplicitInterfaceName' to determine if interface name was
10999 explicitly specified. 'InterfaceType' is not initialized at this time.
11000 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11001 Indexers array is already in the required order. Initialize
11002 'IndexerName' only if there are normal indexers.
11003 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11004 (TypeContainer.Emit): Emit DefaultMember attribute only if
11005 IndexerName is initialized.
11008 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11010 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11013 2004-04-15 Raja R Harinath <rharinath@novell.com>
11015 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11019 * attribute.cs (Attribute.Resolve): Check for duplicate named
11023 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11025 * iterators.cs (MarkYield): track whether we are in an exception,
11026 and generate code accordingly. Use a temporary value to store the
11027 result for our state.
11029 I had ignored a bit the interaction of try/catch with iterators
11030 since their behavior was not entirely obvious, but now it is
11031 possible to verify that our behavior is the same as MS .NET 2.0
11035 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11037 * iterators.cs: Avoid creating temporaries if there is no work to
11040 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11041 Enumerations, use TypeManager.EnumToUnderlying and call
11044 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11047 (This.Emit): Use EmitContext.EmitThis to emit our
11050 (This.EmitAssign): Ditto.
11052 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11053 codepaths, we will move all the functionality into
11056 (FieldExpr.EmitAssign): Ditto.
11058 This fixes several hidden bugs that I uncovered while doing a code
11059 review of this today.
11061 * codegen.cs (EmitThis): reworked so the semantics are more clear
11062 and also support value types "this" instances.
11064 * iterators.cs: Changed so that for iterators in value types, we
11065 do not pass the value type as a parameter.
11067 Initialization of the enumerator helpers is now done in the caller
11068 instead of passing the parameters to the constructors and having
11069 the constructor set the fields.
11071 The fields have now `assembly' visibility instead of private.
11073 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11075 * expression.cs (Argument.Resolve): Check if fields passed as ref
11076 or out are contained in a MarshalByRefObject.
11078 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11079 another compiler type.
11081 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11083 * class.cs (Indexer.Define): use the new name checking method.
11084 Also, return false on an error.
11085 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11086 (is_identifier_[start/part]_character): make static.
11088 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11090 * expression.cs (Binary.ResolveOperator): Do no append strings
11091 twice: since we can be invoked more than once (array evaluation)
11092 on the same concatenation, take care of this here. Based on a fix
11093 from Ben (bug #56454)
11095 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11097 * codegen.cs: Fix another case where CS1548 must be reported (when
11098 delay-sign isn't specified and no private is available #56564). Fix
11099 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11100 error when MCS is used on the MS runtime and we need to delay-sign
11101 (which seems unsupported by AssemblyBuilder - see #56621).
11103 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11105 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11106 (TypeManager.ComputeNamespaces): Faster implementation for
11109 * compiler.csproj: Updated AssemblyName to mcs.
11111 2004-05-11 Jackson Harper <jackson@ximian.com>
11113 * Makefile: Preserve MONO_PATH
11115 2004-05-11 Jackson Harper <jackson@ximian.com>
11117 * Makefile: Use mono and mcs to build gmcs
11119 2004-05-03 Miguel de Icaza <miguel@ximian.com>
11121 * codegen.cs: Add patch from Robert Shade
11122 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11125 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
11127 * CryptoConvert.cs: Updated to latest version. Fix issue with
11128 incomplete key pairs (#57941).
11130 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11132 * codegen.cs: Fix another case where CS1548 must be reported (when
11133 delay-sign isn't specified and no private is available #56564). Fix
11134 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11135 error when MCS is used on the MS runtime and we need to delay-sign
11136 (which seems unsupported by AssemblyBuilder - see #56621).
11138 2004-04-29 Jackson Harper <jackson@ximian.com>
11140 * Makefile: Set MONO_PATH to use the bootstrap corlib
11141 * driver.cs: Check the GAC for referenced assemblies.
11143 2004-04-29 Martin Baulig <martin@ximian.com>
11145 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11147 2004-04-07 Martin Baulig <martin@ximian.com>
11149 * expression.cs (Binary.ResolveOperator): Added special case for
11150 Equality/Inequality between a type parameter and a null literal.
11152 2004-04-07 Martin Baulig <martin@ximian.com>
11154 * convert.cs: Check null literal -> type parameter conversions.
11156 2004-04-07 Martin Baulig <martin@ximian.com>
11158 * generic.cs (ConstructedType.CheckConstraints): Enforce the
11159 `class' and `struct' constraints.
11161 2004-04-07 Martin Baulig <martin@ximian.com>
11163 * generic.cs (SpecialConstraint): New public enum.
11164 (Constraints.Resolve): Added support for the `class' and `struct'
11167 * cs-parser.jay (type_parameter_constraint): Added support for the
11168 `class' and `struct' constraints.
11170 2004-04-07 Martin Baulig <martin@ximian.com>
11172 * support.cs (GenericConstraints): Replaced `Types' by
11173 `ClassConstraint' and `InterfaceConstraints'; added
11174 `HasClassConstraint'.
11176 2004-04-07 Martin Baulig <martin@ximian.com>
11179 (Constraints.InterfaceConstraints): New public property.
11180 (Constraints.Types): Make this property public
11181 (TypeParameter): Implement IMemberContainer.
11182 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11183 instead of a TypeBuilder/MethodBuilder; pass the interface
11184 constraints to TypeManager.AddTypeParameter().
11185 (TypeParameter.DefineType): Just take an EmitContext and no
11186 TypeBuilder/MethodBuilder. Use the new public API.
11188 * typemanager.cs (TypeManager.AddTypeParameter): Added
11189 `TypeExpr[]' argument; add the interfaces to the
11190 `builder_to_ifaces' hash.
11191 (TypeManager.LookupMemberContainer): For
11192 GenericTypeParameterBuilders, get the TypeParameter from the
11193 `builder_to_type_param'.
11194 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11195 the TypeParameter and call FindMembers on it.
11197 2004-04-07 Martin Baulig <martin@ximian.com>
11200 (MethodCore.GenericMethod): Moved this field here from Method.
11201 (MethodCore.IsDuplicateImplementation): Take the number of type
11202 parameters into account if we're a generic method.
11204 * expression.cs (Invocation.InferTypeArguments): Don't return true
11205 if `arguments' is null; we still need to check whether we actually
11206 don't need to infer anything in this case.
11207 (MemberAccess): Merged the functionality from GenericMemberAccess
11210 * generic.cs (GenericMemberAccess): Removed.
11212 2004-04-05 Martin Baulig <martin@ximian.com>
11214 * decl.cs (MemberCore): For generic classes, interfaces and
11215 structs, `Name' now includes the number of type parameters
11216 ("Stack!1.Node!1").
11217 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11218 encode the number of type arguments in the type name.
11220 * expression.cs (Expression.MemberLookup): Removed the
11221 `num_type_args' argument; we now encode the number of type
11222 arguments in the type name.
11224 * ecore.cs (SimpleName): Encode the number of type arguments in
11225 the type name itself.
11227 * generic.cs (ConstructedType): Likewise.
11229 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11230 `MemberName'; we now include the number of type parameters in the
11233 * typemanager.cs (TypeManager.CheckGeneric): Removed.
11234 (TypeManager.MemberLookup): Removed the
11235 `num_type_args' argument; we now encode the number of type
11236 arguments in the type name.
11238 2004-04-03 Martin Baulig <martin@ximian.com>
11240 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11241 (MemberCore.MemberName): Moved here from MemberBase.
11242 (DeclSpace.SetParameterInfo): Just take the constraints as an
11243 ArrayList; we already have the type parameters in our
11244 `MemberName'; also do the CS0080 reporting here.
11246 * cs-parser.jay (struct_declaration): Use `member_name' instead of
11247 `IDENTIFIER opt_type_parameter_list'; when constructing our
11248 `MemberName', it'll already include our type parameters.
11249 (class_declaration, interface_declaration): Likewise.
11250 (delegate_declaration): Likewise.
11251 (MakeName): Take a MemberName and return a MemberName.
11252 The following two changes are required to avoid shift/reduce conflicts:
11253 (member_name): Don't include a TypeName anymore; ie. this is now
11254 just 'IDENTIFIER opt_type_parameter_list'.
11255 (property_declaration, event_declaration): Use a
11256 `namespace_or_type_name' instead of a `member_name'.
11258 2004-04-03 Martin Baulig <martin@ximian.com>
11260 * decl.cs (MemberName): Renamed to `TypeName' and created a new
11261 `MemberName' class.
11262 (TypeName): Formerly known as MemberName.
11264 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11265 instead of a `MemberName'.
11267 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11268 (member_name): New rule; create a MemberName.
11270 2004-04-02 Martin Baulig <martin@ximian.com>
11272 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11273 (CS0305 and CS0308).
11275 2004-04-02 Martin Baulig <martin@ximian.com>
11277 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11278 support for nested types.
11280 2004-04-02 Martin Baulig <martin@ximian.com>
11282 * ecore.cs (IAlias): New public interface.
11283 (TypeExpr, TypeExpression): Implement IAlias.
11284 (TypeAliasExpression): New public class.
11286 * namespace.cs (Namespace): Implement IAlias.
11287 (Namespace.Lookup): Return an IAlias instead on an object.
11288 (Namespace.DefineName): Take an IAlias instead of an object.
11289 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11291 (NamespaceEntry.UsingAlias): Take a Membername instead of an
11293 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11295 (NamespaceEntry.Lookup): Likewise.
11297 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11300 * decl.cs (DeclSpace): Implement IAlias.
11301 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11303 * generic.cs (ConstructedType): Improved error checking.
11305 2004-04-02 Martin Baulig <martin@ximian.com>
11307 * convert.cs: Added type parameter conversions.
11310 (UnboxCast.Emit): Emit an `unbox.any' for type params.
11311 (ClassCast.Emit): If the source type is a type parameter, box it.
11312 If the target type is a type parameter, emit an `unbox.any'
11313 instead of a `classcast'.1
11315 2004-04-01 Martin Baulig <martin@ximian.com>
11317 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11319 2004-04-01 Martin Baulig <martin@ximian.com>
11321 * generic.cs (ConstructedType.CheckConstraints): Use
11322 Convert.ImplicitStandardConversionExists(); user-defined implicit
11323 conversions are not allowed according to the spec.
11325 2004-03-30 Martin Baulig <martin@ximian.com>
11327 * expression.cs (New): Added support for type parameters.
11330 (TypeManager.activator_type): New public static field.
11331 (TypeManager.activator_create_instance): Likewise.
11333 2004-03-30 Martin Baulig <martin@ximian.com>
11335 * typemanager.cs (TypeManager.HasConstructorConstraint): New
11338 2004-03-30 Martin Baulig <martin@ximian.com>
11340 * generic.cs (ConstructedType.CheckConstraints): Actually follow
11341 the spec here: the argument type must be convertible to the
11344 2004-03-30 Martin Baulig <martin@ximian.com>
11347 (TypeParameter.Define, TypeParameter.DefineMethod): Call
11348 TypeManager.AddTypeParameter().
11349 (ConstructedType.CheckConstraints): Re-enable this and actually
11350 check whether we have a constructor constraint.
11353 (TypeManager.builder_to_type_param): New static field.
11354 (TypeManager.AddTypeParameter): New static method.
11355 (TypeManager.LookupTypeParameter): New public method.
11357 2004-03-30 Martin Baulig <martin@ximian.com>
11359 * generic.cs (TypeParameter.DefineType): Return a boolean and use
11360 the new API to actually define the constructor constraint.
11363 (TypeManager.new_constraint_attr_type): New static field.
11364 (TypeManager.InitCoreTypes): Initialize it.
11366 2004-03-30 Martin Baulig <martin@ximian.com>
11368 * generic.cs (Constraints): Completed error checking, use correct
11371 2004-03-29 Martin Baulig <martin@ximian.com>
11373 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11375 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11376 public version which takes a `ParameterData pd' instead of an
11379 2004-03-29 Martin Baulig <martin@ximian.com>
11381 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11384 2004-03-29 Martin Baulig <martin@ximian.com>
11386 * expression.cs (Argument.ResolveMethodGroup): If we're a
11387 ConstructedType, call GetMemberAccess() on it.
11389 2004-03-29 Martin Baulig <martin@ximian.com>
11391 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11392 (MethodCore.CheckGenericOverride): When overriding a generic
11393 method, check whether the constraints match.
11395 * support.cs (GenericConstraints): New public interface.
11396 (ParameterData.GenericConstraints): New public method.
11398 * parameter.cs (Parameter.Resolve): Check whether we're a generic
11399 method parameter and compute our constraints if appropriate.
11400 (Parameter.GenericConstraints): New public property.
11402 * generic.cs (Constraints): Implement GenericConstraints.
11404 2004-03-29 Martin Baulig <martin@ximian.com>
11406 * decl.cs (MemberCache.FindMemberToOverride): Use
11407 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11409 2004-03-29 Martin Baulig <martin@ximian.com>
11411 * generic.cs (GenericMethod.Define): Resolve our type parameters.
11413 2004-03-29 Martin Baulig <martin@ximian.com>
11415 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11416 not allowed on non-generic declarations").
11418 2004-03-29 Martin Baulig <martin@ximian.com>
11420 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11421 public version of this method.
11423 * class.cs (MethodCore.IsDuplicateImplementation): Use
11424 Invocation.InferTypeArguments() to check this.
11426 2004-03-29 Martin Baulig <martin@ximian.com>
11428 * convert.cs: Use TypeManager.IsDelegateType() instead of
11429 comparing types correctly.
11431 2004-03-29 Martin Baulig <martin@ximian.com>
11433 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11434 types directly to make it work for generic instances.
11436 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11438 2004-03-29 Martin Baulig <martin@ximian.com>
11440 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11441 support for arrays.
11443 2004-03-24 Martin Baulig <martin@ximian.com>
11445 * decl.cs (DeclSpace.FindType): Also use
11446 TypeManager.CheckGeneric() for types from the using clauses.
11448 2004-03-23 Martin Baulig <martin@ximian.com>
11450 * expression.cs (Invocation.OverloadResolve): Added `bool
11451 may_fail' argument and use it instead of the Location.IsNull() hack.
11453 2004-03-23 Martin Baulig <martin@ximian.com>
11455 * expression.cs (Invocation.InferType): Use correct type inference
11458 2004-03-23 Martin Baulig <martin@ximian.com>
11460 * ecore.cs (MethodGroupExpr.Name): Use
11461 TypeManager.CSharpSignature() instead of just the name.
11463 * expression.cs (Invocation.OverloadResolve): Provide better error
11465 (Invocation.DoResolve): OverloadResolve() never returns null
11466 without reporting an error, so removed the error -6 reporting here.
11468 2004-03-23 Martin Baulig <martin@ximian.com>
11470 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11473 * cs-parser.jay (delegate_declaration): Support generic delegates.
11475 * delegate.cs: Support generic delegates.
11477 2004-03-22 Martin Baulig <martin@ximian.com>
11479 * expression.cs (Invocation.InferParamsTypeArguments): New static
11480 method; does type inference for params arguments.
11482 2004-03-21 Martin Baulig <martin@ximian.com>
11484 * typemanager.cs (TypeManager.IsGenericMethod): New public static
11485 method; checks whether a method is a generic method.
11487 * expression.cs (Invocation.InferTypeArguments): New static method;
11488 infer type arguments for generic method invocation.
11490 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11491 property; we set this to true if we're resolving a generic method
11492 invocation and the user specified type arguments, ie. we're not
11493 doing type inference.
11495 2004-03-20 Martin Baulig <martin@ximian.com>
11497 * class.cs (MethodData.DeclaringType): New public property.
11498 (MethodData.Define): Set DeclaringType here.
11499 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11500 instead of OperatorMethodBuilder.DeclaringType.
11502 2004-03-20 Martin Baulig <martin@ximian.com>
11504 * cs-tokenizer.cs (xtoken): Return a special
11505 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11507 * cs-parser.jay (default_value_expression): Switch to the new
11510 2004-03-19 Martin Baulig <martin@ximian.com>
11512 * decl.cs (MemberName): New class. We use this to "construct"
11513 namespace_or_type_name's.
11515 * generics.cs (TypeArguments.GetDeclarations): New public method;
11516 returns the type arguments as a string[] and reports a CS0081 if
11517 one of them is not an identifier.
11519 * class.cs (MemberBase): The .ctor now takes the name as a
11520 MemberName instead of a string.
11521 (MemberBase.ExplicitInterfaceName): Changed type from string to
11523 (MemberBase.DoDefine): If we're an explicit implementation, the
11524 InterfaceType may be a generic instance.
11526 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11527 (namespace_name): Call MemberName.GetName () to transform the
11528 MemberName into a string and ensure we don't have any type
11530 (type_name): Call MemberName.GetTypeExpression() to transfrom the
11531 MemberName into an expression.
11532 (method_header): Use namespace_or_type_name instead of member_name.
11534 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11536 * rootcontext.cs: Add new types to the boot resolution.
11538 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11539 MulticastDelegate is not allowed.
11541 * typemanager.cs: Add new types to lookup: System.TypedReference
11544 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11545 check for TypedReference or ArgIterator, they are not allowed.
11547 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11548 makes us properly catch 1510 in some conditions (see bug 56016 for
11551 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11553 * CryptoConvert.cs: update from corlib version
11556 2004-04-05 Miguel de Icaza <miguel@ximian.com>
11558 * class.cs (Indexer.Define): Check indexername declaration
11560 2004-04-05 Marek Safar <marek.safar@seznam.cz>
11562 * attribute.cs (IsClsCompliant): Fixed problem with handling
11563 all three states (compliant, not-compliant, undetected).
11565 2004-03-30 Marek Safar <marek.safar@seznam.cz>
11567 * attribute.cs (Attribute): Location is now public.
11568 (Resolve): Store resolved arguments (pos_values) in attribute class.
11569 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11570 (GetClsCompliantAttributeValue): New method that gets
11571 CLSCompliantAttribute value.
11572 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11573 if exists else null.
11574 (AttributeTester): New class for CLS-Compliant verification routines.
11576 * class.cs (Emit): Add CLS-Compliant verification.
11577 (Method.GetSignatureForError): Implemented.
11578 (Constructor.GetSignatureForError): Implemented
11579 (Constructor.HasCompliantArgs): Returns if constructor has
11580 CLS-Compliant arguments.
11581 (Constructor.Emit): Override.
11582 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11583 is needed to test only parameters.
11584 (FieldBase.GetSignatureForError): Implemented.
11585 (TypeContainer): New member for storing base interfaces.
11586 (TypeContainer.FindMembers): Search in base interfaces too.
11588 * codegen.cs (GetClsComplianceAttribute): New method that gets
11589 assembly or module CLSCompliantAttribute value.
11590 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11592 (ModuleClass.Emit): Add error 3012 test.
11594 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11596 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11597 state for all decl types.
11598 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11599 if CLS-Compliant tests are required.
11600 (IsClsCompliaceRequired): New method. Analyze whether code
11601 must be CLS-Compliant.
11602 (IsExposedFromAssembly): New method. Returns true when MemberCore
11603 is exposed from assembly.
11604 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11605 value or gets cached value.
11606 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11607 is explicitly marked with CLSCompliantAttribute.
11608 (IsIdentifierClsCompliant): New abstract method. This method is
11609 used to testing error 3005.
11610 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11611 for identifier and parameters CLS-Compliant testing.
11612 (VerifyClsCompliance): New method. The main virtual method for
11613 CLS-Compliant verifications.
11614 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11615 null. I don't know why is null (too many public members !).
11616 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11617 and get value of first CLSCompliantAttribute that found.
11619 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11620 (VerifyClsCompliance): Override and add extra tests.
11622 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11623 clscheck- disable CLS-Compliant verification event if assembly is has
11624 CLSCompliantAttribute(true).
11626 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11627 ApllyAttribute is now called in emit section as in the other cases.
11628 Possible future Emit integration.
11629 (IsIdentifierClsCompliant): New override.
11630 (VerifyClsCompliance): New override.
11631 (GetEnumeratorName): Returns full enum name.
11633 * parameter.cs (GetSignatureForError): Implemented.
11635 * report.cs (WarningData): New struct for Warning message information.
11636 (LocationOfPreviousError): New method.
11637 (Warning): New method. Reports warning based on the warning table.
11638 (Error_T): New method. Reports error based on the error table.
11640 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11641 verifications are done here.
11643 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11645 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11646 CLSCompliantAttribute.
11647 (all_imported_types): New member holds all imported types from other
11649 (LoadAllImportedTypes): New method fills static table with exported types
11650 from all referenced assemblies.
11651 (Modules): New property returns all assembly modules.
11653 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11655 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11656 throwing a parser error.
11658 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11659 which removes the hardcoded get_/set_ prefixes for properties, as
11660 IL allows for the properties to be named something else.
11664 * expression.cs: Do not override operand before we know if it is
11665 non-null. Fix 56207
11667 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11669 * typemanager.cs: support for pinned variables.
11671 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11673 * decl.cs, typemanager.cs: Avoid using an arraylist
11674 as a buffer if there is only one result set.
11676 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11678 * expression.cs: Make sure you cant call a static method
11679 with an instance expression, bug #56174.
11681 2004-03-29 Miguel de Icaza <miguel@ximian.com>
11683 * class.cs (IsDuplicateImplementation): Improve error reporting to
11684 flag 663 (method only differs in parameter modifier).
11686 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11687 in preprocessor directives.
11689 * location.cs (LookupFile): Allow for the empty path.
11691 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
11692 better approach for some of that patch, but its failing with the
11693 CharSet enumeration. For now try/catch will do.
11695 * typemanager.cs: Do not crash if a struct does not have fields.
11698 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11700 * expression.cs: cs0213, cant fix a fixed expression.
11703 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11705 * cs-parser.jay: detect invalid embeded statements gracefully.
11708 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11710 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11713 the invocation type may not be a subclass of the tye of the item/
11714 The type of the item must be a subclass of the invocation item.
11719 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11721 * attribute.cs: Added methods to get a string and a bool from an
11722 attribute. Required to information from AssemblyKeyFileAttribute,
11723 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11724 * codegen.cs: Modified AssemblyName creation to include support for
11725 strongnames. Catch additional exceptions to report them as CS1548.
11726 * compiler.csproj: Updated include CryptoConvert.cs.
11727 * compiler.csproj.user: Removed file - user specific configuration.
11728 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11729 Mono.Security assembly. The original class is maintained and tested in
11730 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11731 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11732 like CSC 8.0 (C# v2) supports.
11733 * Makefile: Added CryptoConvert.cs to mcs sources.
11734 * rootcontext.cs: Added new options for strongnames.
11736 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11738 * driver.cs: For --expect-error, report error code `2'
11739 if the program compiled with no errors, error code `1' if
11740 it compiled with an error other than the one expected.
11742 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11744 * compiler.csproj: Updated for Visual Studio .NET 2003.
11745 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11746 * compiler.sln: Updated for Visual Studio .NET 2003.
11748 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11750 * expression.cs: Fix bug #47234. We basically need to apply the
11751 rule that we prefer the conversion of null to a reference type
11752 when faced with a conversion to 'object' (csc behaviour).
11754 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11756 * statement.cs: Shorter form for foreach, eliminates
11757 a local variable. r=Martin.
11759 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11761 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11762 checks if we can use brtrue/brfalse to test for 0.
11763 * expression.cs: use the above in the test for using brtrue/brfalse.
11764 cleanup code a bit.
11766 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11768 * expression.cs: Rewrite string concat stuff. Benefits:
11770 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11771 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11772 rather than a concat chain.
11774 * typemanager.cs: Add lookups for more concat overloads.
11776 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11778 * expression.cs: Emit shorter il code for array init.
11795 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11797 * statement.cs: Before, two switch blocks would be merged if the
11798 total size of the blocks (end_item - begin_item + 1) was less than
11799 two times the combined sizes of the blocks.
11801 Now, it will only merge if after the merge at least half of the
11806 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11808 * class.cs : csc build fix for GetMethods(). See bug #52503.
11810 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11812 * expression.cs: Make sure fp comparisons work with NaN.
11813 This fixes bug #54303. Mig approved this patch a long
11814 time ago, but we were not able to test b/c the runtime
11817 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11819 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11821 2004-03-19 Martin Baulig <martin@ximian.com>
11823 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11824 two overloads may unify for some type parameter substitutions and
11825 report a CS0408 if appropriate.
11827 2004-03-19 Martin Baulig <martin@ximian.com>
11829 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11830 error here and not in our caller.
11832 2004-03-19 Martin Baulig <martin@ximian.com>
11834 * interface.cs: Completely killed this file.
11835 (Interface): We're now a TypeContainer and live in class.cs.
11837 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11838 argument; we're now also called for interfaces.
11839 (TypeContainer.DefineMembers): Allow this method being called
11841 (TypeContainer.GetMethods): New public method; formerly known as
11842 Interface.GetMethod(). This is used by PendingImplementation.
11843 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11844 it's now private and non-static.
11845 (Interface): Moved this here; it's now implemented similar to
11847 (Method, Property, Event, Indexer): Added `bool is_interface'
11848 argument to their .ctor's.
11849 (MemberBase.IsInterface): New public field.
11851 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11852 instances instead of InterfaceMethod, InterfaceProperty, etc.
11853 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11854 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11856 2004-03-19 Martin Baulig <martin@ximian.com>
11858 * class.cs (MethodCore.IsDuplicateImplementation): New private
11859 method which does the CS0111 checking.
11860 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11861 Use IsDuplicateImplementation().
11863 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11865 * decl.cs (FindMemberToOverride): New method to find the correct
11866 method or property to override in the base class.
11868 - Make Method/Property use the above method to find the
11869 version in the base class.
11870 - Remove the InheritableMemberSignatureCompare as it is now
11873 This patch makes large code bases much faster to compile, as it is
11874 O(n) rather than O(n^2) to do this validation.
11876 Also, it fixes bug 52458 which is that nested classes are not
11877 taken into account when finding the base class member.
11879 Reviewed/Approved by Martin.
11881 2004-03-17 Martin Baulig <martin@ximian.com>
11883 * expression.cs (MemberAccess.DoResolve): Take the parent's number
11884 of type arguments into account; use the `real_num_type_args'
11885 approach like in DoResolveAsTypeStep().
11887 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11890 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11892 * interface.cs: In all interface classes removed redundant
11893 member initialization.
11895 2004-03-16 Martin Baulig <martin@ximian.com>
11897 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11899 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11901 * decl.cs (DefineTypeAndParents): New helper method to define a
11902 type's containers before the type itself is defined; This is a
11903 bug exposed by the recent changes to Windows.Forms when an
11904 implemented interface was defined inside a class that had not been
11907 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11909 (Check): Loop correctly to report errors modifiers
11910 (UNSAFE was not in the loop, since it was the same as TOP).
11912 * interface.cs: Every interface member now takes a ModFlags,
11913 instead of a "is_new" bool, which we set on the base MemberCore.
11915 Every place where we called "UnsafeOk" in the interface, now we
11916 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11917 the unsafe settings from the member declaration instead of the
11918 container interface.
11920 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11922 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11923 `set_indexer_name' to the pending bits (one per type).
11925 We fixed a bug today that was picking the wrong method to
11926 override, since for properties the existing InterfaceMethod code
11927 basically ignored the method name. Now we make sure that the
11928 method name is one of the valid indexer names.
11930 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11932 * support.cs (SeekableStreamReader): Keep track of stream byte
11933 positions and don't mix them with character offsets to the buffer.
11935 Patch from Gustavo Giráldez
11937 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11939 * interface.cs (InterfaceSetGetBase): Removed double member
11940 initialization, base class does it as well.
11942 2004-03-13 Martin Baulig <martin@ximian.com>
11944 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11945 when compiling corlib.
11947 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11949 * convert.cs (ExplicitConversion): We were reporting an error on
11950 certain conversions (object_type source to a value type, when the
11951 expression was `null') before we had a chance to pass it through
11952 the user defined conversions.
11954 * driver.cs: Replace / and \ in resource specifications to dots.
11957 * class.cs: Add check for duplicate operators. Fixes 52477
11959 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11961 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11962 that are in the middle of the statements, not only at the end.
11965 * class.cs (TypeContainer.AddField): No longer set the
11966 `HaveStaticConstructor' flag, now we call it
11967 `UserDefineStaticConstructor' to diferentiate the slightly
11968 semantic difference.
11970 The situation is that we were not adding BeforeFieldInit (from
11971 Modifiers.TypeAttr) to classes that could have it.
11972 BeforeFieldInit should be set to classes that have no static
11977 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11979 And most importantly Zoltan's comment:
11981 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11983 "I think beforefieldinit means 'it's ok to initialize the type sometime
11984 before its static fields are used', i.e. initialization does not need
11985 to be triggered by the first access to the type. Setting this flag
11986 helps the JIT to compile better code, since it can run the static
11987 constructor at JIT time, and does not need to generate code to call it
11988 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11989 this flag for lots of classes like String.
11991 csc sets this flag if the type does not have an explicit static
11992 constructor. The reasoning seems to be that if there are only static
11993 initalizers for a type, and no static constructor, then the programmer
11994 does not care when this initialization happens, so beforefieldinit
11997 This bug prevents the AOT compiler from being usable, since it
11998 generates so many calls to mono_runtime_class_init that the AOT code
11999 is much slower than the JITted code. The JITted code is faster,
12000 because it does not generate these calls if the vtable is type is
12001 already initialized, which is true in the majority of cases. But the
12002 AOT compiler can't do this."
12004 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12006 * class.cs (MethodData.Emit): Refactor the code so symbolic
12007 information is generated for destructors; For some reasons we
12008 were taking a code path that did not generate symbolic information
12011 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12013 * class.cs: Create a Constructor.CheckBase method that
12014 takes care of all validation type code. The method
12015 contains some code that was moved from Define.
12017 It also includes new code that checks for duplicate ctors.
12018 This fixes bug #55148.
12020 2004-03-09 Joshua Tauberer <tauberer@for.net>
12022 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12023 a { ... }-style array creation invokes EmitStaticInitializers
12024 which is not good for reference-type arrays. String, decimal
12025 and now null constants (NullCast) are not counted toward
12026 static initializers.
12028 2004-03-05 Martin Baulig <martin@ximian.com>
12030 * location.cs (SourceFile.HasLineDirective): New public field;
12031 specifies whether the file contains or is referenced by a "#line"
12033 (Location.DefineSymbolDocuments): Ignore source files which
12034 either contain or are referenced by a "#line" directive.
12036 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12038 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12039 direct access to our parent, so check the method inline there.
12041 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12043 * expression.cs (Invocation.EmitCall): Miguel's last commit
12044 caused a regression. If you had:
12049 In Foo the implict this would be null.
12051 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12053 * expression.cs (Invocation.EmitCall): If the method is not
12054 virtual, do not emit a CallVirt to it, use Call.
12056 * typemanager.cs (GetFullNameSignature): Improve the method to
12057 cope with ".ctor" and replace it with the type name.
12059 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12060 as an argument the ConstructorBuilder where it is being defined,
12061 to catch the recursive constructor invocations.
12063 2004-03-16 Martin Baulig <martin@ximian.com>
12065 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12066 ConstructedType, call ResolveType() on it to get the type rather
12067 than just using `expr.Type'.
12069 2004-03-16 Martin Baulig <martin@ximian.com>
12071 * generics.cs (ConstructedType.GetMemberAccess): Take the
12072 EmitContext instead on the TypeExpr and use
12073 ec.TypeContainer.CurrentType/ec.ContainerType.
12075 2004-03-16 Martin Baulig <martin@ximian.com>
12077 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12078 parameters before aliases.
12080 2004-03-16 Martin Baulig <martin@ximian.com>
12082 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12083 New oublic function; checks whether two generic instances may become
12084 equal under some instantiations (26.3.1).
12086 * class.cs (TypeContainer.Define): Call
12087 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12090 2004-03-16 Martin Baulig <martin@ximian.com>
12092 * class.cs (TypeContainer.GetClassBases): Moved
12093 Error_TypeParameterAsBase() here and also check whether the base
12094 class is not an attribute.
12096 2004-03-16 Martin Baulig <martin@ximian.com>
12098 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12100 2004-03-16 Martin Baulig <martin@ximian.com>
12102 * class.cs (Error_TypeParameterAsBase): Use correct error number
12105 2004-03-16 Martin Baulig <martin@ximian.com>
12107 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12110 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12113 2004-03-15 Martin Baulig <martin@ximian.com>
12115 * typemanager.cs (TypeManager.GetFullName): New public method.
12116 (TypeManager.MemberLookup): Added `int_num_type_arguments'
12117 argument; only return members with the correct number of type
12119 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12120 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12121 whether the number of type arguments matches.
12123 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12124 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12126 * expression.cs (MemberAccess): Added public `NumTypeArguments'
12127 field; it's set by the protected .ctor when we're actually a
12128 GenericMemberAccess.
12129 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12130 arguments and pass it to MemberLookupFinal ().
12132 * ecore.cs (Expression.MemberLookup): Added `int
12133 num_type_arguments' argument; only return members with the correct
12134 number of type arguments.
12135 (Expression.MemberLookupFailed): Check whether the MemberLookup
12136 failed because we did not have the correct number of type
12137 arguments; report CS0305 in this case.
12139 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12140 `e.ResolveAsTypeTerminal()' already did so.
12142 2004-03-15 Martin Baulig <martin@ximian.com>
12144 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12145 we're a ConstructedType; in this case, the caller must report an
12146 error (for instance CS0131).
12148 * generic.cs (TypeArguments): Added Location argument to the .ctor.
12149 (TypeArguments.Resolve): Actually report errors here.
12151 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12153 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12154 `set_indexer_name' to the pending bits (one per type).
12156 We fixed a bug today that was picking the wrong method to
12157 override, since for properties the existing InterfaceMethod code
12158 basically ignored the method name. Now we make sure that the
12159 method name is one of the valid indexer names.
12161 2004-03-15 Martin Baulig <martin@ximian.com>
12163 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12164 for generic instances.
12166 2004-03-13 Martin Baulig <martin@ximian.com>
12168 * class.cs (TypeContainer.DefineType): Call
12169 TypeManager.AddUserType() immediately after creating the
12170 TypeBuilder; pass all type parameters when creating the
12173 * decl.cs (DeclSpace.FindNestedType): New public method.
12174 (DeclSpace.FindType): Added `int num_type_args' argument; only
12175 return types with the correct number of type parameters.
12176 (DeclSpace.CountTypeParams): New public property.
12178 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12179 the number of type parameters; defaults to zero.
12181 * generic.cs (TypeArguments.Count): New public property.
12182 (ConstructedType.DoResolveAsTypeStep): First call
12183 ds.FindNestedType() to find out whether we're nested in the
12184 current generic type; in this case, we inherit all type parameters
12185 from the current class.
12187 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12188 num_type_args' argument.
12189 (RootContext.LookupType): Added overloaded version which takes the
12190 number of type arguments; only return types with the correct
12191 number of type arguments.
12193 * typemanager.cs (TypeManager.CheckGeneric): New public function;
12194 checks whether `Type t' has `int num_type_args'.
12196 2004-03-13 Martin Baulig <martin@ximian.com>
12198 * generic.cs (GenericMethod.DefineType): New method; calls
12199 DefineType() on all the type parameters.
12201 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12202 (MethodData.Define): If we're a generic method, call
12203 GenericMethod.DefineType() to define the type parameters.
12205 2004-03-10 Martin Baulig <martin@ximian.com>
12207 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12208 instead of IsAssignableFrom.
12210 2004-03-10 Martin Baulig <martin@ximian.com>
12212 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12214 * support.cs (ParameterData.HasArrayParameter): New property.
12215 (ReflectionParameters.ctor): Take a MethodBase instead of a
12216 ParameterInfo[]. If we have any type parameters, get the generic
12217 method definition and ask it whether we have variable arguments.
12219 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12221 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12222 routines to check if a type is an enumerable/enumerator allow
12223 classes that implement the IEnumerable or IEnumerator interfaces.
12225 * class.cs (Property, Operator): Implement IIteratorContainer, and
12226 implement SetYields.
12228 (Property.Define): Do the block swapping for get_methods in the
12229 context of iterators. We need to check if Properties also
12230 include indexers or not.
12232 (Operator): Assign the Block before invoking the
12233 OperatorMethod.Define, so we can trigger the Iterator code
12236 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12237 Property and Operator classes are not created when we parse the
12238 declarator but until we have the block completed, so we use a
12239 singleton SimpleIteratorContainer.Simple to flag whether the
12240 SetYields has been invoked.
12242 We propagate this setting then to the Property or the Operator to
12243 allow the `yield' to function.
12245 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12247 * codegen.cs: Implemented attribute support for modules.
12248 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12249 Assembly/Module functionality.
12251 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12252 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12253 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12255 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12257 * interface.cs (FindMembers): The operation is performed on all base
12258 interfaces and not only on the first. It is required for future CLS Compliance patch.
12260 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12262 * statement.cs, codegen.cs:
12263 This patch deals with patterns such as:
12265 public class List : IEnumerable {
12267 public MyEnumerator GetEnumerator () {
12268 return new MyEnumerator(this);
12271 IEnumerator IEnumerable.GetEnumerator () {
12275 public struct MyEnumerator : IEnumerator {
12280 Before, there were a few things we did wrong:
12281 1) we would emit callvirt on a struct, which is illegal
12282 2) we emited ldarg when we needed to emit ldarga
12283 3) we would mistakenly call the interface methods on an enumerator
12284 type that derived from IEnumerator and was in another assembly. For example:
12286 public class MyEnumerator : IEnumerator
12288 Would have the interface methods called, even if there were public impls of the
12289 method. In a struct, this lead to invalid IL code.
12291 2004-02-11 Marek Safar <marek.safar@seznam.cz>
12293 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12296 * delegate.cs (Define): Fixed crash when delegate type is undefined.
12298 2004-02-11 Miguel de Icaza <miguel@ximian.com>
12300 * cs-parser.jay: Fix small regression: we were not testing V2
12301 compiler features correctly.
12303 * interface.cs: If the emit context is null, then create one
12305 2004-02-09 Marek Safar <marek.safar@seznam.cz>
12307 * decl.cs (GetSignatureForError): New virtual method to get full name
12308 for error messages.
12310 * attribute.cs (IAttributeSupport): New interface for attribute setting.
12311 Now it is possible to rewrite ApplyAttributes method to be less if/else.
12313 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12314 Duplicated members and code in these classes has been removed.
12315 Better encapsulation in these classes.
12317 2004-02-07 Miguel de Icaza <miguel@ximian.com>
12319 * assign.cs (Assign.DoResolve): When dealing with compound
12320 assignments, there is a new rule in ECMA C# 2.4 (might have been
12321 there before, but it is documented here) that states that in:
12325 If b is of type int, and the `op' is a shift-operator, then the
12326 above is evaluated as:
12330 * expression.cs (Binary.ResolveOperator): Instead of testing for
12331 int/uint/long/ulong, try to implicitly convert to any of those
12332 types and use that in pointer arithmetic.
12334 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12335 method to print information for from the type, not from the
12336 null-method we were given.
12338 2004-02-01 Duncan Mak <duncan@ximian.com>
12340 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12341 parsing for cmd, fixes bug #53694.
12343 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12345 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12346 in the member name duplication tests. Property and operator name duplication
12347 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12349 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12351 * interface.cs (PopulateMethod): Fixed crash when interface method
12352 returns not existing type (error test cs0246-3.cs).
12354 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12356 * cs-parser.jay (interface_accessors): Re-write actions to also
12357 store attributes attached to get and set methods. Fix spelling
12360 (inteface_property_declaration): Modify accordingly.
12362 (InterfaceAccessorInfo): New helper class to store information to pass
12363 around between rules that use interface_accessors.
12365 * interface.cs (Emit): Apply attributes on the get and set
12366 accessors of properties and indexers too.
12368 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12369 right MethodBuilder when applying attributes to the get and set accessors.
12371 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12373 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12375 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12377 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12379 2004-01-25 Miguel de Icaza <miguel@ximian.com>
12381 * cs-parser.jay: Remove YIELD token, instead use the new grammar
12382 changes that treat `yield' specially when present before `break'
12383 or `return' tokens.
12385 * cs-tokenizer.cs: yield is no longer a keyword.
12387 2004-01-23 Marek Safar <marek.safar@seznam.cz>
12389 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12390 setting for default constructors.
12391 For default constructors are almost every time set wrong Modifier. The
12392 generated IL code has been alright. But inside mcs this values was
12393 wrong and this was reason why several of my CLS Compliance tests
12396 2004-02-27 Martin Baulig <martin@ximian.com>
12398 * generics.cs (ConstructedType.ResolveType): Make the nested type
12399 stuff actually work.
12401 2004-02-25 Martin Baulig <martin@ximian.com>
12403 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12404 property; returns the type parameters just from the current type,
12405 ie. with the ones from outer classes.
12406 (DeclSpace.LookupGeneric): First search in the current class, then
12408 (DeclSpace.initialize_type_params): When hiding a type parameter
12409 from an outer class, put it into the `type_param_list' anyways.
12411 * expression.cs (MemberAccess.expr): Made this field protected.
12413 * class.cs (TypeContainer.Define): The `CurrentType' just contains
12414 the type parameters from the current class.
12416 * generic.cs (ConstructedType.ResolveType): Support nested generic
12417 types by taking the type parameters which we inherit from outer
12418 classes into account.
12419 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12420 support for nested generic types.
12422 2004-02-23 Martin Baulig <martin@ximian.com>
12424 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12425 field and check whether we're nested inside a generic type.
12426 (DeclSpace.ResolveType): If we're resolving to a generic type
12427 definition, create a ConstructedType and return its resolved type.
12428 (DeclSpace.initialize_type_params): New private method;
12429 initializes the `type_param_list' field from the type parameters
12430 from this and all enclosing classes.
12431 (DeclSpace.TypeParameters): Call initialize_type_params() unless
12432 we're already initialized.
12434 2004-02-23 Martin Baulig <martin@ximian.com>
12436 * class.cs (Method.Define): Create the generic method before
12437 calling DoDefine().
12438 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12439 the TypeContainer one); we use this for generic methods.
12441 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12442 parent's TypeBuilder.
12444 2004-02-18 Martin Baulig <martin@ximian.com>
12446 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12447 to check for equality.
12449 2004-02-05 Martin Baulig <martin@ximian.com>
12451 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12452 `ec.TypeContainer.CurrentType', use it instead of
12453 `ec.ContainerType' to check whether we're in the type's ctor.
12455 2004-01-29 Martin Baulig <martin@ximian.com>
12457 * expression.cs (Invocation.DoResolve): If we're a
12458 `ConstructedType', then we're actually a generic method, so
12459 rewrite the expr as a GenericMemberAccess.
12461 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12462 here; manually parse it into a string.
12464 2004-01-28 Martin Baulig <martin@ximian.com>
12466 * typemanager.cs (TypeManager.IsEqual): New static method.
12467 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12468 check for equality instead of using `=='.
12470 2004-01-26 Martin Baulig <martin@ximian.com>
12472 * decl.cs (DeclSpace.CurrentType): New public field.
12474 * expression.cs (This.ResolveBase): If we have an
12475 `ec.TypeContainer.CurrentType', use it instead of
12476 `ec.ContainerType'.
12478 * class.cs (TypeContainer.DefineType): If we're a generic type,
12479 create the `CurrentType' (unresolved).
12480 (TypeContainer.GenericType): New private field.
12481 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12482 it and store it in `GenericType' before creating the MemberCache.
12483 (TypeContainer.GetMembers): If we have a `GenericType', call
12484 TypeManager.FindMembers() on it.
12486 * interface.cs (Interface.GenericType): New private field.
12487 (Interface.DefineType): If we're a generic type, create the
12488 `CurrentType' (unresolved).
12489 (Interface.DefineMembers): If we have a `CurrentType', resolve it
12490 and store it in `GenericType' before creating the MemberCache.
12491 (Interface.GetMembers): If we have a `GenericType', call
12492 TypeManager.FindMembers() on it.
12494 2004-01-22 Martin Baulig <martin@ximian.com>
12496 * cs-parser.jay (namespace_or_type_name): Return an Expression,
12497 not a QualifiedIdentifier. This is what `type_name_expression'
12498 was previously doing.
12499 (type_name_expression): Removed; the code is now in
12500 `namespace_or_type_name'.
12501 (qualified_identifier): Removed, use `namespace_or_type_name'
12503 (QualifiedIdentifier): Removed this class.
12505 2004-01-22 Martin Baulig <martin@ximian.com>
12507 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12508 not a string as alias name.
12510 2004-01-21 Miguel de Icaza <miguel@ximian.com>
12512 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12513 #52730 bug, and instead compute correctly the need to use a
12514 temporary variable when requesting an address based on the
12515 static/instace modified of the field and the constructor.
12517 2004-01-21 Martin Baulig <martin@ximian.com>
12519 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12520 class and namespace before looking up aliases. Fixes #52517.
12522 2004-01-21 Martin Baulig <martin@ximian.com>
12524 * flowanalysis.cs (UsageVector.Merge): Allow variables being
12525 assinged in a 'try'; fixes exception4.cs.
12527 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12528 * class.cs : Implemented parameter-less constructor for TypeContainer
12530 * decl.cs: Attributes are now stored here. New property OptAttributes
12532 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12534 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12536 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12538 * typemanager.cs (CSharpSignature): Now reports also inner class name.
12539 (CSharpSignature): New method for indexer and property signature.
12541 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12543 * pending.cs (IsVirtualFilter): Faster implementation.
12545 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12547 * typemanager.cs: Avoid inclusion of same assembly more than once.
12549 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12551 * cs-parser.jay: Fixed problem where the last assembly attribute
12552 has been applied also to following declaration (class, struct, etc.)
12554 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12556 * class.cs: Added error CS0538, CS0539 reporting.
12557 Fixed crash on Microsoft runtime when field type is void.
12559 * cs-parser.jay: Added error CS0537 reporting.
12561 * pending.cs: Added error CS0535 reporting.
12562 Improved error report for errors CS0536, CS0534.
12564 2004-01-20 Miguel de Icaza <miguel@ximian.com>
12566 Merge a few bits from the Anonymous Method MCS tree.
12568 * statement.cs (ToplevelBlock): New class for toplevel methods,
12569 will hold anonymous methods, lifted variables.
12571 * cs-parser.jay: Create toplevel blocks for delegates and for
12572 regular blocks of code.
12574 2004-01-20 Martin Baulig <martin@ximian.com>
12576 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12577 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12578 and `NeedExplicitReturn'; added `IsLastStatement'.
12579 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12580 have a `ReturnLabel' or we're not unreachable.
12582 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12583 child's reachability; don't just override ours with it. Fixes
12584 #58058 (lluis's example).
12585 (FlowBranching): Added public InTryOrCatch(), InCatch(),
12586 InFinally(), InLoop(), InSwitch() and
12587 BreakCrossesTryCatchBoundary() methods.
12589 * statement.cs (Return): Do all error checking in Resolve().
12590 Unless we are the last statement in a top-level block, always
12591 create a return label and jump to it.
12592 (Break, Continue): Do all error checking in Resolve(); also make
12593 sure we aren't leaving a `finally'.
12594 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12595 statement in a top-level block.
12596 (Block.Flags): Added `IsDestructor'.
12597 (Block.IsDestructor): New public property.
12599 2004-01-20 Martin Baulig <martin@ximian.com>
12601 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12603 2004-01-20 Martin Baulig <martin@ximian.com>
12605 * statement.cs (Statement.ResolveUnreachable): New public method.
12606 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12607 (Block.Resolve): Resolve unreachable statements.
12609 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12611 * expression.cs: We need to fix the case where we do
12612 not have a temp variable here.
12614 * assign.cs: Only expression compound assignments need
12615 temporary variables.
12617 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12619 * flowanalysis.cs: Reduce memory allocation in a few ways:
12620 - A block with no variables should not allocate a bit
12622 - A method with no out parameters does not need any tracking
12623 for assignment of the parameters, so we need not allocate
12626 public readonly Type[] VariableTypes;
12627 public readonly string[] VariableNames;
12628 Are redundant. The data is already stored in the variable
12629 map, so we need not allocate another array for it.
12630 - We need to add alot of checks for if (params | locals) == null
12631 due to the first two changes.
12633 2004-01-18 Miguel de Icaza <miguel@ximian.com>
12635 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12636 implement IMemoryLocation, we store a copy on a local variable and
12637 take the address of it. Patch from Benjamin Jemlich
12639 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12640 to use a special "type_name_expression" rule which reduces the
12641 number of "QualifiedIdentifier" classes created, and instead
12642 directly creates MemberAccess expressions.
12644 2004-01-17 Miguel de Icaza <miguel@ximian.com>
12646 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12647 that fixes #52853. Null literal assignment to ValueType
12649 * class.cs (MethodData.Emit): Instead of checking the name of the
12650 method to determine if its a destructor, create a new derived
12651 class from Method called Destructor, and test for that.
12653 * cs-parser.jay: Create a Destructor object instead of a Method.
12655 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12659 2004-01-16 Miguel de Icaza <miguel@ximian.com>
12661 * expression.cs (Binary.ResolveOperator): Perform an implicit
12662 conversion from MethodGroups to their delegate types on the
12663 Addition operation.
12665 * delegate.cs: Introduce a new class DelegateCreation that is the
12666 base class for `NewDelegate' and `ImplicitDelegateCreation',
12667 factor some code in here.
12669 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12670 conversion from MethodGroups to compatible delegate types.
12672 * ecore.cs (Expression.Resolve): Do not flag error 654
12673 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12674 we allow conversions from MethodGroups to delegate types now.
12676 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12677 assignments in v2 either.
12679 2004-01-10 Miguel de Icaza <miguel@ximian.com>
12681 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12682 static read-only fields in ctors.
12684 Applied patch from Benjamin Jemlich
12686 * expression.cs (UnaryMutator): Avoid leaking local variables.
12688 2004-01-09 Miguel de Icaza <miguel@ximian.com>
12690 * cs-tokenizer.cs (IsCastToken): Allow the various native types
12691 here to return true, as they can be used like this:
12693 (XXX) int.MEMBER ()
12695 Fixed 49836 and all the other dups
12697 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
12699 * driver.cs: Implement /win32res and /win32icon.
12701 2004-01-08 Miguel de Icaza <miguel@ximian.com>
12703 * cs-parser.jay: Add a rule to improve error handling for the
12704 common mistake of placing modifiers after the type.
12706 2004-01-07 Miguel de Icaza <miguel@ximian.com>
12708 * cs-parser.jay (interface_event_declaration): Catch
12709 initialization of events on interfaces, and report cs0068
12711 * cs-parser.jay (interface_event_declaration): Catch
12712 initialization of events.
12714 * ecore.cs: Better report missing constructors.
12716 * expression.cs (Binary.ResolveOperator): My previous bug fix had
12717 the error reporting done in the wrong place. Fix.
12719 * expression.cs (Binary.ResolveOperator): Catch the
12720 operator + (E x, E y) error earlier, and later allow for implicit
12721 conversions in operator +/- (E e, U x) from U to the underlying
12724 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12725 52596, if the container class is abstract, the default constructor
12726 is protected otherwise its public (before, we were always public).
12728 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12731 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12732 Jemlich that fixes bug #52597, MCS was generating invalid code for
12733 idisposable structs. Thanks to Ben for following up with this
12736 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12738 * driver.cs: Allow assemblies without code to be generated, fixes
12741 2004-01-07 Nick Drochak <ndrochak@gol.com>
12743 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12745 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12747 * cs-parser.jay: Add rules to improve error reporting if fields or
12748 methods are declared at the namespace level (error 116)
12750 * Add rules to catch event add/remove
12752 2004-01-04 David Sheldon <dave-mono@earth.li>
12754 * expression.cs: Added matching ")" to error message for
12757 2004-01-03 Todd Berman <tberman@gentoo.org>
12759 * ecore.cs, attribute.cs:
12760 Applying fix from #52429.
12762 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12764 * ecore.cs, expression.cs, statement.cs:
12765 Total rewrite of how we handle branching. We
12766 now handle complex boolean expressions with fewer
12767 jumps. As well if (x == 0) no longer emits a ceq.
12769 if (x is Foo) is much faster now, because we generate
12772 Overall, we get a pretty big improvement on our benchmark
12773 tests. The code we generate is smaller and more readable.
12775 I did a full two-stage bootstrap. The patch was reviewed
12776 by Martin and Miguel.
12778 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12780 * cs-parser.jay: Make primary_expression not take a QI.
12781 we dont need this because the member_access rule covers
12782 us here. So we replace the rule with just IDENTIFIER.
12784 This has two good effects. First, we remove a s/r conflict.
12785 Second, we allocate many fewer QualifiedIdentifier objects.
12787 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12789 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12790 set the correct information via SRE. This prevents
12791 hanging on the MS runtime. Fixes #29374.
12793 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12795 * convert.cs: correctly handle conversions to value types
12796 from Enum and ValueType as unboxing conversions.
12798 Fixes bug #52569. Patch by Benjamin Jemlich.
12800 2004-01-02 Ravi Pratap <ravi@ximian.com>
12802 * expression.cs (BetterConversion): Prefer int -> uint
12803 over int -> ulong (csc's behaviour). This fixed bug #52046.
12805 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12807 * decl.cs (MemberCache.FindMembers): now returns a
12810 * typemanager.cs: In general, go with with ^^.
12811 (CopyNewMethods): take an IList.
12812 (RealMemberLookup): Only allocate an arraylist
12813 if we copy from two sets of methods.
12815 This change basically does two things:
12816 1) Fewer array lists allocated due to CopyNewMethods.
12817 2) the explicit cast in MemberList costed ALOT.
12819 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12821 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12822 a hashtable to avoid needless string allocations when an identifier is
12823 used more than once (the common case).
12825 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12827 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12828 is broken, it will not return anything. So, we
12829 have to use the information we have in mcs to
12832 * typemanager.cs: Add a cache for GetInterfaces,
12833 since this will now be used more often (due to ^^)
12835 (GetExplicitInterfaces) New method that gets the
12836 declared, not effective, interfaces on a type
12837 builder (eg, if you have interface IFoo, interface
12838 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12841 This patch makes MCS able to bootstrap itself on
12844 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12846 * expression.cs: Remove the Nop's that Miguel put
12849 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12851 * report.cs, codegen.cs: Give the real stack trace to
12852 the error when an exception is thrown.
12854 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12856 * decl.cs: only allocate hashtables for ifaces if
12859 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12861 * expression.cs: fix the error from cs0121-2.cs
12862 (a parent interface has two child interfaces that
12863 have a function with the same name and 0 params
12864 and the function is called through the parent).
12866 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12868 * class.cs, rootcontext.cs, typmanager.cs: do not
12871 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12873 * codegen.cs: remove stack for the ec flow branching.
12874 It is already a linked list, so no need.
12876 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12878 * Makefile: Allow custom profiler here.
12880 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12882 * typemanager.cs (LookupType):
12883 - Use a static char [], because split takes
12884 a param array for args, so it was allocating
12886 - Do not store true in a hashtable, it boxes.
12888 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12890 * flowanalysis.cs: bytify common enums.
12892 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12894 * modifiers.cs: Add a new set of flags for the
12895 flags allowed on explicit interface impls.
12896 * cs-parser.jay: catch the use of modifiers in
12897 interfaces correctly.
12898 * class.cs: catch private void IFoo.Blah ().
12900 All related to bug #50572.
12902 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12904 * decl.cs: Rewrite the consistant accessability checking.
12905 Accessability is not linear, it must be implemented in
12906 a tableish way. Fixes #49704.
12908 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12910 * expression.cs: Handle negation in a checked context.
12911 We must use subtraction from zero. Fixes #38674.
12913 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12915 * class.cs: Ignore static void main in DLLs.
12916 * rootcontext.cs: Handle the target type here,
12917 since we are have to access it from class.cs
12918 * driver.cs: account for the above.
12920 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12922 * report.cs: Give line numbers and files if available.
12924 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12926 * driver.cs: Implement /addmodule.
12928 * typemanager.cs: Change 'modules' field so it now contains Modules not
12931 2003-12-20 Martin Baulig <martin@ximian.com>
12933 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12934 (FieldBase.IsAssigned): Removed this field.
12935 (FieldBase.SetAssigned): New public method.
12936 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12938 2003-12-20 Martin Baulig <martin@ximian.com>
12940 * expression.cs (LocalVariableReference.DoResolve): Don't set
12941 `vi.Used' if we're called from DoResolveLValue().
12943 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12944 returns the usage vector it just merged into the current one -
12945 pass this one to UsageWarning().
12946 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12947 of the `EmitContext', don't call this recursively on our children.
12949 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12951 * driver.cs: Implement /target:module.
12953 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12955 * support.cs (CharArrayHashtable): New helper class.
12957 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12958 char arrays, not strings, so we can avoid creating a string in
12959 consume_identifier if the identifier is a keyword.
12961 2003-12-16 Martin Baulig <martin@ximian.com>
12963 * statement.cs (LocalInfo.Assigned): Removed this property.
12964 (LocalInfo.Flags): Removed `Assigned'.
12965 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12966 and uses flow analysis.
12967 (Block.UsageWarning): Made this method private.
12968 (Block.Resolve): Call UsageWarning() if appropriate.
12970 * expression.cs (LocalVariableReference.DoResolve): Always set
12971 LocalInfo.Used here.
12973 2003-12-13 Martin Baulig <martin@ximian.com>
12975 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12976 any value here; we're now using flow analysis to figure out
12977 whether a statement/block returns a value.
12979 2003-12-13 Martin Baulig <martin@ximian.com>
12981 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12983 (FlowBranching.MergeFinally): Don't call
12984 `branching.CheckOutParameters()' here, this is called in
12986 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12987 when adding the `finally' vector.
12989 2003-12-13 Martin Baulig <martin@ximian.com>
12992 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12993 actually work and also fix #48962.
12995 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12997 * decl.cs: Do not check System.Object for nested types,
12998 since we know it does not have any. Big bang for buck:
13001 Run 1: 8.35 seconds
13002 Run 2: 8.32 seconds
13003 corlib: 17.99 seconds
13005 Run 1: 8.17 seconds
13006 Run 2: 8.17 seconds
13007 corlib: 17.39 seconds
13009 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13011 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13012 time we are returning 0 members, so we save alot here.
13014 2003-12-11 Martin Baulig <martin@ximian.com>
13016 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13017 `MergeChild()', also just take the `FlowBranching' as argument;
13018 call Merge() on it and return the result.
13019 (FlowBranching.Merge): We don't need to do anything if we just
13022 2003-12-11 Martin Baulig <martin@ximian.com>
13024 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13025 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13026 Maurer for this idea.
13028 2003-12-11 Martin Baulig <martin@ximian.com>
13030 * flowanalysis.cs (MergeResult): This class is now gone; we now
13031 use the `UsageVector' for this. The reason for this is that if a
13032 branching just has one sibling, we don't need to "merge" them at
13033 all - that's the next step to do.
13034 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13037 2003-12-11 Martin Baulig <martin@ximian.com>
13039 Reworked flow analyis and made it more precise and bug-free. The
13040 most important change is that we're now using a special `Reachability'
13041 class instead of having "magic" meanings of `FlowReturns'. I'll
13042 do some more cleanups and optimizations and also add some more
13043 documentation this week.
13045 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13046 largely reworked this class.
13047 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13048 the new `Reachability' class instead of having "magic" values here.
13049 (FlowBranching): We're now using an instance of `Reachability'
13050 instead of having separate `Returns', `Breaks' etc. fields.
13052 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13053 based on flow analysis; ignore the return value of block.Emit ().
13055 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13057 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13058 if they are private.
13060 2003-12-09 Martin Baulig <martin@ximian.com>
13062 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13063 call them directly on the UsageVector.
13065 2003-12-09 Martin Baulig <martin@ximian.com>
13067 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13068 Changed return type from `FlowReturns' to `Reachability'.
13070 2003-12-09 Martin Baulig <martin@ximian.com>
13072 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13073 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13074 `Reachable' fields with a single `Reachability' one.
13076 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13078 * class.cs (FindMembers): Remove foreach's.
13083 Run 1: 8.74 seconds
13084 Run 2: 8.71 seconds
13087 Run 1: 8.64 seconds
13088 Run 2: 8.58 seconds
13091 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13096 This patch does a few things:
13097 1. EmptyStatement is now a singleton, so it is never reallocated.
13098 2. All blah is EmptyStatement constructs have been changed to
13099 blah == EmptyStatement.Value, which is much faster and valid
13100 now that EmptyStatement is a singleton.
13101 3. When resolving a block, rather than allocating a new array for
13102 the non-empty statements, empty statements are replaced with
13103 EmptyStatement.Value
13104 4. Some recursive functions have been made non-recursive.
13105 Mainly the performance impact is from (3), however (1) and (2) are needed for
13106 this to work. (4) does not make a big difference in normal situations, however
13107 it makes the profile look saner.
13112 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13113 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13114 Total memory allocated: 56397 KB
13117 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13118 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13119 Total memory allocated: 55666 KB
13121 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13123 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13124 than the hashtable in a hashtable version
13126 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13127 we always end up concating a string. This results in a huge perf
13128 loss, because many strings have to be tracked by the GC. In this
13129 patch, we first use a hashtable that works with two keys, so that
13130 the strings do not need to be concat'ed.
13134 Run 1: 8.74 seconds
13135 Run 2: 8.71 seconds
13138 Run 1: 8.65 seconds
13139 Run 2: 8.56 seconds
13141 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13143 * Makefile: Add a new target `do-time' that does a quick and simple
13144 profile, leaving easy to parse output.
13146 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13148 * codegen.cs (Init): Create the dynamic assembly with
13149 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13151 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13153 * support.cs: Make the PtrHashtable use only one
13154 instance of its comparer.
13156 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13158 * typemanager.cs: Fix lookup of GetNamespaces.
13160 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13162 * expression.cs: Removed redundant line.
13164 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13165 ArrayLists, use for loops with bounds.
13167 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13170 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13171 arraylists, use for loop with bounds.
13173 The above three changes give us a 0.071 second performance
13174 improvement out of 3.294 seconds down to 3.223. On my machine
13175 the above changes reduced the memory usage by 1,387 KB during
13176 compiler bootstrap.
13178 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13179 QualifiedIdentifiers. Before we created a new string through
13180 concatenation, and mostly later on, the result would be
13181 manipulated by DecomposeQI through string manipulation.
13183 This reduced the compiler memory usage for bootstrapping from
13184 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13185 compile times in 0.05 seconds.
13187 2003-11-28 Dick Porter <dick@ximian.com>
13189 * support.cs: Do string compares with the Invariant culture.
13197 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13198 the comparison is done with the Invariant culture.
13200 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13202 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13203 GetEnumerator method.
13205 (ProbeCollectionType): Iterate starting at the most specific type
13206 upwards looking for a GetEnumerator
13208 * expression.cs: Shift count can be up to 31 for int/uint and 63
13211 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13213 * statement.cs (Block.LookupLabel): Also look for the label on the
13214 children blocks. Use a hash table to keep track of visited
13217 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13218 we actually did transform the other operand, otherwise fall back
13219 to the common codepath that casts to long.
13221 * cs-tokenizer.cs: Use the same code pattern as the int case.
13222 Maybe I should do the parsing myself, and avoid depending on the
13223 Parse routines to get this done.
13225 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13227 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13228 which fixes bug 51347. This time test it.
13230 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13231 attributes for example can not tell the difference between these.
13232 The difference was only a syntax feature of the language.
13234 * attribute.cs: Apply attributes to delegates.
13236 * delegate.cs: Call the apply attributes method.
13238 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13240 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13241 comparing 0 vs Byte.MinValue, not the value
13243 (ImplicitConversionRequired): When reporting a conversion error,
13244 use error 31 to print out the constant error instead of the
13247 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13248 which fixes bug 51347.
13250 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13252 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13253 which fixes the -warnaserror command line option.
13255 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13257 * cfold.cs (DoNumericPromotions): During constant folding of
13258 additions on UIntConstant, special case intconstants with
13259 IntConstants like we do on the expression binary operator.
13261 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13263 * convert.cs (ImplicitReferenceConversion): We were missing a case
13264 (System.Enum are not value types or class types, so we need to
13265 classify them separatedly).
13267 * driver.cs: We do not support error 2007.
13269 2003-11-12 Jackson Harper <jackson@ximian.com>
13271 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13272 system directory. Also use the full file name so users can
13273 libraries names mscorlib-o-tron.dll in a non system dir.
13275 2004-01-04 David Sheldon <dave-mono@earth.li>
13277 * expression.cs: Added matching ")" to error message for CS0077.
13279 2003-12-19 Martin Baulig <martin@ximian.com>
13281 * typemanager.cs (TypeManager.IsEqualGenericType): New public
13282 static method; see documentation in the method.
13283 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13285 * convert.cs (Convert.ImplicitReferenceConversion,
13286 Convert.ImplicitReferenceConversionExists): Add support for
13287 generic type declarations; see gen-36.cs.
13289 2003-12-19 Martin Baulig <martin@ximian.com>
13291 * pending.cs (Pending.InterfaceMethod): Use
13292 `Type.IsAssignableFrom()' instead of `=='.
13294 2003-12-18 Martin Baulig <martin@ximian.com>
13296 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13299 * convert.cs (Convert.ImplicitStandardConversionExists): Use
13300 `expr_type.Equals (target_type)' instead of `=='.
13302 2003-12-08 Martin Baulig <martin@ximian.com>
13304 * generics.cs (Constraints.Types): Removed.
13305 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13307 (Constraints.ResolveTypes): New public method; resolves the
13308 TypeExpr's to Type's.
13309 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13310 longer takes the constraints.
13311 (TypeParameter.DefineMethod): Likewise.
13312 (TypeParameter.DefineType): New public method. Calls
13313 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13316 2003-12-08 Martin Baulig <martin@ximian.com>
13318 * convert.cs (Convert.ImplicitConversionStandard): Use
13319 `expr_type.Equals (target_type)' instead of `=='.
13321 2003-12-08 Martin Baulig <martin@ximian.com>
13323 * typemanager.cs (TypeManager.GetReferenceType): Call
13324 `Type.MakeByRefType ()'.
13326 2003-12-08 Martin Baulig <martin@ximian.com>
13328 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13329 just has some special meaning in some situations. For instance,
13330 it is allowed to use `where' as the name of a variable etc.
13332 2003-12-04 Martin Baulig <martin@ximian.com>
13334 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13335 `Type.MakeArrayType()' for array types.
13337 2003-11-18 Miguel de Icaza <miguel@ximian.com>
13339 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13342 (SizeOf.DoResolve): assign the `type_queried' field. This gets
13345 2003-11-16 Martin Baulig <martin@ximian.com>
13347 * codegen.cs (EmitContext.IsGeneric): Removed.
13349 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13350 ResolveGeneric() on the DeclSpace.
13352 2003-11-16 Martin Baulig <martin@ximian.com>
13354 * generic.cs (TypeArguments.Resolve):
13355 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13356 `ResolveType()' on it to get the Type.
13358 2003-11-15 Martin Baulig <martin@ximian.com>
13360 * generic.cs (ConstructedType.GetInterfaces): Override this.
13362 2003-11-14 Martin Baulig <martin@ximian.com>
13364 * interface.cs (Interface.DefineType): Define all type parameters
13365 before adding the interfaces we inherit.
13367 2003-11-11 Martin Baulig <martin@ximian.com>
13369 * generic.cs (ConstructedType.ResolveType): Always call
13370 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13372 2003-11-10 Martin Baulig <martin@ximian.com>
13374 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13375 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13376 calling `ResolveType()' on them, directly assign their `Type'.
13378 2003-11-08 Martin Baulig <martin@ximian.com>
13380 * generic.cs (ConstructedType): Override `IsClass' etc.
13382 2003-11-08 Martin Baulig <martin@ximian.com>
13384 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13385 return value and the `out parent' parameter.
13386 (TypeContainer.DefineType): Moved the CS0644 check into
13387 GetClassBases(). Don't pass the interface types to the
13388 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13389 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13391 * ecore.cs (TypeExpr.IsAttribute): New property.
13392 (TypeExpr.GetInterfaces): New method.
13394 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13395 TypeExpr instead of a Type.
13396 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13397 (Interface.DefineType): Don't pass the interface types to the
13398 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13399 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13401 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13402 instead of a `Type[]'.
13403 (TypeManager.RegisterBuilder): Likewise.
13404 (TypeManager.AddUserInterface): Likewise.
13405 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13406 `Type[]' and also return a `TypeExpr[]'.
13407 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13409 2003-11-08 Martin Baulig <martin@ximian.com>
13411 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13414 2003-11-08 Martin Baulig <martin@ximian.com>
13416 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13417 TypeManager.ResolveExpressionTypes().
13419 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13420 instead of an Expression.
13421 (TypeExpr): This is now an abstract base class for `TypeExpression'.
13422 (TypeExpression): New public class; formerly known as `TypeExpr'.
13424 * expression.cs (ComposedCast): Derive from TypeExpr.
13426 * typemanager.cs (TypeManager.system_*_expr): These are now
13427 TypExpr's instead of Expression's.
13428 (TypeManager.ResolveExpressionTypes): New public static function;
13429 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13432 2003-11-06 Miguel de Icaza <miguel@ximian.com>
13434 * expression.cs (New.DoResolve): Do not dereference value that
13435 might be a null return.
13437 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13438 sure that the constant value has the right type. Fixes an
13439 unreported bug, similar to 50425.
13441 * const.cs (Const.LookupConstantValue): Call
13442 ImplicitStandardConversionExists before doing a conversion to
13443 avoid havng the TypeManager.ChangeType do conversions.
13445 Reduced the number of casts used
13447 (Const.ChangeType): New routine to enable reuse of the constant
13448 type changing code from statement.
13450 * typemanager.cs (ChangeType): Move common initialization to
13451 static global variables.
13455 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13456 every value type to go through, even if it was void. Fix that.
13458 * cs-tokenizer.cs: Use is_identifier_start_character on the start
13459 character of the define, and the is_identifier_part_character for
13460 the rest of the string.
13462 2003-11-05 Miguel de Icaza <miguel@ximian.com>
13464 * expression.cs (UnaryMutator.EmitCode): When I updated
13465 LocalVariableReference.DoResolve, I overdid it, and dropped an
13466 optimization done on local variable references.
13468 2003-11-04 Miguel de Icaza <miguel@ximian.com>
13470 * ecore.cs: Convert the return from Ldlen into an int.
13472 2003-10-20 Miguel de Icaza <miguel@ximian.com>
13474 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13475 the accessibility, this is a special case for toplevel non-public
13476 classes (internal for instance).
13478 2003-10-20 Nick Drochak <ndrochak@gol.com>
13480 * ecore.cs: Fix typo and build. Needed another right paren.
13482 2003-10-19 Miguel de Icaza <miguel@ximian.com>
13484 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
13485 `internal' case regular and protected, but not allowing protected
13486 to be evaluated later. Bug 49840
13488 2003-10-15 Miguel de Icaza <miguel@ximian.com>
13490 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13491 to kb.Nlast, and not the kb.nFirst to isolate the switch
13494 Extract the underlying type, so enumerations of long/ulong are
13495 treated like long/ulong.
13497 2003-10-14 Miguel de Icaza <miguel@ximian.com>
13499 * expression.cs (New): Overload the meaning of RequestedType to
13500 track the possible creation of the NewDelegate type, since
13501 DoResolve is invoked more than once for new constructors on field
13504 See bugs: #48800 and #37014
13506 * cs-parser.jay (declare_local_constants): Take an arraylist
13507 instead of a single constant.
13509 (local_constant_declaration): It should take a
13510 constant_declarators, not a constant_declarator. Fixes 49487
13512 * convert.cs: Fix error report.
13514 2003-10-13 Jackson Harper <jackson@ximian.com>
13516 * typemanager.cs (TypeToCoreType): Add float and double this fixes
13519 2003-11-03 Martin Baulig <martin@ximian.com>
13521 * expression.cs (ArrayAccess.GetStoreOpcode): Added
13522 `out bool has_type_arg'; if set, we need to pass the type to
13524 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13525 Stelem_Any/Ldelem_Any for generic parameters.
13527 2003-11-02 Martin Baulig <martin@ximian.com>
13529 * expression.cs (Invocation.EmitCall): Use
13530 `TypeManager.IsValueType()' to check whether it's a value type.
13531 Don't set `struct_call' when calling a method on a type parameter.
13533 2003-11-02 Martin Baulig <martin@ximian.com>
13535 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13536 and removed the TypeBuilder argument.
13538 * typemanager.cs (TypeManager.IsValueType): Return
13539 `t.IsGenericParameter || t.IsValueType'.
13541 2003-10-25 Martin Baulig <martin@ximian.com>
13543 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13544 call ConstructedType.Resolve() on it.
13546 * generic.cs (ConstructedType.Resolve): Set `type' on success.
13548 2003-10-25 Martin Baulig <martin@ximian.com>
13550 * class.cs (TypeContainer.GetClassBases): Changed
13551 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
13552 CS8214 reporting here.
13553 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13554 instead of a `Type' for our parent. In case of a recursive
13555 declaration (see tests/gen-23.cs for an example), our parent is a
13556 ConstructedType and it doesn't have its type set. So, first
13557 create our own TypeBuilder, then call constructed.Resolve() to get
13558 the parent's type and finally TypeBuilder.SetParent() it.
13560 * ecore.cs (TypeExpr.Name): New public virtual property.
13563 (ConstructedType): We're now a TypeExpr and not just an Expression.
13564 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
13565 arguments here; this is done later.
13566 (ConstructedType.Resolve): New public method to resolve the type
13567 arguments and bind them.
13569 2003-10-21 Martin Baulig <martin@ximian.com>
13571 * convert.cs: Use `TypeManager.IsValueType' instead of
13572 'type.IsValueType' everywhere.
13574 * typemanager.cs (TypeManager.IsValueType): Return true for type
13575 parameters. The reason for this is that we need to box a type
13576 parameter when converting it to a reference type.
13578 * cs-parser.jay: Added support for default value expressions.
13580 * generics.cs (DefaultValueExpression): New public class.
13582 2003-10-17 Martin Baulig <martin@ximian.com>
13584 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13585 TypeContainer so we can also use this for Interfaces.
13586 (TypeParameter.Resolve): Likewise.
13588 * interface.cs (Interface.DefineType): Added support for generic
13591 * cs-parser.jay: Added support for generic structs and interfaces.
13593 2003-10-17 Martin Baulig <martin@ximian.com>
13595 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13596 call generic methods :-)
13598 2003-10-16 Martin Baulig <martin@ximian.com>
13600 * cs-parser.jay (namespace_or_type_name): Only create a
13601 GenericMemberAccess if we actually have type arguments.
13603 2003-10-13 Martin Baulig <martin@ximian.com>
13605 * class.cs (Method.Define): If we're a generic method, call
13606 TypeBuilder.DefineGenericMethod () before resolving
13608 (MethodData): Added .ctor which takes an additional MethodBuilder
13609 argument; this is used for generic methods.
13610 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13611 we already have a MethodBuilder.
13613 2003-10-10 Martin Baulig <martin@ximian.com>
13615 * class.cs (Method): Added .ctor which takes a `GenericMethod'
13616 instead of a `DeclSpace'. This is used for generic methods.
13618 * cs-parser.jay (method_header): Added support for generic
13619 methods; create a `GenericMethod' instance and pass it to the
13620 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13621 parameters and locals.
13623 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13624 since we already have the location. Check whether we're a generic
13625 type declaration or a generic method and create the correct type
13628 * generic.cs (TypeParameter.DefineMethod): New public method.
13629 (GenericMethod): New public class; derives from DeclSpace and is
13630 used for generic methods.
13632 2003-10-09 Martin Baulig <martin@ximian.com>
13634 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13636 (MethodCore.DoDefineParameters): Removed the TypeContainer
13637 argument; use the DeclSpace which was passed to the .ctor instead.
13638 (MethodCore.CheckParameter): Take a DeclSpace instead of a
13639 TypeContainer; we only need a DeclSpace here.
13641 2003-10-09 Martin Baulig <martin@ximian.com>
13643 * class.cs (MethodData): Added additional `DeclSpace ds' argument
13645 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13646 EmitContext's .ctor.
13648 2003-10-09 Martin Baulig <martin@ximian.com>
13650 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13651 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13652 AsAccessible(), moved them as well.
13654 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13656 2003-10-07 Miguel de Icaza <miguel@ximian.com>
13658 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13659 generation for >=, as spotted by Paolo, bug 48679.
13660 Patch from David Waite.
13662 * cs-tokenizer.cs: Add handling for #pragma.
13664 * cs-parser.jay: Allow for both yield and yield return in the
13665 syntax. The anti-cobolization of C# fight will go on!
13667 * class.cs (TypeBuilder.DefineType): Catch error condition here
13668 (Parent.DefineType erroring out and returning null).
13670 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13671 coping with enumerations variables, we were mistakenly processing
13672 them as a regular value type instead of built-in types. Fixes the
13675 * typemanager.cs (IsBuiltinOrEnum): New method.
13677 2003-09-30 Miguel de Icaza <miguel@ximian.com>
13679 * cs-parser.jay: Upgrade: yield now needs the return clause.
13681 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13683 * cs-parser.jay : Renamed yyName to yyNames related to jay.
13685 2003-09-29 Martin Baulig <martin@ximian.com>
13687 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13688 inflated generic methods.
13690 * generics.cs (ConstructedType): Distinguish between open and
13691 closed constructed types; correctly resolve the arguments.
13693 2003-09-22 Martin Baulig <martin@ximian.com>
13695 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13696 all type arguments meet their constraints.
13698 2003-09-19 Martin Baulig <martin@ximian.com>
13700 * decl.cs (MemberCache.SetupCacheForInterface): Take a
13701 `MemberCache parent' argument. Normally, an interface doesn't
13702 have a parent type except System.Object, but we use this in gmcs
13703 for generic type parameters.
13705 2003-09-18 Martin Baulig <martin@ximian.com>
13707 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13708 on `type.IsInterface'; don't check whether the type has a parent
13709 to determine whether it's an interface.
13711 2003-09-17 Martin Baulig <martin@ximian.com>
13713 * generic.cs (ConstructedType.ToString): Always use `name' as the
13716 2003-09-15 Martin Baulig <martin@ximian.com>
13718 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13720 * generic.cs (Constraints.Resolve): New public method; this is
13721 called to resolve the constraint types and to check whether all
13722 the constraints are correct.
13723 (Constraints.Types): New public property.
13724 (TypeParameter.Resolve): New public method; resolves all the
13725 type's constraints.
13727 * class.cs (TypeContainer.DefineType): Call
13728 TypeParameter.Resolve() before actually defining the type.
13730 2003-09-15 Martin Baulig <martin@ximian.com>
13732 * class.cs (TypeContainer.DefineType): Added an error flag to
13733 avoid reporting duplicate CS0146's ("class definition is
13736 * driver.cs (Driver.MainDriver): Abort if
13737 RootContext.ResolveTree() reported any errors.
13739 2003-09-07 Martin Baulig <martin@ximian.com>
13741 * report.cs (Error, Warning): Added overloaded versions which take
13742 a `params object[] args' and call String.Format().
13744 2003-09-07 Martin Baulig <martin@ximian.com>
13746 * decl.cs (DeclSpace..ctor): Don't call
13747 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13748 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
13749 (DeclSpace.RecordDecl): New method.
13751 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13753 2003-09-02 Ravi Pratap <ravi@ximian.com>
13755 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13756 value attributes to be applied to ParameterBuilders.
13758 * class.cs (MethodCore.LabelParameters): Make static and more
13759 generic so that it can be used from other places - like interface
13760 methods, for instance.
13762 * interface.cs (Interface.Emit): Call LabelParameters before
13763 emitting attributes on the InterfaceMethod.
13765 2003-09-07 Martin Baulig <martin@ximian.com>
13767 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13768 if the number of type parameters doesn't match.
13770 2003-09-04 Martin Baulig <martin@ximian.com>
13772 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13773 for arrays of generic type params (ie. `!0[]').
13775 2003-09-04 Martin Baulig <martin@ximian.com>
13777 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13780 2003-09-04 Martin Baulig <martin@ximian.com>
13782 * decl.cs (DeclSpace.LookupGeneric): New method.
13783 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13786 * generic.cs (TypeParameterExpr): Take a TypeParameter as
13787 argument, not just a string.
13788 (TypeParameter.Define): New public method; this is called to
13789 actually define the generic parameter; after this, you can use the
13790 new `Type' property to get the type.
13792 2003-09-04 Martin Baulig <martin@ximian.com>
13794 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13795 is now an ArrayList; initialize the result of the `TypeParameters'
13797 (DeclSpace.GetGenericData): Removed.
13798 (DeclSpace.LookupGeneric): Temporarily removed; we need to
13799 implement this in a different way.
13800 (DeclSpace.GetTypeParameters): Removed; there's now a
13801 `TypeParameters' property.
13802 (DeclSpace.TypeParameters): New public property.
13804 * generic.cs (Constraints): Make this class public.
13805 (TypeParameter): New public class.
13807 2003-09-04 Martin Baulig <martin@ximian.com>
13809 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13810 generic parameters.
13812 * class.cs (TypeContainer.DefineType): Call
13813 TypeBuilder.DefineGenericParameter () on all generic parameters if
13814 this is a generic type.
13816 2003-08-28 Martin Baulig <martin@ximian.com>
13818 * sample-stack.il: Compile this with ilasm: "ilasm /dll
13821 * sample-hello.cs: Compile this with gmcs: "gmcs
13822 /r:sample-stack.dll sample-hello.cs".
13824 2003-08-28 Martin Baulig <martin@ximian.com>
13826 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13827 the parameters to the generic type.
13829 2003-08-28 Martin Baulig <martin@ximian.com>
13831 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13833 2003-08-28 Martin Baulig <martin@ximian.com>
13835 * cs-parser.jay (opt_type_argument_list): Use
13836 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13837 (primary_expression): Replace `qualified_identifier' with `type_name'.
13838 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13840 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13841 parser to check whether it is syntactically a type parameter list;
13842 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13845 2003-08-26 Martin Baulig <martin@ximian.com>
13847 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13848 resolving aliases; fixes #47927.
13850 2003-08-26 Martin Baulig <martin@ximian.com>
13852 * statement.cs (Using.DoResolve): This is internally emitting a
13853 try/finally clause, so we need to set ec.NeedExplicitReturn if we
13854 do not always return. Fixes #47681.
13856 2003-08-26 Martin Baulig <martin@ximian.com>
13858 * decl.cs (MemberCore): Moved WarningNotHiding(),
13859 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13861 (AdditionResult): Make this nested in DeclSpace.
13862 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13863 argument; call NamespaceEntry.Define() unless we're nested in a
13866 * namespace.cs (Namespace.DefineName): New public function. This
13867 is called from DeclSpace's .ctor to add
13868 (Namespace.Lookup): Include DeclSpaces in the lookup.
13870 * class.cs (Operator): Derive from MemberBase, not MemberCore.
13872 * const.cs (Const): Derive from MemberBase, not MemberCore.
13874 2003-08-25 Martin Baulig <martin@ximian.com>
13876 * convert.cs (Convert.ExplicitReferenceConversion): When
13877 converting from an interface type to a class, unbox if the target
13878 type is a struct type. Fixes #47822.
13880 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13882 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13885 2003-08-22 Martin Baulig <martin@ximian.com>
13887 * class.cs (TypeManager.DefineType): When defining a nested type,
13888 call DefineType() on our parent; fixes #47801.
13890 2003-08-22 Martin Baulig <martin@ximian.com>
13892 * class.cs (MethodData.Define): While checking if a method is an
13893 interface implementation, improve the test a bit more to fix #47654.
13895 2003-08-22 Martin Baulig <martin@ximian.com>
13897 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13898 correctly; fixes #47722.
13900 2003-08-22 Martin Baulig <martin@ximian.com>
13902 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13903 LocalVariableReference, ensure it's not read-only. Fixes #47536.
13905 * statement.cs (Fixed.DoResolve): Make all variables read-only.
13907 2003-08-22 Martin Baulig <martin@ximian.com>
13909 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13910 can only be assigned in static constructors. Fixes #47161.
13912 2003-08-22 Martin Baulig <martin@ximian.com>
13914 Rewrote and improved the flow analysis code.
13916 * flowbranching.cs (FlowBranching): Make this class abstract.
13917 (FlowBranching.CreateBranching): New static function to create a
13918 new flow branching.
13919 (FlowBranchingBlock, FlowBranchingException): New classes.
13920 (FlowBranching.UsageVector.Type): New public readonly field.
13921 (FlowBranching.UsageVector.Breaks): Removed the setter.
13922 (FlowBranching.UsageVector.Returns): Removed the setter.
13923 (FlowBranching.UsageVector): Added Break(), Return(),
13924 NeverReachable() and Throw() methods to modify the reachability.
13925 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13926 done by FlowBranching.Merge().
13927 (FlowBranching.UsageVector.MergeChild): New method; merges the
13928 merge result into the current vector.
13929 (FlowBranching.Merge): New abstract method to merge a branching.
13931 2003-08-12 Martin Baulig <martin@ximian.com>
13933 * expression.cs (Indirection.CacheTemporaries): Create the
13934 LocalTemporary with the pointer type, not its element type.
13936 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13938 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13939 token was a keyword or not.
13941 Add `error' options where an IDENTIFIER was expected; Provide
13942 CheckToken and CheckIdentifierToken convenience error reporting
13945 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13947 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13948 NameSpaceEntry NameSpaceEntry.
13950 (LookupInterfaceOrClass): Avoid creating a full qualified name
13951 from namespace and name: avoid doing lookups when we know the
13952 namespace is non-existant. Use new Tree.LookupByNamespace which
13953 looks up DeclSpaces based on their namespace, name pair.
13955 * driver.cs: Provide a new `parser verbose' to display the
13956 exception thrown during parsing. This is turned off by default
13957 now, so the output of a failure from mcs is more graceful.
13959 * namespace.cs: Track all the namespaces defined in a hashtable
13962 (IsNamespace): New method
13964 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13966 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13967 we know that we need to concatenate (full typename can never be
13972 * statement.cs: Use a bitfield; Do not initialize to null things
13973 which are done by the constructor by default.
13975 * cs-parser.jay: bug fix, parameter was 4, not 3.
13977 * expression.cs: Just use the property;
13979 * statement.cs: No need for GetVariableInfo method.
13981 2003-08-08 Martin Baulig <martin@ximian.com>
13983 * flowanalysis.cs (FlowReturns): This is now nested in the
13984 `FlowBranching' class.
13985 (MyBitVector): Moved this here from statement.cs.
13986 (FlowBranching.SiblingType): New enum type.
13987 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13989 2003-08-07 Martin Baulig <martin@ximian.com>
13991 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13992 `FlowBranching' class and called `BranchingType'.
13994 2003-08-07 Martin Baulig <martin@ximian.com>
13996 * flowanalysis.cs: Moved all the control flow analysis code into
13999 2003-08-07 Martin Baulig <martin@ximian.com>
14001 * assign.cs (Assign.DoResolve): `target' must either be an
14002 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
14005 2003-08-07 Miguel de Icaza <miguel@ximian.com>
14007 * expression.cs (BinaryMethod): This kind of expression is created by the
14008 Binary class if it determines that the operator has to be handled
14011 (BinaryDelegate): This kind of expression is created if we are
14012 dealing with a + or - operator on delegates.
14014 (Binary): remove method, argumetns, and DelegateOperator: when
14015 dealing with methods,
14017 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14019 * statement.cs (Block): use bitfields for the three extra booleans
14020 we had in use. Remove unused topblock parameter.
14022 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14024 * assign.cs: Drop extra unneeded tests.
14026 2003-08-06 Miguel de Icaza <miguel@ximian.com>
14028 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14030 * statement.cs (Foreach): Use VariableStorage instead of
14033 * codegen.cs (VariableStorage): New class used by clients that
14034 require a variable stored: locals or fields for variables that
14035 need to live across yield.
14037 Maybe provide a convenience api for EmitThis+EmitLoad?
14039 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14042 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14044 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14045 RemapParameterLValue): New methods that are used to turn a
14046 precomputed FieldInfo into an expression like this:
14050 The idea is to use this instead of making LocalVariableReference
14051 have more than one meaning.
14053 * cs-parser.jay: Add error production to BASE.
14055 * ecore.cs: Deal with TypeManager.GetField returning null, which
14056 is now a valid return value.
14058 (FieldExprNoAddress): New expression for Fields whose address can
14061 * expression.cs (LocalVariableReference): During the resolve
14062 phases, create new expressions if we are in a remapping context.
14063 Remove code that dealt with remapping here.
14065 (ParameterReference): same.
14067 (ProxyInstance): New expression, like the `This' expression, but
14068 it is born fully resolved. We know what we are doing, so remove
14069 the errors that are targeted to user-provided uses of `this'.
14071 * statement.cs (Foreach): our variable is now stored as an
14072 Expression; During resolution, follow the protocol, dont just
14073 assume it will return this.
14075 2003-08-06 Martin Baulig <martin@ximian.com>
14077 * support.cs (SeekableStreamReader.cs): New public class.
14079 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14080 SeekableStreamReader instead of the normal StreamReader.
14082 2003-08-04 Martin Baulig <martin@ximian.com>
14084 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14085 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14086 deambiguate casts and delegate invocations.
14087 (parenthesized_expression): Use the new tokens to ensure this is
14088 not a cast of method invocation.
14090 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14091 when reading a `)' and Deambiguate_CloseParens () was previously
14094 * expression.cs (ParenthesizedExpression): New class. This is
14095 just used for the CS0075 test.
14096 (Binary.DoResolve): Check for CS0075.
14098 2003-07-29 Ravi Pratap <ravi@ximian.com>
14100 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14101 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14102 reference comparison.
14104 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14105 examine the ReturnType for equality - this is necessary in the
14106 cases of implicit and explicit operators whose signature also
14107 includes the return type.
14109 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14111 * namespace.cs: Cache the result of the namespace computation,
14112 instead of computing it every time.
14114 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14116 * decl.cs: Use a global arraylist that we reuse over invocations
14117 to avoid excesive memory consumption. Reduces memory usage on an
14118 mcs compile by one meg (45 average).
14120 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14121 private, work around that.
14123 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14125 * literal.cs (IntLiteral): Define Zero and One static literals.
14127 * cs-parser.jay (integer_literal): use static literals to reduce
14128 memory usage for the most used literals (0, 1 and -1). 211kb
14129 reduced in memory usage.
14131 Replace all calls to `new ArrayList' with `new
14132 ArrayList(4)' which is a good average number for most allocations,
14133 and also requires only 16 bytes of memory for its buffer by
14136 This reduced MCS memory usage in seven megabytes for the RSS after
14139 2003-07-28 Ravi Pratap <ravi@ximian.com>
14141 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14142 handle params methods the correct way by forming only one
14143 applicable set with params and normal methods in them. Earlier we
14144 were looking at params methods only if we found no normal methods
14145 which was not the correct thing to do.
14147 (Invocation.BetterFunction): Take separate arguments indicating
14148 when candidate and the best method are params methods in their
14151 This fixes bugs #43367 and #46199.
14153 * attribute.cs: Documentation updates.
14155 (CheckAttribute): Rename to CheckAttributeTarget.
14156 (GetValidPlaces): Rename to GetValidTargets.
14158 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14159 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14163 2003-07-28 Miguel de Icaza <miguel@ximian.com>
14165 * codegen.cs: Compute IsGeneric correctly.
14167 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14170 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14171 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
14172 regressions, and I was chasing more bugs than I required.
14174 * interface.cs: Use expressions for base type names (like classes
14175 and structs have been doing for a while now), and resolve that.
14176 This patch should probably go into head as well.
14178 This makes it one less user of FindType.
14180 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14182 This compiler can not self host currently. Need to fix that.
14184 * Makefile: compile to `gmcs.exe'
14186 * driver.cs: Turn on v2 by default on gmcs.
14188 * generic.cs (ConstructedType): Does no longer take a container
14189 type argument; That will be taken care of later.
14191 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14192 Use SimpleName to resolve for now, so we can continue the work on
14193 the parser, until we get Type.GetType that understands generics.
14195 (ConstructedType.ToString): Implement
14197 (TypeArguments.Resolve): Resolve the child expressions as types.
14199 * cs-parser.jay: Rename interface_constraints to
14200 type_parameter_constraints
14202 (namespace_or_type_name): Only use constructed types for the basic
14203 construction, we will deal with identifier<...> later.
14205 (type/type_name): No longer call DecomposeQI, as
14206 namespace_or_type_name is always decoded now.
14208 2003-07-22 Ravi Pratap <ravi@ximian.com>
14210 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14211 closely: we eliminate methods in base types when we have an
14212 applicable method in a top-level type.
14214 Please see section 14.5.5.1 for an exact description of what goes
14217 This fixes bug #45127 and a host of other related to corlib compilation.
14219 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14220 array is the method corresponding to the top-level type (this is
14221 because of the changes made to icall.c) so we change this
14224 (MethodGroupExpr.Name): This too.
14226 * typemanager.cs (GetElementType): New method which does the right
14227 thing when compiling corlib.
14229 * everywhere: Make use of the above in the relevant places.
14231 2003-07-22 Martin Baulig <martin@ximian.com>
14233 * cs-parser.jay (invocation_expression): Moved
14234 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14235 `cast_expression', but create a InvocationOrCast which later
14236 resolves to either an Invocation or a Cast.
14238 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14239 method; call this before EmitStatement() to make sure that this
14240 expression can be used as a statement.
14242 * expression.cs (InvocationOrCast): New class; resolves to either
14243 an Invocation or a Cast.
14245 * statement.cs (StatementExpression): Call ResolveStatement() on
14246 the ExpressionStatement before emitting it.
14248 2003-07-21 Martin Baulig <martin@ximian.com>
14250 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14251 `ref' and `out' attributes match; fixes #46220.
14252 (MemberAccess.ResolveMemberAccess): You can't reference a type
14253 through an expression; fixes #33180.
14254 (Indexers.GetIndexersForType): Don't return the indexers from
14255 interfaces the class implements; fixes #46502.
14257 2003-07-21 Martin Baulig <martin@ximian.com>
14259 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14260 CS0661 checks; fixes bug #30442.
14262 2003-07-21 Martin Baulig <martin@ximian.com>
14264 * decl.cs (AdditionResult): Added `Error'.
14266 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14268 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14269 cs0031.cs actually work.
14271 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14273 * cs-parser.jay (namespace_name): do not use
14274 namespace_or_type_name, use qualified_identifier, because
14275 namespace_or_type_name will soon return a composed expression
14276 instead of a string.
14278 (namespace_or_type_name): Instead of returning a string, now this
14279 production returns an expression.
14281 * codegen.cs (EmitContext): Setup IsGeneric property based on
14282 whether our DeclSpace is generic, our the method is generic.
14284 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14285 the method is generic.
14287 * cs-parser.jay (type_arguments, opt_type_argument_list,
14288 type_parameters, type_parameter_list, opt_type_parameter_list,
14289 type_parameter,, opt_type_parameter_constraints_clauses,
14290 type_parameter_constraints_clauses,
14291 type_parameter_constraint_clause, type_parameter_constraint,
14292 interface_constraints): Add new production
14294 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14295 DeclSpace is generic or not.
14297 (DeclSpace.SetParameterInfo): New routine, used to set the
14298 parameter info for a type.
14300 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14301 returns a GenericTypeExpr
14303 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14304 generic, lookup the generic argument.
14306 * attribute.cs: Do not allow TypeParameterExpressions in
14309 * class.cs: Do not allow the Main method to be defined in a
14312 * expression.cs (SizeOf): Do not allow generic types to be used as
14313 arguments to sizeof.
14315 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14316 it: whether a type is generic or not. Only works for types we are
14317 currently building for now.
14319 2003-07-20 Martin Baulig <martin@ximian.com>
14321 * namespace.cs: Fixed that bug which caused a crash when compiling
14322 the debugger's GUI.
14324 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14326 * typemanager.cs (LookupTypeReflection): Never expose types which
14327 are NotPublic, NestedPrivate, NestedAssembly, or
14328 NestedFamANDAssem. We used to return these, and later do a check
14329 that would report a meaningful error, but the problem is that we
14330 would not get the real match, if there was a name override.
14332 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14334 * namespace.cs (Namespace, Name): Do not compute the namespace
14335 name dynamically, compute it in the constructor. This reduced
14336 memory usage by 1697 KB.
14338 * driver.cs: Use --pause to pause at the end.
14340 2003-07-17 Peter Williams <peter@newton.cx>
14342 * Makefile: Change the name of the test target so that it doesn't
14343 conflict with the recursive test target.
14345 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14347 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14348 AddressOf): Do not use EmitThis, that was wrong, use the actual
14351 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14353 * class.cs (MethodData.Define): While checking if a method is an
14354 interface implementation, improve the test: If we are not public
14355 (use new test here: use the computed MethodAttributes directly,
14356 instead of the parsed modifier flags) check if the `implementing'
14357 method comes from an interface or not.
14359 * pending.cs (VerifyPendingMethods): Slightly better error
14362 * makefile: add test target that does the mcs bootstrap.
14364 2003-07-16 Ravi Pratap <ravi@ximian.com>
14366 * interface.cs (Define): Do nothing here since there are no
14367 members to populate etc. Move the attribute emission out of here
14368 since this was just totally the wrong place to put it. Attribute
14369 application happens during the 'Emit' phase, not in the 'Define'
14372 (Emit): Add this method and move the attribute emission here
14374 * rootcontext.cs (EmitCode): Call the Emit method on interface
14377 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14379 * expression.cs (OverloadResolve): Report error only if Location
14380 is not 'Null' which means that there was a probe going on.
14382 2003-07-14 Martin Baulig <martin@ximian.com>
14384 * expression.cs (ConditionalLogicalOperator): New public class to
14385 implement user defined conditional logical operators.
14386 This is section 14.11.2 in the spec and bug #40505.
14388 2003-07-14 Martin Baulig <martin@ximian.com>
14390 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14392 2003-07-14 Martin Baulig <martin@ximian.com>
14394 * codegen.cs (EmitContext.InFixedInitializer): New public field.
14396 * ecore.cs (IVariable.VerifyFixed): New interface method.
14398 * expression.cs (Unary.ResolveOperator): When resolving the `&'
14399 operator, check whether the variable is actually fixed. Fixes bug
14400 #36055. Set a variable definitely assigned when taking its
14401 address as required by the spec.
14403 * statement.cs (LocalInfo.IsFixed): New field.
14404 (LocalInfo.MakePinned): Set `IsFixed' to true.
14406 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14408 * attribute.cs (Attribute.Resolve): While doing a Member lookup
14409 for .ctors, ensure that we only ask for members declared in the
14410 attribute type (BindingFlags.DeclaredOnly).
14414 * expression.cs (Error_WrongNumArguments): Report error 1501
14415 correctly the way CSC does.
14417 2003-07-13 Martin Baulig <martin@ximian.com>
14419 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14420 lookup on the fully qualified name, to make things like "X.X" work
14421 where "X.X" is a fully qualified type name, but we also have a
14422 namespace "X" in the using list. Fixes #41975.
14424 2003-07-13 Martin Baulig <martin@ximian.com>
14426 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14427 function. If we're a CompoundAssign, we need to create an embedded
14428 CompoundAssign, not an embedded Assign.
14429 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14432 2003-07-13 Martin Baulig <martin@ximian.com>
14434 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14435 work to fix bug #46088.
14437 2003-07-13 Ravi Pratap <ravi@ximian.com>
14439 * class.cs (Operator.Emit): Do not emit attributes here - it is
14440 taken care of by the Method class that we delegate too. This takes
14441 care of bug #45876.
14443 2003-07-10 Martin Baulig <martin@ximian.com>
14445 * expression.cs (TypeOfVoid): New class.
14446 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
14448 2003-07-10 Martin Baulig <martin@ximian.com>
14450 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14453 2003-07-10 Martin Baulig <martin@ximian.com>
14455 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14456 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14458 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14460 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14462 2003-07-10 Martin Baulig <martin@ximian.com>
14464 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14465 of decimal. Fixes #42850.
14467 NOTE: I also fixed the created byte blob, but this doesn't work on
14468 the MS runtime and csc never produces any byte blobs for decimal
14471 2003-07-10 Martin Baulig <martin@ximian.com>
14473 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14474 structs; fixes #32068.
14475 (Block.AddChildVariableNames): Fixed #44302.
14477 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14479 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14481 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14483 * attribute.cs: And this test is onger needed.
14485 2003-07-08 Martin Baulig <martin@ximian.com>
14487 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14488 inaccessible types. Fixes #36313.
14490 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14492 * namespace.cs (NamespaceEntry): Create implicit entries for all
14493 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14494 implicit entries for N1.N2 and N1.
14496 2003-07-08 Martin Baulig <martin@ximian.com>
14498 Rewrote the handling of namespaces to fix a lot of the issues
14499 wrt. `using' aliases etc.
14501 * namespace.cs (Namespace): Splitted this class into a
14502 per-assembly `Namespace' and a per-file `NamespaceEntry'.
14504 * typemanager.cs (TypeManager.IsNamespace): Removed.
14505 (TypeManager.ComputeNamespaces): Only compute namespaces from
14506 loaded assemblies here, not the namespaces from the assembly we're
14507 currently compiling.
14509 2003-07-08 Martin Baulig <martin@ximian.com>
14511 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14513 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14515 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14518 I thought about the memory savings here, but LookupTypeReflection
14519 is used under already very constrained scenarios. Compiling
14520 corlib or mcs only exposes one hit, so it would not really reduce
14521 any memory consumption.
14523 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14525 * typemanager.cs: fixes bug #45889 by only adding public types from
14526 other assemblies to the list of known types.
14528 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14530 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14531 on the type we resolved.
14533 2003-07-05 Martin Baulig <martin@ximian.com>
14535 * pending.cs (PendingImplementation.ParentImplements): Don't
14536 create the proxy if the parent is abstract.
14538 * class.cs (TypeContainer.DefineIndexers): Process explicit
14539 interface implementations first. Fixes #37714.
14541 2003-07-04 Miguel de Icaza <miguel@ximian.com>
14543 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14544 defined recursively; but since we modify the input parameters
14545 (left is set to `this' temporarily), we reset this value if the
14546 left_is_explicit is false, which gives the original semantics to
14549 * literal.cs (NullPointer): new class used to represent a null
14550 literal in a pointer context.
14552 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14553 type is a pointer, use a NullPointer object instead of a
14554 NullLiteral. Closes 43687
14556 (ExplicitConversion): Convert pointer values using
14557 the conv opcode to the proper type.
14559 * ecore.cs (New): change ValueTypeVariable property into a method,
14560 that returns whether the valuetype is suitable for being used.
14562 * expression.cs (Binary.DoNumericPromotions): Only return if we
14563 the int constant was a valid uint, and we can return both left and
14564 right as uints. If not, we continue processing, to trigger the
14565 type conversion. This fixes 39018.
14567 * statement.cs (Block.EmitMeta): During constant resolution, set
14568 the CurrentBlock property on the emitcontext, so that we resolve
14569 constants propertly.
14571 2003-07-02 Martin Baulig <martin@ximian.com>
14573 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14574 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14576 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14577 than emitting it here.
14579 * statement.cs: Fixed some more flow analysis bugs.
14581 2003-07-02 Martin Baulig <martin@ximian.com>
14583 * class.cs (MethodData.Define): When implementing interface
14584 methods, set Final unless we're Virtual.
14586 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14587 check work for interface methods.
14589 2003-07-01 Martin Baulig <martin@ximian.com>
14591 * ecore.cs (EmitContext.This): Replaced this property with a
14592 GetThis() method which takes a Location argument. This ensures
14593 that we get the correct error location for a CS0188.
14595 2003-07-01 Miguel de Icaza <miguel@ximian.com>
14597 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14598 ImplicitStandardConversion.
14600 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14602 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
14604 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14607 2003-06-30 Miguel de Icaza <miguel@ximian.com>
14609 * class.cs (Constructor.Define): Turn off initlocals for unsafe
14612 (MethodData.Define): Turn off initlocals for unsafe methods.
14614 2003-06-29 Miguel de Icaza <miguel@ximian.com>
14616 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14617 complete; Fixes #37521.
14619 * delegate.cs: Use Modifiers.TypeAttr to compute the
14620 TypeAttributes, instead of rolling our own. This makes the flags
14621 correct for the delegates.
14623 2003-06-28 Miguel de Icaza <miguel@ximian.com>
14625 * class.cs (Constructor.Define): Set the private flag for static
14626 constructors as well.
14628 * cs-parser.jay (statement_expression): Set the return value to
14629 null, to avoid a crash when we catch an error.
14631 2003-06-24 Miguel de Icaza <miguel@ximian.com>
14633 * cs-parser.jay: Applied patch from Jackson that adds support for
14634 extern and unsafe modifiers to destructor declarations.
14636 * expression.cs: Report error 21 if the user is trying to index a
14639 * driver.cs: Add an error message, suggested by the bug report.
14641 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14642 if we do not have a ": this ()" constructor initializer. Fixes 45149
14644 2003-06-14 Miguel de Icaza <miguel@ximian.com>
14646 * namespace.cs: Add some information to reduce FAQs.
14648 2003-06-13 Miguel de Icaza <miguel@ximian.com>
14650 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14651 underlying enumeration types. Fixes #43915.
14653 * expression.cs: Treat ushort/short as legal values to be used in
14654 bitwise operations.
14656 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14658 * delegate.cs: transfer custom attributes for paramenters from
14659 the delegate declaration to Invoke and BeginInvoke.
14661 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14663 * attribute.cs: handle custom marshalers and emit marshal info
14666 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
14668 * makefile.gnu: Added anonymous.cs to the compiler sources.
14670 2003-05-28 Miguel de Icaza <miguel@ximian.com>
14672 * iterators.cs: Change the name of the proxy class to include two
14675 * cs-parser.jay: Update grammar to include anonymous methods.
14677 * anonymous.cs: new file.
14679 2003-05-27 Miguel de Icaza <miguel@ximian.com>
14681 * class.cs (Field.Define): Add missing test for pointers and
14684 2003-05-27 Ravi Pratap <ravi@ximian.com>
14686 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14687 we use the stobj opcode.
14689 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14690 since it wasn't the correct fix.
14692 It still is puzzling that we are required to use stobj for IntPtr
14693 which seems to be a ValueType.
14695 2003-05-26 Miguel de Icaza <miguel@ximian.com>
14697 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14698 during regular simple name resolution. Now, the trick is that
14699 instead of returning for processing the simplename, we do a
14700 TypeManager.LookupType (ie, a rooted lookup as opposed to a
14701 contextual lookup type). If a match is found, return that, if
14702 not, return for further composition.
14704 This fixes long-standing 30485.
14706 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14707 using the address to initialize an object, do an Stobj instead of
14708 using the regular Stelem.
14710 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14711 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14712 Because if we are a BaseIndexerAccess that value will be true.
14715 * statement.cs (GotoCase.Resolve): Return after reporting an
14716 error, do not attempt to continue.
14718 * expression.cs (PointerArithmetic.Emit): If our operand is a
14719 long, convert our constants to match the operand before
14720 multiplying. Convert to I type before adding. Fixes 43670.
14722 2003-05-14 Ravi Pratap <ravi@ximian.com>
14724 * enum.cs (ImplicitConversionExists) : Rename to
14725 ImplicitEnumConversionExists to remove ambiguity.
14727 * ecore.cs (NullCast): New type of cast expression class which
14728 basically is very similar to EmptyCast with the difference being
14729 it still is a constant since it is used only to cast a null to
14731 (eg. (string) null)
14733 * convert.cs (ImplicitReferenceConversion): When casting a null
14734 literal, we return a NullCast.
14736 * literal.cs (NullLiteralTyped): Remove - I don't see why this
14737 should be around anymore.
14739 The renaming (reported was slightly wrong). Corrections:
14741 ConvertImplicitStandard -> ImplicitConversionStandard
14742 ConvertExplicitStandard -> ExplicitConversionStandard
14744 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14745 before passing them in !
14747 * convert.cs (ImplicitConversionStandard): When comparing for
14748 equal expr and target types, ensure that expr is not a
14751 In general, we must not be checking (expr_type ==
14752 target_type) in the top level conversion methods
14753 (ImplicitConversion, ExplicitConversion etc). This checking is
14754 done in the methods that they delegate to.
14756 2003-05-20 Miguel de Icaza <miguel@ximian.com>
14758 * convert.cs: Move Error_CannotConvertType,
14759 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14760 ImplicitNumericConversion, ImplicitConversionExists,
14761 ImplicitUserConversionExists, StandardConversionExists,
14762 FindMostEncompassedType, FindMostSpecificSource,
14763 FindMostSpecificTarget, ImplicitUserConversion,
14764 ExplicitUserConversion, GetConversionOperators,
14765 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14766 TryImplicitIntConversion, Error_CannotConvertImplicit,
14767 ConvertImplicitRequired, ConvertNumericExplicit,
14768 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14769 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14772 Perform the following renames:
14774 StandardConversionExists -> ImplicitStandardConversionExists
14775 ConvertImplicit -> ImplicitConversion
14776 ConvertImplicitStandard -> ImplicitStandardConversion
14777 TryImplicitIntConversion -> ImplicitIntConversion
14778 ConvertImplicitRequired -> ImplicitConversionRequired
14779 ConvertNumericExplicit -> ExplicitNumericConversion
14780 ConvertReferenceExplicit -> ExplicitReferenceConversion
14781 ConvertExplicit -> ExplicitConversion
14782 ConvertExplicitStandard -> ExplicitStandardConversion
14784 2003-05-19 Martin Baulig <martin@ximian.com>
14786 * statement.cs (TypeInfo.StructInfo): Made this type protected.
14787 (TypeInfo): Added support for structs having structs as fields.
14789 * ecore.cs (FieldExpr): Implement IVariable.
14790 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14791 VariableInfo for the field.
14793 2003-05-18 Martin Baulig <martin@ximian.com>
14795 * expression.cs (This.DoResolve): Report a CS0027 if we're
14796 emitting a field initializer.
14798 2003-05-18 Martin Baulig <martin@ximian.com>
14800 * expression.cs (This.ResolveBase): New public function.
14801 (This.DoResolve): Check for CS0188.
14803 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14806 * ecore.cs (MethodGroupExpr.DoResolve): Set the
14807 `instance_expression' to null if we don't have any non-static
14810 2003-05-18 Martin Baulig <martin@ximian.com>
14812 Reworked the way how local variables and parameters are handled by
14813 the flow analysis code.
14815 * statement.cs (TypeInfo, VariableMap): New public classes.
14816 (VariableInfo): New public class. This is now responsible for
14817 checking whether a variable has been assigned. It is used for
14818 parameters and local variables.
14819 (Block.EmitMeta): Take the InternalParameters as argument; compute
14820 the layout of the flow vectors here.
14821 (Block.LocalMap, Block.ParameterMap): New public properties.
14822 (FlowBranching): The .ctor doesn't get the InternalParameters
14823 anymore since Block.EmitMeta() now computes the layout of the flow
14825 (MyStructInfo): This class is now known as `StructInfo' and nested
14826 in `TypeInfo'; we don't access this directly anymore.
14828 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14829 property and removed IsAssigned(), IsFieldAssigned(),
14830 SetAssigned() and SetFieldAssigned(); we now call them on the
14831 VariableInfo so we don't need to duplicate this code everywhere.
14833 * expression.cs (ParameterReference): Added `Block block' argument
14835 (LocalVariableReference, ParameterReference, This): The new
14836 VariableInfo class is now responsible for all the definite
14839 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14840 IsParameterAssigned, SetParameterAssigned): Removed.
14842 2003-05-18 Martin Baulig <martin@ximian.com>
14844 * typemanager.cs (InitCoreTypes): Try calling
14845 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14846 the 3-args-version. Corlib now also needs our `void_type'.
14847 (GetMethod): Added overloaded version which takes an optional
14848 `bool report_errors' to allow lookups of optional methods.
14850 2003-05-12 Martin Baulig <martin@ximian.com>
14852 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14853 only used for locals and not for parameters.
14855 2003-05-12 Miguel de Icaza <miguel@ximian.com>
14857 * support.cs (InternalParameters.ParameterType): Return the
14858 ExternalType of the parameter.
14860 * parameter.cs (Parameter.ExternalType): drop the two arguments,
14863 2003-05-11 Miguel de Icaza <miguel@ximian.com>
14865 * class.cs (MethodData.Define): Do not set the `newslot' on
14866 interface members, if they are also flagged as "override".
14868 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14869 better code for ++i and i++. This only works for static fields
14870 and local variables.
14872 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14873 want to pull the DeclSpace out of the builder_to_declspace instead
14874 of the TypeBuilder (like in TypeContainer.FindMembers).
14876 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14877 instead of LookupTypeContainer. Fixes the crash on .NET for
14878 looking up interface members.
14880 * const.cs: Create our own emit context during the Definition
14881 stage, so that constants are evaluated in the proper context, when
14882 a recursive definition happens.
14884 2003-05-11 Martin Baulig <martin@ximian.com>
14886 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
14887 new block for a switch section.
14888 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14889 the adding/lookup in the switch block. Fixes #39828.
14891 2003-05-09 Miguel de Icaza <miguel@ximian.com>
14893 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14894 functionality: I needed to convert the data after I had performed
14895 the add/sub operation into the operands type size.
14897 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14898 pass the type for the box operation, otherwise the resulting
14899 object would have been of type object.
14901 (BoxedCast): Add constructor to specify the type to box as.
14903 2003-05-07 Miguel de Icaza <miguel@ximian.com>
14905 * iterators.cs: I was reusing the `count' variable inadvertently,
14906 take steps to not allow this to happen.
14908 2003-05-06 Miguel de Icaza <miguel@ximian.com>
14910 * attribute.cs (Attribute.Resolve): Params attributes are encoded
14911 by creating an array at the point where the params starts and
14912 putting all those arguments there, then adjusting the size of the
14915 2003-05-05 Miguel de Icaza <miguel@ximian.com>
14917 * expression.cs (New.AddressOf): Implement interface
14918 IMemoryLocation. This is used when the `new' operator is used in
14919 the context of an invocation to a method on a value type.
14921 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14924 * namespace.cs: Also check the using aliases here.
14926 * driver.cs: Move the test for using validity after the types have
14927 been entered, so we do a single pass that also includes the using
14930 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14931 in the regular case. CreateSiblingForFinally is doing extra
14934 * attribute.cs (GetAttributeArgumentExpression): Store the result
14935 on an out value, and use the return value to indicate failure
14936 instead of using null (which is a valid return for Constant.GetValue).
14938 * statement.cs: Perform the analysis flow for the increment
14939 portion after the statement, because this will be the real flow of
14940 execution. Fixes #42385
14942 * codegen.cs (EmitContext.EmitArgument,
14943 EmitContext.EmitStoreArgument): New helper functions when the
14944 RemapToProxy flag is set.
14946 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14949 Add support for remapping parameters.
14951 * iterators.cs: Propagate parameter values; Store parameter
14952 values in the proxy classes.
14954 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14956 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14957 need a proxy reference; I do not know what I was thinking
14959 * cs-parser.jay (constructor_initializer): catch another error,
14960 and display nice message.
14962 (field_declaration): catch void field declaration
14963 to flag a better error.
14965 * class.cs (MemberBase.CheckBase): Report an error instead of a
14966 warning if a new protected member is declared in a struct.
14967 (Field.Define): catch the error of readonly/volatile.
14969 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14971 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14972 volatile variable is taken
14974 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14976 * statement.cs (Fixed.Resolve): Report an error if we are not in
14979 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14981 * typemanager.cs: reuse the code that handles type clashes for
14982 delegates and enumerations.
14984 * class.cs (Report28): Always report.
14986 * expression.cs (EncodeAsAttribute): Allow nulls here.
14988 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14990 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14991 the functionality for testing whether an expression is valid for
14992 an attribute here. Also handle the case of arrays of elements
14995 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14996 encoding a linear array into an array of objects that are suitable
14997 to be passed to an CustomAttributeBuilder.
14999 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15001 * ecore.cs: (FieldExpr): Handle field remapping here.
15003 * iteratators.cs: Pass the instance variable (if the method is an
15004 instance method) to the constructors, so we can access the field
15005 variables on the class.
15007 TODO: Test this with structs. I think the THIS variable on
15008 structs might have to be a pointer, and not a refenrece
15010 2003-04-27 Miguel de Icaza <miguel@ximian.com>
15012 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15013 local variables to fields in a proxy class.
15015 * iterators.cs (PopulateProxy): Rename our internal fields to
15017 Create a <THIS> field if we are an instance method, so we can
15018 reference our parent container variables.
15019 (MapVariable): Called back from the EmitContext code to enter a
15020 new variable to field mapping into the proxy class (we just create
15024 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15025 for using the remapped locals to fields.
15027 I placed the code here, because that gives the same semantics to
15028 local variables, and only changes the Emit code.
15030 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15031 statements inside iterators.
15032 (VariableInfo): Add a FieldBuilder for the cases when we are
15033 remapping local variables to fields in a proxy class
15035 * ecore.cs (SimpleNameResolve): Avoid testing two times for
15036 current_block != null.
15038 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15039 not cope with strings, as it has been moved to the
15040 TableSwitchEmit. Fixed bug in switch generation.
15042 * expression.cs (New.DoResolve): Provide more context for the user
15043 when reporting an error.
15045 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15048 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15049 check the permissions for it. Note than in a type-resolution
15050 context the check was already present in DeclSpace.ResolveType,
15051 but was missing from the MemberAccess.
15053 (ArrayCreation.CheckIndices): warn if the user has
15054 more nested levels of expressions, but there are no more
15055 dimensions specified. Avoids crash on bug 41906.
15057 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15059 * statement.cs (Block): replace Implicit bool, for a generic
15061 New flag: `Unchecked'. This is used during the EmitMeta phase
15062 (which is out-of-line with the regular Resolve/Emit process for a
15063 statement, as this is done ahead of time, but still gets a chance
15064 to call constant resolve).
15066 (Block.Flags): new enum for adding a new flag.
15068 (Block.EmitMeta): track the state of unchecked.
15070 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15071 to enable constant resolution to work there as well.
15073 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15075 * typemanager.cs (ienumerable_type): Also look up
15076 System.Collections.IEnumerable.
15078 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15080 TODO: Test more than one conditional per method.
15082 * class.cs (Indexer.Define): Report the location where the user is
15083 referencing the unsupported feature.
15085 (MethodData): Overload the use of `conditionals' to
15086 minimize the creation of needless ArrayLists. This saves roughly
15087 212kb on my machine.
15089 (Method): Implement the new IIteratorContainer interface.
15090 (Method.SetYields): Implement the method by setting the ModFlags
15091 to contain METHOD_YIELDS.
15093 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15094 which just got set to null.
15096 * iterators.cs: New file.
15098 (Yield, YieldBreak): New statements.
15100 * statement.cs (Return.Resolve): Flag an error if we are used in
15101 an iterator method.
15103 * codegen.cs (InIterator): New flag set if the code is being
15104 compiled in an iterator method.
15106 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15107 internal modifier, and we just use it to avoid adding extra
15108 fields, as this is seldom used.
15110 * cs-parser.jay: Add yield_statement (yield and yield break).
15112 * driver.cs: New flag -v2 to turn on version 2 features.
15114 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15115 hashtable when v2 is enabled.
15117 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15119 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15120 there is already a namespace defined with this name.
15122 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15123 people upgraded their corlibs.
15125 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15126 always use fully qualified types, no need to use the compiler
15129 (TypeManager.IsNamespace): Use binarysearch.
15131 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15132 AddDelegate): I did not quite use the new IsValid API properly: I
15133 have to pass the short-name and the fullname. I was passing only
15134 the basename instead of the fullname sometimes.
15136 (TypeContainer.DefineType): call NamespaceClash.
15138 * interface.cs (Interface.DefineType): use NamespaceClash before
15141 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15144 * enum.cs: (Enum.DefineType): use NamespaceClash before
15147 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15148 speed increase. First, use the negative_hits cache when we get a
15149 negative. Second, add the type with its full original name
15150 instead of the new . and + encoded name (reflection uses + to
15151 separate type from a nested type). Use LookupTypeReflection
15152 directly which bypasses the type->name hashtable (that we already
15153 know does not contain the type.
15155 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15156 location/container type.
15158 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15160 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15162 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15164 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15165 method is being referenced in the method group from a static
15166 context, and report error 120 if so.
15168 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15171 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15172 is created, we create the A namespace).
15174 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15177 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15179 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15180 invocation to ModuleBuilder.GetType with the same values will
15181 return a new type instance, so we need to cache its return
15184 * expression.cs (Binary.ResolveOperator): Only allow the compare
15185 operators on enums if they are of the same type.
15187 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15188 types of ValueType on their own case. Before we were giving them
15189 the same treatment as objects.
15191 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15192 fullname. Short name is used to compare against container name.
15193 Fullname is used to check against defined namespace names.
15195 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15196 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15198 (Method.CheckBase): Call parent.
15199 (MemberBase.CheckBase): Check for protected members on sealed
15201 (PropertyBase.CheckBase): Call parent.
15202 (Field.Define): Call parent.
15204 * report.cs: Negative error codes are now mapped to 8000 - code,
15205 so that the display is render more nicely.
15207 * typemanager.cs: Do not use try/catch, instead report a regular
15210 (GetPointerType, GetReferenceType): These methods provide
15211 mechanisms to obtain the T* and T& from a T. We had the code
15212 previously scattered around the code base, and it also used
15213 TypeManager.LookupType that would go through plenty of caches.
15214 This one goes directly to the type source.
15216 In some places we did the Type.GetType followed by
15217 ModuleBuilder.GetType, but not in others, so this unifies the
15218 processing as well.
15220 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15221 statements now that we have namespace information.
15223 * typemanager.cs (IsNamespace): New method, returns whether the
15224 string presented is a namespace or not.
15226 (ComputeNamespaces): New public entry point, computes the list of
15227 available namespaces, using the GetNamespaces API call in Mono, or
15228 the slower version in MS.NET.
15230 Now before we start the semantic analysis phase, we have a
15231 complete list of namespaces including everything that the user has
15234 Deleted old code to cache namespaces in .nsc files.
15236 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15238 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15239 class/struct location definition Location for the implicit
15240 constructor location.
15242 (Operator.Define): Use the location of the operator for the
15243 implicit Method definition.
15245 (Constructor.Emit): use the constructor location for the implicit
15246 base initializer constructor.
15248 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15249 and the Expression class now contains two new methods:
15251 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15252 isolate type lookup from the rest of the resolution process.
15254 Since we use Expressions to hold type definitions due to the way
15255 we parse the input we have historically overloaded Resolve to
15256 perform the Type lookups if a special flag is passed. Now this is
15257 eliminated and two methods take their place.
15259 The differences in the two methods between xStep and xTerminal is
15260 that xStep is involved in our current lookup system that uses
15261 SimpleNames to compose a name, while xTerminal is used just to
15262 catch the case where the simplename lookup failed.
15264 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15266 * expression.cs (ResolveMemberAccess): Remove redundant code.
15267 TypeExpr expressions are always born fully resolved.
15269 * interface.cs (PopulateMethod): Do not lookup the types twice.
15270 We were doing it once during SemanticAnalysis and once during
15273 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15274 in local variable type definitions, were being returned as a
15275 SimpleName (we decomposed everything into a string), that is
15276 because primary_expression was being used instead of a type in the
15277 grammar (reduce/reduce conflicts).
15279 The part that was wrong is that we converted the expression into a
15280 string (an oversimplification in one hand, compounded with primary
15281 expressions doing string concatenation).
15287 Would return "A.B.C[]" as a SimpleName. This stopped things like
15288 using clauses from working on this particular context. And a type
15289 was being matched directly against "A.B.C[]".
15291 We now use the correct approach, and allow for ComposedCast to be
15292 part of the unary expression. So the "A.B.C []" become a composed
15293 cast of "A.B.C" (as a nested group of MemberAccess with a
15294 SimpleName at the end) plus the rank composition "[]".
15298 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15300 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15301 for the access level checking.
15303 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15304 `TypeContainer container', because I kept getting confused when I
15305 was debugging this code.
15307 * expression.cs (Indexers): Instead of tracking getters/setters,
15308 we now track them in parallel. We create one arraylist less, but
15309 most importantly it is possible now for the LValue code to find a
15310 matching get for a set.
15312 (IndexerAccess.DoResolveLValue): Update the code.
15313 GetIndexersForType has been modified already to extract all the
15314 indexers from a type. The code assumed it did not.
15316 Also make the code set the correct return type for the indexer.
15317 This was fixed a long time ago for properties, but was missing for
15318 indexers. It used to be void_type.
15320 (Binary.Emit): Test first for doubles instead of
15321 floats, as they are more common.
15323 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15324 when dealing with floats and the <=, >= operators. This fixes bug
15327 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15328 to load the array value by emitting a load on the foreach variable
15329 type. This was incorrect.
15331 We now emit the code to load an element using the the array
15332 variable type, and then we emit the conversion operator.
15336 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15338 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15340 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15342 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15343 test for protection before we test for signatures.
15345 (MethodSignature.ToString): implement.
15347 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15348 to the case where we reduced into a LongConstant.
15350 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15351 depend on whether the information is acurrate, because the
15352 Microsoft runtime will always claim that the array type is public,
15353 regardless of the real state.
15355 If the type is a pointer, another problem happens: the type is
15356 reported as non-public in Microsoft.
15358 In both cases we have to call CheckAccessLevel recursively with
15359 the underlying type as the argument to be tested.
15361 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15363 * assign.cs (Assign.Emit): If we are dealing with a compound
15364 assignment expression, we should use the code path that stores the
15365 intermediate result in a temporary value. This fixes #40903.
15367 *expression.cs (Indirection.ToString): Provide ToString method for
15370 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15372 * class.cs: Null out fields holding references to Block objects so
15373 they can be garbage collected.
15375 * expression.cs (OverloadResolve): Remove unused local.
15377 2003-04-07 Martin Baulig <martin@ximian.com>
15379 * codegen.cs (EmitContext.CurrentFile): New public field.
15380 (EmitContext.Mark): Use the CurrentFile to check whether the
15381 location is in the correct file.
15382 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15384 2003-04-07 Martin Baulig <martin@ximian.com>
15386 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15388 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15389 location. [FIXME: The location argument which gets passed to this
15390 method is sometimes wrong!]
15392 2003-04-07 Nick Drochak <ndrochak@gol.com>
15394 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15396 2003-04-07 Miguel de Icaza <miguel@ximian.com>
15398 * expression.cs (Indirection.EmitAssign): We were using the
15399 temporary, but returning immediately instead of continuing the
15402 2003-04-06 Martin Baulig <martin@ximian.com>
15404 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15405 if it's a nested child, but also deriving from the outer class.
15408 * typemanager.cs (IsNestedChildOf): Make this work if it's a
15409 nested child, but also deriving from the outer class. See
15411 (FilterWithClosure): We may access private members of the outer
15412 class if we're a nested child and deriving from the outer class.
15413 (RealMemberLookup): Only set `closure_private_ok' if the
15414 `original_bf' contained BindingFlags.NonPublic.
15416 2003-04-05 Martin Baulig <martin@ximian.com>
15418 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15419 probe if its a type parameter, and if so, flag an error.
15421 * decl.cs: Move here the SetParameterInfo code from class.cs.
15422 Handle IsGeneric here.
15424 Handle a variety of errors in the parameter info definition.
15426 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15427 type parameters here.
15429 * cs-parser.jay (class_declaration): report errors for parameters
15432 2003-01-21 Miguel de Icaza <miguel@ximian.com>
15434 * generic.cs: New file, contains support code for generics.
15436 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15437 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15439 Update parser for the above removals.
15441 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
15442 now taken care of in the parser.
15444 2003-04-02 Miguel de Icaza <miguel@ximian.com>
15446 * class.cs (Event.Define): Do not allow abstract events to have
15449 2003-04-01 Miguel de Icaza <miguel@ximian.com>
15451 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15452 block in event declarations.
15454 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15455 value type, get its address.
15457 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15458 leaving a class on the stack instead of a boolean value (int
15459 0/1). Change the code so we compare against null, and then the
15460 result against zero.
15462 * class.cs (TypeContainer.GetClassBases): We were checking for the
15463 parent class being sealed too late.
15465 * expression.cs (Binary.Emit): For <= and >= when dealing with
15466 floating point values, use cgt.un and clt.un instead of cgt and
15469 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
15471 * statement.cs: Apply the same optimization as MS: skip the
15472 GetEnumerator returning an IEnumerator, and use the one returning a
15473 CharEnumerator instead. This allows us to avoid the try-finally block
15476 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
15478 * cs-parser.jay: Attributes cannot be applied to
15479 namespaces. Fixes #40473
15481 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15484 (Add*): check if the name is valid using the full name for constants,
15485 fields, properties and events.
15487 2003-03-28 Miguel de Icaza <miguel@ximian.com>
15489 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15490 char constants to be part of the enumeration.
15492 * expression.cs (Conditional.DoResolve): Add support for operator
15493 true. Implements the missing functionality from 14.12
15495 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15496 operator true/false as required by the spec.
15498 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15499 implicit conversion to boolean.
15501 * statement.cs (Statement.ResolveBoolean): A boolean expression is
15502 also one where the type implements `operator true'.
15504 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15505 get an expression that will invoke operator true based on an
15508 (GetConversionOperators): Removed the hack that called op_True
15511 (Expression.ResolveBoolean): Move this from Statement.
15513 2003-03-17 Miguel de Icaza <miguel@ximian.com>
15515 * ecore.cs (FieldExpr): do not allow initialization of initonly
15516 fields on derived classes
15518 2003-03-13 Martin Baulig <martin@ximian.com>
15520 * statement.cs (Block.Emit): Call ig.BeginScope() and
15521 ig.EndScope() when compiling with debugging info; call
15522 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15524 2003-03-08 Miguel de Icaza <miguel@ximian.com>
15526 * expression.cs (Indexers): Do not construct immediately, allow
15527 for new members to be appended as we go. Fixes 38143
15529 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15531 * expression.cs: save/restore context when resolving an unchecked
15534 2003-03-05 Miguel de Icaza <miguel@ximian.com>
15536 * cfold.cs: Catch division by zero in modulus operator during
15539 2003-03-03 Miguel de Icaza <miguel@ximian.com>
15541 * interface.cs (Interface.DefineMembers): Avoid defining members
15544 2003-02-27 Miguel de Icaza <miguel@ximian.com>
15546 * driver.cs: handle the +/- options for -noconfig
15548 * statement.cs (Unckeched.Resolve): Also track the state of
15549 unchecked in the Resolve phase.
15551 2003-02-27 Martin Baulig <martin@ximian.com>
15553 * ecore.cs (Expression.MemberLookup): Don't create a
15554 MethodGroupExpr for something which is not a method. Fixes #38291.
15556 2003-02-25 Miguel de Icaza <miguel@ximian.com>
15558 * class.cs (MemberBase.CheckParameters): Also check that the type
15559 is unmanaged if it is a pointer.
15561 * expression.cs (SizeOf.Resolve): Add location information.
15563 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15564 a managed type is declared.
15566 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15567 parameter modifiers as well. Fixes bug 38606
15569 * class.cs: Very sad. Am backing out the speed up changes
15570 introduced by the ArrayList -> Array in the TypeContainer, as they
15571 were not actually that much faster, and introduced a bug (no error
15572 reports on duplicated methods).
15574 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15575 source first, this will guarantee that we have a valid expression
15576 before calling in lower levels functions that will require a
15577 resolved object. Then use this original_source in the
15578 target.ResolveLValue instead of the original source that was
15581 Another change. Use target.Resolve instead of LValueResolve.
15582 Although we are resolving for LValues, we will let the Assign code
15583 take care of that (it will be called again from Resolve). This
15584 basically allows code like this:
15586 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15587 class Y { void A (X x) { x [0] += o; }
15589 The problem was that the indexer was trying to resolve for
15590 set_Item (idx, object o) and never finding one. The real set_Item
15591 was set_Item (idx, X). By delaying the process we get the right
15596 2003-02-23 Martin Baulig <martin@ximian.com>
15598 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15599 while calling DoEmit ().
15601 * codegen.cs (EmitContext.Mark): Don't mark locations in other
15602 source files; if you use the #line directive inside a method, the
15603 compiler stops emitting line numbers for the debugger until it
15604 reaches the end of the method or another #line directive which
15605 restores the original file.
15607 2003-02-23 Martin Baulig <martin@ximian.com>
15609 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15611 2003-02-23 Martin Baulig <martin@ximian.com>
15613 * statement.cs (Block.AddChildVariableNames): We need to call this
15614 recursively, not just for our immediate children.
15616 2003-02-23 Martin Baulig <martin@ximian.com>
15618 * class.cs (Event.Define): Always make the field private, like csc does.
15620 * typemanager.cs (TypeManager.RealMemberLookup): Make events
15621 actually work, fixes bug #37521.
15623 2003-02-23 Miguel de Icaza <miguel@ximian.com>
15625 * delegate.cs: When creating the various temporary "Parameters"
15626 classes, make sure that we call the ComputeAndDefineParameterTypes
15627 on those new parameters (just like we do with the formal ones), to
15628 allow them to be resolved in the context of the DeclSpace.
15630 This fixes the bug that Dick observed in Bugzilla #38530.
15632 2003-02-22 Miguel de Icaza <miguel@ximian.com>
15634 * expression.cs (ResolveMemberAccess): When resolving a constant,
15635 do not attempt to pull a constant if the value was not able to
15636 generate a valid constant.
15638 * const.cs (LookupConstantValue): Do not report more errors than required.
15640 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15642 * expression.cs: fixes bug #38328.
15644 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15646 * class.cs: Changed all the various members that can be part of a
15647 class from being an ArrayList to be an Array of the right type.
15648 During the DefineType type_list, interface_list, delegate_list and
15649 enum_list are turned into types, interfaces, delegates and enums
15652 And during the member population, indexer_list, event_list,
15653 constant_list, field_list, instance_constructor_list, method_list,
15654 operator_list and property_list are turned into their real arrays.
15656 Although we could probably perform this operation earlier, for
15657 good error reporting we need to keep the lists and remove the
15658 lists for longer than required.
15660 This optimization was triggered by Paolo profiling the compiler
15661 speed on the output of `gen-sample-program.pl' perl script.
15663 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15664 not crash in methods like MemberLookupFailed that use this field.
15666 This problem arises when the compiler fails to resolve a type
15667 during interface type definition for example.
15669 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15671 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15672 inherit from System.Object, so we have to stop at null, not only
15673 when reaching System.Object.
15675 2003-02-17 Miguel de Icaza <miguel@ximian.com>
15677 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15678 DeclaredOnly because the parent indexer might have had a different
15679 name, but did not loop until the top of the hierarchy was reached.
15681 The problem this one fixes is 35492: when a class implemented an
15682 indexer from an interface, we were getting the interface method
15683 (which was abstract) and we were flagging an error (can not invoke
15686 This also keeps bug 33089 functioning, and test-148 functioning.
15688 * typemanager.cs (IsSpecialMethod): The correct way of figuring
15689 out if a method is special is to see if it is declared in a
15690 property or event, or whether it is one of the predefined operator
15691 names. This should fix correctly #36804.
15693 2003-02-15 Miguel de Icaza <miguel@ximian.com>
15695 The goal here is to remove the dependency on EmptyCast.Peel ().
15696 Killing it completely.
15698 The problem is that currently in a number of places where
15699 constants are expected, we have to "probe" for an EmptyCast, and
15700 Peel, which is not the correct thing to do, as this will be
15701 repetitive and will likely lead to errors.
15703 The idea is to remove any EmptyCasts that are used in casts that
15704 can be reduced to constants, so we only have to cope with
15707 This bug hunt was triggered by Bug 37363 and the desire to remove
15708 the duplicate pattern where we were "peeling" emptycasts to check
15709 whether they were constants. Now constants will always be
15712 * ecore.cs: Use an enumconstant here instead of wrapping with
15715 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15716 throwing me off. By handling this we can get rid of a few hacks.
15718 * statement.cs (Switch): Removed Peel() code.
15720 2003-02-14 Miguel de Icaza <miguel@ximian.com>
15722 * class.cs: Location information for error 508
15724 * expression.cs (New.DoResolve): Add a guard against double
15725 resolution of an expression.
15727 The New DoResolve might be called twice when initializing field
15728 expressions (see EmitFieldInitializers, the call to
15729 GetInitializerExpression will perform a resolve on the expression,
15730 and later the assign will trigger another resolution
15732 This leads to bugs (#37014)
15734 * delegate.cs: The signature for EndInvoke should contain any ref
15735 or out parameters as well. We were not doing this in the past.
15737 * class.cs (Field.Define): Do not overwrite the type definition
15738 inside the `volatile' group. Turns out that volatile enumerations
15739 were changing the type here to perform a validity test, which
15742 2003-02-12 Miguel de Icaza <miguel@ximian.com>
15744 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15745 and structs, we do not want to load the instance variable
15747 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15748 enum_type has to be handled like an object reference (implicit
15749 conversions exists from this to object), but the regular IsClass
15750 and IsValueType tests will never return true for this one.
15752 Also we use TypeManager.IsValueType instead of type.IsValueType,
15753 just for consistency with the rest of the code (this is only
15754 needed if we ever use the construct exposed by test-180.cs inside
15755 corlib, which we dont today).
15757 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
15759 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15762 2003-02-09 Martin Baulig <martin@ximian.com>
15764 * namespace.cs (Namespace..ctor): Added SourceFile argument.
15765 (Namespace.DefineNamespaces): New static public method; this is
15766 called when we're compiling with debugging to add all namespaces
15767 to the symbol file.
15769 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15770 pass it to the Namespace's .ctor.
15772 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15773 and MethodBase arguments; pass the namespace ID to the symwriter;
15774 pass the MethodBase instead of the token to the symwriter.
15775 (SymbolWriter.DefineNamespace): New method to add a namespace to
15778 2003-02-09 Martin Baulig <martin@ximian.com>
15780 * symbolwriter.cs: New file. This is a wrapper around
15781 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
15782 methods here in near future.
15784 2003-02-09 Martin Baulig <martin@ximian.com>
15786 * codegen.cs (EmitContext.Mark): Just pass the arguments to
15787 ILGenerator.MarkSequencePoint() which are actually used by the
15790 2003-02-09 Martin Baulig <martin@ximian.com>
15792 * location.cs (SourceFile): New public sealed class. This
15793 contains the name and an index which is used in the location's token.
15794 (Location): Reserve an appropriate number of bits in the token for
15795 the source file instead of walking over that list, this gives us a
15796 really huge performance improvement when compiling with debugging.
15798 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15799 `SourceFile' argument instead of a string.
15800 (Driver.ProcessFile): Add all the files via Location.AddFile(),
15801 but don't parse/tokenize here, we need to generate the list of all
15802 source files before we do that.
15803 (Driver.ProcessFiles): New static function. Parses/tokenizes all
15806 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15807 instead of a string.
15809 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15812 2003-02-09 Martin Baulig <martin@ximian.com>
15814 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15815 filename on `#line default'.
15817 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15819 * statement.cs: don't clear the pinned var when the fixed statement
15820 returns from the method (fixes bug#37752).
15822 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15824 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
15827 2003-02-07 Martin Baulig <martin@ximian.com>
15829 * driver.cs: Removed the `--debug-args' command line argument.
15831 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15832 automatically by the AsssemblyBuilder.
15833 (CodeGen.InitializeSymbolWriter): We don't need to call any
15834 initialization function on the symbol writer anymore. This method
15835 doesn't take any arguments.
15837 2003-02-03 Miguel de Icaza <miguel@ximian.com>
15839 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15840 from referenced assemblies as well.
15842 2003-02-02 Martin Baulig <martin@ximian.com>
15844 * class.cs (MethodData.Emit): Generate debugging info for external methods.
15846 2003-02-02 Martin Baulig <martin@ximian.com>
15848 * class.cs (Constructor.Emit): Open the symbol writer before
15849 emitting the constructor initializer.
15850 (ConstructorInitializer.Emit): Call ec.Mark() to allow
15851 single-stepping through constructor initializers.
15853 2003-01-30 Miguel de Icaza <miguel@ximian.com>
15855 * class.cs: Handle error 549: do not allow virtual methods in
15858 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15860 * decl.cs: Check access levels when resolving types
15862 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15864 * statement.cs: Add parameters and locals set in catch blocks that might
15865 return to set vector
15867 2003-01-29 Miguel de Icaza <miguel@ximian.com>
15869 * class.cs (Operator): Set the SpecialName flags for operators.
15871 * expression.cs (Invocation.DoResolve): Only block calls to
15872 accessors and operators on SpecialName methods.
15874 (Cast.TryReduce): Handle conversions from char constants.
15877 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15879 * statement.cs: small memory and time optimization in FlowBranching.
15881 2003-01-28 Pedro Mart <yoros@wanadoo.es>
15883 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15884 problem that the last fix but in the other sid (Set).
15886 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15887 access when there is no indexer in the hierarchy.
15889 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15891 * class.cs: Combine some if statements.
15893 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15895 * driver.cs: fixed bug #37187.
15897 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
15899 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15900 any indexer, it's needed to build a list with all the indexers in the
15901 hierarchy (AllGetters), else we have problems. Fixes #35653.
15903 2003-01-23 Miguel de Icaza <miguel@ximian.com>
15905 * class.cs (MethodData.Define): It is wrong for an interface
15906 implementation to be static in both cases: explicit and implicit.
15907 We were only handling this in one case.
15909 Improve the if situation there to not have negations.
15911 * class.cs (Field.Define): Turns out that we do not need to check
15912 the unsafe bit on field definition, only on usage. Remove the test.
15914 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15916 * driver.cs: use assembly.Location instead of Codebase (the latest
15917 patch made mcs fail when using MS assemblies).
15919 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
15921 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15922 get the path to *corlib.dll.
15924 2003-01-21 Nick Drochak <ndrochak@gol.com>
15928 * typemanager.cs: Remove compiler warnings
15930 2003-01-20 Duncan Mak <duncan@ximian.com>
15932 * AssemblyInfo.cs: Bump the version number to 0.19.
15934 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15936 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15938 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
15940 * class.cs (Constructor::Emit): Emit debugging info for constructors.
15942 2003-01-17 Miguel de Icaza <miguel@ximian.com>
15944 * cs-parser.jay: Small fix: we were not comparing the constructor
15945 name correctly. Thanks to Zoltan for the initial pointer.
15947 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15949 * cs-tokenizer.cs: Set file name when specified with #line
15951 2003-01-15 Miguel de Icaza <miguel@ximian.com>
15953 * cs-parser.jay: Only perform the constructor checks here if we
15954 are named like the class; This will help provider a better
15955 error. The constructor path is taken when a type definition is
15956 not found, but most likely the user forgot to add the type, so
15957 report that rather than the constructor error.
15959 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15961 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15964 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15966 * cs-parser.jay: Add cleanup call.
15968 2003-01-13 Duncan Mak <duncan@ximian.com>
15970 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15971 consistent with other methods.
15973 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15975 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15977 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15979 * attribute.cs: only set GuidAttr to true when we have a
15982 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15986 * typemanager.cs: fixes to allow mcs compile corlib with the new
15987 Type.IsSubclassOf fix.
15989 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15991 * expression.cs (LocalVariableReference.DoResolve): Classify a
15992 constant as a value, not as a variable. Also, set the type for
15995 * cs-parser.jay (fixed_statement): take a type instead of a
15996 pointer_type, so we can produce a better error message later.
15998 * statement.cs (Fixed.Resolve): Flag types that are not pointers
16001 (For.DoEmit): Make inifinite loops have a
16002 non-conditional branch back.
16004 (Fixed.DoEmit): First populate the pinned variables, then emit the
16005 statement, then clear the variables. Before I was emitting the
16006 code once for each fixed piece.
16009 2003-01-08 Martin Baulig <martin@ximian.com>
16011 * statement.cs (FlowBranching.MergeChild): A break in a
16012 SWITCH_SECTION does not leave a loop. Fixes #36155.
16014 2003-01-08 Martin Baulig <martin@ximian.com>
16016 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16017 lives in the same number space than `param_map'. Fixes #36154.
16019 2003-01-07 Miguel de Icaza <miguel@ximian.com>
16021 * cs-parser.jay (constructor_declaration): Set the
16022 Constructor.ModFlags before probing for it. This makes the
16023 compiler report 514, 515 and 132 (the code was there, but got
16026 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16027 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16028 (GotoCase.Resolve): Set `Returns' to ALWAYS.
16030 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16032 * enum.cs: create the enum static fields using the enum type.
16034 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16036 * class.cs: don't try to create the ParamBuilder for the return
16037 type if it's not needed (and handle it breaking for the ms runtime
16040 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16042 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16044 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16046 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16047 the command. This showed up while compiling the JANET source
16048 code, which used \r as its only newline separator.
16050 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16052 * class.cs (Method.Define): If we are an operator (because it
16053 reuses our code), then set the SpecialName and HideBySig. #36128
16055 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16057 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16058 exception, report error 120 `object reference required'.
16060 * driver.cs: Add --pause option, used during to measure the size
16061 of the process as it goes with --timestamp.
16063 * expression.cs (Invocation.DoResolve): Do not allow methods with
16064 SpecialName to be invoked.
16066 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16068 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16069 number before adding it.
16071 2002-12-21 Ravi Pratap <ravi@ximian.com>
16073 * ecore.cs (StandardImplicitConversion): When in an unsafe
16074 context, we allow conversion between void * to any other pointer
16075 type. This fixes bug #35973.
16077 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16079 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16080 is not thrown when extensionless outputs are used
16082 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16084 * rootcontext.cs: fixed compilation of corlib.
16086 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16088 * attribute.cs (Attributes.Contains): Add new method.
16090 * class.cs (MethodCore.LabelParameters): if the parameter is an
16091 `out' parameter, check that no attribute `[In]' has been passed.
16093 * enum.cs: Handle the `value__' name in an enumeration.
16095 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16097 * decl.cs: Added special case to allow overrides on "protected
16100 2002-12-18 Ravi Pratap <ravi@ximian.com>
16102 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16103 since it makes much more sense.
16105 (Attributes.ctor): Don't require a Location parameter.
16107 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16109 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16110 since we already have that information per attribute.
16112 * everywhere : make appropriate changes.
16114 * class.cs (LabelParameters): Write the code which actually
16115 applies attributes to the return type. We can't do this on the MS
16116 .NET runtime so we flag a warning in the case an exception is
16119 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16121 * const.cs: Handle implicit null conversions here too.
16123 2002-12-17 Ravi Pratap <ravi@ximian.com>
16125 * class.cs (MethodCore.LabelParameters): Remove the extra
16126 Type [] parameter since it is completely unnecessary. Instead
16127 pass in the method's attributes so that we can extract
16128 the "return" attribute.
16130 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16132 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16133 of ignoring it and letting the compile continue.
16135 * typemanager.cs (ChangeType): use an extra argument to return an
16136 error condition instead of throwing an exception.
16138 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16140 * expression.cs (Unary.TryReduce): mimic the code for the regular
16141 code path. Perform an implicit cast in the cases where we can
16142 implicitly convert to one of the integral types, and then reduce
16143 based on that constant. This fixes bug #35483.
16145 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16147 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16149 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16151 * namespace.cs: fixed bug #35489.
16153 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16155 * class.cs: Remove some dead code.
16157 * cs-parser.jay: Estimate the number of methods needed
16158 (RootContext.MethodCount);
16160 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16161 numbers instead of StringBuilders.
16163 * support.cs (PtrHashtable): Add constructor with initial size;
16164 We can now reduce reallocations of the method table.
16166 2002-12-10 Ravi Pratap <ravi@ximian.com>
16168 * attribute.cs (ApplyAttributes): Keep track of the emitted
16169 attributes on a per-target basis. This fixes bug #35413.
16171 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16173 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16174 default to the Windows 1252 encoding.
16176 (UnixParseOption): Support version, thanks to Alp for the missing
16179 * AssemblyInfo.cs: Add nice assembly information.
16181 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16184 * cs-parser.jay: Allow a trailing comma before the close bracked
16185 in the attribute_section production.
16187 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16188 address of the instance was being taken, I will take this out,
16189 because we take the address of the object immediately here.
16191 2002-12-09 Ravi Pratap <ravi@ximian.com>
16193 * typemanager.cs (AreMultipleAllowed): Take care of the most
16194 obvious case where attribute type is not in the current assembly -
16197 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16199 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16200 definitions, instead of doing that afterwards.
16202 Also we use a nice little hack, depending on the constructor, we
16203 know if we are a "composed" name or a simple name. Hence, we
16204 avoid the IndexOf test, and we avoid
16206 * codegen.cs: Add code to assist in a bug reporter to track down
16207 the source of a compiler crash.
16209 2002-12-07 Ravi Pratap <ravi@ximian.com>
16211 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16212 types have been emitted for a given element and flag an error
16213 if something which does not have AllowMultiple set is used more
16216 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16217 attribute types and their corresponding AllowMultiple properties
16219 (AreMultipleAllowed): Check the property for a given type.
16221 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16222 property in the case we have a TypeContainer.
16224 (Attributes.AddAttribute): Detect duplicates and just skip on
16225 adding them. This trivial fix catches a pretty gross error in our
16226 attribute emission - global attributes were being emitted twice!
16228 Bugzilla bug #33187 is now fixed.
16230 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16232 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16233 instead of pp_and).
16235 * expression.cs (Binary.ResolveOperator): I can only use the
16236 Concat (string, string, string) and Concat (string, string,
16237 string, string) if the child is actually a concatenation of
16240 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16242 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16243 context where we need a 2-character lookahead.
16245 * pending.cs (PendingImplementation): Rework so we can keep track
16246 of interface types all the time, and flag those which were
16247 implemented by parents as optional.
16249 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16251 * expression.cs (Binary.ResolveOperator): Use
16252 String.Concat(string,string,string) or
16253 String.Concat(string,string,string,string) when possible.
16255 * typemanager: More helper methods.
16258 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16260 * pending.cs: remove the bogus return from GetMissingInterfaces()
16261 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16263 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16265 * namespace.cs: avoid duplicated 'using xxx' being added to
16266 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16267 when we get more than one 'using' statement for the same namespace.
16268 Report a CS0105 warning for it.
16270 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16272 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16273 of calling getChar/putback, uses internal knowledge of it.
16275 (xtoken): Reorder tokenizer so most common patterns are checked
16276 first. This reduces the compilation time in another 5% (from 8.11s
16277 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16279 The parsing time is 22% of the compilation in mcs, and from that
16280 64% is spent on the tokenization process.
16282 I tried using a binary search for keywords, but this is slower
16283 than the hashtable. Another option would be to do a couple of
16286 * Not use a StringBuilder, instead use an array of chars,
16287 with a set value. Notice that this way we could catch
16288 the 645 error without having to do it *afterwards*.
16290 * We could write a hand-parser to avoid the hashtable
16291 compares altogether.
16293 The identifier consumption process takes 37% of the tokenization
16294 time. Another 15% is spent on is_number. 56% of the time spent
16295 on is_number is spent on Int64.Parse:
16297 * We could probably choose based on the string length to
16298 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16301 Another 3% is spend on wrapping `xtoken' in the `token' function.
16303 Handle 0xa0 as whitespace (#34752)
16305 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16307 * typemanager.cs (IsCLRType): New routine to tell whether a type
16308 is one of the builtin types.
16310 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16311 typecode in more places instead of doing pointer comparissions.
16312 We could leverage some knowledge about the way the typecodes are
16315 New code to cache namespaces in assemblies, it is currently not
16316 invoked, to be used soon.
16318 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16320 * expression.cs (Binary.ResolveOperator): specially handle
16321 strings, and do not perform user-defined operator overloading for
16324 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16326 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16327 internalcall as it is a pretty simple operation; Avoid whenever
16328 possible to call Char.IsLetter.
16330 (consume_identifier): Cut by half the number of
16331 hashtable calls by merging the is_keyword and GetKeyword behavior.
16333 Do not short-circuit, because if we do, we
16334 report errors (ie, #if false && true would produce an invalid
16338 2002-11-24 Martin Baulig <martin@ximian.com>
16340 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16341 check constant ranges and report a CS0221. Fixes #33186.
16343 2002-11-24 Martin Baulig <martin@ximian.com>
16345 * cs-parser.jay: Make this work for uninitialized variable
16346 declarations in the `for' initializer. Fixes #32416.
16348 2002-11-24 Martin Baulig <martin@ximian.com>
16350 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16351 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16353 2002-11-24 Martin Baulig <martin@ximian.com>
16355 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16356 argument; if true, we also check for user-defined conversions.
16357 This is only needed if both arguments are of a user-defined type.
16358 Fixes #30443, added test-175.cs.
16359 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16361 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16363 2002-11-24 Martin Baulig <martin@ximian.com>
16365 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16366 function to get the store opcode.
16367 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16368 only emit the Ldelema if the store opcode is Stobj. You must run
16369 both test-34 and test-167 to test this. Fixes #34529.
16371 2002-11-23 Martin Baulig <martin@ximian.com>
16373 * ecore.cs (Expression.MemberLookup): Added additional
16374 `qualifier_type' argument which is used when we're being called
16375 from MemberAccess.DoResolve() and null if we're called from a
16377 (Expression.MemberLookupFailed): New method to report errors; this
16378 does the CS1540 check and reports the correct error message.
16380 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16381 argument for the CS1540 check and redone the way how we're dealing
16382 with private members. See the comment in the source code for details.
16383 (FilterWithClosure): Reverted this back to revision 1.197; renamed
16384 `closure_start_type' to `closure_qualifier_type' and check whether
16385 it's not null. It was not this filter being broken, it was just
16386 being called with the wrong arguments.
16388 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16389 and pass it the correct `qualifier_type'; this also does the error
16392 2002-11-22 Miguel de Icaza <miguel@ximian.com>
16394 * expression.cs (Invocation.EmitParams): If the we are dealing
16395 with a non-built-in value type, load its address as well.
16397 (ArrayCreation): Use a a pretty constant instead
16398 of the hardcoded value 2. Use 6 instead of 2 for the number of
16399 static initializers.
16401 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16402 because they are not really value types, just glorified integers.
16404 * driver.cs: Do not append .exe, the CSC compiler does not do it.
16406 * ecore.cs: Remove redundant code for enumerations, make them use
16407 the same code path as everything else, fixes the casting issue
16408 with enumerations in Windows.Forms.
16410 * attribute.cs: Do only cast to string if it is a string, the
16411 validation happens later.
16413 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16414 people upgrade their corlibs.
16416 * ecore.cs: Oops, enumerations were not following the entire code path
16418 2002-11-21 Miguel de Icaza <miguel@ximian.com>
16420 * typemanager.cs (FilterWithClosure): Commented out the test for
16421 1540 in typemanager.cs, as it has problems when accessing
16422 protected methods from a parent class (see test-174.cs).
16424 * attribute.cs (Attribute.ValidateGuid): new method.
16425 (Attribute.Resolve): Use above.
16427 2002-11-19 Miguel de Icaza <miguel@ximian.com>
16429 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16431 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16432 handling for enumerations, as we only needed the TypeContainer
16433 functionality to begin with (this is required for the fix below to
16434 work for enums that reference constants in a container class for
16437 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16439 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16440 a valid TypeBuilder to perform lookups on.o
16442 * class.cs (InheritableMemberSignatureCompare): Use true in the
16443 call to GetGetMethod and GetSetMethod, because we are comparing
16444 the signature, and we need to get the methods *even* if they are
16447 (PropertyBase.CheckBase): ditto.
16449 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16450 GotoCase.Resolve): Use Peel on EmpytCasts.
16452 * ecore.cs (EmptyCast): drop child, add Peel method.
16454 2002-11-17 Martin Baulig <martin@ximian.com>
16456 * ecore.cs (EmptyCast.Child): New public property.
16458 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16459 label resolved to an EmptyCast. Fixes #34162.
16460 (GotoCase.Resolve): Likewise.
16461 (Block.EmitMeta): Likewise.
16463 2002-11-17 Martin Baulig <martin@ximian.com>
16465 * expression.cs (Invocation.BetterConversion): Prefer int over
16466 uint; short over ushort; long over ulong for integer literals.
16467 Use ImplicitConversionExists instead of StandardConversionExists
16468 since we also need to check for user-defined implicit conversions.
16469 Fixes #34165. Added test-173.cs.
16471 2002-11-16 Martin Baulig <martin@ximian.com>
16473 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16474 with the `true' and `false' literals. Fixes #33151.
16476 2002-11-16 Martin Baulig <martin@ximian.com>
16478 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16479 October 22nd; don't do the cs1540 check for static members.
16481 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16482 now using our own filter here and doing the cs1540 check again.
16484 2002-11-16 Martin Baulig <martin@ximian.com>
16486 * support.cs (InternalParameters): Don't crash if we don't have
16487 any fixed parameters. Fixes #33532.
16489 2002-11-16 Martin Baulig <martin@ximian.com>
16491 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16492 when looking up static methods to make this work on Windows.
16495 2002-11-16 Martin Baulig <martin@ximian.com>
16497 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16498 a setter rather than using PropertyInfo.CanWrite.
16500 2002-11-15 Nick Drochak <ndrochak@gol.com>
16502 * class.cs: Allow acces to block member by subclasses. Fixes build
16505 2002-11-14 Martin Baulig <martin@ximian.com>
16507 * class.cs (Constructor.Emit): Added the extern/block check.
16510 2002-11-14 Martin Baulig <martin@ximian.com>
16512 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16513 iteration while looking for indexers, this is needed because the
16514 indexer may have a different name in our base classes. Fixed the
16515 error reporting (no indexers at all, not get accessor, no
16516 overloaded match). Fixes bug #33089.
16517 (IndexerAccess.DoResolveLValue): Likewise.
16519 2002-11-14 Martin Baulig <martin@ximian.com>
16521 * class.cs (PropertyBase.CheckBase): Make this work for multiple
16522 indexers. Fixes the first part of bug #33089.
16523 (MethodSignature.InheritableMemberSignatureCompare): Added support
16526 2002-11-13 Ravi Pratap <ravi@ximian.com>
16528 * attribute.cs (Attribute.Resolve): Catch the
16529 NullReferenceException and report it since it isn't supposed to
16532 2002-11-12 Miguel de Icaza <miguel@ximian.com>
16534 * expression.cs (Binary.EmitBranchable): Also handle the cases for
16535 LogicalOr and LogicalAnd that can benefit from recursively
16536 handling EmitBranchable. The code now should be nice for Paolo.
16538 2002-11-08 Miguel de Icaza <miguel@ximian.com>
16540 * typemanager.cs (LookupType): Added a negative-hit hashtable for
16541 the Type lookups, as we perform quite a number of lookups on
16542 non-Types. This can be removed once we can deterministically tell
16543 whether we have a type or a namespace in advance.
16545 But this might require special hacks from our corlib.
16549 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16550 and double which avoids a conversion from an integer to a double.
16552 * expression.cs: tiny optimization, avoid calling IsConstant,
16553 because it effectively performs the lookup twice.
16555 2002-11-06 Miguel de Icaza <miguel@ximian.com>
16557 But a bogus return here to keep the semantics of the old code
16558 until the Mono runtime is fixed.
16560 * pending.cs (GetMissingInterfaces): New method used to remove all
16561 the interfaces that are already implemented by our parent
16562 classes from the list of pending methods.
16564 * interface.cs: Add checks for calls after ResolveTypeExpr.
16566 2002-11-05 Miguel de Icaza <miguel@ximian.com>
16568 * class.cs (Class.Emit): Report warning 67: event not used if the
16569 warning level is beyond 3.
16571 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16572 being a NullLiteral.
16574 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16577 * class.cs (TypeContainer.GetClassBases): Cover a missing code
16578 path that might fail if a type can not be resolved.
16580 * expression.cs (Binary.Emit): Emit unsigned versions of the
16583 * driver.cs: use error 5.
16585 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16587 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16589 2002-11-01 Miguel de Icaza <miguel@ximian.com>
16591 * cs-parser.jay (switch_section): A beautiful patch from Martin
16592 Baulig that fixed 33094.
16594 2002-10-31 Miguel de Icaza <miguel@ximian.com>
16596 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16597 Check whether the base is abstract and report an error if so.
16599 * expression.cs (IndexerAccess.DoResolveLValue,
16600 IndexerAccess.DoResolve): ditto.
16602 (Invocation.DoResolve): ditto.
16604 (Invocation.FullMethodDesc): Improve the report string.
16606 * statement.cs (Block): Eliminate IsVariableDefined as it is
16607 basically just a wrapper for GetVariableInfo.
16609 * ecore.cs (SimpleName): Use new
16611 * support.cs (ReflectionParamter.ParameterType): We unwrap the
16612 type, as we return the actual parameter ref/unref state on a
16615 2002-10-30 Miguel de Icaza <miguel@ximian.com>
16617 * support.cs: Return proper flags REF/OUT fixing the previous
16620 * expression.cs: Reverted last patch, that was wrong. Is_ref is
16621 not used to mean `ref' but `ref or out' in ParameterReference
16623 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16624 full type signature instead of calling TypeManger.CSharpName
16627 * support.cs (InternalParameters.ParameterDesc): Do not compare
16628 directly to the modflags, because REF/OUT will actually be bitsets
16631 * delegate.cs (VerifyMethod): Check also the modifiers.
16633 * cs-tokenizer.cs: Fix bug where floating point values with an
16634 exponent where a sign was missing was ignored.
16636 * driver.cs: Allow multiple assemblies to be specified in a single
16639 2002-10-28 Miguel de Icaza <miguel@ximian.com>
16641 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
16642 because identifiers after a parenthesis would end up in this kind
16643 of production, and we needed to desamiguate it for having casts
16646 (UserDefinedType *) xxx
16648 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16650 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16651 we should set on the Bindingflags.NonPublic, but not turn on
16652 private_ok. private_ok controls whether a Private member is
16653 returned (this is chekced on the filter routine), while the
16654 BindingFlags.NonPublic just controls whether private/protected
16655 will be allowed. This fixes the problem part of the problem of
16656 private properties being allowed to be used in derived classes.
16658 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16659 so we can call the children DoResolveLValue method (this will
16660 properly signal errors on lvalue assignments to base properties)
16662 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16663 getter are null, and we have a property info, we know that this
16664 happened because the lookup failed, so we report an error 122 for
16665 protection level violation.
16667 We also silently return if setter and getter are null in the
16668 resolve functions, this condition only happens if we have flagged
16669 the error before. This is the other half of the problem.
16671 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16672 not have accessibility information, that is why we were returning
16673 true in the filter function in typemanager.cs.
16675 To properly report 122 (property is inaccessible because of its
16676 protection level) correctly, we report this error in ResolveAccess
16677 by failing if both the setter and the getter are lacking (ie, the
16680 DoResolve and DoLResolve have been modified to check for both
16681 setter/getter being null and returning silently, the reason being
16682 that I did not want to put the knowledge about this error in upper
16685 int old = Report.Errors;
16686 x = new PropertyExpr (...);
16687 if (old != Report.Errors)
16692 So the property expr is returned, but it is invalid, so the error
16693 will be flagged during the resolve process.
16695 * class.cs: Remove InheritablePropertySignatureCompare from the
16696 class, as we no longer depend on the property signature to compute
16697 whether it is possible to implement a method or not.
16699 The reason is that calling PropertyInfo.GetGetMethod will return
16700 null (in .NET, in Mono it works, and we should change this), in
16701 cases where the Get Method does not exist in that particular
16706 class X { public virtual int A { get { return 1; } } }
16708 class Z : Y { public override int A { get { return 2; } } }
16710 Would fail in Z because the parent (Y) would not have the property
16711 defined. So we avoid this completely now (because the alternative
16712 fix was ugly and slow), and we now depend exclusively on the
16715 (PropertyBase.CheckBase): Use a method-base mechanism to find our
16716 reference method, instead of using the property.
16718 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16719 routines are gone now.
16721 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16722 names, they were incorrectly named.
16724 * cs-tokenizer.cs: Return are more gentle token on failure.
16726 * pending.cs (PendingImplementation.InterfaceMethod): This routine
16727 had an out-of-sync index variable, which caused it to remove from
16728 the list of pending methods the wrong method sometimes.
16730 2002-10-22 Miguel de Icaza <miguel@ximian.com>
16732 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16733 CanWrite, because those refer to this particular instance of the
16734 property, and do not take into account the fact that we can
16735 override single members of a property.
16737 Constructor requires an EmitContext. The resolution process does
16738 not happen here, but we need to compute the accessors before,
16739 because the resolution does not always happen for properties.
16741 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16742 subclass, before we did not update this flag, but we did update
16745 (GetAccessors): Drop this routine, as it did not work in the
16746 presence of partially overwritten set/get methods.
16748 Notice that this broke the cs1540 detection, but that will require
16751 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16755 * driver.cs: issue a warning instead of an error if we don't support
16756 debugging for the platform. Also ignore a couple of errors that may
16757 arise when trying to write the symbols. Undo my previous patch.
16759 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16761 * driver.cs: ignore /debug switch except for Unix platforms.
16763 2002-10-23 Nick Drochak <ndrochak@gol.com>
16765 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16767 2002-10-21 Miguel de Icaza <miguel@ximian.com>
16769 * driver.cs: Do not make mcs-debug conditional, so we do not break
16770 builds that use it.
16772 * statement.cs (UsageVector.MergeChildren): I would like Martin to
16773 review this patch. But basically after all the children variables
16774 have been merged, the value of "Breaks" was not being set to
16775 new_breaks for Switch blocks. I think that it should be set after
16776 it has executed. Currently I set this to the value of new_breaks,
16777 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16778 conservative, but I do not understand this code very well.
16780 I did not break anything in the build, so that is good ;-)
16782 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16784 2002-10-20 Mark Crichton <crichton@gimp.org>
16786 * cfold.cs: Fixed compile blocker. Really fixed it this time.
16788 2002-10-20 Nick Drochak <ndrochak@gol.com>
16790 * cfold.cs: Fixed compile blocker.
16792 2002-10-20 Miguel de Icaza <miguel@ximian.com>
16794 * driver.cs: I was chekcing the key, not the file.
16796 2002-10-19 Ravi Pratap <ravi@ximian.com>
16798 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16799 message that we were generating - we just need to silently return
16802 2002-10-19 Miguel de Icaza <miguel@ximian.com>
16804 * class.cs (Event.Define): Change my previous commit, as this
16805 breaks the debugger. This is a temporary hack, as it seems like
16806 the compiler is generating events incorrectly to begin with.
16808 * expression.cs (Binary.ResolveOperator): Added support for
16809 "U operator - (E x, E y)"
16811 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16814 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16815 init-only variables, but this path did not take into account that
16816 there might be also instance readonly variables. Correct this
16819 This fixes bug 32253
16821 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16824 * driver.cs: Change the extension for modules to `netmodule'
16826 * cs-parser.jay: Improved slightly the location tracking for
16827 the debugger symbols.
16829 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16830 modifiers that were specified instead of the hardcoded value
16831 (FamAndAssem). This was basically ignoring the static modifier,
16832 and others. Fixes 32429.
16834 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16835 fixed a bug in the process (32476)
16837 * expression.cs (ArrayAccess.EmitAssign): Patch from
16838 hwang_rob@yahoo.ca that fixes bug 31834.3
16840 2002-10-18 Miguel de Icaza <miguel@ximian.com>
16842 * driver.cs: Make the module extension .netmodule.
16844 2002-10-16 Miguel de Icaza <miguel@ximian.com>
16846 * driver.cs: Report an error if the resource file is not found
16847 instead of crashing.
16849 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16850 false, like Emit does.
16852 2002-10-16 Nick Drochak <ndrochak@gol.com>
16854 * typemanager.cs: Remove unused private member. Also reported mcs
16855 bug to report this as a warning like csc.
16857 2002-10-15 Martin Baulig <martin@gnome.org>
16859 * statement.cs (Statement.Emit): Made this a virtual method; emits
16860 the line number info and calls DoEmit().
16861 (Statement.DoEmit): New protected abstract method, formerly knows
16862 as Statement.Emit().
16864 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16866 2002-10-11 Miguel de Icaza <miguel@ximian.com>
16868 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16869 have fixed a remaining problem: not every AddXXXX was adding a
16870 fully qualified name.
16872 Now everyone registers a fully qualified name in the DeclSpace as
16873 being defined instead of the partial name.
16875 Downsides: we are slower than we need to be due to the excess
16876 copies and the names being registered this way.
16878 The reason for this is that we currently depend (on the corlib
16879 bootstrap for instance) that types are fully qualified, because
16880 we dump all the types in the namespace, and we should really have
16881 types inserted into the proper namespace, so we can only store the
16882 basenames in the defined_names array.
16884 2002-10-10 Martin Baulig <martin@gnome.org>
16886 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16887 from bug #31834, see the bug report for a testcase which is
16890 2002-10-10 Martin Baulig <martin@gnome.org>
16892 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16893 flow analysis code for this.
16895 * statement.cs (Do, While, For): Tell the flow analysis code about
16897 (FlowBranching.UsageVector): Added support for infinite loops.
16898 (Block.Resolve): Moved the dead code elimination here and use flow
16901 2002-10-09 Miguel de Icaza <miguel@ximian.com>
16903 * class.cs (Field.Define): Catch cycles on struct type
16906 * typemanager.cs (IsUnmanagedtype): Do not recursively check
16907 fields if the fields are static. We only need to check instance
16910 * expression.cs (As.DoResolve): Test for reference type.
16912 * statement.cs (Using.ResolveExpression): Use
16913 ConvertImplicitRequired, not ConvertImplicit which reports an
16915 (Using.ResolveLocalVariableDecls): ditto.
16917 * expression.cs (Binary.ResolveOperator): Report errors in a few
16918 places where we had to.
16920 * typemanager.cs (IsUnmanagedtype): Finish implementation.
16922 2002-10-08 Miguel de Icaza <miguel@ximian.com>
16924 * expression.cs: Use StoreFromPtr instead of extracting the type
16925 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
16927 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16928 an enumeration value to a System.Enum, but System.Enum is not a
16929 value type, but an class type, so we need to box.
16931 (Expression.ConvertExplicit): One codepath could return
16932 errors but not flag them. Fix this. Fixes #31853
16934 * parameter.cs (Resolve): Do not allow void as a parameter type.
16936 2002-10-06 Martin Baulig <martin@gnome.org>
16938 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16939 if it's a class type and not a struct. Fixes #31815.
16941 2002-10-06 Martin Baulig <martin@gnome.org>
16943 * statement.cs: Reworked the flow analysis code a bit to make it
16944 usable for dead code elimination.
16946 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16948 * cs-parser.jay: allow empty source files. Fixes bug #31781.
16950 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16952 * expression.cs (ComposedCast.DoResolveType): A quick workaround
16953 to fix the test 165, will investigate deeper.
16955 2002-10-04 Martin Baulig <martin@gnome.org>
16957 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16958 finally blocks actually work.
16959 (Try.Resolve): We don't need to create a sibling for `finally' if
16960 there is no finally block.
16962 2002-10-04 Martin Baulig <martin@gnome.org>
16964 * class.cs (Constructor.Define): The default accessibility for a
16965 non-default constructor is private, not public.
16967 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16969 * class.cs (Constructor): Make AllowedModifiers public, add
16972 * cs-parser.jay: Perform the modifiers test here, as the
16973 constructor for the Constructor class usually receives a zero
16974 because of the way we create it (first we create, later we
16975 customize, and we were never checking the modifiers).
16977 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16978 is a version of LookupTypeReflection that includes the type-name
16979 cache. This can be used as a fast path for functions that know
16980 the fully qualified name and are only calling into *.GetType() to
16981 obtain a composed type.
16983 This is also used by TypeManager.LookupType during its type
16986 (LookupType): We now also track the real type name, as sometimes
16987 we can get a quey for the real type name from things like
16988 ComposedCast. This fixes bug 31422.
16990 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16991 complete type fullname, it does not have to go through the type
16992 resolution system to obtain the composed version of the type (for
16993 obtaining arrays or pointers).
16995 (Conditional.Emit): Use the EmitBoolExpression to
16996 generate nicer code, as requested by Paolo.
16998 (ArrayCreation.CheckIndices): Use the patch from
16999 hwang_rob@yahoo.ca to validate the array initializers.
17001 2002-10-03 Miguel de Icaza <miguel@ximian.com>
17003 * class.cs (ConstructorInitializer.Emit): simplify code by using
17004 Invocation.EmitCall, and at the same time, fix the bugs in calling
17005 parent constructors that took variable arguments.
17007 * ecore.cs (Expression.ConvertNumericExplicit,
17008 Expression.ImplicitNumericConversion): Remove the code that
17009 manually wrapped decimal (InternalTypeConstructor call is now gone
17012 * expression.cs (Cast.TryReduce): Also handle decimal types when
17013 trying to perform a constant fold on the type.
17015 * typemanager.cs (IsUnmanagedtype): Partially implemented.
17017 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17018 that only turned off an error report, and did nothing else.
17020 2002-10-02 Miguel de Icaza <miguel@ximian.com>
17022 * driver.cs: Handle and ignore /fullpaths
17024 2002-10-01 Miguel de Icaza <miguel@ximian.com>
17026 * expression.cs (Binary.ResolveOperator): Catch the case where
17027 DoNumericPromotions returns true,
17029 (Binary.DoNumericPromotions): Simplify the code, and the tests.
17031 2002-09-27 Miguel de Icaza <miguel@ximian.com>
17033 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17036 2002-09-26 Miguel de Icaza <miguel@ximian.com>
17038 * ecore.cs (ConvertNumericExplicit): It is not enough that the
17039 conversion exists, but it is also required that the conversion be
17040 performed. This manifested in "(Type64Enum) 2".
17042 * class.cs (TypeManager.AddMethod): The fix is not to change
17043 AddEnum, because that one was using a fully qualified name (every
17044 DeclSpace derivative does), but to change the AddMethod routine
17045 that was using an un-namespaced name. This now correctly reports
17046 the duplicated name.
17048 Revert patch until I can properly fix it. The issue
17049 is that we have a shared Type space across all namespaces
17050 currently, which is wrong.
17052 Options include making the Namespace a DeclSpace, and merge
17053 current_namespace/current_container in the parser.
17055 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17057 * cs-parser.jay: Improve error reporting when we get a different
17058 kind of expression in local_variable_type and
17059 local_variable_pointer_type.
17061 Propagate this to avoid missleading errors being reported.
17063 * ecore.cs (ImplicitReferenceConversion): treat
17064 TypeManager.value_type as a target just like object_type. As
17069 Is valid, and needs to result in the int 1 being boxed before it
17070 is assigned to the value type v.
17072 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17073 to validate the enumeration name.
17075 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17076 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17077 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17079 * ecore.cs (TryImplicitIntConversion): When doing an
17080 implicit-enumeration-conversion, check if the type is 64-bits and
17081 perform a conversion before passing to EnumConstant.
17083 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17085 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17086 report ambiguous type references. Unlike the MS version, we
17087 report what the ambiguity is. Innovation at work ;-)
17089 (DeclSpace.FindType): Require a location argument to
17090 display when we display an ambiguous error.
17092 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17094 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17096 * expression.cs (EmitDynamicInitializers): Apply patch from
17097 hwang_rob@yahoo.ca that fixes the order in which we emit our
17100 2002-09-21 Martin Baulig <martin@gnome.org>
17102 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17103 delegate takes no arguments.
17105 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17107 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17110 * expression.cs: Extract the underlying type.
17112 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17114 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17116 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17118 * class.cs (TypeContainer.DefineType): We can not use the nice
17119 PackingSize with the size set to 1 DefineType method, because it
17120 will not allow us to define the interfaces that the struct
17123 This completes the fixing of bug 27287
17125 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17126 means also structs. This fixes part of the problem.
17127 (Expresion.ImplicitReferenceConversionExists): ditto.
17129 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17130 error if there were no errors reported during the type lookup
17131 process, to avoid duplicates or redundant errors. Without this
17132 you would get an ambiguous errors plus a type not found. We have
17133 beaten the user enough with the first error.
17135 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17138 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17139 during the resolution process, stop the lookup, this avoids
17140 repeated error reports (same error twice).
17142 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17144 * typemanager.cs (LookupType): Redo the type lookup code to match
17145 the needs of System.Reflection.
17147 The issue is that System.Reflection requires references to nested
17148 types to begin with a "+" sign instead of a dot. So toplevel
17149 types look like: "NameSpace.TopLevelClass", and nested ones look
17150 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17153 2002-09-19 Martin Baulig <martin@gnome.org>
17155 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17156 says that a method always returns or always throws an exception,
17157 don't report the CS0161.
17159 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17160 set `Returns = new_returns'.
17162 2002-09-19 Martin Baulig <martin@gnome.org>
17164 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17165 to an enum constant, check for a CS0176.
17167 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17169 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17170 for operators that must be in pairs and report errors.
17172 * ecore.cs (SimpleName.DoResolveType): During the initial type
17173 resolution process, when we define types recursively, we must
17174 check first for types in our current scope before we perform
17175 lookups in the enclosing scopes.
17177 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17179 (Invocation.VerifyArgumentsCompat): Call
17180 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17181 I thought we were supposed to always call this, but there are a
17182 few places in the code where we dont do it.
17184 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17186 * driver.cs: Add support in -linkres and -resource to specify the
17187 name of the identifier.
17189 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17191 * ecore.cs (StandardConversionExists): Sync with the conversion
17192 code: allow anything-* to void* conversions.
17194 (FindMostSpecificSource): Use an Expression argument
17195 instead of a Type, because we might be handed over a Literal which
17196 gets a few more implicit conversions that plain types do not. So
17197 this information was being lost.
17199 Also, we drop the temporary type-holder expression when not
17202 2002-09-17 Martin Baulig <martin@gnome.org>
17204 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17205 this is an explicit interface implementation.
17207 2002-09-17 Martin Baulig <martin@gnome.org>
17209 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17210 different `IndexerName' attributes.
17212 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17213 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17214 virtual CommonResolve().
17216 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17218 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17219 and convert that to the UnderlyingType.
17221 * statement.cs (Foreach.Resolve): Indexers are just like variables
17222 or PropertyAccesses.
17224 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17225 inside quoted strings, we were not doing this before.
17227 2002-09-16 Martin Baulig <martin@gnome.org>
17229 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17230 resolve it. This is needed for the definite assignment check of the
17231 instance expression, fixes bug #29846.
17232 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17234 2002-09-16 Nick Drochak <ndrochak@gol.com>
17236 * parameter.cs: Fix compile error. Cannot reference static member
17237 from an instance object. Is this an mcs bug?
17239 2002-09-14 Martin Baulig <martin@gnome.org>
17241 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17242 multiple times. Fixes bug #30295, added test-166.cs.
17244 2002-09-14 Martin Baulig <martin@gnome.org>
17246 * statement.cs (Block.Emit): Don't emit unreachable code.
17247 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17248 `break' statements.
17249 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17251 2002-09-14 Martin Baulig <martin@gnome.org>
17253 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17256 2002-09-14 Martin Baulig <martin@gnome.org>
17258 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17259 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17260 be false on the ms runtime.
17262 2002-09-13 Martin Baulig <martin@gnome.org>
17264 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17265 the CS0038 error message.
17267 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17269 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17270 constant inside, return it.
17272 2002-09-12 Martin Baulig <martin@gnome.org>
17274 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17275 implicit conversion can be done between enum types.
17277 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17278 check whether an implicit conversion to the current enum's UnderlyingType
17279 exists and report an error if not.
17281 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17282 without debugging support.
17284 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17285 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
17287 2002-09-12 Martin Baulig <martin@gnome.org>
17289 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17291 * ecore.cs (IMemberExpr.DeclaringType): New property.
17292 (SimpleName.SimpleNameResolve): Check whether we're accessing a
17293 nonstatic member of an outer type (CS0038).
17295 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17297 * driver.cs: Activate the using-error detector at warning level
17298 4 (at least for MS-compatible APIs).
17300 * namespace.cs (VerifyUsing): Small buglett fix.
17302 * pending.cs (PendingImplementation): pass the container pointer.
17304 * interface.cs (GetMethods): Allow for recursive definition. Long
17305 term, I would like to move every type to support recursive
17306 definitions, not the current ordering mechanism that we have right
17309 The situation is this: Attributes are handled before interfaces,
17310 so we can apply attributes to interfaces. But some attributes
17311 implement interfaces, we will now handle the simple cases
17312 (recursive definitions will just get an error).
17314 * parameter.cs: Only invalidate types at the end if we fail to
17317 2002-09-09 Martin Baulig <martin@gnome.org>
17319 * ecore.cs (PropertyExpr.Emit): Also check for
17320 TypeManager.system_int_array_get_length so this'll also work when
17321 compiling corlib. Fixes #30003.
17323 2002-09-09 Martin Baulig <martin@gnome.org>
17325 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17326 and throw an exception if we can't get the type's size. Fixed #30040,
17329 2002-09-09 Martin Baulig <martin@gnome.org>
17331 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17333 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17334 context. Fixes bug #30027.
17336 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17337 virtual functions. Fixes bug #30043, added test-164.cs.
17339 2002-09-08 Ravi Pratap <ravi@ximian.com>
17341 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17343 2002-09-08 Nick Drochak <ndrochak@gol.com>
17345 * driver.cs: Use an object to get the windows codepage since it's not a
17348 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17350 * statement.cs (For.Emit): for infinite loops (test == null)
17351 return whether there is a break inside, not always "true".
17353 * namespace.cs (UsingEntry): New struct to hold the name of the
17354 using definition, the location where it is defined, and whether it
17355 has been used in a successful type lookup.
17357 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17362 2002-09-06 Ravi Pratap <ravi@ximian.com>
17364 * attribute.cs : Fix incorrect code which relied on catching
17365 a NullReferenceException to detect a null being passed in
17366 where an object was expected.
17368 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17370 * statement.cs (Try): flag the catch variable as assigned
17372 * expression.cs (Cast): Simplified by using ResolveType instead of
17373 manually resolving.
17375 * statement.cs (Catch): Fix bug by using ResolveType.
17377 2002-09-06 Ravi Pratap <ravi@ximian.com>
17379 * expression.cs (BetterConversion): Special case for when we have
17380 a NullLiteral as the argument and we have to choose between string
17381 and object types - we choose string the way csc does.
17383 * attribute.cs (Attribute.Resolve): Catch the
17384 NullReferenceException and report error #182 since the Mono
17385 runtime no more has the bug and having this exception raised means
17386 we tried to select a constructor which takes an object and is
17389 2002-09-05 Ravi Pratap <ravi@ximian.com>
17391 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17392 message (1502, 1503) when we can't locate a method after overload
17393 resolution. This is much more informative and closes the bug
17396 * interface.cs (PopulateMethod): Return if there are no argument
17397 types. Fixes a NullReferenceException bug.
17399 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17400 expressions too. Previously we were checking only in one place for
17401 positional arguments leaving out named arguments.
17403 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17404 type to the enum type is not allowed. Remove code corresponding to
17407 (ConvertNumericExplicit): Allow explicit conversions from
17408 the underlying type to enum type. This precisely follows the spec
17409 and closes a bug filed by Gonzalo.
17411 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17414 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17416 2002-09-03 Miguel de Icaza <miguel@ximian.com>
17418 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17419 it was important that we stored the right value after the
17420 reduction in `converted'.
17422 2002-09-04 Martin Baulig <martin@gnome.org>
17424 * location.cs (Location.SymbolDocument): Use full pathnames for the
17427 2002-08-30 Miguel de Icaza <miguel@ximian.com>
17429 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17430 of the expression resolve mechanism, because that will catch the
17431 SimpleName error failures.
17433 (Conditional): If we can not resolve the
17434 expression, return, do not crash.
17436 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17439 (location): display token name instead of its number.
17441 2002-08-28 Martin Baulig <martin@gnome.org>
17443 * expression.cs (Binary.ResolveOperator): Don't silently return
17444 but return an error if an operator cannot be applied between two
17447 2002-08-28 Martin Baulig <martin@gnome.org>
17449 * class.cs (Constructor.Define): Set the permission attributes
17450 correctly instead of making all constructors public.
17452 2002-08-28 Martin Baulig <martin@gnome.org>
17454 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17455 for private members before reporting a CS0103; if we find anything,
17458 2002-08-28 Martin Baulig <martin@gnome.org>
17460 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17461 to check whether `closure_start_type == closure_invocation_type',
17462 we also need to check whether `m.DeclaringType == closure_invocation_type'
17463 before bypassing the permission checks. We might be accessing
17464 protected/private members from the base class.
17465 (TypeManager.RealMemberLookup): Only set private_ok if private
17466 members were requested via BindingFlags.NonPublic.
17468 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17470 * expression.cs (MemberAccess.ResolveMemberAccess): Set
17471 MethodGroupExpr.IsExplicitImpl if appropriate.
17472 (Invocation.DoResolve): Don't report the CS0120 for explicit
17473 interface implementations.
17475 2002-08-27 Martin Baulig <martin@gnome.org>
17477 * expression.cs (Invocation.DoResolve): If this is a static
17478 method and we don't have an InstanceExpression, we must report
17481 2002-08-25 Martin Baulig <martin@gnome.org>
17483 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17484 `==' between a valuetype and an object.
17486 2002-08-25 Miguel de Icaza <miguel@ximian.com>
17488 * ecore.cs (TypeExpr): Provide a ToString method.
17490 2002-08-24 Martin Baulig <martin@gnome.org>
17492 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17493 now called proggie.dbg and it's a binary file.
17495 2002-08-23 Martin Baulig <martin@gnome.org>
17497 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17499 2002-08-23 Martin Baulig <martin@gnome.org>
17501 * struct.cs (MyStructInfo.ctor): Make this work with empty
17502 structs; it's not allowed to use foreach() on null.
17504 2002-08-23 Martin Baulig <martin@gnome.org>
17506 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17507 writer the full pathname of the generated assembly.
17509 2002-08-23 Martin Baulig <martin@gnome.org>
17511 * statements.cs (FlowBranching.UsageVector.MergeChildren):
17512 A `finally' block never returns or breaks; improved handling of
17515 2002-08-23 Martin Baulig <martin@gnome.org>
17517 * statement.cs (Throw.Resolve): Allow `throw null'.
17519 2002-08-23 Martin Baulig <martin@gnome.org>
17521 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17522 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17523 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
17524 MemberLookup would return a wrong event if this is an explicit
17525 interface implementation and the class has an event with the same
17528 2002-08-23 Martin Baulig <martin@gnome.org>
17530 * statement.cs (Block.AddChildVariableNames): New public method.
17531 (Block.AddChildVariableName): Likewise.
17532 (Block.IsVariableNameUsedInChildBlock): Likewise.
17533 (Block.AddVariable): Check whether a variable name has already
17534 been used in a child block.
17536 * cs-parser.jay (declare_local_variables): Mark all variable names
17537 from the current block as being used in a child block in the
17540 2002-08-23 Martin Baulig <martin@gnome.org>
17542 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17543 find the symbol writer.
17545 * driver.cs: csc also allows the arguments to /define being
17546 separated by commas, not only by semicolons.
17548 2002-08-23 Martin Baulig <martin@gnome.org>
17550 * interface.cs (Interface.GetMembers): Added static check for events.
17552 2002-08-15 Martin Baulig <martin@gnome.org>
17554 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17555 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17557 * ecore.cs (Expression.MemberLookup): Added documentation and explained
17558 why the MethodData.EmitDestructor() change was necessary.
17560 2002-08-20 Martin Baulig <martin@gnome.org>
17562 * class.cs (TypeContainer.FindMembers): Added static check for events.
17564 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17566 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17567 use Type.GetEvents(), not Type.FindMembers().
17569 2002-08-20 Martin Baulig <martin@gnome.org>
17571 * decl.cs (MemberCache): Added a special method cache which will
17572 be used for method-only searched. This ensures that a method
17573 search will return a MethodInfo with the correct ReflectedType for
17576 2002-08-20 Martin Baulig <martin@gnome.org>
17578 * decl.cs (DeclSpace.FindMembers): Made this public.
17580 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17582 * delegate.cs: fixed build on windows.
17583 [FIXME: Filed as bug #29150: MCS must report these errors.]
17585 2002-08-19 Ravi Pratap <ravi@ximian.com>
17587 * ecore.cs (StandardConversionExists): Return a false
17588 if we are trying to convert the void type to anything else
17589 since that is not allowed.
17591 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17592 we flag error 70 in the event an event is trying to be accessed
17593 directly from outside the declaring type.
17595 2002-08-20 Martin Baulig <martin@gnome.org>
17597 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17598 MemberCache from typemanager.cs to decl.cs.
17600 2002-08-19 Martin Baulig <martin@gnome.org>
17602 * class.cs (TypeContainer): Implement IMemberContainer.
17603 (TypeContainer.DefineMembers): Create the MemberCache.
17604 (TypeContainer.FindMembers): Do better BindingFlags checking; only
17605 return public members if BindingFlags.Public was given, check
17606 whether members are static.
17608 2002-08-16 Martin Baulig <martin@gnome.org>
17610 * decl.cs (DeclSpace.Define): Splitted this in Define and
17611 DefineMembers. DefineMembers is called first and initializes the
17614 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
17615 DefineMembers() on all our DeclSpaces.
17617 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17618 but call DefineMembers() on all nested interfaces. We call their
17619 Define() in our new Define() function.
17621 * interface.cs (Interface): Implement IMemberContainer.
17622 (Interface.Define): Moved all code except the attribute stuf to
17624 (Interface.DefineMembers): Initialize the member cache.
17626 * typemanager.cs (IMemberFinder): Removed this interface, we don't
17627 need this anymore since we can use MemberCache.FindMembers directly.
17629 2002-08-19 Martin Baulig <martin@gnome.org>
17631 * typemanager.cs (MemberCache): When creating the cache for an
17632 interface type, add all inherited members.
17633 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17634 to `out bool used_cache' and documented it.
17635 (TypeManager.MemberLookup): If we already used the cache in the first
17636 iteration, we don't need to do the interfaces check.
17638 2002-08-19 Martin Baulig <martin@gnome.org>
17640 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
17641 here from IMemberFinder and don't implement this interface anymore.
17642 (DeclSpace.MemberCache): Moved here from IMemberFinder.
17644 * typemanager.cs (IMemberFinder): This interface is now only used by
17645 classes which actually support the member cache.
17646 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17647 since we only put DeclSpaces into this Hashtable.
17648 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17649 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17651 2002-08-16 Martin Baulig <martin@gnome.org>
17653 * typemanager.cs (ICachingMemberFinder): Removed.
17654 (IMemberFinder.MemberCache): New property.
17655 (TypeManager.FindMembers): Merged this with RealFindMembers().
17656 This function will never be called from TypeManager.MemberLookup()
17657 so we can't use the cache here, just the IMemberFinder.
17658 (TypeManager.MemberLookup_FindMembers): Check whether the
17659 IMemberFinder has a MemberCache and call the cache's FindMembers
17661 (MemberCache): Rewrote larger parts of this yet another time and
17662 cleaned it up a bit.
17664 2002-08-15 Miguel de Icaza <miguel@ximian.com>
17666 * driver.cs (LoadArgs): Support quoting.
17668 (Usage): Show the CSC-like command line arguments.
17670 Improved a few error messages.
17672 2002-08-15 Martin Baulig <martin@gnome.org>
17674 * typemanager.cs (IMemberContainer.Type): New property.
17675 (IMemberContainer.IsInterface): New property.
17677 The following changes are conditional to BROKEN_RUNTIME, which is
17678 defined at the top of the file.
17680 * typemanager.cs (MemberCache.MemberCache): Don't add the base
17681 class'es members, but add all members from TypeHandle.ObjectType
17682 if we're an interface.
17683 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17684 is the current type.
17685 (MemberCache.CacheEntry.Container): Removed this field.
17686 (TypeHandle.GetMembers): Include inherited members.
17688 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17690 * typemanager.cs: fixed compilation and added a comment on a field that
17693 2002-08-15 Martin Baulig <martin@gnome.org>
17695 * class.cs (ConstructorInitializer.Resolve): In the
17696 Expression.MemberLookup call, use the queried_type as
17699 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17700 declared' attribute, it's always true.
17701 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17702 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17703 temporary wrapper for FindMembers which tells MemberLookup whether
17704 members from the base classes are included in the return value.
17705 This will go away soon.
17706 (TypeManager.MemberLookup): Use this temporary hack here; once the
17707 new MemberCache is completed, we don't need to do the DeclaredOnly
17708 looping here anymore since the MemberCache will take care of this.
17709 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17710 (MemberCache): When creating the MemberCache for a class, get
17711 members from the current class and all its base classes.
17712 (MemberCache.CacheEntry.Container): New field. This is a
17713 temporary hack until the Mono runtime is fixed to distinguish
17714 between ReflectedType and DeclaringType. It allows us to use MCS
17715 with both the MS runtime and the unfixed Mono runtime without
17716 problems and without accecting performance.
17717 (MemberCache.SearchMembers): The DeclaredOnly looping from
17718 TypeManager.MemberLookup is now done here.
17720 2002-08-14 Martin Baulig <martin@gnome.org>
17722 * statement.cs (MyStructInfo.MyStructInfo): Don't call
17723 Type.GetFields on dynamic types but get the fields from the
17724 corresponding TypeContainer.
17725 (MyStructInfo.GetStructInfo): Added check for enum types.
17727 * typemanager.cs (MemberList.IsSynchronized): Implemented.
17728 (MemberList.SyncRoot): Implemented.
17729 (TypeManager.FilterWithClosure): No need to check permissions if
17730 closure_start_type == closure_invocation_type, don't crash if
17731 closure_invocation_type is null.
17733 2002-08-13 Martin Baulig <martin@gnome.org>
17735 Rewrote TypeContainer.FindMembers to use a member cache. This
17736 gives us a speed increase of about 35% for the self-hosting MCS
17737 build and of about 15-20% for the class libs (both on GNU/Linux).
17739 * report.cs (Timer): New class to get enhanced profiling. This
17740 whole class is "TIMER" conditional since it remarkably slows down
17743 * class.cs (MemberList): New class. This is an IList wrapper
17744 which we're now using instead of passing MemberInfo[]'s around to
17745 avoid copying this array unnecessarily.
17746 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17747 (ICachingMemberFinder, IMemberContainer): New interface.
17748 (TypeManager.FilterWithClosure): If `criteria' is null, the name
17749 has already been checked, otherwise use it for the name comparision.
17750 (TypeManager.FindMembers): Renamed to RealMemberFinder and
17751 provided wrapper which tries to use ICachingMemberFinder.FindMembers
17752 if possible. Returns a MemberList, not a MemberInfo [].
17753 (TypeHandle): New class, implements IMemberContainer. We create
17754 one instance of this class per type, it contains a MemberCache
17755 which is used to do the member lookups.
17756 (MemberCache): New class. Each instance of this class contains
17757 all members of a type and a name-based hash table.
17758 (MemberCache.FindMembers): This is our new member lookup
17759 function. First, it looks up all members of the requested name in
17760 the hash table. Then, it walks this list and sorts out all
17761 applicable members and returns them.
17763 2002-08-13 Martin Baulig <martin@gnome.org>
17765 In addition to a nice code cleanup, this gives us a performance
17766 increase of about 1.4% on GNU/Linux - not much, but it's already
17767 half a second for the self-hosting MCS compilation.
17769 * typemanager.cs (IMemberFinder): New interface. It is used by
17770 TypeManager.FindMembers to call FindMembers on a TypeContainer,
17771 Enum, Delegate or Interface.
17772 (TypeManager.finder_to_member_finder): New PtrHashtable.
17773 (TypeManager.finder_to_container): Removed.
17774 (TypeManager.finder_to_delegate): Removed.
17775 (TypeManager.finder_to_interface): Removed.
17776 (TypeManager.finder_to_enum): Removed.
17778 * interface.cs (Interface): Implement IMemberFinder.
17780 * delegate.cs (Delegate): Implement IMemberFinder.
17782 * enum.cs (Enum): Implement IMemberFinder.
17784 * class.cs (TypeContainer): Implement IMemberFinder.
17786 2002-08-12 Martin Baulig <martin@gnome.org>
17788 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17790 2002-08-12 Martin Baulig <martin@gnome.org>
17792 * ecore.cs (ITypeExpression): New interface for expressions which
17794 (TypeExpression): Renamed to TypeLookupExpression.
17795 (Expression.DoResolve): If we're doing a types-only lookup, the
17796 expression must implement the ITypeExpression interface and we
17797 call DoResolveType() on it.
17798 (SimpleName): Implement the new ITypeExpression interface.
17799 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17800 hack, the situation that we're only looking up types can't happen
17801 anymore when this method is called. Moved the type lookup code to
17802 DoResolveType() and call it.
17803 (SimpleName.DoResolveType): This ITypeExpression interface method
17804 is now doing the types-only lookup.
17805 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17806 (ResolveFlags): Added MaskExprClass.
17808 * expression.cs (MemberAccess): Implement the ITypeExpression
17810 (MemberAccess.DoResolve): Added support for a types-only lookup
17811 when we're called via ITypeExpression.DoResolveType().
17812 (ComposedCast): Implement the ITypeExpression interface.
17814 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
17815 Expression.Resolve() with ResolveFlags.Type instead.
17817 2002-08-12 Martin Baulig <martin@gnome.org>
17819 * interface.cs (Interface.Define): Apply attributes.
17821 * attribute.cs (Attribute.ApplyAttributes): Added support for
17822 interface attributes.
17824 2002-08-11 Martin Baulig <martin@gnome.org>
17826 * statement.cs (Block.Emit): Only check the "this" variable if we
17827 do not always throw an exception.
17829 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17830 whether the property has a set accessor.
17832 2002-08-11 Martin Baulig <martin@gnome.org>
17834 Added control flow analysis support for structs.
17836 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17837 with control flow analysis turned off.
17838 (IVariable): New interface.
17839 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17840 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17841 (FieldExpr.DoResolve): Resolve the instance expression with flow
17842 analysis turned off and do the definite assignment check after the
17843 resolving when we know what the expression will resolve to.
17845 * expression.cs (LocalVariableReference, ParameterReference):
17846 Implement the new IVariable interface, only call the flow analysis
17847 code if ec.DoFlowAnalysis is true.
17848 (This): Added constructor which takes a Block argument. Implement
17849 the new IVariable interface.
17850 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17851 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17852 This does the definite assignment checks for struct members.
17854 * class.cs (Constructor.Emit): If this is a non-static `struct'
17855 constructor which doesn't have any initializer, call
17856 Block.AddThisVariable() to tell the flow analysis code that all
17857 struct elements must be initialized before control returns from
17860 * statement.cs (MyStructInfo): New public class.
17861 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17862 argument to this indexer. If non-zero, check an individual struct
17863 member, not the whole struct.
17864 (FlowBranching.CheckOutParameters): Check struct members.
17865 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17866 overloaded versions of these methods which take an additional
17867 `int field_idx' argument to check struct members.
17868 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17869 overloaded versions of these methods which take an additional
17870 `string field_name' argument to check struct member.s
17871 (VariableInfo): Implement the IVariable interface.
17872 (VariableInfo.StructInfo): New public property. Returns the
17873 MyStructInfo instance of the variable if it's a struct or null.
17874 (Block.AddThisVariable): New public method. This is called from
17875 Constructor.Emit() for non-static `struct' constructor which do
17876 not have any initializer. It creates a special variable for the
17877 "this" instance variable which will be checked by the flow
17878 analysis code to ensure that all of the struct's fields are
17879 initialized before control returns from the constructor.
17880 (UsageVector): Added support for struct members. If a
17881 variable/parameter is a struct with N members, we reserve a slot
17882 in the usage vector for each member. A struct is considered fully
17883 initialized if either the struct itself (slot 0) or all its
17884 members are initialized.
17886 2002-08-08 Martin Baulig <martin@gnome.org>
17888 * driver.cs (Driver.MainDriver): Only report an error CS5001
17889 if there were no compilation errors.
17891 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17892 `UnsafeContext' property to determine whether the parent is in
17893 unsafe context rather than checking the parent's ModFlags:
17894 classes nested in an unsafe class are unsafe as well.
17896 2002-08-08 Martin Baulig <martin@gnome.org>
17898 * statement.cs (UsageVector.MergeChildren): Distinguish between
17899 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17900 we return. Added test17() and test18() to test-154.cs.
17902 2002-08-08 Martin Baulig <martin@gnome.org>
17904 * typemanager.cs (TypeManager.FilterWithClosure): If we have
17905 Family access, make sure the invoking type isn't a subclass of the
17906 queried type (that'd be a CS1540).
17908 * ecore.cs (Expression.MemberLookup): Added overloaded version of
17909 this method which takes an additional `Type invocation_type'.
17911 * expression.cs (BaseAccess.DoResolve): Use the base type as
17912 invocation and query type.
17913 (MemberAccess.DoResolve): If the lookup failed and we're about to
17914 report a CS0122, try a lookup with the ec.ContainerType - if this
17915 succeeds, we must report a CS1540.
17917 2002-08-08 Martin Baulig <martin@gnome.org>
17919 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17920 (MethodGroupExpr): Implement the IMemberExpr interface.
17922 * expression (MemberAccess.ResolveMemberAccess): No need to have
17923 any special code for MethodGroupExprs anymore, they're now
17926 2002-08-08 Martin Baulig <martin@gnome.org>
17928 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17929 Family, FamANDAssem and FamORAssem permissions.
17930 (TypeManager.IsSubclassOrNestedChildOf): New public method.
17932 2002-08-08 Martin Baulig <martin@gnome.org>
17934 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17935 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17938 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17940 * driver.cs: implemented /resource option to embed managed resources.
17942 2002-08-07 Martin Baulig <martin@gnome.org>
17944 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17945 (FieldBase.HasFieldInitializer): New public property.
17946 (FieldBase.GetInitializerExpression): New public method. Resolves and
17947 returns the field initializer and makes sure it is only resolved once.
17948 (TypeContainer.EmitFieldInitializers): Call
17949 FieldBase.GetInitializerExpression to get the initializer, this ensures
17950 that it isn't resolved multiple times.
17952 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
17953 the resolving process (SimpleName/MemberLookup) that we're currently
17954 emitting a field initializer (which must not access any instance members,
17955 this is an error CS0236).
17957 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17958 argument, if the `IsFieldInitializer' flag is set, we must report and
17959 error CS0236 and not an error CS0120.
17961 2002-08-07 Martin Baulig <martin@gnome.org>
17963 * ecore.cs (IMemberExpr): New public interface.
17964 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17965 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17966 if the expression is an IMemberExpr.
17968 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17969 to be null, implicitly default to `this' if we're non-static in
17970 this case. Simplified the code a lot by using the new IMemberExpr
17971 interface. Also fixed bug #28176 here.
17973 2002-08-06 Martin Baulig <martin@gnome.org>
17975 * cs-parser.jay (SimpleLookup): Removed. We need to create
17976 ParameterReferences during semantic analysis so that we can do a
17977 type-only search when resolving Cast, TypeOf and SizeOf.
17978 (block): Pass the `current_local_parameters' to the Block's
17981 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17982 argument to the constructor.
17983 (ConstructorInitializer.Resolve): Create a temporary implicit
17984 block with the parameters.
17986 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17987 references here if we aren't doing a type-only search.
17989 * statement.cs (Block): Added constructor which takes a
17990 `Parameters parameters' argument.
17991 (Block.Parameters): New public property.
17993 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17994 to `Parameters' and made it public readonly.
17996 2002-08-06 Martin Baulig <martin@gnome.org>
17998 * ecore.cs (Expression.Warning): Made this public as well.
18000 * report.cs (Report.Debug): Print the contents of collections.
18002 2002-08-06 Martin Baulig <martin@gnome.org>
18004 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
18005 used to tell Resolve() which kinds of expressions it may return.
18006 (Expression.Resolve): Added overloaded version of this method which
18007 takes a `ResolveFlags flags' argument. This can be used to tell
18008 Resolve() which kinds of expressions it may return. Reports a
18010 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18011 ResolveFlags.SimpleName.
18012 (Expression.Error118): Added overloaded version of this method which
18013 takes a `ResolveFlags flags' argument. It uses the flags to determine
18014 which kinds of expressions are allowed.
18016 * expression.cs (Argument.ResolveMethodGroup): New public method.
18017 Resolves an argument, but allows a MethodGroup to be returned.
18018 This is used when invoking a delegate.
18020 * TODO: Updated a bit.
18022 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18024 Fixed compilation with csc.
18026 * ecore.cs: Expression.Error made public. Is this correct? Should
18027 Warning be made public too?
18029 * expression.cs: use ea.Location instead of ea.loc.
18030 [FIXME: Filed as bug #28607: MCS must report these errors.]
18032 2002-08-06 Martin Baulig <martin@gnome.org>
18034 * ecore.cs (Expression.loc): Moved the location here instead of
18035 duplicating it in all derived classes.
18036 (Expression.Location): New public property.
18037 (Expression.Error, Expression.Warning): Made them non-static and
18038 removed the location argument.
18039 (Expression.Warning): Added overloaded version which takes an
18040 `int level' argument.
18041 (Expression.Error118): Make this non-static and removed the
18042 expression and location arguments.
18043 (TypeExpr): Added location argument to the constructor.
18045 * expression.cs (StaticCallExpr): Added location argument to
18047 (Indirection, PointerArithmetic): Likewise.
18048 (CheckedExpr, UnCheckedExpr): Likewise.
18049 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18050 (StringPtr): Likewise.
18053 2002-08-05 Martin Baulig <martin@gnome.org>
18055 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18057 * assign.cs (Assign.DoResolve): Check whether the source
18058 expression is a value or variable.
18060 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18061 while resolving the corresponding blocks.
18063 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18064 an error, don't silently return null.
18066 * statement.cs (Block.AddVariable): Do the error reporting here
18067 and distinguish between CS0128 and CS0136.
18068 (Block.DoResolve): Report all unused labels (warning CS0164).
18069 (LabeledStatement): Pass the location to the constructor.
18070 (LabeledStatement.HasBeenReferenced): New property.
18071 (LabeledStatement.Resolve): Set it to true here.
18073 * statement.cs (Return.Emit): Return success even after reporting
18074 a type mismatch error (CS0126 or CS0127), this is what csc does and
18075 it avoids confusing the users with any consecutive errors.
18077 2002-08-05 Martin Baulig <martin@gnome.org>
18079 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18081 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18083 * expression.cs (MemberAccess.DoResolve): Silently return if an
18084 error has already been reported.
18086 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18087 error has already been reported.
18089 2002-08-05 Martin Baulig <martin@gnome.org>
18091 * statement.cs (UsageVector): Only initialize the `parameters'
18092 vector if we actually have any "out" parameters.
18094 2002-08-05 Martin Baulig <martin@gnome.org>
18096 * expression.cs (Binary.ResolveOperator): When combining delegates,
18097 they must have the same type.
18099 2002-08-05 Martin Baulig <martin@gnome.org>
18101 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18102 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18103 work with the ms runtime and we also don't need it: if we're a
18104 PropertyBuilder and not in the `indexer_arguments' hash, then we
18105 are a property and not an indexer.
18107 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18108 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18109 since the latter one doesn't work with the ms runtime.
18111 2002-08-03 Martin Baulig <martin@gnome.org>
18113 Fixed bugs #27998 and #22735.
18115 * class.cs (Method.IsOperator): New public field.
18116 (Method.CheckBase): Report CS0111 if there's already a method
18117 with the same parameters in the current class. Report CS0508 when
18118 attempting to change the return type of an inherited method.
18119 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18120 and it's not marked abstract or extern.
18121 (PropertyBase): New abstract base class for Property and Indexer.
18122 (PropertyBase.CheckBase): Moved here from Property and made it work
18124 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18125 the same so we can reuse it there.
18126 (Property, Indexer): Derive from PropertyBase.
18127 (MethodSignature.inheritable_property_signature_filter): New delegate
18128 to find properties and indexers.
18130 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18131 argument and improved error reporting.
18133 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18134 EmptyReadOnlyParameters and made it a property.
18136 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18137 version of this method which takes a `PropertyInfo indexer'.
18138 (TypeManager.RegisterIndexer): New method.
18140 * class.cs: Added myself as author of this file :-)
18142 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18144 * class.cs: fixed compilation on windoze.
18146 2002-08-03 Martin Baulig <martin@gnome.org>
18148 * interface.cs (Interface.GetInterfaceBases): Check whether all
18149 base interfaces are at least as accessible than the current one.
18151 * class.cs (TypeContainer.GetClassBases): Check whether base types
18152 are at least as accessible than the current type.
18153 (TypeContainer.AsAccessible): Implemented and made non-static.
18154 (MemberBase.CheckParameters): Report errors if the accessibility
18157 * delegate.cs (Delegate.Delegate): The default visibility is
18158 internal for top-level types and private for nested types.
18159 (Delegate.Define): Report errors if the accessibility checks fail.
18161 * enum.cs (Enum.Enum): The default visibility is internal for
18162 top-level types and private for nested types.
18163 (Enum.DefineType): Compute the correct visibility.
18165 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18166 function which takes a `bool is_toplevel' instead of a TypeContainer.
18168 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18171 2002-08-02 Martin Baulig <martin@gnome.org>
18173 * expression.cs (LocalVariableReferenc): Added constructor which
18174 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18175 (LocalVariableReference.IsReadOnly): New property.
18176 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18177 variable is readonly, use our own readonly flag to do this; you can
18178 use the new constructor to get a writable reference to a read-only
18181 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18182 reference to the local variable.
18184 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18186 * rootcontext.cs (ResolveCore): Also include System.Exception
18188 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18189 we reach an EmptyStatement.
18191 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18194 * expression.cs (Binary.ResolveOperator): Check error result in
18197 use brtrue/brfalse directly and avoid compares to null.
18199 2002-08-02 Martin Baulig <martin@gnome.org>
18201 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18202 Fixes bug #28407, added test-155.cs.
18204 2002-08-01 Martin Baulig <martin@gnome.org>
18206 * class.cs (Event.EmitDefaultMethod): Make this work with static
18207 events. Fixes #28311, added verify-3.cs.
18209 2002-08-01 Martin Baulig <martin@gnome.org>
18211 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18212 `is_disposable' fields.
18213 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18214 `hm.is_disposable' if we're using the collection pattern.
18215 (Foreach.EmitCollectionForeach): Use the correct type for the
18216 enumerator's local variable, only emit the try/finally block if
18217 necessary (fixes #27713).
18219 2002-08-01 Martin Baulig <martin@gnome.org>
18221 * ecore.cs (Expression.report118): Renamed to Error118 and made
18224 * statement.cs (Throw.Resolve): Check whether the expression is of
18225 the correct type (CS0118) and whether the type derives from
18226 System.Exception (CS0155).
18227 (Catch.Resolve): New method. Do the type lookup here and check
18228 whether it derives from System.Exception (CS0155).
18229 (Catch.CatchType, Catch.IsGeneral): New public properties.
18231 * typemanager.cs (TypeManager.exception_type): Added.
18233 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18235 * driver.cs: Updated About function.
18237 2002-07-31 Martin Baulig <martin@gnome.org>
18239 Implemented Control Flow Analysis.
18241 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18242 (EmitContext.CurrentBranching): Added.
18243 (EmitContext.StartFlowBranching): Added.
18244 (EmitContext.EndFlowBranching): Added.
18245 (EmitContext.KillFlowBranching): Added.
18246 (EmitContext.IsVariableAssigned): Added.
18247 (EmitContext.SetVariableAssigned): Added.
18248 (EmitContext.IsParameterAssigned): Added.
18249 (EmitContext.SetParameterAssigned): Added.
18250 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18251 Added control flow analysis stuff here.
18253 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18254 resolve the expression as lvalue.
18255 (LocalVariableReference.DoResolve): Check whether the variable has
18256 already been assigned.
18257 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18258 the parameter as assigned here.
18259 (ParameterReference.DoResolve): Check whether the parameter has already
18261 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18262 expression as lvalue.
18264 * statement.cs (FlowBranching): New class for the flow analysis code.
18265 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18266 (LabeledStatement.IsDefined): New public property.
18267 (LabeledStatement.AddUsageVector): New public method to tell flow
18268 analyis that the label may be reached via a forward jump.
18269 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18271 (VariableInfo.Number): New public field. This is used by flow analysis
18272 to number all locals of a block.
18273 (Block.CountVariables): New public property. This is the number of
18274 local variables in this block (including the locals from all parent
18276 (Block.EmitMeta): Number all the variables.
18278 * statement.cs: Added flow analysis support to all classes.
18280 2002-07-31 Martin Baulig <martin@gnome.org>
18282 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18283 To get debugging messages, compile mcs with /define:MCS_DEBUG and
18284 then use this argument.
18286 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18288 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18289 use this to specify /define options.
18291 2002-07-29 Martin Baulig <martin@gnome.org>
18293 * statement.cs (Fixed): Moved all code that does variable lookups
18294 and resolvings from Emit to Resolve.
18296 * statement.cs (For): Moved all code that does variable lookups
18297 and resolvings from Emit to Resolve.
18299 * statement.cs (Using): Moved all code that does variable lookups
18300 and resolvings from Emit to Resolve.
18302 2002-07-29 Martin Baulig <martin@gnome.org>
18304 * attribute.cs (Attribute.Resolve): Explicitly catch a
18305 System.NullReferenceException when creating the
18306 CustromAttributeBuilder and report a different warning message.
18308 2002-07-29 Martin Baulig <martin@gnome.org>
18310 * support.cs (ParameterData.ParameterName): Added method to
18311 get the name of a parameter.
18313 * typemanager.cs (TypeManager.IsValueType): New public method.
18315 2002-07-29 Martin Baulig <martin@gnome.org>
18317 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18318 is a flag which specifies that it's either ref or out.
18319 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18320 the out parameter to `out Parameter.Modifier mod', also set the
18321 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18323 * support.cs (InternalParameters.ParameterModifier): Distinguish
18324 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18325 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18327 * expression.cs (Argument.GetParameterModifier): Distinguish
18328 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18329 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18331 2002-07-29 Martin Baulig <martin@gnome.org>
18333 * expression.cs (ParameterReference.ParameterReference): Added
18334 `Location loc' argument to the constructor.
18336 * cs-parser.jay: Pass location to ParameterReference.
18338 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18340 * statement.cs (Try): Initialize the location.
18342 * cs-parser.jay: pass location to Try.
18344 * expression.cs (Unary.Reduce): Change the prototype to return
18345 whether a constant fold could be performed or not. The result is
18346 returned in an out parameters. In the case of Indirection and
18347 AddressOf, we want to perform the full tests.
18349 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18351 * statement.cs (Statement.Emit): Flag dead code.
18353 2002-07-27 Andrew Birkett <andy@nobugs.org>
18355 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18357 2002-07-27 Martin Baulig <martin@gnome.org>
18359 * class.cs (MethodData.Define): Put back call to
18360 TypeManager.AddMethod(), accidentally commented this out.
18362 * report.cs (Debug): New public method to print debugging information,
18363 this is `[Conditional ("DEBUG")]'.
18365 2002-07-26 Martin Baulig <martin@gnome.org>
18367 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18368 (switch_statement): Push the current_block to the switch_stack and
18369 pop it again when we're done with the switch.
18370 (switch_section): The new block is a child of the current_block.
18371 Fixes bug #24007, added test-152.cs.
18373 2002-07-27 Martin Baulig <martin@gnome.org>
18375 * expression.cs (Invocation.EmitArguments): When calling a varargs
18376 function with only its fixed arguments, we need to pass an empty
18379 2002-07-27 Martin Baulig <martin@gnome.org>
18381 Mono 0.13 has been released.
18383 2002-07-25 Miguel de Icaza <miguel@ximian.com>
18385 * driver.cs: Rename --resource to --linkres, because that is what
18386 we do currently, we dont support --resource yet.
18388 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18390 2002-07-25 Martin Baulig <martin@gnome.org>
18392 * class.cs (MethodData): New public class. This is a `method builder'
18393 class for a method or one accessor of a Property/Indexer/Event.
18394 (MethodData.GetMethodFlags): Moved here from MemberBase.
18395 (MethodData.ApplyAttributes): Likewise.
18396 (MethodData.ApplyObsoleteAttribute): Likewise.
18397 (MethodData.ApplyConditionalAttribute): Likewise.
18398 (MethodData.ApplyDllImportAttribute): Likewise.
18399 (MethodData.CheckAbstractAndExternal): Likewise.
18400 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18401 (MethodData.Emit): Formerly known as Method.Emit().
18402 (MemberBase): Moved everything which was specific to a single
18403 accessor/method to MethodData.
18404 (Method): Create a new MethodData and call Define() and Emit() on it.
18405 (Property, Indexer, Event): Create a new MethodData objects for each
18406 accessor and call Define() and Emit() on them.
18408 2002-07-25 Martin Baulig <martin@gnome.org>
18410 Made MethodCore derive from MemberBase to reuse the code from there.
18411 MemberBase now also checks for attributes.
18413 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18414 (MemberBase.GetMethodFlags): Moved here from class Method and marked
18416 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18417 `CallingConventions cc' and `Attributes opt_attrs' arguments.
18418 (MemberBase.ApplyAttributes): New virtual method; applies the
18419 attributes to a method or accessor.
18420 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18421 (MemberBase.ApplyConditionalAttribute): Likewise.
18422 (MemberBase.ApplyDllImportAttribute): Likewise.
18423 (MemberBase.CheckAbstractAndExternal): Likewise.
18424 (MethodCore.ParameterTypes): This is now a property instead of a
18425 method, it's initialized from DoDefineParameters().
18426 (MethodCore.ParameterInfo): Removed the set accessor.
18427 (MethodCore.DoDefineParameters): New protected virtual method to
18428 initialize ParameterTypes and ParameterInfo.
18429 (Method.GetReturnType): We can now simply return the MemberType.
18430 (Method.GetMethodFlags): Override the MemberBase version and add
18431 the conditional flags.
18432 (Method.CheckBase): Moved some code from Define() here, call
18433 DoDefineParameters() here.
18434 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18435 here to avoid some larger code duplication.
18436 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18437 ensure that abstract and external accessors don't declare a body.
18439 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18440 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18441 lookup in the attribute's parent classes, so we need to abort as soon
18442 as we found the first match.
18443 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18444 the attribute has no arguments.
18446 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18449 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18451 * cs-parser.jay: reverted previous patch.
18453 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18455 * cs-parser.jay: fixed bug #22119.
18457 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18459 * attribute.cs: fixed compilation. The error was:
18460 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
18461 be assigned to before control leaves the current method."
18462 [FIXME: Filed as bug #28186: MCS must report this error.]
18464 2002-07-25 Martin Baulig <martin@gnome.org>
18466 * attribute.cs (Attribute.Conditional_GetConditionName): New static
18467 method to pull the condition name ouf of a Conditional attribute.
18468 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18469 the obsolete message and error flag out of an Obsolete attribute.
18471 * class.cs (Method.GetMethodFlags): New public method to get the
18472 TypeManager.MethodFlags for this method.
18473 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18475 (Method.Define): Get and apply the Obsolete and Conditional attributes;
18476 if we're overriding a virtual function, set the new private variable
18477 `parent_method'; call the new TypeManager.AddMethod().
18479 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
18480 the MethodBuilder and the Method in a PtrHashtable.
18481 (TypeManager.builder_to_method): Added for this purpose.
18482 (TypeManager.MethodFlags): Added IsObsoleteError.
18483 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
18484 Obsolete and Conditional arguments in MethodBuilders. If we discover
18485 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18486 the message from the attribute.
18488 2002-07-24 Martin Baulig <martin@gnome.org>
18490 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18491 preprocessor directives, ensure that the argument to #define/#undef is
18492 exactly one identifier and that it's actually an identifier.
18494 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18497 2002-07-24 Martin Baulig <martin@gnome.org>
18499 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18500 initialize it to TypeManager.object_type in the constructor.
18501 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18502 of the `hm.get_current' method if we're using the collection pattern.
18503 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18504 for the explicit conversion to make it work when we're using the collection
18505 pattern and the `Current' property has a different return type than `object'.
18508 2002-07-24 Martin Baulig <martin@gnome.org>
18510 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18511 does not match, but don't report any errors. This method is called in
18512 order for all methods in a MethodGroupExpr until a matching method is
18513 found, so we don't want to bail out if the first method doesn't match.
18514 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18515 matches, report the 123. Fixes #28070.
18517 2002-07-24 Martin Baulig <martin@gnome.org>
18519 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18520 TypeManager.TypeToCoreType() to the top of the method so the
18521 following equality checks will work. Fixes #28107.
18523 2002-07-24 Martin Baulig <martin@gnome.org>
18525 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18526 operand is of type uint, and the other operand is of type sbyte,
18527 short or int, the operands are converted to type long." -
18528 Actually do what this comment already told us. Fixes bug #28106,
18531 2002-07-24 Martin Baulig <martin@gnome.org>
18533 * class.cs (MethodBase): New abstract class. This is now a base
18534 class for Property, Indexer and Event to avoid some code duplication
18535 in their Define() and DefineMethods() methods.
18536 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18537 generic methods for Define() and DefineMethods().
18538 (FieldBase): Derive from MemberBase, not MemberCore.
18539 (Property): Derive from MemberBase, not MemberCore.
18540 (Property.DefineMethod): Moved all the code from this method to the
18541 new MethodBase.DefineAccessor(), just call it with appropriate
18543 (Property.Define): Call the new Property.DoDefine(), this does some
18544 sanity checks and we don't need to duplicate the code everywhere.
18545 (Event): Derive from MemberBase, not MemberCore.
18546 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18547 accessors, this will also make them work with interface events.
18548 (Indexer): Derive from MemberBase, not MemberCore.
18549 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18550 (Indexer.Define): Use the new MethodBase functions.
18552 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18553 argument to the constructor.
18554 (Interface.FindMembers): Added support for interface events.
18555 (Interface.PopluateEvent): Implemented.
18557 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
18559 2002-07-22 Miguel de Icaza <miguel@ximian.com>
18561 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18562 but this is required to check for a method name being the same as
18563 the containing class.
18567 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18569 * interface.cs: initialize variable.
18571 2002-07-23 Martin Baulig <martin@gnome.org>
18573 Implemented the IndexerName attribute in interfaces.
18575 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18576 name if this is an explicit interface implementation.
18577 (Indexer.InterfaceIndexerName): New public variable. If we're
18578 implementing an interface indexer, this is the IndexerName in that
18579 interface. Otherwise, it's the IndexerName.
18580 (Indexer.DefineMethod): If we're implementing interface indexer,
18581 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
18582 and Pending.ImplementIndexer methods.
18583 (Indexer.Define): Also define the PropertyBuilder if we're
18584 implementing an interface indexer and this is neither an explicit
18585 interface implementation nor do the IndexerName match the one in
18588 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18589 If a method is defined here, then we always need to create a proxy
18590 for it. This is used when implementing interface indexers.
18591 (Pending.IsInterfaceIndexer): New public method.
18592 (Pending.ImplementIndexer): New public method.
18593 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18594 This is used when implementing interface indexers to define a proxy
18596 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18597 define a proxy if necessary.
18599 * interface.cs (Interface.IndexerName): New public variable.
18600 (Interface.PopulateIndexer): Set the IndexerName.
18601 (Interface.DefineIndexers): New private method. Populate all the
18602 indexers and make sure their IndexerNames match.
18604 * typemanager.cs (IndexerPropertyName): Added support for interface
18607 2002-07-22 Martin Baulig <martin@gnome.org>
18609 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18610 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18611 ret if HasReturnLabel.
18612 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18615 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18616 and set the ec.LoopBeginTryCatchLevel.
18617 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18618 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18619 the current ec.TryCatchLevel, the branch goes out of an exception
18620 block. In this case, we need to use Leave and not Br.
18622 2002-07-22 Martin Baulig <martin@gnome.org>
18624 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18625 block unless the block does not always return or it is contained in
18626 another try { ... } catch { ... } block. Fixes bug #26506.
18627 Added verify-1.cs to the test suite.
18629 2002-07-22 Martin Baulig <martin@gnome.org>
18631 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18632 then we do not always return. Fixes bug #24985.
18634 2002-07-22 Martin Baulig <martin@gnome.org>
18636 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18637 lookup on a per-class level; ie. walk up the class hierarchy until we
18638 found at least one applicable method, then choose the best among them.
18639 Fixes bug #24463 and test-29.cs.
18641 2002-07-22 Martin Baulig <martin@gnome.org>
18643 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18644 return types of the methods. The return type is not part of the
18645 signature and we must not check it to make the `new' modifier work.
18646 Fixes bug #27999, also added test-147.cs.
18647 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18649 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18650 on the method's return type.
18652 2002-07-21 Martin Baulig <martin@gnome.org>
18654 * assign.cs: Make this work if the rightmost source is a constant and
18655 we need to do an implicit type conversion. Also adding a few more tests
18656 to test-38.cs which should have caught this.
18658 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18659 target in the makefile for this. The makefile.gnu is primarily intended
18660 for end-users who don't want to debug the compiler.
18662 2002-07-21 Martin Baulig <martin@gnome.org>
18664 * assign.cs: Improved the Assign class so it can now handle embedded
18665 assignments (X = Y = Z = something). As a side-effect this'll now also
18666 consume less local variables. test-38.cs now passes with MCS, added
18667 a few new test cases to that test.
18669 2002-07-20 Martin Baulig <martin@gnome.org>
18671 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18672 instructions. Fixes bug #27977, also added test-146.cs.
18674 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18676 * cs-tokenizer.cs: fixed getHex ().
18678 2002-07-19 Martin Baulig <martin@gnome.org>
18680 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18681 not Type.GetType() to lookup the array type. This is needed when
18682 we're constructing an array of a user-defined type.
18683 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18684 single-dimensional arrays, but also for single-dimensial arrays of
18687 2002-07-19 Martin Baulig <martin@gnome.org>
18689 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18690 this function is called, it's not allowed to share LocalBuilders
18691 among ILGenerators.
18693 2002-07-19 Martin Baulig <martin@gnome.org>
18695 * expression.cs (Argument.Resolve): Report an error 118 when trying
18696 to pass a type as argument.
18698 2002-07-18 Martin Baulig <martin@gnome.org>
18700 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18701 Conv_R_Un for the signed `long' type.
18703 2002-07-15 Miguel de Icaza <miguel@ximian.com>
18705 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18706 `expr' for the temporary result, as that will fail if we do
18707 multiple resolves on the same expression.
18709 2002-07-05 Miguel de Icaza <miguel@ximian.com>
18711 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18712 ec.TypeContainer for looking up aliases.
18714 * class.cs (TypeContainer): Remove LookupAlias from here.
18716 * decl.cs (DeclSpace); Move here.
18718 2002-07-01 Miguel de Icaza <miguel@ximian.com>
18720 * class.cs (FindMembers): Only call filter if the constructor
18721 bulider is not null.
18723 Also handle delegates in `NestedTypes' now. Now we will perform
18724 type lookups using the standard resolution process. This also
18727 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18728 This uses Expressions (the limited kind that can be parsed by the
18729 tree) instead of strings.
18731 * expression.cs (ComposedCast.ToString): Implement, used to flag
18732 errors since now we have to render expressions.
18734 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
18737 * ecore.cs (SimpleName.ToString): ditto.
18739 * cs-parser.jay: Instead of using strings to assemble types, use
18740 Expressions to assemble the type (using SimpleName, ComposedCast,
18741 MemberAccess). This should fix the type lookups in declarations,
18742 because we were using a different code path for this.
18744 * statement.cs (Block.Resolve): Continue processing statements
18745 even when there is an error.
18747 2002-07-17 Miguel de Icaza <miguel@ximian.com>
18749 * class.cs (Event.Define): Also remove the `remove' method from
18750 the list of pending items.
18752 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18753 generate more compact code.
18755 2002-07-17 Martin Baulig <martin@gnome.org>
18757 * const.cs (Const.LookupConstantValue): Add support for constant
18758 `unchecked' and `checked' expressions.
18759 Also adding test case test-140.cs for this.
18761 2002-07-17 Martin Baulig <martin@gnome.org>
18763 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18764 check whether mi.ReturnType implements the IEnumerator interface; the
18765 `==' and the IsAssignableFrom() will fail in this situation.
18767 2002-07-16 Ravi Pratap <ravi@ximian.com>
18769 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
18772 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18774 * expression.cs: fixed bug #27811.
18776 2002-07-14 Miguel de Icaza <miguel@ximian.com>
18778 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18779 Molaro: when we are a ref, the value already contains a pointer
18780 value, do not take the address of it.
18782 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18783 * removed mb-parser.jay and mb-tokenizer.cs
18785 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18787 * expression.cs: check against the building corlib void type.
18789 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18791 * ecore.cs: fix for valuetype static readonly fields: when
18792 initializing them, we need their address, not the address of a copy.
18794 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18796 * typemanager.cs: register also enum_type in corlib.
18798 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18800 * class.cs: allow calling this (but not base) initializers in structs.
18802 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18804 * ecore.cs: make sure we compare against the building base types
18807 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18809 * typemanager.cs: fix TypeToCoreType() to handle void and object
18810 (corlib gets no more typerefs after this change).
18812 2002-07-12 Miguel de Icaza <miguel@ximian.com>
18814 * expression.cs (ArrayCreation.EmitArrayArguments): use
18815 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18817 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18818 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
18819 array indexes, the runtime actually forbids them.
18821 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18822 for array arguments here.
18824 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18825 instead of the default for ValueTypes.
18827 (New.DoEmit): Use IsValueType instead of
18828 IsSubclassOf (value_type)
18829 (New.DoResolve): ditto.
18830 (Invocation.EmitCall): ditto.
18832 * assign.cs (Assign): ditto.
18834 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18835 Statements *are* currently doing part of their resolution during
18838 Expressions do always resolve during resolve, but statements are
18839 only required to propagate resolution to their children.
18841 2002-07-11 Miguel de Icaza <miguel@ximian.com>
18843 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18845 (LoadAssembly): Do not add the dll if it is already specified
18847 (MainDriver): Add the System directory to the link path at the end,
18848 after all the other -L arguments.
18850 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18851 wrong opcode for loading bytes and bools (ldelem.i1 instead of
18852 ldelem.u1) and using the opposite for sbytes.
18854 This fixes Digger, and we can finally run it.
18856 * driver.cs (UnixParseOption): Move the option parsing here.
18857 (CSCParseOption): Implement CSC-like parsing of options.
18859 We now support both modes of operation, the old Unix way, and the
18860 new CSC-like way. This should help those who wanted to make cross
18861 platform makefiles.
18863 The only thing broken is that /r:, /reference: and /lib: are not
18864 implemented, because I want to make those have the same semantics
18865 as the CSC compiler has, and kill once and for all the confussion
18866 around this. Will be doing this tomorrow.
18868 * statement.cs (Unsafe.Resolve): The state is checked during
18869 resolve, not emit, so we have to set the flags for IsUnsfe here.
18871 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18873 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18874 not catch the Error_ObjectRefRequired in SimpleName (as it is
18875 possible to have a class/instance variable name that later gets
18876 deambiguated), we have to check this here.
18878 2002-07-10 Ravi Pratap <ravi@ximian.com>
18880 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18881 make static and put into Expression.
18883 (Event.Define): Register the private field of the event with the
18884 TypeManager so that GetFieldFromEvent can get at it.
18886 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18887 keep track of the private field associated with an event which
18890 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18893 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18895 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18897 * expression.cs (Binary.EmitBranchable): this routine emits the
18898 Binary expression in a branchable context. This basically means:
18899 we need to branch somewhere, not just get the value on the stack.
18901 This works together with Statement.EmitBoolExpression.
18903 * statement.cs (Statement.EmitBoolExpression): Use
18906 2002-07-09 Miguel de Icaza <miguel@ximian.com>
18908 * statement.cs (For): Reduce the number of jumps in loops.
18910 (For): Implement loop inversion for the For statement.
18912 (Break): We can be breaking out of a Try/Catch controlled section
18913 (foreach might have an implicit try/catch clause), so we need to
18914 use Leave instead of Br.
18916 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18917 now). If the instace expression supports IMemoryLocation, we use
18918 the AddressOf method from the IMemoryLocation to extract the
18919 address instead of emitting the instance.
18921 This showed up with `This', as we were emitting the instance
18922 always (Emit) instead of the Address of This. Particularly
18923 interesting when This is a value type, as we dont want the Emit
18924 effect (which was to load the object).
18926 2002-07-08 Miguel de Icaza <miguel@ximian.com>
18928 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18930 * statement.cs (Checked): Set the CheckedState during the resolve
18931 process too, as the ConvCast operations track the checked state on
18932 the resolve process, and not emit.
18934 * cs-parser.jay (namespace_member_declaration): Flag that we have
18935 found a declaration when we do. This is used to flag error 1529
18937 * driver.cs: Report ok when we display the help only.
18939 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
18941 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18943 2002-07-04 Miguel de Icaza <miguel@ximian.com>
18945 * cs-tokenizer.cs (define): We also have to track locally the
18946 defines. AllDefines is just used for the Conditional Attribute,
18947 but we also need the local defines for the current source code.
18949 2002-07-03 Miguel de Icaza <miguel@ximian.com>
18951 * statement.cs (While, For, Do): These loops can exit through a
18952 Break statement, use this information to tell whether the
18953 statement is the last piece of code.
18955 (Break): Flag that we break.
18957 * codegen.cs (EmitContexts): New `Breaks' state variable.
18959 2002-07-03 Martin Baulig <martin@gnome.org>
18961 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18962 modifiers in method declarations in structs. Otherwise, you won't
18963 be able to override things like Object.Equals().
18965 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18967 * class.cs (Method, Property, Indexer): Do not allow the public
18968 modifier to be used in explicit interface implementations.
18970 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18971 override modifiers in method declarations in structs
18973 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18975 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18976 integer or real overflow, report an error
18978 2002-07-02 Martin Baulig <martin@gnome.org>
18980 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18981 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18982 to tell the runtime about our newly created System.Object and
18983 System.ValueType types.
18985 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18987 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18988 struct instead of Ldarg/Starg.
18990 2002-07-02 Martin Baulig <martin@gnome.org>
18992 * expression.cs (Indirection.Indirection): Call
18993 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18995 2002-07-02 Martin Baulig <martin@gnome.org>
18997 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18998 ValueType, call TypeManager.TypeToCoreType() on it.
18999 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19000 the OpCodes.Newarr argument.
19002 2002-07-02 Martin Baulig <martin@gnome.org>
19004 * expression.cs (Invocation.EmitCall): When compiling corlib,
19005 replace all calls to the system's System.Array type to calls to
19006 the newly created one.
19008 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19009 System.Array methods.
19010 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19011 from the system's System.Array type which must be replaced.
19013 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19015 * typemanager.cs: load unverifiable_code_ctor so we can build
19016 corlib using the correct type. Avoid using GetTypeCode() with
19018 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19019 TypeManager.object_type to allow building corlib.
19021 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19023 * ecore.cs: handle System.Enum separately in LoadFromPtr().
19025 2002-07-01 Martin Baulig <martin@gnome.org>
19027 * class.cs: Make the last change actually work, we need to check
19028 whether `ifaces != null' to avoid a crash.
19030 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19032 * class.cs: when we build structs without fields that implement
19033 interfaces, we need to add the interfaces separately, since there is
19034 no API to both set the size and add the interfaces at type creation
19037 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19039 * expression.cs: the dimension arguments to the array constructors
19040 need to be converted if they are a long.
19042 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19044 * class.cs: don't emit ldarg.0 if there is no parent constructor
19045 (fixes showstopper for corlib).
19047 2002-06-29 Martin Baulig <martin@gnome.org>
19049 MCS now compiles corlib on GNU/Linux :-)
19051 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19052 ie. check for MethodImplOptions.InternalCall.
19054 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19055 and TypeManager.attribute_type are null, so we must explicitly check
19056 whether parent is not null to find out whether it's an attribute type.
19057 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19058 and SetBuilder, not only if the property is neither abstract nor external.
19059 This is necessary to set the MethodImplOptions on the accessor methods.
19060 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19061 SetBuilder, see Property.Emit().
19063 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19064 populate "System.Object", "System.ValueType" and "System.Attribute" since
19065 they've already been populated from BootCorlib_PopulateCoreTypes().
19067 2002-06-29 Martin Baulig <martin@gnome.org>
19069 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19070 is the NullLiteral, we also need to make sure that target_type is not
19073 2002-06-29 Martin Baulig <martin@gnome.org>
19075 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19076 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19077 before calling BootstrapCorlib_ResolveDelegate ().
19079 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19081 * statement.cs: fixed build-breaker. All tests passed ok.
19083 2002-06-27 Martin Baulig <martin@gnome.org>
19085 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19086 for System.Decimal when compiling corlib.
19088 2002-06-27 Martin Baulig <martin@gnome.org>
19090 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19091 switch blocks which contain nothing but a default clause.
19093 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19095 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19097 2002-06-27 Martin Baulig <martin@gnome.org>
19099 * ecore.cs (PropertyExpr.PropertyExpr): Call
19100 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19102 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19103 is already a TypeBuilder.
19105 2002-06-27 Martin Baulig <martin@gnome.org>
19107 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19108 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19109 the "from an array-type to System.Array" case. This makes it work
19110 when compiling corlib.
19112 2002-06-27 Martin Baulig <martin@gnome.org>
19114 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19115 non-static PropertyExpr, set its InstanceExpression. This makes
19116 the `ICollection.Count' property work in System/Array.cs.
19118 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19120 * driver.cs: Made error handling more consistent. Errors now
19121 tracked by Report class, so many methods which used to return int
19122 now return void. Main() now prints success/failure and
19123 errors/warnings message.
19125 Renamed '--probe' compiler argument to '--expect-error'. Removed
19126 the magic number return values (123 and 124). Now, if the
19127 expected error occurs, the compiler exits with success (exit value
19128 0). If the compilation completes without seeing that particular
19129 error, the compiler exits with failure (exit value 1). The
19130 makefile in mcs/errors has been changed to handle the new behaviour.
19132 * report.cs: Made 'expected error' number a property and renamed
19133 it from 'Probe' to 'ExpectedError'.
19135 * genericparser.cs: Removed error handling support, since it is
19136 now all done by Report class.
19138 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19139 class, so parse() no longer returns an int.
19141 * namespace.cs: Use Report.Error instead of GenericParser.error
19143 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19145 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19146 TypeContainer.AddOperator): At the front of the list put the
19147 explicit implementations, so they get resolved/defined first.
19149 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19151 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19152 interface type is implemented by this TypeContainer. Used during
19153 explicit interface implementation.
19155 (Property.Define, Indexer.Define, Method.Define): Validate that
19156 the given interface in the explicit implementation is one of the
19157 base classes for the containing type.
19159 Also if we are explicitly implementing an interface, but there is
19160 no match in the pending implementation table, report an error.
19162 (Property.Define): Only define the property if we are
19163 not explicitly implementing a property from an interface. Use the
19164 correct name also for those properties (the same CSC uses,
19165 although that is really not needed).
19167 (Property.Emit): Do not emit attributes for explicitly implemented
19168 properties, as there is no TypeBuilder.
19170 (Indexer.Emit): ditto.
19172 Hiding then means that we do not really *implement* a pending
19173 implementation, which makes code fail.
19175 2002-06-22 Martin Baulig <martin@gnome.org>
19177 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19178 the return value of Object.GetType(). [FIXME: we need to do this whenever
19179 we get a type back from the reflection library].
19181 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19183 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19185 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19187 * attribute.cs: Return null if we can not look up the type.
19189 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19190 the interface types found.
19192 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19193 interface types found.
19195 * typemanager.cs (GetInterfaces): Make this routine returns alll
19196 the interfaces and work around the lame differences between
19197 System.Type and System.Reflection.Emit.TypeBuilder in the results
19198 result for GetInterfaces.
19200 (ExpandInterfaces): Given an array of interface types, expand and
19201 eliminate repeated ocurrences of an interface. This expands in
19202 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19205 2002-06-21 Martin Baulig <martin@gnome.org>
19207 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19210 2002-06-21 Martin Baulig <martin@gnome.org>
19212 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19213 and called with one of the core types, return the corresponding typebuilder for
19216 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19219 2002-06-21 Martin Baulig <martin@gnome.org>
19221 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19222 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19223 (Expression.ConvertReferenceExplicit): Likewise.
19225 * expression.cs (ElementAccess.DoResolve): Likewise.
19226 (ElementAccess.DoResolveLValue): Likewise.
19228 2002-06-10 Martin Baulig <martin@gnome.org>
19230 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19231 add the "value" parameter to the parameter list.
19233 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19236 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19238 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19239 the argument to an int, uint, long or ulong, per the spec. Also
19240 catch negative constants in array creation.
19242 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19244 * class.cs: do not allow the same interface to appear twice in
19245 the definition list.
19247 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19249 * ecore.cs: don't use ldlen with System.Array.
19251 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19253 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19255 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19257 * modifiers.cs: produce correct field attributes for protected
19258 internal. Easy fix so miguel can work on ther harder stuff:-)
19260 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19262 * pending.cs: New file. Move the code from class.cs here.
19263 Support clearning the pending flag for all methods (when not doing
19264 explicit interface implementation).
19266 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19268 * rootcontext.cs: added a couple more types needed to bootstrap.
19270 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19272 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19273 constructor in the type, instead of any constructor in the type
19274 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19275 a bug in the Mono runtime when applying the params attribute).
19277 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19278 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19280 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19282 * expression.cs (Unary.ResolveOperator): Use TypeManager
19283 to resolve the type.
19285 2002-06-13 Ravi Pratap <ravi@ximian.com>
19287 * cs-parser.jay (enum_member_declaration): Pass in the attributes
19290 * enum.cs (AddEnumMember): Add support to store the attributes associated
19291 with each member too.
19293 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19294 field builders too - this takes care of the enum member case.
19296 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19298 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19299 address-of operator on both value types and pointers.
19301 2002-06-10 Martin Baulig <martin@gnome.org>
19303 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19304 PropertyBuilder to the `property_builders' list.
19306 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19307 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19308 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19309 find any indexers which are inherited from an interface.
19311 2002-06-09 Martin Baulig <martin@gnome.org>
19313 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19314 the same type as the constant if necessary. There's also a test-130.cs
19317 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19319 * typemanager.cs (TypeManager.ChangeType): Previously known as
19320 Enum.ChangeEnumType().
19322 2002-06-09 Martin Baulig <martin@gnome.org>
19324 * expression.cs (Cast.TryReduce): Added support for consts.
19326 2002-06-08 Ravi Pratap <ravi@ximian.com>
19328 * class.cs (Accessor): Hold attributes information so we can pass
19331 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19332 Modify to pass in attributes attached to the methods.
19334 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19336 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19337 to handle the Accessor kind :-)
19339 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19341 2002-06-08 Martin Baulig <martin@gnome.org>
19343 * expression.cs (Unary.TryReduceNegative): Added support for
19346 2002-06-08 Martin Baulig <martin@gnome.org>
19348 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19349 name can't be found in the `defined_names' - the caller will do a
19350 MemberLookup in this case and thus find methods in System.Enum
19351 such as Enum.IsDefined().
19353 2002-06-08 Martin Baulig <martin@gnome.org>
19355 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19356 Convert.ChangeType() which works with TypeBuilder created types.
19357 (Enum.LookupEnumValue, Enum.Define): Use it here.
19359 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19360 `TypeBuilder.BaseType != null' check.
19361 (TypeContainer.FindMembers): Only lookup parent members if we
19362 actually have a parent.
19363 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19364 (ConstructorInitializer.Resolve): Likewise.
19366 * interface.cs (Interface.FindMembers): Added
19367 `TypeBuilder.BaseType != null' check.
19369 * rootcontext.cs (RootContext.ResolveCore): Added
19370 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19371 classes_second_stage.
19373 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19374 debug_type and trace_type when compiling with --nostdlib.
19376 2002-06-07 Martin Baulig <martin@gnome.org>
19378 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19379 (AddField): Set it to true when adding a non-static field.
19380 (DefineType): Use `have_nonstatic_fields' to find out whether we
19381 have non-static fields, not `Fields != null'.
19383 2002-06-02 Miguel de Icaza <miguel@ximian.com>
19385 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19386 dereferencing a null on the static-field code path)
19388 2002-05-30 Martin Baulig <martin@gnome.org>
19390 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19391 to take command line arguments. Use reflection to call the new
19392 custom `Initialize' function on the symbol writer and pass it the
19393 command line arguments.
19395 * driver.cs (--debug-args): New command line argument to pass command
19396 line arguments to the symbol writer.
19398 2002-05-28 Miguel de Icaza <miguel@ximian.com>
19400 * assign.cs (DoResolve): Forgot to do the implicit conversion to
19401 the target type for indexers and properties. Thanks to Joe for
19404 2002-05-27 Miguel de Icaza <miguel@ximian.com>
19406 * typemanager.cs (MethodFlags): returns the method flags
19407 (Obsolete/ShouldIgnore) that control warning emission and whether
19408 the invocation should be made, or ignored.
19410 * expression.cs (Invocation.Emit): Remove previous hack, we should
19411 not do this on matching a base type, we should do this based on an attribute
19413 Only emit calls to System.Diagnostics.Debug and
19414 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19415 on the command line.
19417 * rootcontext.cs: Global settings for tracing and debugging.
19419 * cs-tokenizer.cs (define): New utility function to track
19420 defines. Set the global settings for TRACE and DEBUG if found.
19422 2002-05-25 Ravi Pratap <ravi@ximian.com>
19424 * interface.cs (Populate*): Pass in the TypeContainer as well as
19425 the DeclSpace as parameters so that we can create EmitContexts and
19426 then use that to apply attributes etc.
19428 (PopulateMethod, PopulateEvent, PopulateProperty)
19429 (PopulateIndexer): Apply attributes everywhere.
19431 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19434 (ApplyAttributes): Update accordingly.
19436 We now apply interface attributes for all members too.
19438 2002-05-26 Miguel de Icaza <miguel@ximian.com>
19440 * class.cs (Indexer.Define); Correctly check if we are explicit
19441 implementation (instead of checking the Name for a ".", we
19442 directly look up if the InterfaceType was specified).
19444 Delay the creation of the PropertyBuilder.
19446 Only create the PropertyBuilder if we are not an explicit
19447 interface implementation. This means that explicit interface
19448 implementation members do not participate in regular function
19449 lookups, and hence fixes another major ambiguity problem in
19450 overload resolution (that was the visible effect).
19452 (DefineMethod): Return whether we are doing an interface
19455 * typemanager.cs: Temporary hack until we get attributes in
19456 interfaces (Ravi is working on that) and we get IndexerName
19457 support in interfaces.
19459 * interface.cs: Register the indexers as properties.
19461 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19462 warning, I have verified that this is a bug in the .NET runtime
19463 (JavaScript suffers of the same problem).
19465 * typemanager.cs (MemberLookup): When looking up members for
19466 interfaces, the parent of an interface is the implicit
19467 System.Object (so we succeed in searches of Object methods in an
19468 interface method invocation. Example: IEnumerable x; x.ToString
19471 2002-05-25 Miguel de Icaza <miguel@ximian.com>
19473 * class.cs (Event): Events should also register if they do
19474 implement the methods that an interface requires.
19476 * typemanager.cs (MemberLookup); use the new GetInterfaces
19479 (GetInterfaces): The code used to lookup interfaces for a type is
19480 used in more than one place, factor it here.
19482 * driver.cs: Track the errors at the bottom of the file, we kept
19485 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19486 instance if the method we are calling is static!
19488 2002-05-24 Miguel de Icaza <miguel@ximian.com>
19490 * attribute.cs (ApplyAttributes): Make this function filter out
19491 the IndexerName attribute (as that attribute in reality is never
19492 applied) and return the string constant for the IndexerName
19495 * class.cs (TypeContainer.Emit): Validate that all the indexers
19496 have the same IndexerName attribute, and if so, set the
19497 DefaultName attribute on the class.
19499 * typemanager.cs: The return value might contain other stuff (not
19500 only methods). For instance, consider a method with an "Item"
19501 property and an Item method.
19503 * class.cs: If there is a problem with the parameter types,
19506 2002-05-24 Ravi Pratap <ravi@ximian.com>
19508 * ecore.cs (ImplicitConversionExists): Wrapper function which also
19509 looks at user defined conversion after making a call to
19510 StandardConversionExists - we need this for overload resolution.
19512 * expression.cs : Update accordingly the various method calls.
19514 This fixes 2 bugs filed against implicit user defined conversions
19516 2002-05-22 Miguel de Icaza <miguel@ximian.com>
19518 * statement.cs: Track the result of the assignment.
19520 2002-05-21 Miguel de Icaza <miguel@ximian.com>
19522 * expression.cs (MemberAccess): Improved error reporting for
19523 inaccessible members.
19525 2002-05-22 Martin Baulig <martin@gnome.org>
19527 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
19528 itself with debugging support.
19530 2002-05-22 Martin Baulig <martin@gnome.org>
19532 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19533 Removed, this isn't needed anymore.
19535 2002-05-20 Martin Baulig <martin@gnome.org>
19537 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19538 be underlying type for an enum.
19540 2002-05-20 Miguel de Icaza <miguel@ximian.com>
19542 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19543 that splits out the loading of just the core types.
19545 * rootcontext.cs (ResolveCore): Split the struct resolution in
19546 two, so we can load the enumeration underlying types before any
19549 * expression.cs (Is): Bandaid until we fix properly Switch (see
19550 bug #24985 for details).
19552 * typemanager.cs (ImplementsInterface): The hashtable will contain
19553 a null if there are no interfaces implemented.
19555 2002-05-18 Miguel de Icaza <miguel@ximian.com>
19557 * cs-parser.jay (indexer_declarator): It is fine to have array
19560 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19562 * typemanager.cs: (RegisterBuilder): New function used to register
19563 TypeBuilders that implement interfaces. Since
19564 TypeBuilder.GetInterfaces (as usual) does not work with lame
19566 (AddUserType): register interfaces.
19568 (ImplementsInterface): Use the builder_to_ifaces hash if we are
19569 dealing with TypeBuilder. Also, arrays are showing up as
19570 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19571 methods can not be invoked on them!
19573 * ecore.cs (ExplicitReferenceConversionExists): Made public.
19574 (ImplicitReferenceConversionExists): Split out from
19575 StandardConversionExists.
19577 * expression.cs (As): We were only implementing one of the three
19578 cases for the as operator. We now implement them all.
19579 (Is): Implement the various other cases for Is as well.
19581 * typemanager.cs (CACHE): New define used to control if we want or
19582 not the FindMembers cache. Seems to have a negative impact on
19583 performance currently
19585 (MemberLookup): Nested types have full acess to
19586 enclosing type members
19588 Remove code that coped with instance/static returns for events, we
19589 now catch this in RealFindMembers.
19591 (RealFindMembers): only perform static lookup if the instance
19592 lookup did not return a type or an event.
19594 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19596 * assign.cs (CompoundAssign): We pass more semantic information
19597 now to Compound Assignments than we did before: now we have all
19598 the information at hand, and now we resolve the target *before* we
19599 do the expression expansion, which allows the "CacheValue" method
19600 to have the effect we intended (before, a [x] += 1 would generate
19601 two differen ArrayAccess expressions from the ElementAccess,
19602 during the resolution process).
19604 (CompoundAssign.DoResolve): Resolve target and original_source here.
19606 2002-05-16 Miguel de Icaza <miguel@ximian.com>
19608 * expression.cs (ArrayAccess): dropped debugging information.
19610 * typemanager.cs: Small bug fix: I was always returning i_members,
19611 instead of one of i_members or s_members (depending on which had
19614 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
19615 method is invoked before any code generation takes place, and it
19616 is a mechanism to inform that the expression will be invoked more
19617 than once, and that the method should use temporary values to
19618 avoid having side effects
19620 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19622 * ecore.cs (Expression.CacheTemporaries): Provide empty default
19625 * expression.cs (Indirection, ArrayAccess): Add support for
19626 CacheTemporaries in these two bad boys.
19628 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19629 ldobj or ldind_ref.
19630 (StoreFromPtr): Handle stobj as well.
19632 * expression.cs (UnaryMutator): Share more code.
19634 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19635 down: I was not tracking the Filter function as well, which
19636 was affecting the results of the cache.
19638 2002-05-15 Miguel de Icaza <miguel@ximian.com>
19640 * attribute.cs: Remove the hack to handle the CharSet property on
19643 2002-05-14 Miguel de Icaza <miguel@ximian.com>
19645 * attribute.cs (DoResolve): More uglyness, we now only try to
19646 resolve the attribute partially, to extract the CharSet
19647 information (only if we are a StructLayout attribute). Otherwise
19649 (GetExtraTypeInfo): Add some code to conditionally kill in the
19650 future this. I am more and more convinced that the .NET
19651 framework has special code to handle the attribute setting on
19654 * expression.cs (IsParamsMethodApplicable): Revert my previous
19655 foreach change here, it was wrong.
19657 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19659 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19660 (pp_expr): do not abort on unknown input, just return.
19661 (eval): abort if there are pending chars.
19663 * attribute.cs (Attribute.Resolve): Positional parameters are
19664 optional. Deal with that case.
19666 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19667 the Ansi/Unicode/Auto information for the type.
19669 (TypeContainer.DefineType): instantiate the EmitContext here, as
19670 we will be using it during the type definition (to resolve
19671 attributes) and during the emit phase.
19673 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19674 to pull type information out of the attributes
19676 (Attribute.Resolve): track the constructor builder, and allow for
19677 multiple invocations (structs and classes will use this).
19679 * ecore.cs (MemberLookupFinal): new version with all the
19680 parameters customizable.
19682 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19683 constructors. Return if the result value is null (as the error
19684 would have been flagged already by MemberLookupFinal)
19686 Do not allow instances of abstract classes or interfaces to be
19689 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19690 We have to compare the assembly property here when dealing with
19691 FamANDAssem and Assembly access modifiers, because we might be
19692 creating an assembly from *modules* (that means that we are not
19693 getting TypeBuilders for types defined in other modules that are
19694 part of this assembly).
19696 (Method.Emit): If the method is marked abstract and has a body,
19699 (TypeContainer.DefineMembers): If both the defined member and the
19700 parent name match are methods, then do not emit any warnings: let
19701 the Method.Define routine take care of flagging warnings. But if
19702 there is a mismatch (method overrides something else, or method is
19703 overriwritten by something, then emit warning).
19705 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19706 set to null, this means `do not check for the return type on the
19709 (Method.Define): set the return type for the method signature to
19710 null, so that we get methods with the same name and parameters and
19711 different return types. This is used to flag warning 114 (you are
19712 hiding a method, and you probably want to use the new/override
19715 * typemanager.cs (MemberLookup): Implemented proper access
19716 control, closing a long standing set of bug reports. The problem
19717 was that the Framework only has two bits: Public and NonPublic,
19718 and NonPublic includes private and protected methods, but we need
19719 to enforce the FamANDAssem, FamOrAssem and Family.
19721 2002-05-11 Miguel de Icaza <miguel@ximian.com>
19723 * statement.cs (GotoCase): Return true: Ammounts to giving up
19724 knowledge on whether we return or not, and letting the other case
19725 be responsible for it.
19727 2002-05-10 Miguel de Icaza <miguel@ximian.com>
19729 * driver.cs: Do not load directories for each file processed, only
19730 do it if there is a pattern.
19732 * ecore.cs: Report readonly assigns here as well, as we might have
19733 been resolved only by MemberAccess.
19735 (SimpleName.SimpleNameResolve): Also be useful for LValue
19736 resolution. We need this to propagate assign to local readonly variables
19738 * typemanager.cs: Use a ptrhashtable for the criteria, because we
19739 do not want to reuse potential criteria memory.
19741 * class.cs (MyEventBuilder): Set reflected_type;
19743 * ecore.cs (Constantify): Added support for constifying bools.
19745 (RootContext.LookupType): Added a cache for values looked up in
19746 the declaration space.
19748 * typemanager.cs (FindMembers): Now is a front-end to
19749 RealFindMembers, and provides a two-level hashtable-based cache to
19752 15% performance improvement: from 22.5 to 19.2 seconds.
19754 * expression.cs (IsParamsMethodApplicable): use foreach.
19755 (Invocation.DoResolve): ditto.
19756 (New.DoResolve): ditto.
19757 (ArrayCreation.DoResolve): ditto.
19759 * ecore.cs (FindMostEncompassingType): use foreach.
19761 * delegate.cs (NewDelegate.DoResolve): Use foreach
19763 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19764 (RemoveMethods): use foreach.
19766 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19767 nested foreach statements instead of for, and also break out of
19768 the inner loop once a match is found.
19770 (Invocation.OverloadResolve): Use foreach, simplify the code.
19772 2002-05-08 Miguel de Icaza <miguel@ximian.com>
19774 * cfold.cs (BinaryFold): During an enumeration evaluation context,
19775 we actually unwrap the expression to allow for extra information
19778 * expression.cs: Use Shr_Un on unsigned operations.
19780 2002-05-08 Ravi Pratap <ravi@ximian.com>
19782 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
19783 applicable operators was not being considered correctly. This closes
19784 the bug Miguel reported.
19786 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19788 * attribute.cs: check that the type derives from System.Attribute
19789 and report the correct error in that case (moved the duplicate code to
19790 its own method, too).
19792 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19794 * attribute.cs: lookup attribute type name as the spec says: first the
19795 bare attribute name and then name + "Attribute" (nant compiles with
19796 mcs after this fix).
19798 2002-05-07 Miguel de Icaza <miguel@ximian.com>
19800 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
19801 Because of the way we parse things, we should try to see if a
19802 UIntConstant can fit in an integer.
19804 2002-05-07 Ravi Pratap <ravi@ximian.com>
19806 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19807 when we are in an explicit context.
19809 (ConvertReferenceExplicit): When converting from Iface type S to Class
19810 T make sure the rules are implemented as an OR.
19812 * parameter.cs (ParameterType): Make it a property for now although the
19813 purpose really isn't anything immediate.
19815 * expression.cs (Is*Applicable): Do better checking on the parameter type
19816 of a ref/out parameter. The ones from the system assemblies are already
19817 marked with the correct type so we don't need to do any correction.
19819 * ecore.cs (StandardConversionExists): Conversion from Interface types to
19820 the object type is standard too so include that.
19822 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19824 * ecore.cs (StandardConversionExists): Augment with missing code:
19825 deal with IntConstant, LongConstants and Enumerations.
19827 * assign.cs: Report the error, instead of failing silently
19829 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19830 typecontainer that they are declared, because the
19831 typecontainer/namespace will have the list of using clauses that
19832 need to be applied.
19834 Assembly Attributes were escaping the normal registration
19837 (EmitCode): Apply attributes within an EmitContext that represents
19838 the container they were declared on.
19840 * cs-parser.jay: Track bases for structs. How did I get this wrong?
19842 2002-05-06 Ravi Pratap <ravi@ximian.com>
19844 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19845 Revamp completely - make much cleaner as we now operate only
19848 (FindMostSpecificSource, FindMostSpecificTarget): New methods
19849 to implement the logic detailed in the spec more correctly.
19851 (UserDefinedConversion): Update accordingly.
19853 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19855 * statement.cs: Return flow analysis information up.
19857 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19860 (token): Do not consume an extra character before calling
19863 2002-05-06 Piers Haken <piersh@friskit.com>
19865 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19867 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19869 * class.cs (Constructor.Emit): Set the IsStatic flag in the
19870 EmitContext during the instance constructor initializer
19871 resolution, to stop access to instance variables.
19873 This is mandated by the spec, last paragraph of the `constructor
19874 initializers' section.
19876 2002-05-05 Miguel de Icaza <miguel@ximian.com>
19878 * cs-parser.jay, class.cs (Accessor): new class used to represent
19879 an accessor (get or set). In the past we used `null' to represent
19880 a missing accessor. But this is ambiguous because there was no
19881 way to tell in abstract indexers/properties if one of them was
19884 Now there is a way of addressing that.
19886 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19887 instead of FindMembers.
19889 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19890 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19892 * attribute.cs: Treat indexers and properties as the same in terms
19893 of applying attributes
19895 * ecore.cs (FindMostEncompassedType): Use statically initialized
19896 EmptyExpressions()s like we do elsewhere to avoid creating useless
19897 objects (and we take this out of the tight loop).
19899 (GetConversionOperators): Move the code to extract the actual
19900 operators to a separate routine to clean things up.
19902 2002-05-04 Miguel de Icaza <miguel@ximian.com>
19904 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19905 events are always registered FieldBuilders.
19907 * class.cs (FieldBase): New class shared by Fields
19909 * delegate.cs: If we are a toplevel delegate, use our full name.
19910 If we are a nested delegate, then only use our tail name.
19912 2002-05-02 Ravi Pratap <ravi@ximian.com>
19914 * expression.cs (IsApplicable): Ensure that we add the "&" to
19915 ref/out types before comparing it with the type of the argument.
19917 (IsParamsMethodApplicable): Ditto.
19919 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
19922 * delegate.cs : Handle the case when we have more than one applicable
19923 method. Flag an error only when we finish checking all.
19925 2002-05-02 Miguel de Icaza <miguel@ximian.com>
19927 * expression.cs: Add support for boolean static initializers.
19929 2002-05-01 Miguel de Icaza <miguel@ximian.com>
19931 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19933 * parameter.cs (ComputeParameterTypes,
19934 ComputeAndDefineParameterTypes): Better error handling: now we
19935 clear the `types' cache if we fail during any of the type lookups.
19936 We also return the status code correctly to our caller
19938 * delegate.cs: If we fail to define a delegate, abort the extra
19941 * expression.cs (Binary.ResolveOperator): for
19942 operator==(object,object) and operator !=(object, object) we also
19943 have to verify that there is an implicit conversion from one to
19946 (ArrayAccess.DoResolve): Array Access can operate on
19949 2002-04-30 Miguel de Icaza <miguel@ximian.com>
19951 * assign.cs (CompoundAssign): A new class used as a "flag" that
19952 the assignment actually is happening as part of a compound
19953 assignment operator.
19955 During compound assignment, a few new rules exist to enable things
19962 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19963 to the type of x) if y is implicitly convertible to the type of x,
19964 and the operator is a builtin operator and the return type of the
19965 operator is explicitly convertible to the type of x.
19967 * rootcontext.cs: Reset warning level to 2. 4 catches various
19968 "interesting" features in mcs, we must clean this up at some
19969 point, but currently am trying to kill other bugs ;-)
19971 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19972 in container classes as well.
19974 * expression.cs (Binary.ResolveOperator): Handle string case
19975 before anything else (as operator overloading does emit an error
19976 before doing anything else).
19978 This code could go away when we move to a table driven model, but
19979 i could not come up with a good plan last night.
19981 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19983 * typemanager.cs (CSharpName): reimplementation using regex.
19984 * class.cs: added null check for fields in Emit
19985 * rootcontext.cs: set warninglevel to 4
19987 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19989 * typemanager.cs (CSharpName): reimplemented with Lupus
19992 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19994 * statement.cs (If): correclty implement Resolve, because we were
19995 not catching sem errors in there. The same process is needed
19997 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20000 (Statement.Warning_DeadCodeFound): Factorize code.
20001 (While): Report dead code here too.
20003 (Statement): Added Resolve virtual method to allow
20004 for resolution split from the emit code.
20006 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20008 * statement.cs (EmitBoolExpression): No longer try to resolve the
20010 (MakeBoolean): New utility function that resolve, implicitly
20011 converts to boolean and tags the expression.
20014 (If, Do): Implement dead code elimination.
20015 (While): Implement loop inversion
20017 (Do, While, For, If): Resolve the expression prior to calling our
20020 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
20023 - added method Report28 (warning: program has more than one entry point)
20024 - added method IsEntryPoint, implements paragraph 10.1 of the spec
20025 - modified method Method.Define, the part at the end of the method
20027 * rootcontext.cs: added static public Location EntryPointLocation;
20029 * ../errors/cs0028.cs : Add test case for the above warning.
20032 - modified method CSharpName to allow arrays of primitive type to
20033 be printed nicely (e.g. instead of System.Int32[][] it now prints
20035 - added method CSharpSignature: returns the signature of a method
20036 in string format to be used in reporting errors, warnings, etc.
20038 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20041 2002-04-26 Ravi Pratap <ravi@ximian.com>
20043 * delegate.cs (Define): Fix extremely silly bug where I was
20044 setting the type of the 'object' parameter of the BeginInvoke
20045 method to System.IAsyncResult instead of System.Object ;-)
20047 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20049 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20052 (Constructor.Emit): return if we fail to initialize the
20053 constructor. Another door closed!
20055 * expression.cs (New.DoResolve): Improve error message (from -6 to
20056 1501). Use DeclaredOnly lookup to find the exact constructor.
20058 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20059 loop. This is useful.
20061 * cs-parser.jay: Adjust the default parameters so that destructors
20062 have the proper signature.
20064 2002-04-26 Martin Baulig <martin@gnome.org>
20066 * driver.cs (LoadAssembly): If `assembly' contains any characters
20067 which are only valid in path names and not in assembly names
20068 (currently slash, backslash and point), use Assembly.LoadFrom ()
20069 instead of Assembly.Load () on the `assembly' (before iteration
20070 over the link_paths).
20072 2002-04-26 Martin Baulig <martin@gnome.org>
20074 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20076 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20078 * class.cs (Property): use the new typemanager.MemberLookup
20080 (TypeContainer.MemberLookup): Implement using the
20081 TypeManager.MemberLookup now.
20083 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20084 and return MemberInfos, so that these can be used without an
20085 EmitContext (what we had before).
20087 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20089 * expression.cs: Fix the case where the argument to params if the
20090 type of the params. I omitted handling this before. Fixed
20092 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20094 * driver.cs: Call BootCorlib_PopulateCoreType
20096 * class.cs (Property.CheckBase): Check for properties only, not
20099 * interface.cs: Temporary hack: try/catch around the
20100 CustomAttributeBuilder, because I am getting an exception that I
20103 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20104 types whose definitions are required to be there (attributes are
20105 defined before standard types).
20107 Compute definitions as we boot the various types, as they are used
20108 immediately (value_type class will need object_type, but if we do
20109 not initialize object_type, we will pass a null, which will let
20110 the runtime pick the System.Object from the existing corlib, which
20111 is not what we want).
20113 2002-04-22 Patrik Torstensson <totte@labs2.com>
20115 * cs-tokenizer.cs: fixed a number of trim() issues.
20117 2002-04-22 Ravi Pratap <ravi@ximian.com>
20119 * expression.cs (Argument.Type): Ensure that we return the correct
20120 type when we have out or ref parameters [in which case we
20123 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20125 * class.cs (Property, Indexer): Allow extern modifier in there.
20127 * typemanager.cs (InitBaseTypes): Initializes object_type and
20128 value_type, since those will be used early on during the bootstrap
20129 process to compile corlib.
20131 (InitCoreTypes): Move code from here to InitBaseTypes.
20133 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20135 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20136 single-dimension arrays as using the ldlen opcode.
20138 Daniel Lewis discovered this optimization.
20140 * typemanager.cs: Add signature for System.Array::get_Length
20142 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20144 * statement.cs: report the error when the foreach does not apply to an
20145 array nor a collection.
20147 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20149 * expression.cs: Add implicit conversions to the operator ~.
20151 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20153 * typemanager.cs: Locate the decimal constructor.
20155 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20157 * attribute.cs: use the new property of TypeOf.
20158 * expression.cs: added 'get' property around typearg.
20160 These changes fix a build breaker reported by NickD. Is this the
20161 correct way to fix? If not, please, revert my changes and make it
20164 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20166 * attribute.cs: Add support for typeof in attribute invocations.
20167 I am not sure that this is right though.
20169 2002-04-14 Duncan Mak <duncan@ximian.com>
20171 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20172 Binary.Operator.Division case.
20174 2002-04-13 Ravi Pratap <ravi@ximian.com>
20176 * class.cs (DefineType): Ensure that we do a proper check on
20177 attribute types and also register it with the TypeManager.
20179 (TypeContainer.Targets): The default for attribute types is
20180 AttributeTargets.All.
20182 * attribute.cs (ApplyAttributes): Registering the attribute type
20183 is done elsewhere, not when we discover we have a Usage attribute.
20185 2002-04-12 Ravi Pratap <ravi@ximian.com>
20187 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20188 and get rid of is_delegate parameter.
20190 * everywhere : update.
20192 2002-04-12 Ravi Pratap <ravi@ximian.com>
20194 * cs-parser.jay (compilation_unit): Revamp completely to use
20195 some new ideas that I got from Rhys' grammar to solve the problems
20196 with assembly level attributes.
20198 (outer_declaration): New grammar production.
20200 (attribute_sections): Add.
20202 (opt_attributes): Base on attribute_sections
20204 (namespace_declaration): Allow opt_attributes to tackle the case
20205 when we have assembly level attributes - we are clever in this
20208 * attribute.cs (ApplyAttributes): Do not worry about assembly
20209 attributes in the non-global context.
20211 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20212 instead of SetGlobalAttributes.
20214 * class.cs, rootcontext.cs : Ensure we define and generate
20215 attribute types before anything else.
20217 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20218 and flag the new error -20 for the case when the attribute type
20219 does not have valid targets specified. csc does not catch this.
20221 * ../errors/errors.txt : update for error # -20
20223 2002-04-11 Ravi Pratap <ravi@ximian.com>
20225 * support.cs (InternalParameters.ParameterModifier): Do some null
20226 checking and return sane values.
20228 * class.cs (Method.Define): If we are a PInvoke method, ensure
20229 that we are static and extern. Report error # 601
20231 * ../errors/cs0601.cs : Add test case for the above error.
20233 2002-04-07 Ravi Pratap <ravi@ximian.com>
20235 * rootcontext.cs (attribute_types): We need to keep type of
20236 all attribute types separately and emit code for them first.
20238 (RegisterAttribute) : Implement.
20240 * class.cs (DefineType): Check if the current Type is a custom
20241 attribute type and register it accordingly.
20243 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20244 adding the first attribute twice and rename to
20246 (SetGlobalAttributes): this.
20248 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20251 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20252 if we are processing global arguments. Hmm, I am unsure of this.
20254 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20256 * expression.cs: added static array of strings to avoid calling
20257 Enum.ToString () for Operator in Binary. Significant recover of
20260 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20262 * class.cs (FindMembers): Allow the Builders of the various
20263 members to be null. If they are skip them. This only happens
20264 during the PInvoke declaration.
20266 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20268 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20269 failure, so we do not keep going afterwards.
20271 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20272 wanted to pass `false' as the `is_delegate' argument. If this is
20273 the case, why not use delegate_type == null to mean `is_delegate =
20274 false' and anything else as is_delegate = true.
20276 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20278 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20279 code for the section, not the beginning of the tests.
20281 2002-04-08 Miguel de Icaza <miguel@ximian.com>
20283 * cfold.cs: Handle operator + (Enum x, Underlying x)
20285 * expression.cs (Binary): same. Warn about errors where we have
20286 Enum/Enum in operator + as well.
20288 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
20291 - added support for switch(bool)
20292 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20293 - add TableSwitchEmit() to handle table-based switch statements
20295 2002-04-05 Ravi Pratap <ravi@ximian.com>
20297 * expression.cs (Invocation.OverloadResolve): Factor out code which
20298 does parameter compatibility checking with arguments so that we can
20299 re-use the code even from Delegate.VerifyApplicability
20301 (VerifyArgumentsCompat): Move above code here.
20303 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20304 and instead make a call to the above method.
20306 2002-03-31 Ravi Pratap <ravi@ximian.com>
20308 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20309 We use it to keep track of classes which are attribute types.
20311 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20313 * delegate.cs (Delegate.Define): Correctly define the types in the
20314 presence of fixed and array parameters.
20316 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20319 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20320 include NonPublic after the first iteration.
20322 * class.cs (Indexer.CheckBase): Only check if both parents are
20325 * cs-parser.jay (accessor_body): If empty, set to null.
20327 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20328 same code path here to resolve constants names that we did have in
20329 MemberAccess.DoResolve. There is too much code duplicated here.
20331 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20333 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20335 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20338 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20339 tokens, numbers and strings.
20341 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20344 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20345 asyncronous parameters and the regular parameters.
20347 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20348 specify the target directory.
20350 * expression.cs: (This.DoResolve): Simplify
20351 (As.Emit): Optimize, do not generate IsInst if the expression is
20352 always of the given type.
20354 (Is.DoResolve): Bug fix, we were reporting both always/never for
20357 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20358 creating too many unnecessary arrays.
20360 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20362 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20363 fields instead of rolling our own initializer. Takes care of all
20364 implicit conversions, and drops unnecessary static checks/argument.
20366 2002-03-31 Dick Porter <dick@ximian.com>
20368 * driver.cs: use the GetDirectories() return values properly, and
20369 use "/" as path separator.
20371 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20373 * expression.cs (Unary): Optimize - - expr into expr.
20374 (Binary): Optimize a + (-b) into a -b.
20376 * codegen.cs (CodeGen): Made all methods static.
20378 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20382 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20383 TypeBuilder property.
20385 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20388 * tree.cs: Removed the various RecordXXXX, and replaced with a
20389 single RecordDecl. Removed all the accessor methods, and just
20390 left a single access point Type
20392 * enum.cs: Rename DefineEnum to DefineType.
20394 * decl.cs: New abstract method `DefineType' used to unify the
20395 Defines for Enumerations, Interfaces, TypeContainers and
20398 (FindType): Moved LookupInterfaceOrClass here. Moved the
20399 LookupBaseClasses method that used to live in class.cs and
20400 interface.cs here, and renamed to FindType.
20402 * delegate.cs: Implement DefineType. Take advantage of the
20403 refactored pattern for locating the parent builder without taking
20404 the parent_builder argument (which we know does not work if we are
20405 nested, and triggering a toplevel definition).
20407 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20409 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20410 accessibility of a member has changed during override and report
20413 * class.cs (Method.Define, Property.Define): Only complain on
20414 overrides if the method is private, any other accessibility is
20415 fine (and since we just checked the permission is the same, we are
20418 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20419 and elif are processed always. The other pre-processing
20420 directives are only processed if we are "taking" the path
20422 2002-03-29 Martin Baulig <martin@gnome.org>
20424 * class.cs (Method.Emit): Only emit symbolic debugging info if the
20425 current location is not Null.
20427 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20428 a separate method so we can profile it.
20430 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20431 `span.Seconds' are just seconds, but no minutes or hours.
20432 (MainDriver): Profile the CodeGen.SaveSymbols calls.
20434 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20436 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20437 Remove the gratuitous set of Final:
20439 // If an interface implementation, then we can set Final.
20440 if (((flags & MethodAttributes.Abstract) == 0) &&
20441 implementing.DeclaringType.IsInterface)
20442 flags |= MethodAttributes.Final;
20444 I do not know what I was smoking when I used that.
20447 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20448 step into fixing the name resolution issues for delegates and
20449 unifying the toplevel name resolution.
20451 2002-03-28 Martin Baulig <martin@gnome.org>
20453 * class.cs (Method.Emit): If we have a symbol writer, call its
20454 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20455 tell it about the current method.
20457 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20458 writer that we're going to emit the first byte of IL code for a new
20459 statement (a new source line).
20460 (EmitContext.EmitTopBlock): If we have a symbol writer, call
20461 EmitContext.Mark() before emitting any code.
20463 * location.cs (SymbolDocument): Return null when we're Null.
20465 * statement.cs (Statement): Moved the `Location loc' variable here.
20466 (Statement.EmitBoolExpression): If we have a symbol writer, call
20467 ec.Mark() before emitting any code to tell it that we're at the
20468 beginning of a new statement.
20469 (StatementExpression): Added `Location' argument to the constructor.
20470 (Block): Added public readonly variable `StartLocation' and public
20471 variable `EndLocation'. The latter is to be set using SetEndLocation().
20472 (Block): Added constructor which takes a start and end location.
20473 (Block.SetEndLocation): New method. This sets the end location.
20474 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20475 local variables we create.
20476 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20477 each statement and do also mark the begin and end of the block.
20479 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20480 tell it the current lexer.Location, use Location.Null for the end of the
20482 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20483 current block, set its end location using SetEndLocation().
20484 (statement_expression): StatementExpression constructor now takes the
20485 lexer.Location as additional argument.
20486 (for_statement, declare_local_variables): Likewise.
20487 (declare_local_variables): When creating a new implicit block, use the
20488 new Block constructor and pass it the lexer.Location.
20490 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20492 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20493 members also on the parent interfaces recursively.
20495 2002-03-27 Miguel de Icaza <miguel@ximian.com>
20497 * report.cs: Use new formats, since Gonzalo finished the missing
20500 * expression.cs (Binary.ResolveOperator): added missing operator|
20501 operator& and operator^ for bool/bool.
20503 * cs-parser.jay: CheckDef now takes a Location argument that is
20504 used to report errors more precisly (instead of reporting the end
20505 of a definition, we try to track something which is a lot closer
20506 to the source of the problem).
20508 * cs-tokenizer.cs: Track global token use, so we can properly flag
20509 the use of #define/#undef after the first token has been seen.
20511 Also, rename the reportXXXX to Error_DescriptiveName
20513 * decl.cs (DeclSpace.IsTopLevel): Move property here from
20514 TypeContainer, so that Enum and Interface can use this too.
20516 * class.cs (TypeContainer.LookupInterfaceOrClass,
20517 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20518 `builder' argument. Typically this was used to pass the parent
20519 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20522 The problem is that a nested class could trigger the definition of
20523 a toplevel class, and the builder would be obviously wrong in that
20526 So we drop this argument, and we compute dynamically the
20527 TypeBuilder/ModuleBuilder (the correct information was available
20528 to us anyways from DeclSpace.Parent)
20530 * interface.cs (Interface.DefineInterface): Drop builder
20531 parameter cleanup like class.cs
20533 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
20536 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20539 (Try.Emit): Propagate the returns value from the statement.
20541 (Return.Emit): Even if we are leavning
20543 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20545 * modifiers.cs: Fix the computation of MethodAttributes flags.
20547 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20549 * driver.cs: allow compilation of files that start with '/'.
20550 Add a default case when checking the argument of --target.
20552 2002-03-25 Miguel de Icaza <miguel@ximian.com>
20554 * interface.cs: Implement the same search algorithm for types in
20555 the interface code.
20557 * delegate.cs: Do not allow multiple definition.
20559 * Recovered ChangeLog that got accidentally amputated
20561 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20563 * rootcontext.cs: Load manually enum to allow core classes to
20564 contain enumerations.
20566 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20567 Update to new static methods in TypeManager.
20569 * typemanager.cs (GetMethod, GetConstructor): Use our
20570 implementation of FindMembers to find the members, since during
20571 corlib compilation, the types are TypeBuilders and GetMethod and
20572 GetConstructor do not work.
20574 Make all methods in TypeManager static.
20576 (InitCodeHelpers): Split the functionality from
20577 the InitCodeTypes function.
20579 * driver.cs: Call InitCodeHelpers after we have populated the
20582 * cs-parser.jay (delegate_declaration): we did not used to compute
20583 the delegate name correctly for void delegates.
20585 2002-03-24 Miguel de Icaza <miguel@ximian.com>
20587 * rootcontext.cs (RootContext): Init the interface_resolve_order
20588 and type_container_resolve_order always.
20590 (ResolveCore, BootstrapCorlib_ResolveClass,
20591 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20592 compiler when compiling with --nostdlib
20594 * class.cs (TypeContainer.DefineType): Check that our parent is
20595 not null. This test is most important when we are bootstraping
20598 * codegen.cs: Split out the symbol writing code.
20600 2002-03-25 Martin Baulig <martin@gnome.org>
20602 * driver.cs (-g): Made -g an alias for --debug.
20604 2002-03-24 Martin Baulig <martin@gnome.org>
20606 * codegen.cs (SymbolWriter): New public variable. Returns the
20607 current symbol writer.
20608 (CodeGen): Added `bool want_debugging_support' argument to the
20609 constructor. If true, tell the ModuleBuild that we want debugging
20610 support and ask it for the ISymbolWriter.
20611 (Save): If we have a symbol writer, call it's Close() method after
20612 saving the assembly.
20614 * driver.c (--debug): New command line argument to create a
20615 debugger information file.
20617 * location.cs (SymbolDocument): New public property. Returns an
20618 ISymbolDocumentWriter object for the current source file or null
20619 if we don't have a symbol writer.
20621 2002-03-21 Miguel de Icaza <miguel@ximian.com>
20623 * driver.cs (LoadAssembly): Correctly return when all the paths
20624 have been tried and not before.
20626 * statement.cs (Switch.Emit): return the actual coverage for this
20627 statement (returns/not-returns)
20629 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20630 switch of the statement if we are the last switch section. That
20631 kills two problems: try/catch problems (we used to emit an empty
20632 nop at the end) and switch statements where all branches would
20635 2002-03-19 Miguel de Icaza <miguel@ximian.com>
20637 * driver.cs: Add default assemblies (the equivalent to the
20638 Microsoft CSC.RSP file)
20640 * cs-tokenizer.cs: When updating `cols and setting it to zero,
20641 also update tokens_seen and set it to false.
20643 * driver.cs: Implement --recurse for Mike.
20645 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20646 correctly splitting out the paths.
20648 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20650 * interface.cs (Interface.PopulateProperty): Instead of using
20651 `parent' as the declaration space for the set parameters, use
20654 * support.cs (InternalParameters): InternalParameters constructor
20655 takes a DeclSpace instead of a TypeContainer.
20657 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20658 types are being initialized, load the address of it before calling
20661 (New): Provide a mechanism to disable the generation of local
20662 value type temporaries when the caller will be providing us with
20663 an address to store it.
20665 (ArrayCreation.EmitDynamicInitializers): Use it.
20667 2002-03-17 Miguel de Icaza <miguel@ximian.com>
20669 * expression.cs (Invocation.EmitArguments): Only probe for array
20670 property if there is more than one argument. Sorry about that.
20672 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20673 empty param arrays.
20675 * class.cs (Method.LabelParameters): Fix incorrect code path that
20676 prevented the `ParamArrayAttribute' from being applied to the
20679 2002-03-16 Miguel de Icaza <miguel@ximian.com>
20681 * support.cs (ReflectionParameters): Correctly compute whether the
20682 last argument is a params array. Fixes the problem with
20685 * typemanager.cs: Make the assemblies array always be non-null
20686 (empty, but non-null)
20688 * tree.cs (RecordDecl): New function that abstracts the recording
20689 of names. This reports error 101, and provides a pointer to the
20690 previous declaration. Fixes a crash in the compiler.
20692 * cs-parser.jay (constructor_declaration): Update to new grammar,
20693 and provide a constructor_body that can be empty.
20695 2002-03-15 Miguel de Icaza <miguel@ximian.com>
20697 * driver.cs: Add support for --resources.
20699 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20700 Make all types for the various array helper methods be integer.
20702 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20703 CheckState to ConvCast.
20705 (ConvCast): Now it takes a `checked' state argument, to avoid
20706 depending on the emit context for the conversion, and just using
20707 the resolve time setting.
20709 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20710 instead of Invocation.EmitArguments. We do not emit the original
20711 arguments, instead we emit those which have been converted to
20712 unsigned int expressions.
20714 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20716 * codegen.cs: ditto.
20718 * expression.cs (LocalVariableReference): Drop the use of the
20719 Store function that depended on the variable index.
20721 * statement.cs (VariableInfo): Drop the `Idx' property from this
20722 class, as this is not taking into account the indexes for
20723 temporaries tat we generate during the execution, getting the
20726 * class.cs: First emit class initializers, then call the parent
20729 * expression.cs (Binary): Fix opcode emision.
20730 (UnaryMutator.EmitCode): Support checked code generation
20732 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20733 matches for events for both the Static and Instance scans,
20734 pointing to the same element. Fix that.
20736 2002-03-14 Miguel de Icaza <miguel@ximian.com>
20738 * rootcontext.cs (ResolveTree): Always set the
20739 interface_resolve_order, because nested interfaces will be calling
20742 * class.cs (GetInterfaceOrClass): Track the same resolution
20743 process used by TypeManager.LookupType. This fixes the nested
20744 type lookups in class declarations (separate path from
20747 (TypeContainer.DefineType): Also define nested interfaces.
20748 (TypeContainer.RegisterOrder): New public function used to
20749 register the order in which child interfaces need to be closed.
20751 Nested interfaces need to be closed after their parents have been
20754 * interface.cs (InterfaceAttr): Put all the logic for computing
20755 the interface attribute here.
20757 (DefineInterface): Register our interface order with the
20758 RootContext or with the TypeContainer depending on the case.
20760 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20762 * cs-parser.jay: rework foreach statement to work with the new
20763 changes to the policy on SimpleNames.
20765 * report.cs: support Stacktrace on warnings as well.
20767 * makefile: drop --unsafe and /unsafe from the compile.
20769 2002-03-13 Ravi Pratap <ravi@ximian.com>
20771 * ecore.cs (StandardConversionExists): Modify to take an Expression
20772 as the first parameter. Ensure we do null -> reference type conversion
20775 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20776 temporary Expression objects.
20778 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20780 * interface.cs: workaround bug in method overloading resolution
20781 (there is already a bugzilla bug for it).
20783 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20785 We could also solve this problem by having a separate path for
20786 performing type lookups, instead of DoResolve, we could have a
20787 ResolveType entry point, and only participating pieces of the
20788 production (simplename, deref, array) would implement this.
20790 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20791 signal SimpleName to only resolve type names and not attempt to
20792 resolve anything else.
20794 * expression.cs (Cast): Set the flag.
20796 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20798 * class.cs: Only report 108 if there is no `new' modifier.
20800 * cs-parser.jay: rework foreach statement to work with the new
20801 changes to the policy on SimpleNames.
20803 * report.cs: support Stacktrace on warnings as well.
20805 * makefile: drop --unsafe and /unsafe from the compile.
20807 2002-03-11 Miguel de Icaza <miguel@ximian.com>
20809 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20810 lookups here, instead of doing that at parse time. This means
20811 that our grammar will not introduce `LocalVariableReferences' as
20812 expressions at this point. That solves the problem of code like
20816 static void Main ()
20820 This is only half the fix. The full fix requires parameters to
20821 also be handled in this way.
20823 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20824 makes the use more obvious of the DeclSpace. The
20825 ec.TypeContainer.TypeBuilder is now only used to pull the
20826 TypeBuilder for it.
20828 My theory is that I can get rid of the TypeBuilder completely from
20829 the EmitContext, and have typecasts where it is used (from
20830 DeclSpace to where it matters).
20832 The only pending problem is that the code that implements Aliases
20833 is on TypeContainer, and probably should go in DeclSpace.
20835 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20836 lookups here, instead of doing that at parse time. This means
20837 that our grammar will not introduce `LocalVariableReferences' as
20838 expressions at this point. That solves the problem of code like
20842 static void Main ()
20846 This is only half the fix. The full fix requires parameters to
20847 also be handled in this way.
20849 * class.cs (Property.DefineMethod): When implementing an interface
20850 method, set newslot, when implementing an abstract method, do not
20851 set the flag (before we tried never setting it, or always setting
20852 it, which is the difference).
20853 (Indexer.DefineMethod): same.
20854 (Method.DefineMethod): same.
20856 * ecore.cs: Only set the status used flag if we get back a Field.
20858 * attribute.cs: Temporary hack, so Paolo can keep working.
20860 2002-03-08 Ravi Pratap <ravi@ximian.com>
20862 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20863 the unmanaged type in the case we have a MarshalAs attribute.
20865 (Resolve): Handle the case when we are parsing the special MarshalAs
20866 attribute [we need to store the unmanaged type to use later]
20868 * typemanager.cs (marshal_as_attr_type): Built in type for the
20869 MarshalAs Attribute.
20871 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
20872 on parameters and accordingly set the marshalling info.
20874 2002-03-09 Miguel de Icaza <miguel@ximian.com>
20876 * class.cs: Optimizing slightly by removing redundant code after
20877 we switched to the `NoTypes' return value.
20878 (Property.DefineMethod): use NoTypes here too.
20880 This fixes the bug I introduced in my last batch of changes.
20882 2002-03-05 Ravi Pratap <ravi@ximian.com>
20884 * tree.cs (RecordEnum): Add. We now keep track of enums too.
20886 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20887 Enums since those are types too.
20889 * cs-parser.jay (enum_declaration): Record enums as we parse them.
20891 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
20892 thanks to a call during the lookup process.
20894 2002-03-07 Miguel de Icaza <miguel@ximian.com>
20896 * statement.cs (Foreach): Lots of work to accomodate a particular
20897 kind of foreach statement that I had not kept in mind. It is
20898 possible to have foreachs on classes that provide a GetEnumerator
20899 method that return objects that implement the "pattern" for using
20900 a foreach, there is no need to support GetEnumerator
20903 This is needed to compile nant.
20905 * decl.cs: Only report 114 if the member is not `Finalize' and if
20906 the warning level is at least 2.
20908 * class.cs: Moved the compare function from Method to
20911 (MethodSignature.InheritableMemberSignatureCompare): Add new
20912 filter function that is used to extract inheritable methods from a
20915 (Method.Define): Use the new `inheritable_method_signature_filter'
20918 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20921 2002-03-06 Miguel de Icaza <miguel@ximian.com>
20923 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20925 * cs-parser.jay: Add opt_semicolon to the interface declaration.
20927 * expression.cs: Pass location information to
20928 ConvertImplicitStandard.
20930 * class.cs: Added debugging code to track return values from
20933 2002-03-05 Miguel de Icaza <miguel@ximian.com>
20935 * expression.cs (Is.DoResolve): If either side of the `is' is an
20936 interface, do not flag the warning.
20938 * ecore.cs (ImplicitReferenceConversion): We need a separate test
20941 * report.cs: Allow for --fatal to be used with --probe.
20943 * typemanager.cs (NoTypes): Move the definition for the empty Type
20946 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20948 (TypeContainer.DefineProxy): New function used to proxy to parent
20949 implementations when implementing interfaces.
20950 (TypeContainer.ParentImplements): used to lookup if our parent
20951 implements a public function that is required by an interface.
20952 (TypeContainer.VerifyPendingMethods): Hook this up.
20954 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20955 `modules' and `assemblies' arraylists into arrays. We only grow
20956 these are the very early start up of the program, so this improves
20957 the speedof LookupType (nicely measured).
20959 * expression.cs (MakeByteBlob): Replaced unsafe code with
20960 BitConverter, as suggested by Paolo.
20962 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20963 folding of string concatenation, but if either side is a string,
20964 and the other is not, then return null, and let the runtime use
20965 the concatenation on the string plus the object (using
20966 `Object.ToString').
20968 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20970 Constant Folding has been implemented now.
20972 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20973 the error instead on types that are not supported in one's
20976 * constant.cs (Constant and all children): New set of functions to
20977 perform implict and explicit conversions.
20979 * ecore.cs (EnumConstant): Implement the new functions to perform
20980 conversion by proxying to the child expression.
20982 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20983 own separate setting that can not be turned off from the command
20984 line using --unchecked or --checked and is only controlled using
20985 the checked/unchecked statements and expressions. This setting is
20986 used by the constant folder to flag errors.
20988 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20989 ConstantCheckState as well.
20991 During Resolve, they also have to flag the state, because the
20992 constant folder runs completely in the Resolve phase.
20994 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20997 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20999 * cfold.cs: New file, this file contains the constant folder.
21001 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21002 argument to track whether we are using the resulting address to
21003 load or store a value and provide better error messages.
21005 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21006 new AddressOf arguments.
21008 * statement.cs (Foreach.EmitCollectionForeach): Update
21010 * expression.cs (Argument.Emit): Call AddressOf with proper
21011 arguments to track usage.
21013 (New.DoEmit): Call AddressOf with new arguments.
21015 (Unary.Emit): Adjust AddressOf call.
21017 2002-03-01 Ravi Pratap <ravi@ximian.com>
21019 * cs-parser.jay (member_access): Change the case for pre-defined types
21020 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
21023 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21026 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21027 essentially like methods and apply attributes like MethodImplOptions to them too.
21029 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21032 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21033 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21036 * Update code everywhere accordingly.
21038 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21040 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21042 2002-02-28 Ravi Pratap <ravi@ximian.com>
21044 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21045 try performing lookups against those instead of jumping straight into using
21046 the 'using' clauses.
21048 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21050 (LookupType): Perform lookups in implicit parents too.
21052 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21053 sequence as RootContext.LookupType.
21055 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21056 the various cases of namespace lookups into this method.
21058 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21060 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21061 in positional arguments)
21063 * class.cs (Operator): Update the AllowedModifiers to contain
21066 * cs-parser.jay: Update operator declaration to allow for the
21067 operator body to be empty.
21069 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21072 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21074 * class.cs (Method.Emit): Label parameters.
21076 * driver.cs: Return 1 or 0 as the program exit code.
21078 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21080 * expression.cs: Special case the `null' object when trying to
21081 auto-compute the type, as anything can be explicitly converted to
21084 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21085 spotting this Paolo.
21087 (Expression.ImplicitNumericConversion): Perform comparissions of
21088 the type using the underlying type in the case of an enumeration
21089 rather than using the enumeration type for the compare.
21091 Cope with the underlying == type case, which is not possible to
21094 (Expression.ConvertNumericExplicit): Perform comparissions of
21095 the type using the underlying type in the case of an enumeration
21096 rather than using the enumeration type for the compare.
21098 * driver.cs: If the user does not supply an extension, assume .exe
21100 * cs-parser.jay (if_statement): Rewrote so that we can track the
21101 location for the if statement.
21103 * expression.cs (Binary.ConstantFold): Only concat strings when
21104 the operation is "+", not everything ;-)
21106 * statement.cs (Statement.EmitBoolExpression): Take a location
21108 (If, While, Do): Track location.
21110 * expression.cs (Binary.ResolveOperator): In the object + string
21111 case, I was missing a call to ConvertImplicit
21113 2002-02-25 Ravi Pratap <ravi@ximian.com>
21115 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21116 Location arguments. Ensure we use RootContext.LookupType to do our work
21117 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21119 * interface.cs (PopulateMethod): Handle the type of the parameter being
21122 * expression.cs (Invocation.BetterFunction): Handle the case when we
21123 have a params method with no fixed arguments and a call is made with no
21126 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21128 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21129 the verbatim-string-literal
21131 * support.cs (InternalParameters.ParameterModifier): handle null
21133 (InternalParameters.ParameterType): ditto.
21135 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21136 duplicating the name of the variable parameter.
21137 (GetParameterByName): Fix bug where we were not looking up array
21138 paramters if they were the only present (thanks Paolo!).
21139 (GetParameterInfo): We only have an empty set of types if both
21140 fixed and array are set to null.
21141 (GetParameterInfo-idx): Handle FixedParameter == null
21143 * cs-parser.jay: Handle the case where there is no catch
21144 statements (missing null test).
21146 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21148 * driver.cs (MainDriver): Be conservative on our command line
21151 Catch DirectoryNotFoundException when calling GetFiles.
21153 (SplitPathAndPattern): Used to split the input specification into
21154 a path and a pattern that we can feed to Directory.GetFiles.
21156 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21158 * statement.cs (Fixed): Implement the last case of the Fixed
21159 statement (string handling).
21161 * expression.cs (StringPtr): New class used to return a char * to
21162 a string; Used by the Fixed statement.
21164 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21166 * expression.cs (Binary.ResolveOperator): Remove redundant
21167 MemberLookup pn parent type.
21168 Optimize union call, we do not need a union if the types are the same.
21169 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21172 Specialize the use of MemberLookup everywhere, instead of using
21173 the default settings.
21175 (StackAlloc): Implement stackalloc keyword.
21177 * cs-parser.jay: Add rule to parse stackalloc.
21179 * driver.cs: Handle /h, /help, /?
21181 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21182 before we supported unsafe code.
21184 * makefile: add --unsafe to the self compilation of mcs.
21186 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21188 * expression.cs (PointerArithmetic): New class that is used to
21189 perform pointer arithmetic.
21190 (Binary.Resolve): Handle pointer arithmetic
21191 Handle pointer comparission.
21192 (ArrayPtr): Utility expression class that is used to take the
21193 address of an array.
21195 (ElementAccess): Implement array access for pointers
21197 * statement.cs (Fixed): Implement fixed statement for arrays, we
21198 are missing one more case before we are done.
21200 * expression.cs (Indirection): Implement EmitAssign and set the
21201 ExprClass to Variable. This allows pointer dereferences to be
21202 treated as variables, and to have values assigned to them.
21204 * ecore.cs (Expression.StoreFromPtr): New utility function to
21205 store values dereferencing.
21207 2002-02-20 Ravi Pratap <ravi@ximian.com>
21209 * expression.cs (Binary.ResolveOperator): Ensure that we are
21210 not trying to operate on a void type - this fixes the reported
21213 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21214 the parent implementation is sealed.
21216 * ../errors/cs0239.cs : Add.
21218 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21220 * typemanager.cs (unverifiable_code_type): Corresponds to
21221 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21222 which have unsafe code in them.
21224 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21227 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21229 * cs-tokenizer.cs: Add support for @"litreal strings"
21231 Make tokenizer accept pre-processor directives
21232 on any column (remove the old C-like limitation).
21234 * rootcontext.cs (EmitCode): Emit any global attributes.
21235 (AddGlobalAttributes): Used to keep track of assembly attributes.
21237 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21239 * cs-parser.jay: Add support for global attributes.
21241 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21243 * expression.cs (Indirection): New helper class. Unary will
21244 create Indirection classes to be able to implement the
21245 IMemoryLocation interface on it.
21247 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21249 * cs-parser.jay (fixed_statement): reference the right statement.
21251 * statement.cs (Fixed.Emit): Finish implementing the fixed
21252 statement for the &x case.
21254 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21256 * class.cs (Property.Define, Method.Define): Remove newslot when
21259 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21260 wrong. NewSlot should only be used if the `new' keyword is present.
21262 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21263 locating our system dir. Sorry about this.
21265 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21267 * driver.cs (GetSystemDir): Compute correctly the location of our
21268 system assemblies. I was using the compiler directory instead of
21269 the library directory.
21271 2002-02-13 Ravi Pratap <ravi@ximian.com>
21273 * expression.cs (BetterFunction): Put back in what Miguel commented out
21274 since it is the correct fix. The problem is elsewhere ;-)
21276 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21277 parameters of the parms method are themselves compatible or not !
21279 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21280 to check that a class implements an interface before saying that an implicit
21281 conversion was allowed. Use ImplementsInterface to do the checking.
21283 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21285 * class.cs (Method.Define): Track whether we are an explicit
21286 implementation or not. And only call DefineMethodOverride if we
21287 are an explicit implementation.
21289 (Property.DefineMethod): Ditto.
21291 2002-02-11 Ravi Pratap <ravi@ximian.com>
21293 * expression.cs (BetterFunction): Catch hideous bug which was
21294 preventing us from detecting ambiguous calls due to implicit casts i.e
21297 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21299 * support.cs (Pair): Remove un-needed method. I figured why I was
21300 getting the error in cs-parser.jay, the variable in a foreach loop
21301 is readonly, and the compiler does not really treat this as a variable.
21303 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21304 instead of EQUALS in grammar.
21306 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21308 * expression.cs (Unary.DoResolve): Check whether the argument is
21311 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21313 * support.cs: Api for Pair to set a value. Despite the fact that
21314 the variables are public the MS C# compiler refuses to compile
21315 code that accesses the field if the variable is part of a foreach
21318 * statement.cs (Fixed): Begin implementation of the fixed
21321 (Block.AddVariable): Return the VariableInfo on success and null
21322 on failure instead of true/false.
21324 * cs-parser.jay (foreach): Catch errors on variables already
21325 defined (we were ignoring this value before) and properly unwind
21326 the block hierarchy
21328 (fixed_statement): grammar for the fixed statement.
21330 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21332 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21333 pointer types to be incretemented.
21335 (SizeOf): Implement.
21337 * cs-parser.jay (pointer_member_access): Implement
21338 expr->IDENTIFIER production.
21340 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21341 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21344 (Unary): Implement indirection.
21346 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21347 use in non-unsafe context).
21349 (SimpleName.DoResolve): Check for pointers in field access on safe
21352 (Expression.LoadFromPtr): Factor the load-indirect code in this
21353 function. This was duplicated in UnboxCast and ParameterReference
21355 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21357 * expression.cs (ComposedCast): report an error if a pointer cast
21358 is used in a safe region.
21360 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21361 pointer type casts in unsafe context.
21363 * codegen.cs (EmitContext): Set up IsUnsafe.
21365 * cs-parser.jay (non_expression_type): Add productions for pointer
21368 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21369 code. We should not use force into static mode if the method is
21370 not virtual. Fixes bug in MIS
21372 * statement.cs (Do.Emit, While.Emit, For.Emit,
21373 Statement.EmitBoolExpression): Add support to Do and While to
21374 propagate infinite loop as `I do return' semantics.
21376 Improve the For case to also test for boolean constants.
21378 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21379 to the list of attributes we can add.
21381 Remove `EmitContext' argument.
21383 * class.cs (Method.Define): Apply parameter attributes.
21384 (Constructor.Define): Apply parameter attributes.
21385 (MethodCore.LabelParameters): Move here the core of labeling
21388 * support.cs (ReflectionParameters.ParameterModifier,
21389 InternalParameters.ParameterModifier): Use IsByRef on the type and
21390 only return the OUT bit for these parameters instead of in/out/ref
21393 This is because I miss-understood things. The ParameterInfo.IsIn
21394 and IsOut represent whether the parameter has the [In] and [Out]
21397 2002-01-22 Miguel de Icaza <miguel@ximian.com>
21399 * ecore.cs (FieldExpr.Emit): Release temporaries.
21401 * assign.cs (LocalTemporary.Release): new function.
21403 * codegen.cs (EmitContext.GetTemporaryStorage,
21404 EmitContext.FreeTemporaryStorage): Rework the way we deal with
21405 temporary storage. Now we can "put back" localbuilders when we
21408 2002-01-21 Miguel de Icaza <miguel@ximian.com>
21410 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21411 need to make a copy of the variable to generate verifiable code.
21413 2002-01-19 Miguel de Icaza <miguel@ximian.com>
21415 * driver.cs: Compute dynamically the system directory.
21417 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21418 Slower, but more generally useful. Used by the abstract
21419 registering implementation.
21421 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21422 the rules for the special rule on Type/instances. First check if
21423 we have the same name, and if so, try that special static path
21424 rather than the instance path.
21426 2002-01-18 Miguel de Icaza <miguel@ximian.com>
21428 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21431 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21432 Enum, ValueType, Delegate or Array for non-corlib compiles.
21434 * cs-tokenizer.cs: Catch long identifiers (645)
21436 * typemanager.cs (IndexerPropetyName): Ravi never tested this
21439 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21440 fix, we were returning too early, so we were not registering
21441 pending methods from abstract classes.
21443 Do not register pending methods if the class is abstract.
21445 * expression.cs (Conditional.DoResolve): Report circular implicit
21446 conversions when we neecd to compute it for conditional
21449 (Is.DoResolve): If the expression is always of the provided type,
21450 flag warning 183. If the expression can not ever be of the
21451 provided type flag warning 184.
21453 * class.cs: Catch 169 as well.
21455 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21458 2002-01-18 Nick Drochak <ndrochak@gol.com>
21460 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
21462 2002-01-17 Miguel de Icaza <miguel@ximian.com>
21464 * interface.cs: (PopulateMethod): Check for pointers being defined
21465 only if the unsafe context is active.
21466 (PopulateProperty): ditto.
21467 (PopulateIndexer): ditto.
21469 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21470 specified. If pointers are present, make sure that they are
21471 present in an unsafe context.
21472 (Constructor, Constructor.Define): ditto.
21473 (Field, Field.Define): ditto.
21474 (Property, Property.Define): ditto.
21475 (Event, Event.Define): ditto.
21477 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21478 hashtable if there are classes or structs defined.
21480 * expression.cs (LocalVariableReference.DoResolve): Simplify this
21481 code, as the constant resolution moved.
21483 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21484 the metadata, so we can flag error 133.
21486 * decl.cs (MemberCore.UnsafeOK): New function to test that a
21487 pointer is being declared in an unsafe context.
21489 2002-01-16 Miguel de Icaza <miguel@ximian.com>
21491 * modifiers.cs (Modifiers.Check): Require a Location argument.
21492 Report error 227 for Unsafe use.
21494 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21496 * statement.cs (For.Emit): If the test is null, then report that
21497 we do `return', as we wont reach anything afterwards.
21499 (Switch.SwitchGoverningType): Track the expression that matched
21502 * driver.cs: Allow negative numbers as an error code to flag.
21504 * cs-parser.jay: Handle 1551.
21506 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21508 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21510 * cs-parser.jay: Report 1518 (type declaration can only contain
21511 class, struct, interface, enum or delegate)
21513 (switch_label): Report 1523 (keywords `case' or `default' must
21516 (opt_switch_sections): Report 1522 (empty switch)
21518 * driver.cs: Report 1515 (response file specified multiple times)
21519 Report 1516 (Source file specified multiple times).
21521 * expression.cs (Argument.Resolve): Signal 1510
21523 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21524 access not allowed in static code)
21526 2002-01-11 Ravi Pratap <ravi@ximian.com>
21528 * typemanager.cs (IsPointerType): Utility method which we are going
21531 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21532 the object type, so we take care of that.
21534 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21536 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21537 added to non-params parameters :-)
21539 * typemanager.cs (CSharpName): Include 'void' type too.
21541 (void_ptr_type): Include in the set of core types.
21543 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
21546 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
21549 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
21550 completely forgotten about it.
21552 2002-01-10 Ravi Pratap <ravi@ximian.com>
21554 * cs-parser.jay (pointer_type): Add. This begins our implementation
21555 of parsing rules for unsafe code.
21557 (unsafe_statement): Implement.
21559 (embedded_statement): Modify to include the above.
21561 * statement.cs (Unsafe): Implement new class for unsafe blocks.
21563 * codegen.cs (EmitContext.InUnsafe): Add. This determines
21564 if the current context is an unsafe one.
21566 * cs-parser.jay (local_variable_pointer_type): Since local variable types
21567 are handled differently, we need separate rules for them.
21569 (local_variable_declaration): Update to use local_variable_pointer_type
21570 to allow variable declarations of unmanaged pointer types.
21572 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21573 in unsafe contexts.
21575 * ../errors/cs0214.cs : Add.
21577 2002-01-16 Nick Drochak <ndrochak@gol.com>
21579 * makefile: remove 'response' file when cleaning.
21581 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21583 * cs-parser.jay: Report 1524.
21585 2002-01-14 Miguel de Icaza <miguel@ximian.com>
21587 * typemanager.cs (RegisterMethod): drop checking if we have
21588 registered this from here
21590 2002-01-12 Miguel de Icaza <miguel@ximian.com>
21592 * class.cs (Method.EmitDestructor): Implement calling our base
21595 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21596 value of InFinally.
21598 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21599 this routine and will wrap the call in a try/catch block. Deal
21602 2002-01-11 Miguel de Icaza <miguel@ximian.com>
21604 * ecore.cs (Expression.MemberLookup): instead of taking a
21605 parameter `same_type' that was used to tell whether we could
21606 access private members we compute our containing type from the
21609 (FieldExpr): Added partial support for volatile fields. This does
21610 not work for volatile fields exposed from assemblies, as I can not
21611 figure out how to extract the modreq from it.
21613 Updated all the source files to use this.
21615 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21616 because it is referenced by MemberLookup very often.
21618 2002-01-09 Ravi Pratap <ravi@ximian.com>
21620 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21621 TypeBuilder.GetCustomAttributes to retrieve what we need.
21623 Get rid of redundant default_member_attr_type as this is the same as
21624 default_member_type which already exists.
21626 * interface.cs, attribute.cs : Update accordingly.
21628 2002-01-08 Miguel de Icaza <miguel@ximian.com>
21630 * typemanager.cs: Enable IndexerPropertyName again. It does not
21631 work for TYpeBuilders though. Ravi, can you please fix this?
21633 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21635 * expression.cs (Argument.Emit): Handle the case of ref objects
21636 being passed to ref functions;
21638 (ParameterReference.EmitLoad): Loads the content of the pointer
21639 without dereferencing.
21641 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21643 * cs-tokenizer.cs: Implemented the pre-processing expressions.
21645 2002-01-08 Ravi Pratap <ravi@ximian.com>
21647 * class.cs (Indexer.DefineMethod): Incorporate the interface
21648 type in the name of the method if we are doing explicit interface
21651 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21653 (BetterConversion): Fix extremely trivial bug where we were referring to
21654 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21657 * ../errors/bug16.cs : Add although we have fixed it.
21659 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21661 * expression.cs (BaseIndexer): Begin implementation.
21663 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21665 * cs-parser.jay (indexer_declarator): Use qualified_identifier
21666 production directly to remove a shift/reduce, and implement
21667 explicit interface implementation.
21669 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21670 after a floating point suffix.
21672 * expression.cs (DoNumericPromotions): Improved the conversion for
21673 uint/uint. If we have a constant, we avoid doing a typecast to a
21676 * class.cs (Indexer): Implement explicit interface implementation
21679 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21681 * class.cs: make the default instance constructor public and hidebysig.
21683 2001-01-03 Ravi Pratap <ravi@ximian.com>
21685 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21686 so we can call it from elsewhere.
21688 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21689 we emit it internally if the class has a defined indexer; otherwise the user
21690 emits it by decorating the class definition with the DefaultMemberAttribute.
21692 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21693 attribute is not used on a type which defines an indexer.
21695 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21696 character when we skip whitespace.
21698 * ../errors/cs0646.cs : Add.
21700 2002-01-03 Miguel de Icaza <miguel@ximian.com>
21702 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21705 * makefile: Add practical target `mcs3.exe' which builds the third
21706 generation compiler.
21708 * expression.cs (New): Fix structures constructor calling.
21710 * class.cs (Property, Method, Indexer): Emit Final flag on the
21711 method if we are an interface implementation and we are not
21714 * ecore.cs (PropertyExpr): New public field `IsBase', tells
21715 whether this property is referencing a `base' method.
21717 * expression.cs (Invocation.EmitCall): take an extra argument:
21718 is_base, this is used to determine whether the `call' or
21719 `callvirt' opcode should be used.
21722 * delegate.cs: update EmitCall.
21724 * class.cs (Method.Define): Set NewSlot for the cases where we are
21725 not implementing an interface method.
21727 (Property.Define): ditto.
21729 2002-01-02 Miguel de Icaza <miguel@ximian.com>
21731 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21732 'r'. Allows mcs to parse itself fully.
21734 2002-01-02 Ravi Pratap <ravi@ximian.com>
21736 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21737 of the number of initializers that require the InitializeArray method.
21739 (CheckIndices): Store the Expression in all cases - not the plain value. Also
21740 update the above field where necessary.
21742 (MakeByteBlob): Update accordingly.
21744 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
21747 (EmitDynamicInitializers): Update in accordance with the new optimization.
21749 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21750 same OpCode applies.
21752 * cs-parser.jay : Fix some glaring errors I introduced.
21754 2002-01-01 Ravi Pratap <ravi@ximian.com>
21756 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21757 so that we can check for name clashes there too.
21759 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21760 for interface indexers.
21762 * interfaces.cs (Define): Emit the default member attribute.
21764 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21765 variable was being referred to while setting the value ;-)
21767 2002-01-01 Miguel de Icaza <miguel@ximian.com>
21769 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21770 byte-by-byte information when we know the data is zero.
21772 Make the block always a multiple of 4, because
21773 DefineInitializedData has a bug.
21775 * assign.cs: Fix, we should assign from the temporary, not from
21778 * expression.cs (MakeByteBlob): Fix my incorrect code.
21780 2001-12-31 Miguel de Icaza <miguel@ximian.com>
21782 * typemanager.cs (EnumToUnderlying): This function is used to get
21783 the underlying type from an enumeration, because it does not
21786 * constant.cs: Use the I4_S form for values between -128 and 127.
21788 * statement.cs (Block.LookupLabel): Looks up a label.
21789 (Block): Drop support for labeled blocks.
21791 (LabeledStatement): New kind of statement that represents a label
21794 (Goto): Finally implement this bad boy.
21796 * cs-parser.jay: Update to reflect new mechanism to implement
21799 2001-12-30 Miguel de Icaza <miguel@ximian.com>
21801 * codegen.cs (EmitContext.This): a codegen property that keeps the
21802 a single instance of this instead of creating many different this
21805 * delegate.cs (Delegate.DoResolve): Update to use the property;
21807 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21809 * expression.cs (BaseAccess.DoResolve): Ditto.
21811 2001-12-29 Ravi Pratap <ravi@ximian.com>
21813 * typemanager.cs (methodimpl_attr_type): Add to hold the type
21814 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21816 (InitCoreTypes): Update accordingly.
21818 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21819 so we can quickly store the state.
21821 (ApplyAttributes): Set the correct implementation flags
21822 for InternalCall methods.
21824 2001-12-29 Miguel de Icaza <miguel@ximian.com>
21826 * expression.cs (EmitCall): if a method is not virtual, then do
21827 not use callvirt on it.
21829 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21830 user defined stuff) requires the use of stobj, which takes an
21831 address on the stack instead of an array and an index. So emit
21832 the Ldelema operation for it.
21834 (EmitStoreOpcode): Use stobj for valuetypes.
21836 (UnaryMutator.EmitCode): Use the right 1 value depending on
21837 whether we are dealing with int64/uint64, float or doubles.
21839 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21840 constructors that I implemented last night.
21842 (Constructor.IsDefault): Fix to work properly for static
21845 * cs-parser.jay (CheckDef): report method signature errors.
21846 Update error number 103 to be 132.
21848 * decl.cs: New AdditionResult enumeration value: MethodExists.
21849 Although we do this check for methods later on in the semantic
21850 analysis, catching repeated default constructors is so easy that
21851 we catch these here.
21853 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21856 (ParameterReference.EmitAssign, Emit): handle
21859 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21860 (ArrayAccess.EmitStoreOpcode): ditto.
21862 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21864 * expression.cs (MakeByteBlob): Complete all the missing types
21865 (uint, short, ushort, byte, sbyte)
21867 * class.cs: Only init instance field initializers on instance
21870 Rename `constructors' to instance_constructors.
21872 (TypeContainer.AddConstructor): Only add constructors to the list
21873 if it is not static.
21875 Make sure that we handle default_static_constructor independently
21876 everywhere where we handle instance_constructors
21878 2001-12-28 Miguel de Icaza <miguel@ximian.com>
21880 * class.cs: Do not lookup or create a base initializer for a
21881 static constructor.
21883 (ConstructorInitializer.Resolve): use the proper type to lookup
21886 * cs-parser.jay: Report error 1585 (modifiers between type and name).
21888 * enum.cs, interface.cs: Remove CloseType, this is taken care by
21891 * decl.cs: CloseType is now an virtual method, the default
21892 implementation just closes this type.
21894 2001-12-28 Ravi Pratap <ravi@ximian.com>
21896 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21897 to PreserveSig by default. Also emit HideBySig on such methods.
21899 Basically, set the defaults to standard values.
21901 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21902 argument, if candidate is better, it can't be worse than the best !
21904 (Invocation): Re-write bits to differentiate between methods being
21905 applicable in their expanded form and their normal form - for params
21908 Get rid of use_standard everywhere as only standard conversions are allowed
21909 in overload resolution.
21911 More spec conformance.
21913 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21915 * driver.cs: Add --timestamp, to see where the compiler spends
21918 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21919 `this' in static code.
21921 (SimpleName.DoResolve): Implement in terms of a helper function
21922 that allows static-references to be passed upstream to
21925 (Expression.ResolveWithSimpleName): Resolve specially simple
21926 names when called by MemberAccess to implement the special
21929 (Expression.ImplicitReferenceConversion): Handle conversions from
21930 Null to reference types before others, as Null's type is
21933 * expression.cs (Invocation.EmitCall): Handle the special case of
21934 calling methods declared on a reference type from a ValueType
21935 (Base classes System.Object and System.Enum)
21937 (MemberAccess.Resolve): Only perform lookups on Enumerations if
21938 the left hand side is a TypeExpr, not on every enumeration.
21940 (Binary.Resolve): If types are reference types, then do a cast to
21941 object on operators != and == of both arguments.
21943 * typemanager.cs (FindMembers): Extract instance and static
21944 members if requested.
21946 * interface.cs (PopulateProperty): Use void_type instead of null
21947 as the return type for the setter method.
21949 (PopulateIndexer): ditto.
21951 2001-12-27 Ravi Pratap <ravi@ximian.com>
21953 * support.cs (ReflectionParameters): Fix minor bug where we
21954 were examining the wrong parameter for the ParamArray attribute.
21956 Cope with requests for the type of the parameter at position
21957 greater than the params parameter's. We now return the element
21958 type of the params array as that makes more sense.
21960 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21961 accordingly as we no longer have to extract the element type
21964 (Invocation.OverloadResolve): Update.
21966 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21968 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21969 against IEnumerator, test whether the return value is a descendant
21970 of the IEnumerator interface.
21972 * class.cs (Indexer.Define): Use an auxiliary method to implement
21973 the other bits of the method definition. Begin support for
21974 explicit interface implementation.
21976 (Property.DefineMethod): Use TypeManager.void_type instead of null
21977 for an empty return value.
21979 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21981 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21982 dealing with a FieldExpr which is composed of a FieldBuilder, in
21983 the code path we did extract the constant, but we should have
21984 obtained the underlying value to be able to cast it (otherwise we
21985 end up in an infinite loop, this is what Ravi was running into).
21987 (ArrayCreation.UpdateIndices): Arrays might be empty.
21989 (MemberAccess.ResolveMemberAccess): Add support for section
21990 14.5.4.1 that deals with the special case of E.I when E is a type
21991 and something else, that I can be a reference to a static member.
21993 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21994 handle a particular array type to create byte blobs, it is just
21995 something we dont generate byteblobs for.
21997 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22000 * location.cs (Push): remove the key from the hashtable that we
22001 are about to add. This happens for empty files.
22003 * driver.cs: Dispose files after we have parsed them.
22005 (tokenize): new function that only runs the tokenizer on its
22006 input, for speed testing.
22008 2001-12-26 Ravi Pratap <ravi@ximian.com>
22010 * class.cs (Event.Define): Define the private field only if there
22011 are no accessors defined.
22013 * expression.cs (ResolveMemberAccess): If there is no associated
22014 field with the event, that means we have an event defined with its
22015 own accessors and we should flag error cs0070 since transforming
22016 ourselves into a field is not valid in that case.
22018 * ecore.cs (SimpleName.DoResolve): Same as above.
22020 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22021 and charset to sane values.
22023 2001-12-25 Ravi Pratap <ravi@ximian.com>
22025 * assign.cs (DoResolve): Perform check on events only if they
22026 are being accessed outside the declaring type.
22028 * cs-parser.jay (event_declarations): Update rules to correctly
22029 set the type of the implicit parameter etc.
22031 (add_accessor, remove_accessor): Set current local parameters.
22033 * expression.cs (Binary): For delegate addition and subtraction,
22034 cast the return value from the method into the appropriate delegate
22037 2001-12-24 Ravi Pratap <ravi@ximian.com>
22039 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22040 of these as the workaround is unnecessary.
22042 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22043 delegate data - none of that is needed at all.
22045 Re-write bits to extract the instance expression and the delegate method
22048 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22051 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22052 of attaching attributes instead of duplicating code everywhere.
22054 * everywhere : Update code to do attribute emission using the above method.
22056 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22058 * expression.cs (IsParamsMethodApplicable): if there are not
22059 parameters, return immediately.
22061 * ecore.cs: The 0 literal can be implicity converted to an enum
22064 (SimpleName.DoResolve): First lookup the type, then lookup the
22067 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22068 want to get its address. If the InstanceExpression is not
22069 addressable, store the result in a temporary variable, then get
22072 * codegen.cs: Only display 219 errors on warning level or above.
22074 * expression.cs (ArrayAccess): Make it implement the
22075 IMemoryLocation interface.
22077 (Binary.DoResolve): handle the operator == (object a, object b)
22078 and operator != (object a, object b) without incurring into a
22079 BoxedCast (because 5 != o should never be performed).
22081 Handle binary enumerator operators.
22083 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22084 value type, otherwise use Ldelem_ref.
22086 Use precomputed names;
22088 (AddressOf): Implement address of
22090 * cs-parser.jay (labeled_statement): Fix recursive block
22091 addition by reworking the production.
22093 * expression.cs (New.DoEmit): New has a special case:
22095 If we are dealing with a ValueType, we have a few
22096 situations to deal with:
22098 * The target of New is a ValueType variable, that is
22099 easy, we just pass this as the variable reference
22101 * The target of New is being passed as an argument,
22102 to a boxing operation or a function that takes a
22105 In this case, we need to create a temporary variable
22106 that is the argument of New.
22109 2001-12-23 Ravi Pratap <ravi@ximian.com>
22111 * rootcontext.cs (LookupType): Check that current_type is not null before
22112 going about looking at nested types.
22114 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22115 not implement the IAssignMethod interface any more.
22117 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22118 where we tranform them into FieldExprs if they are being resolved from within
22119 the declaring type.
22121 * ecore.cs (SimpleName.DoResolve): Do the same here.
22123 * assign.cs (DoResolve, Emit): Clean up code considerably.
22125 * ../errors/bug10.cs : Add.
22127 * ../errors/cs0070.cs : Add.
22129 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22131 * assign.cs : Get rid of EventIsLocal everywhere.
22133 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22135 * ecore.cs (ConvertIntLiteral): finished the implementation.
22137 * statement.cs (SwitchLabel): Convert the value we are using as a
22138 key before looking up the table.
22140 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22142 * codegen.cs (EmitTopBlock): Require a Location argument now.
22144 * cs-parser.jay (constructor_declarator): We need to setup
22145 current_local_parameters before we parse the
22146 opt_constructor_initializer, to allow the variables to be bound
22147 to the constructor arguments.
22149 * rootcontext.cs (LookupType): First lookup nested classes in our
22150 class and our parents before we go looking outside our class.
22152 * expression.cs (ConstantFold): Extract/debox the values at the
22155 * rootcontext.cs (EmitCode): Resolve the constants first before we
22156 resolve the types. This is not really needed, but it helps debugging.
22158 * statement.cs: report location.
22160 * cs-parser.jay: pass location to throw statement.
22162 * driver.cs: Small bug fix.
22164 * report.cs: Updated format to be 4-zero filled digits.
22166 2001-12-22 Ravi Pratap <ravi@ximian.com>
22168 * expression.cs (CheckIndices): Fix minor bug where the wrong
22169 variable was being referred to ;-)
22171 (DoEmit): Do not call EmitStaticInitializers when the
22172 underlying type is System.Object.
22174 2001-12-21 Ravi Pratap <ravi@ximian.com>
22176 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22177 and do the usual workaround for SRE.
22179 * class.cs (MyEventBuilder.EventType): New member to get at the type
22180 of the event, quickly.
22182 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22184 * assign.cs (Assign.DoResolve): Handle the case when the target
22185 is an EventExpr and perform the necessary checks.
22187 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22190 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22192 (EventExpr): Set the type in the constructor itself since we
22193 are meant to be born fully resolved.
22195 (EventExpr.Define): Revert code I wrote earlier.
22197 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22198 instance expression is null. The instance expression is a This in that case
22199 or a null, depending on whether it is a static method or not.
22201 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22202 refers to more than one method.
22204 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22205 and accordingly flag errors.
22207 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22209 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22211 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22213 * location.cs (ToString): Provide useful rutine.
22215 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22217 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22218 objects, return the actual integral boxed.
22220 * statement.cs (SwitchLabel): define an ILLabel for each
22223 (Switch.CheckSwitch): If the value is a Literal, extract
22224 the underlying literal.
22226 Also in the unused hashtable we had, add the SwitchLabel so we can
22227 quickly look this value up.
22229 * constant.cs: Implement a bunch of new constants. Rewrite
22230 Literal based on this. Made changes everywhere to adapt to this.
22232 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22233 dereferencing array only once, and also copes with enumrations.
22235 bytes are two bytes wide, not one.
22237 (Cast): Perform constant conversions.
22239 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22240 wrappers to the literals here.
22242 * expression.cs (DoNumericPromotions): long literals can converted
22243 to ulong implicity (this is taken care of elsewhere, but I was
22244 missing this spot).
22246 * ecore.cs (Expression.Literalize): Make the return type Literal,
22247 to improve type checking.
22249 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22251 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22253 * literal.cs: Revert code from ravi that checked the bounds. The
22254 bounds are sane by the definition of the type itself.
22256 * typemanager.cs: Fix implementation of ImplementsInterface. We
22257 need to actually look up in our parent hierarchy for interfaces
22260 * const.cs: Use the underlying type for enumerations
22262 * delegate.cs: Compute the basename for the delegate creation,
22263 that should fix the delegate test case, and restore the correct
22264 Type Lookup semantics in rootcontext
22266 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22267 referencing a nested type with the Reflection API is using the "+"
22270 * cs-parser.jay: Do not require EOF token at the end.
22272 2001-12-20 Ravi Pratap <ravi@ximian.com>
22274 * rootcontext.cs (LookupType): Concatenate type names with
22275 a '.' instead of a '+' The test suite passes again.
22277 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22278 field of the enumeration.
22280 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22281 the case when the member is an EventExpr.
22283 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22284 static has an associated instance expression.
22286 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22288 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22290 * class.cs (Event.Define): Register event and perform appropriate checks
22293 We define the Add and Remove methods even if the use provides none because
22294 in that case, we provide default implementations ourselves.
22296 Define a private field of the type of the event. This is done by the CSC compiler
22297 and we should be doing it too ;-)
22299 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22300 More methods we use in code we generate.
22302 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22305 (InitCoreTypes): Update accordingly for the above.
22307 * class.cs (Event.Emit): Generate code for default accessors that we provide
22309 (EmitDefaultMethod): Do the job in the above.
22311 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22314 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22316 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22317 builders even if we were missing one.
22319 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22320 pass the Basename as our class name instead of the Name. The
22321 basename will be correctly composed for us.
22323 * parameter.cs (Paramters): Now takes a Location argument.
22325 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22326 make all the code call directly LookupType in RootContext and take
22327 this chance to pass the Location information everywhere.
22329 * Everywhere: pass Location information.
22331 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22333 * class.cs (Constructor.Define): Updated way of detecting the
22334 length of the parameters.
22336 (TypeContainer.DefineType): Use basename as the type name for
22339 (TypeContainer.Define): Do not recursively define types here, as
22340 definition is taken care in order by the RootContext.
22342 * tree.cs: Keep track of namespaces in a per-file basis.
22344 * parameter.cs (Parameter.ComputeSignature): Update to use
22347 (Parameters.GetSignature): ditto.
22349 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22350 instead of a TypeContainer.
22352 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22353 resolve names. Because we need to be resolve in our context, not
22356 * driver.cs: Implement response files.
22358 * class.cs (TypeContainer.DefineType): If we are defined, do not
22359 redefine ourselves.
22361 (Event.Emit): Emit the code for add/remove handlers.
22362 (Event.Define): Save the MethodBuilders for add/remove.
22364 * typemanager.cs: Use pair here too.
22366 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22367 DictionaryEntry requires the first argument to be non-null.
22369 (enum_declaration): Compute full name for registering the
22372 (delegate_declaration): Instead of using
22373 formal_parameter_list, use opt_formal_parameter_list as the list
22376 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22377 (EventParsing): New property that controls whether `add' and
22378 `remove' are returned as tokens or identifiers (for events);
22380 2001-12-19 Ravi Pratap <ravi@ximian.com>
22382 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22383 use MyEventBuilder only and let it wrap the real builder for us.
22385 (MyEventBuilder): Revamp constructor etc.
22387 Implement all operations that we perform on EventBuilder in precisely the same
22390 (FindMembers): Update to use the EventBuilder member.
22392 (Event.Emit): Update accordingly.
22394 2001-12-18 Ravi Pratap <ravi@ximian.com>
22396 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22397 by calling the appropriate methods.
22399 (GetCustomAttributes): Make stubs as they cannot possibly do anything
22402 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22404 2001-12-17 Ravi Pratap <ravi@ximian.com>
22406 * delegate.cs (Delegate.Populate): Check that the return type
22407 and various parameters types are indeed accessible.
22409 * class.cs (Constructor.Define): Same here.
22411 (Field.Define): Ditto.
22413 (Event.Define): Ditto.
22415 (Operator.Define): Check that the underlying Method defined itself
22416 correctly - so it's MethodBuilder should not be null.
22418 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22419 expression happens to be null.
22421 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22422 members but as of now we don't seem to be able to do anything really useful with it.
22424 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22425 not the EventBuilder.
22427 2001-12-18 Miguel de Icaza <miguel@ximian.com>
22429 * cs-tokenizer.cs: Add support for defines.
22430 Add support for #if, #elif, #else, #endif
22432 (eval_var): evaluates a variable.
22433 (eval): stubbed for evaluating functions.
22435 * cs-parser.jay: Pass the defines information
22437 * driver.cs: Add --define command line option.
22439 * decl.cs: Move MemberCore here.
22441 Make it the base class for DeclSpace. This allows us to catch and
22442 report 108 and 109 for everything now.
22444 * class.cs (TypeContainer.Define): Extract all the members
22445 before populating and emit the warning 108 (new keyword required
22446 to override) instead of having each member implement this.
22448 (MemberCore.Define): New abstract method, we will be using this in
22449 the warning reporting engine in Populate.
22451 (Operator.Define): Adjust to new MemberCore protocol.
22453 * const.cs (Const): This does not derive from Expression, it is a
22454 temporary object we use to create fields, it is a MemberCore.
22456 * class.cs (Method.Define): Allow the entry point to be in a
22459 * driver.cs: Rewrite the argument handler to clean it up a bit.
22461 * rootcontext.cs: Made it just an auxiliary namespace feature by
22462 making everything static.
22464 * driver.cs: Adapt code to use RootContext type name instead of
22467 * delegate.cs: Remove RootContext argument.
22469 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22472 * class.cs (Event.Define): The lookup can fail.
22474 * cs-tokenizer.cs: Begin implementation of pre-procesor.
22476 * expression.cs: Resolve the this instance before invoking the code.
22478 2001-12-17 Miguel de Icaza <miguel@ximian.com>
22480 * cs-parser.jay: Add a production in element_access that allows
22481 the thing to become a "type" reference. This way we can parse
22482 things like "(string [])" as a type.
22484 Note that this still does not handle the more complex rules of
22488 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
22490 * ecore.cs: (CopyNewMethods): new utility function used to
22491 assemble the list of methods from running FindMembers.
22493 (MemberLookup): Rework FindMembers so that
22495 2001-12-16 Miguel de Icaza <miguel@ximian.com>
22497 * class.cs (TypeContainer): Remove Delegates who fail to be
22500 * delegate.cs (Populate): Verify that we dont get null return
22501 values. TODO: Check for AsAccessible.
22503 * cs-parser.jay: Use basename to emit error 574 (destructor should
22504 have the same name as container class), not the full name.
22506 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22507 possible representation.
22509 Also implements integer type suffixes U and L.
22511 2001-12-15 Miguel de Icaza <miguel@ximian.com>
22513 * expression.cs (ArrayCreation.DoResolve): We need to do the
22514 argument resolution *always*.
22516 * decl.cs: Make this hold the namespace. Hold the root context as
22518 (LookupType): Move here.
22520 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22522 * location.cs (Row, Name): Fixed the code, it was always returning
22523 references to the first file.
22525 * interface.cs: Register properties defined through interfaces.
22527 * driver.cs: Add support for globbing on the command line
22529 * class.cs (Field): Make it derive from MemberCore as well.
22532 2001-12-15 Ravi Pratap <ravi@ximian.com>
22534 * class.cs (Event::Define): Check that the type of the event is a delegate
22535 type else flag error #66.
22537 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22540 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22541 values of EntryPoint, CharSet etc etc.
22543 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22545 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22546 be null and we should ignore this. I am not sure if this is really clean. Apparently,
22547 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22548 which needs this to do its work.
22550 * ../errors/cs0066.cs : Add.
22552 2001-12-14 Miguel de Icaza <miguel@ximian.com>
22554 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22557 * class.cs: (MethodSignature.MethodSignature): Removed hack that
22558 clears out the parameters field.
22559 (MemberSignatureCompare): Cleanup
22561 (MemberCore): New base class used to share code between MethodCore
22564 (RegisterRequiredImplementations) BindingFlags.Public requires
22565 either BindingFlags.Instace or Static. Use instance here.
22567 (Property): Refactored code to cope better with the full spec.
22569 * parameter.cs (GetParameterInfo): Return an empty array instead
22572 * class.cs (Property): Abstract or extern properties have no bodies.
22574 * parameter.cs (GetParameterInfo): return a zero-sized array.
22576 * class.cs (TypeContainer.MethodModifiersValid): Move all the
22577 method modifier validation to the typecontainer so we can reuse
22578 this on properties.
22580 (MethodCore.ParameterTypes): return an empty sized array of types.
22582 (Property.Define): Test property modifier validity.
22584 Add tests for sealed/override too.
22586 (Method.Emit): abstract or extern methods have no bodies.
22588 2001-12-14 Ravi Pratap <ravi@ximian.com>
22590 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22593 (Method::Define, ::Emit): Modify accordingly.
22595 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22597 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22599 * makefile: Pass in /unsafe.
22601 2001-12-13 Miguel de Icaza <miguel@ximian.com>
22603 * class.cs (MakeKey): Kill routine.
22605 * class.cs (TypeContainer.Define): Correctly define explicit
22606 method implementations (they require the full interface name plus
22609 * typemanager.cs: Deply the PtrHashtable here and stop using the
22610 lame keys. Things work so much better.
22612 This of course broke everyone who depended on `RegisterMethod' to
22613 do the `test for existance' test. This has to be done elsewhere.
22615 * support.cs (PtrHashtable): A hashtable that avoid comparing with
22616 the object stupid Equals method (because, that like fails all over
22617 the place). We still do not use it.
22619 * class.cs (TypeContainer.SetRequiredInterface,
22620 TypeContainer.RequireMethods): Killed these two routines and moved
22621 all the functionality to RegisterRequiredImplementations.
22623 (TypeContainer.RegisterRequiredImplementations): This routine now
22624 registers all the implementations required in an array for the
22625 interfaces and abstract methods. We use an array of structures
22626 which can be computed ahead of time to reduce memory usage and we
22627 also assume that lookups are cheap as most classes will not
22628 implement too many interfaces.
22630 We also avoid creating too many MethodSignatures.
22632 (TypeContainer.IsInterfaceMethod): Update and optionally does not
22633 clear the "pending" bit if we find that there are problems with
22636 (TypeContainer.VerifyPendingMethods): Update to report errors of
22637 methods that look like implementations but are not.
22639 (TypeContainer.Define): Add support for explicit interface method
22642 2001-12-12 Miguel de Icaza <miguel@ximian.com>
22644 * typemanager.cs: Keep track of the parameters here instead of
22645 being a feature of the TypeContainer.
22647 * class.cs: Drop the registration of parameters here, as
22648 InterfaceMethods are also interface declarations.
22650 * delegate.cs: Register methods with the TypeManager not only with
22651 the TypeContainer. This code was buggy.
22653 * interface.cs: Full registation here.
22655 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22657 * expression.cs: Remove reducer for binary expressions, it can not
22660 * const.cs: Put here the code that used to go into constant.cs
22662 * constant.cs: Put here the code for constants, this is a new base
22663 class for Literals.
22665 * literal.cs: Make Literal derive from Constant.
22667 2001-12-09 Miguel de Icaza <miguel@ximian.com>
22669 * statement.cs (Return.Emit): Report error 157 if the user
22670 attempts to return from a finally block.
22672 (Return.Emit): Instead of emitting a return, jump to the end of
22675 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22676 LocalBuilder to store the result of the function. ReturnLabel is
22677 the target where we jump.
22680 2001-12-09 Radek Doulik <rodo@ximian.com>
22682 * cs-parser.jay: remember alias in current namespace
22684 * ecore.cs (SimpleName::DoResolve): use aliases for types or
22687 * class.cs (LookupAlias): lookup alias in my_namespace
22689 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22691 (LookupAlias): lookup alias in this and if needed in parent
22694 2001-12-08 Miguel de Icaza <miguel@ximian.com>
22698 * rootcontext.cs: (ModuleBuilder) Made static, first step into
22699 making things static. I need this to avoid passing the
22700 TypeContainer when calling ParameterType.
22702 * support.cs (InternalParameters.ParameterType): Remove ugly hack
22703 that did string manipulation to compute the type and then call
22704 GetType. Use Parameter.ParameterType instead.
22706 * cs-tokenizer.cs: Consume the suffix for floating values.
22708 * expression.cs (ParameterReference): figure out whether this is a
22709 reference parameter or not. Kill an extra variable by computing
22710 the arg_idx during emission.
22712 * parameter.cs (Parameters.GetParameterInfo): New overloaded
22713 function that returns whether a parameter is an out/ref value or not.
22715 (Parameter.ParameterType): The type of the parameter (base,
22716 without ref/out applied).
22718 (Parameter.Resolve): Perform resolution here.
22719 (Parameter.ExternalType): The full type (with ref/out applied).
22721 * statement.cs (Using.Emit, Using.EmitExpression): Implement
22722 support for expressions on the using statement.
22724 2001-12-07 Miguel de Icaza <miguel@ximian.com>
22726 * statement.cs (Using.EmitLocalVariableDecls): Split the
22727 localvariable handling of the using statement.
22729 (Block.EmitMeta): Keep track of variable count across blocks. We
22730 were reusing slots on separate branches of blocks.
22732 (Try.Emit): Emit the general code block, we were not emitting it.
22734 Check the type of the declaration to be an IDisposable or
22735 something that can be implicity converted to it.
22737 Emit conversions if required.
22739 * ecore.cs (EmptyExpression): New utility class.
22740 (Expression.ImplicitConversionExists): New utility function.
22742 2001-12-06 Miguel de Icaza <miguel@ximian.com>
22744 * statement.cs (Using): Implement.
22746 * expression.cs (LocalVariableReference): Support read only variables.
22748 * statement.cs: Remove the explicit emit for the Leave opcode.
22749 (VariableInfo): Add a readonly field.
22751 2001-12-05 Miguel de Icaza <miguel@ximian.com>
22753 * ecore.cs (ConvCast): new class used to encapsulate the various
22754 explicit integer conversions that works in both checked and
22755 unchecked contexts.
22757 (Expression.ConvertNumericExplicit): Use new ConvCast class to
22758 properly generate the overflow opcodes.
22760 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22762 * statement.cs: The correct type for the EmptyExpression is the
22763 element_type, not the variable type. Ravi pointed this out.
22765 2001-12-04 Ravi Pratap <ravi@ximian.com>
22767 * class.cs (Method::Define): Handle PInvoke methods specially
22768 by using DefinePInvokeMethod instead of the usual one.
22770 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22771 above to do the task of extracting information and defining the method.
22773 2001-12-04 Ravi Pratap <ravi@ximian.com>
22775 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22776 of the condition for string type.
22778 (Emit): Move that here.
22780 (ArrayCreation::CheckIndices): Keep string literals in their expression
22783 (EmitDynamicInitializers): Handle strings appropriately.
22785 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22787 * codegen.cs (EmitContext): Replace multiple variables with a
22788 single pointer to the current Switch statement.
22790 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22793 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22797 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22800 (Foreach.Emit): Foreach on arrays was not setting
22801 up the loop variables (for break/continue).
22803 (GotoCase): Semi-implented.
22805 2001-12-03 Ravi Pratap <ravi@ximian.com>
22807 * attribute.cs (CheckAttribute): Handle system attributes by using
22808 Attribute.GetAttributes to examine information we need.
22810 (GetValidPlaces): Same here.
22812 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22814 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22816 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22818 (Method::Define): Set appropriate flags if we have a DllImport attribute.
22820 (Method::Emit): Handle the case when we are a PInvoke method.
22822 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22824 * expression.cs: Use ResolveWithSimpleName on compound names.
22826 2001-12-02 Ravi Pratap <ravi@ximian.com>
22828 * constant.cs (EmitConstant): Make sure we resolve the associated expression
22829 before trying to reduce it.
22831 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22833 * constant.cs (LookupConstantValue): Implement.
22835 (EmitConstant): Use the above in emitting the constant.
22837 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22838 that are user-defined by doing a LookupConstantValue on them.
22840 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22843 2001-11-29 Miguel de Icaza <miguel@ximian.com>
22845 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22847 (BaseAccess.DoResolve): Implement.
22849 (MemberAccess.DoResolve): Split this routine into a
22850 ResolveMemberAccess routine that can be used independently
22852 2001-11-28 Miguel de Icaza <miguel@ximian.com>
22854 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22855 As that share bits of the implementation. Is returns a boolean,
22856 while As returns the Type that is being probed.
22858 2001-12-01 Ravi Pratap <ravi@ximian.com>
22860 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22861 instead of a Literal - much easier.
22863 (EnumInTransit): Remove - utterly useless :-)
22865 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22867 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22869 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22870 chain when we have no associated expression.
22872 2001-11-30 Ravi Pratap <ravi@ximian.com>
22874 * constant.cs (Define): Use Location while reporting the errror.
22876 Also emit a warning when 'new' is used and there is no inherited
22879 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
22882 (LookupEnumValue): Implement to lookup an enum member's value and define it
22885 (Populate): Re-write accordingly to use the above routine.
22887 2001-11-27 Miguel de Icaza <miguel@ximian.com>
22889 * expression.cs (This): Fix prototype for DoResolveLValue to
22890 override the base class DoResolveLValue.
22892 * cs-parser.cs: Report errors cs574 and cs575 (destructor
22895 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22896 (we need to load the address of the field here). This fixes
22899 (FieldExpr.DoResolveLValue): Call the DoResolve
22900 function to initialize the Instance expression.
22902 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22903 correctly the GetEnumerator operation on a value type.
22905 * cs-parser.jay: Add more simple parsing error catches.
22907 * statement.cs (Switch): Add support for string switches.
22908 Handle null specially.
22910 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
22912 2001-11-28 Ravi Pratap <ravi@ximian.com>
22914 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22916 (declare_local_constant): New helper function.
22918 * statement.cs (AddConstant): Keep a separate record of constants
22920 (IsConstant): Implement to determine if a variable is a constant.
22922 (GetConstantExpression): Implement.
22924 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22926 * statement.cs (IsVariableDefined): Re-write.
22928 2001-11-27 Ravi Pratap <ravi@ximian.com>
22930 * class.cs (TypeContainer::FindMembers): Look for constants
22931 in the case when we are looking for MemberTypes.Field
22933 * expression.cs (MemberAccess::DoResolve): Check that in the
22934 case we are a FieldExpr and a Literal, we are not being accessed
22935 by an instance reference.
22937 * cs-parser.jay (local_constant_declaration): Implement.
22939 (declaration_statement): Implement for constant declarations.
22941 2001-11-26 Miguel de Icaza <miguel@ximian.com>
22943 * statement.cs (Switch): Catch double defaults.
22945 (Switch): More work on the switch() statement
22946 implementation. It works for integral values now, need to finish
22950 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22952 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22953 integer literals into other integer literals. To be used by
22956 2001-11-24 Ravi Pratap <ravi@ximian.com>
22958 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22961 (EmitDynamicInitializers): Cope with the above since we extract data
22962 directly from ArrayData now.
22964 (ExpectInitializers): Keep track of whether initializers are mandatory
22967 (Bounds): Make it a hashtable to prevent the same dimension being
22968 recorded for every element in that dimension.
22970 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22973 Also fix bug which was causing the indices to be emitted in the reverse
22976 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22978 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22979 unfinished. They do not work, because the underlying code is
22982 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22984 * cs-parser.jay: Remove bogus fixme.
22986 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22987 on Switch statement.
22989 2001-11-23 Ravi Pratap <ravi@ximian.com>
22991 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22994 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22995 parameter. Apparently, any expression is allowed.
22997 (ValidateInitializers): Update accordingly.
22999 (CheckIndices): Fix some tricky bugs thanks to recursion.
23001 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
23002 I was being completely brain-dead.
23004 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23005 and re-write acordingly.
23007 (DelegateInvocation): Re-write accordingly.
23009 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23011 (MakeByteBlob): Handle types more correctly.
23013 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23014 initialization from expressions but it is incomplete because I am a complete
23017 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23019 * statement.cs (If.Emit): Fix a bug that generated incorrect code
23020 on If. Basically, we have to return `true' (ie, we do return to
23021 our caller) only if both branches of the if return.
23023 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23024 short-circuit operators, handle them as short circuit operators.
23026 (Cast.DoResolve): Resolve type.
23027 (Cast.Cast): Take an expression as the target type.
23029 * cs-parser.jay (cast_expression): Remove old hack that only
23030 allowed a limited set of types to be handled. Now we take a
23031 unary_expression and we resolve to a type during semantic
23034 Use the grammar productions from Rhys to handle casts (this is
23035 not complete like Rhys syntax yet, we fail to handle that corner
23036 case that C# has regarding (-x), but we will get there.
23038 2001-11-22 Ravi Pratap <ravi@ximian.com>
23040 * class.cs (EmitFieldInitializer): Take care of the case when we have a
23041 field which is an array type.
23043 * cs-parser.jay (declare_local_variables): Support array initialization too.
23045 * typemanager.cs (MakeKey): Implement.
23047 (everywhere): Use the above appropriately.
23049 * cs-parser.jay (for_statement): Update for array initialization while
23050 declaring variables.
23052 * ecore.cs : The error message was correct, it's the variable's names that
23053 were misleading ;-) Make the code more readable.
23055 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23056 the correct type etc.
23058 (ConvertExplicit): Handle Enum types by examining the underlying type.
23060 2001-11-21 Ravi Pratap <ravi@ximian.com>
23062 * parameter.cs (GetCallingConvention): Always return
23063 CallingConventions.Standard for now.
23065 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23067 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23068 and `r' after calling DoNumericPromotions.
23070 * ecore.cs: Fix error message (the types were in the wrong order).
23072 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23073 BindingFlags.Instance as well
23075 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23076 implicit int literal conversion in an empty cast so that we
23077 propagate the right type upstream.
23079 (UnboxCast): new class used to unbox value types.
23080 (Expression.ConvertExplicit): Add explicit type conversions done
23083 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23084 the target type before applying the implicit LongLiterals to ULong
23087 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23089 * cs-parser.jay (for_statement): Reworked the way For works: now
23090 we declare manually any variables that are introduced in
23091 for_initializer to solve the problem of having out-of-band code
23092 emition (that is what got for broken).
23094 (declaration_statement): Perform the actual variable declaration
23095 that used to be done in local_variable_declaration here.
23097 (local_variable_declaration): Do not declare anything, just pass
23098 the information on a DictionaryEntry
23100 2001-11-20 Ravi Pratap <ravi@ximian.com>
23102 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23103 re-write of the logic to now make it recursive.
23105 (UpdateIndices): Re-write accordingly.
23107 Store element data in a separate ArrayData list in the above methods.
23109 (MakeByteBlob): Implement to dump the array data into a byte array.
23111 2001-11-19 Ravi Pratap <ravi@ximian.com>
23113 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23116 * constant.cs (Define): Implement.
23118 (EmitConstant): Re-write fully.
23120 Pass in location info.
23122 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23125 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23126 DictionaryEntry since we need location info too.
23128 (constant_declaration): Update accordingly.
23130 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23131 code into another method : UpdateIndices.
23133 2001-11-18 Ravi Pratap <ravi@ximian.com>
23135 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23136 some type checking etc.
23138 2001-11-17 Ravi Pratap <ravi@ximian.com>
23140 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23141 bits to provide dimension info if the user skips doing that.
23143 Update second constructor to store the rank correctly.
23145 2001-11-16 Ravi Pratap <ravi@ximian.com>
23147 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23148 and try to implement.
23150 * ../errors/cs0150.cs : Add.
23152 * ../errors/cs0178.cs : Add.
23154 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23156 * statement.cs: Implement foreach on multi-dimensional arrays.
23158 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23159 name of the params argument.
23161 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23162 initializing the array.
23164 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23165 we can use this elsewhere.
23167 * statement.cs: Finish implementation of foreach for single
23170 * cs-parser.jay: Use an out-of-band stack to pass information
23171 around, I wonder why I need this.
23173 foreach_block: Make the new foreach_block the current_block.
23175 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23176 function used to return a static Parameters structure. Used for
23177 empty parameters, as those are created very frequently.
23179 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23181 2001-11-15 Ravi Pratap <ravi@ximian.com>
23183 * interface.cs : Default modifier is private, not public. The
23184 make verify test passes again.
23186 2001-11-15 Ravi Pratap <ravi@ximian.com>
23188 * support.cs (ReflectionParameters): Fix logic to determine
23189 whether the last parameter is a params one. Test 9 passes again.
23191 * delegate.cs (Populate): Register the builders we define with
23192 RegisterParameterForBuilder. Test 19 passes again.
23194 * cs-parser.jay (property_declaration): Reference $6 instead
23195 of $$ to get at the location.
23197 (indexer_declaration): Similar stuff.
23199 (attribute): Ditto.
23201 * class.cs (Property): Register parameters for the Get and Set methods
23202 if they exist. Test 23 passes again.
23204 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23205 call to EmitArguments as we are sure there aren't any params arguments.
23206 Test 32 passes again.
23208 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23209 IndexOutOfRangeException.
23211 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23212 Test 33 now passes again.
23214 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23216 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23217 broke a bunch of things. Will have to come up with a better way
23218 of tracking locations.
23220 * statement.cs: Implemented foreach for single dimension arrays.
23222 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23224 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23225 an error. This removes the lookup from the critical path.
23227 * cs-parser.jay: Removed use of temporary_loc, which is completely
23230 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23232 * support.cs (ReflectionParameters.ParameterModifier): Report
23233 whether the argument is a PARAMS argument or not.
23235 * class.cs: Set the attribute `ParamArrayAttribute' on the
23236 parameter argument.
23238 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23239 and cons_param_array_attribute (ConstructorInfo for
23240 ParamArrayAttribute).,
23242 * codegen.cs: Emit the return using the `Return' statement, that
23243 way we can report the error correctly for missing return values.
23245 * class.cs (Method.Emit): Clean up.
23247 * expression.cs (Argument.Resolve): Take another argument: the
23248 location where this argument is used. Notice that this is not
23249 part of the "Argument" class as to reduce the size of the
23250 structure (we know the approximate location anyways).
23252 Test if the argument is a variable-reference, if not, then
23253 complain with a 206.
23255 (Argument.Emit): Emit addresses of variables.
23257 (Argument.FullDesc): Simplify.
23259 (Invocation.DoResolve): Update for Argument.Resolve.
23261 (ElementAccess.DoResolve): ditto.
23263 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23264 method should be virtual, as this method is always virtual.
23266 (NewDelegate.DoResolve): Update for Argument.Resolve.
23268 * class.cs (ConstructorInitializer.DoResolve): ditto.
23270 * attribute.cs (Attribute.Resolve): ditto.
23272 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23274 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23276 * expression.cs (ParameterReference): Drop IStackStorage and implement
23277 IAssignMethod instead.
23279 (LocalVariableReference): ditto.
23281 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23282 IAssignMethod instead.
23284 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23286 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23287 enumerations that are used in heavily used structures derive from
23288 byte in a laughable and pathetic attempt to reduce memory usage.
23289 This is the kind of pre-optimzations that you should not do at
23290 home without adult supervision.
23292 * expression.cs (UnaryMutator): New class, used to handle ++ and
23293 -- separatedly from the other unary operators. Cleans up the
23294 code, and kills the ExpressionStatement dependency in Unary.
23296 (Unary): Removed `method' and `Arguments' from this class, making
23297 it smaller, and moving it all to SimpleCall, so I can reuse this
23298 code in other locations and avoid creating a lot of transient data
23299 strucutres when not required.
23301 * cs-parser.jay: Adjust for new changes.
23303 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23305 * enum.cs (Enum.Populate): If there is a failure during
23308 * cs-parser.jay (opt_enum_base): we used to catch type errors
23309 here, but this is really incorrect. The type error should be
23310 catched during semantic analysis.
23312 2001-12-11 Ravi Pratap <ravi@ximian.com>
23314 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23315 current_local_parameters as expected since I, in my stupidity, had forgotten
23318 * attribute.cs (GetValidPlaces): Fix stupid bug.
23320 * class.cs (Method::Emit): Perform check on applicability of attributes.
23322 (Constructor::Emit): Ditto.
23324 (Field::Emit): Ditto.
23326 (Field.Location): Store location information.
23328 (Property, Event, Indexer, Operator): Ditto.
23330 * cs-parser.jay (field_declaration): Pass in location for each field.
23332 * ../errors/cs0592.cs : Add.
23334 2001-11-12 Ravi Pratap <ravi@ximian.com>
23336 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23338 (InitCoreTypes): Update accordingly.
23340 (RegisterAttrType, LookupAttr): Implement.
23342 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23343 info about the same.
23345 (Resolve): Update to populate the above as necessary.
23347 (Error592): Helper.
23349 (GetValidPlaces): Helper to the above.
23351 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23353 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23355 2001-11-12 Ravi Pratap <ravi@ximian.com>
23357 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23359 * ../errors/cs0617.cs : Add.
23361 2001-11-11 Ravi Pratap <ravi@ximian.com>
23363 * enum.cs (Emit): Rename to Populate to be more consistent with what
23364 we expect it to do and when exactly it is called.
23366 * class.cs, rootcontext.cs : Update accordingly.
23368 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23369 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23371 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23373 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23374 of a fieldinfo using the above, when dealing with a FieldBuilder.
23376 2001-11-10 Ravi Pratap <ravi@ximian.com>
23378 * ../errors/cs0031.cs : Add.
23380 * ../errors/cs1008.cs : Add.
23382 * ../errrors/cs0543.cs : Add.
23384 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23387 (FindMembers): Implement.
23389 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23390 enums and delegates too.
23392 (enum_types): Rename to builder_to_enum.
23394 (delegate_types): Rename to builder_to_delegate.
23396 * delegate.cs (FindMembers): Implement.
23398 2001-11-09 Ravi Pratap <ravi@ximian.com>
23400 * typemanager.cs (IsEnumType): Implement.
23402 * enum.cs (Emit): Re-write parts to account for the underlying type
23403 better and perform checking etc.
23405 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23406 of the underlying type.
23408 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23411 * enum.cs (error31): Helper to report error #31.
23413 * cs-parser.jay (enum_declaration): Store location of each member too.
23415 * enum.cs (member_to_location): New hashtable.
23417 (AddEnumMember): Update location hashtable.
23419 (Emit): Use the location of each member while reporting errors.
23421 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23423 * cs-parser.jay: A for_initializer if is a
23424 local_variable_declaration really ammount to have an implicit
23425 block with the variable declaration and no initializer for for.
23427 * statement.cs (For.Emit): Cope with null initializers.
23429 This fixes the infinite loop on for initializers.
23431 2001-11-08 Miguel de Icaza <miguel@ximian.com>
23433 * enum.cs: More cleanup.
23435 * ecore.cs: Remove dead code.
23437 * class.cs (Property.Emit): More simplification.
23438 (Event.Emit): ditto.
23440 Reworked to have less levels of indentation.
23442 2001-11-08 Ravi Pratap <ravi@ximian.com>
23444 * class.cs (Property): Emit attributes.
23454 * enum.cs (Emit): Ditto.
23456 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23459 * class.cs (Field, Event, etc.): Move attribute generation into the
23460 Emit method everywhere.
23462 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23463 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23464 as we had no way of defining nested enums !
23466 * rootcontext.cs : Adjust code accordingly.
23468 * typemanager.cs (AddEnumType): To keep track of enum types separately.
23470 2001-11-07 Ravi Pratap <ravi@ximian.com>
23472 * expression.cs (EvalConstantExpression): Move into ecore.cs
23474 * enum.cs (Enum): Rename some members and make them public and readonly
23475 according to our convention.
23477 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23480 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23482 (Enum::Emit): Write a simple version for now which doesn't try to compute
23483 expressions. I shall modify this to be more robust in just a while.
23485 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23487 (TypeContainer::CloseType): Create the Enum types too.
23489 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23491 * expression.cs (EvalConstantExpression): Get rid of completely.
23493 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23494 user-defined values and other cases.
23496 (IsValidEnumLiteral): Helper function.
23498 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
23499 out there in the case we had a literal FieldExpr.
23501 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23503 (Literalize): Revamp a bit to take two arguments.
23505 (EnumLiteral): New class which derives from Literal to wrap enum literals.
23507 2001-11-06 Ravi Pratap <ravi@ximian.com>
23509 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23511 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23513 (Resolve): Use the above to ensure we have proper initializers.
23515 2001-11-05 Ravi Pratap <ravi@ximian.com>
23517 * expression.cs (Expression::EvalConstantExpression): New method to
23518 evaluate constant expressions.
23520 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23522 2001-11-07 Miguel de Icaza <miguel@ximian.com>
23524 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23527 (Binary.ResolveOperator): Handle operator != (object a, object b)
23528 and operator == (object a, object b);
23530 (Binary.DoNumericPromotions): Indicate whether the numeric
23531 promotion was possible.
23533 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23536 Made the ArrayAccess implement interface IAssignMethod instead of
23537 IStackStore as the order in which arguments are passed reflects
23540 * assign.cs: Instead of using expr.ExprClass to select the way of
23541 assinging, probe for the IStackStore/IAssignMethod interfaces.
23543 * typemanager.cs: Load InitializeArray definition.
23545 * rootcontext.cs (RootContext.MakeStaticData): Used to define
23546 static data that can be used to initialize arrays.
23548 2001-11-05 Miguel de Icaza <miguel@ximian.com>
23550 * expression.cs: Handle operator== and operator!= for booleans.
23552 (Conditioal.Reduce): Implement reducer for the ?: operator.
23554 (Conditional.Resolve): Implement dead code elimination.
23556 (Binary.Resolve): Catch string literals and return a new
23557 concatenated string.
23559 (Unary.Reduce): Implement reduction of unary expressions.
23561 * ecore.cs: Split out the expression core handling here.
23563 (Expression.Reduce): New method used to perform constant folding
23564 and CSE. This is needed to support constant-expressions.
23566 * statement.cs (Statement.EmitBoolExpression): Pass true and false
23567 targets, and optimize for !x.
23569 2001-11-04 Ravi Pratap <ravi@ximian.com>
23571 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23572 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23573 set custom atttributes.
23575 * literal.cs (Literal::GetValue): New abstract method to return the actual
23576 value of the literal, cast as an object.
23578 (*Literal): Implement GetValue method.
23580 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23581 expressions to the arraylist but objects of type Argument.
23583 * class.cs (TypeContainer::Emit): Emit our attributes too.
23585 (Method::Emit, Constructor::Emit): Ditto.
23587 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23588 to be ignoring earlier.
23590 2001-11-03 Ravi Pratap <ravi@ximian.com>
23592 * attribute.cs (AttributeSection::Define): Implement to do the business
23593 of constructing a CustomAttributeBuilder.
23595 (Attribute): New trivial class. Increases readability of code.
23597 * cs-parser.jay : Update accordingly.
23599 (positional_argument_list, named_argument_list, named_argument): New rules
23601 (attribute_arguments): Use the above so that we are more correct.
23603 2001-11-02 Ravi Pratap <ravi@ximian.com>
23605 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23606 to perform all checks for a method with a params parameter.
23608 (Invocation::OverloadResolve): Update to use the above method and therefore
23609 cope correctly with params method invocations.
23611 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
23614 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23615 constructors in our parent too because we can't afford to miss out on
23618 * attribute.cs (AttributeSection): New name for the class Attribute
23620 Other trivial changes to improve readability.
23622 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23623 use the new class names.
23625 2001-11-01 Ravi Pratap <ravi@ximian.com>
23627 * class.cs (Method::Define): Complete definition for params types too
23629 (Indexer::Define): Ditto.
23631 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23632 Cope everywhere with a request for info about the array parameter.
23634 2001-11-01 Ravi Pratap <ravi@ximian.com>
23636 * tree.cs (RecordNamespace): Fix up to check for the correct key.
23638 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
23639 local_variable_type to extract the string corresponding to the type.
23641 (local_variable_type): Fixup the action to use the new helper method.
23643 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
23646 * expression.cs : Clean out code which uses the above.
23648 2001-10-31 Ravi Pratap <ravi@ximian.com>
23650 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23651 and bale out if necessary by returning a false.
23653 (RegisterProperty): Ditto.
23655 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23656 and print out appropriate error messages.
23658 * interface.cs (everywhere): Ditto.
23660 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23661 location to constructor.
23663 * class.cs (Property, Event, Indexer): Update accordingly.
23665 * ../errors/cs111.cs : Added.
23667 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23668 of a method, as laid down by the spec.
23670 (Invocation::OverloadResolve): Use the above method.
23672 2001-10-31 Ravi Pratap <ravi@ximian.com>
23674 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23675 now take a TypeContainer and a Parameters object.
23677 (ParameterData): Modify return type of ParameterModifier method to be
23678 Parameter.Modifier and not a string.
23680 (ReflectionParameters, InternalParameters): Update accordingly.
23682 * expression.cs (Argument::GetParameterModifier): Same here.
23684 * support.cs (InternalParameters::ParameterType): Find a better way of determining
23685 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23686 symbol in it at all so maybe this is only for now.
23688 2001-10-30 Ravi Pratap <ravi@ximian.com>
23690 * support.cs (InternalParameters): Constructor now takes an extra argument
23691 which is the actual Parameters class.
23693 (ParameterDesc): Update to provide info on ref/out modifiers.
23695 * class.cs (everywhere): Update call to InternalParameters to pass in
23696 the second argument too.
23698 * support.cs (ParameterData): Add ParameterModifier, which is a method
23699 to return the modifier info [ref/out etc]
23701 (InternalParameters, ReflectionParameters): Implement the above.
23703 * expression.cs (Argument::ParameterModifier): Similar function to return
23704 info about the argument's modifiers.
23706 (Invocation::OverloadResolve): Update to take into account matching modifiers
23709 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23710 a new SetFormalParameters object which we pass to InternalParameters.
23712 2001-10-30 Ravi Pratap <ravi@ximian.com>
23714 * expression.cs (NewArray): Merge into the ArrayCreation class.
23716 2001-10-29 Ravi Pratap <ravi@ximian.com>
23718 * expression.cs (NewArray): Merge classes NewBuiltinArray and
23719 NewUserdefinedArray into one as there wasn't much of a use in having
23722 * expression.cs (Argument): Change field's name to ArgType from Type.
23724 (Type): New readonly property which returns the proper type, taking into
23725 account ref/out modifiers.
23727 (everywhere): Adjust code accordingly for the above.
23729 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23730 whether we are emitting for a ref or out parameter.
23732 * expression.cs (Argument::Emit): Use the above field to set the state.
23734 (LocalVariableReference::Emit): Update to honour the flag and emit the
23737 * parameter.cs (Attributes): Set the correct flags for ref parameters.
23739 * expression.cs (Argument::FullDesc): New function to provide a full desc.
23741 * support.cs (ParameterData): Add method ParameterDesc to the interface.
23743 (ReflectionParameters, InternalParameters): Implement the above method.
23745 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23748 (Invocation::FullMethodDesc): Ditto.
23750 2001-10-29 Miguel de Icaza <miguel@ximian.com>
23752 * cs-parser.jay: Add extra production for the second form of array
23755 * expression.cs (ArrayCreation): Update to reflect the above
23758 * Small changes to prepare for Array initialization.
23760 2001-10-28 Miguel de Icaza <miguel@ximian.com>
23762 * typemanager.cs (ImplementsInterface): interface might be null;
23763 Deal with this problem;
23765 Also, we do store negative hits on the cache (null values), so use
23766 this instead of calling t.GetInterfaces on the type everytime.
23768 2001-10-28 Ravi Pratap <ravi@ximian.com>
23770 * typemanager.cs (IsBuiltinType): New method to help determine the same.
23772 * expression.cs (New::DoResolve): Get rid of array creation code and instead
23773 split functionality out into different classes.
23775 (New::FormArrayType): Move into NewBuiltinArray.
23777 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23780 (NewBuiltinArray): New class to handle creation of built-in arrays.
23782 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23783 account creation of one-dimensional arrays.
23785 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23787 (NewUserdefinedArray::DoResolve): Implement.
23789 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23791 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23792 we maintain inside the TypeManager. This is necessary to perform lookups on the
23795 (LookupType): Update to perform GetType on the module builders too.
23797 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23799 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23801 2001-10-23 Ravi Pratap <ravi@ximian.com>
23803 * expression.cs (New::DoResolve): Implement guts of array creation.
23805 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23807 2001-10-27 Miguel de Icaza <miguel@ximian.com>
23809 * expression.cs: Fix bug I introduced lsat night that broke
23812 (Expression.Resolve): Report a 246 error (can not resolve name)
23813 if we find a SimpleName in the stream.
23815 (Expression.ResolveLValue): Ditto.
23817 (Expression.ResolveWithSimpleName): This function is a variant of
23818 ResolveName, this one allows SimpleNames to be returned without a
23819 warning. The only consumer of SimpleNames is MemberAccess
23821 2001-10-26 Miguel de Icaza <miguel@ximian.com>
23823 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23824 might arrive here. I have my doubts that this is correct.
23826 * statement.cs (Lock): Implement lock statement.
23828 * cs-parser.jay: Small fixes to support `lock' and `using'
23830 * cs-tokenizer.cs: Remove extra space
23832 * driver.cs: New flag --checked, allows to turn on integer math
23835 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23836 Threading.Monitor.Exit
23838 2001-10-23 Miguel de Icaza <miguel@ximian.com>
23840 * expression.cs (IndexerAccess::DoResolveLValue): Set the
23841 Expression Class to be IndexerAccess.
23843 Notice that Indexer::DoResolve sets the eclass to Value.
23845 2001-10-22 Miguel de Icaza <miguel@ximian.com>
23847 * class.cs (TypeContainer::Emit): Emit code for indexers.
23849 * assign.cs (IAssignMethod): New interface implemented by Indexers
23850 and Properties for handling assignment.
23852 (Assign::Emit): Simplify and reuse code.
23854 * expression.cs (IndexerAccess, PropertyExpr): Implement
23855 IAssignMethod, clean up old code.
23857 2001-10-22 Ravi Pratap <ravi@ximian.com>
23859 * typemanager.cs (ImplementsInterface): New method to determine if a type
23860 implements a given interface. Provides a nice cache too.
23862 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23865 (ConvertReferenceExplicit): Ditto.
23867 * delegate.cs (Delegate::Populate): Update to define the parameters on the
23868 various methods, with correct names etc.
23870 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
23871 Operator.UnaryNegation.
23873 * cs-parser.jay (operator_declarator): Be a little clever in the case where
23874 we have a unary plus or minus operator.
23876 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
23879 * everywhere : update accordingly.
23881 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23884 * class.cs (Method::Define): For the case where we are implementing a method
23885 inherited from an interface, we need to set the MethodAttributes.Final flag too.
23886 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23888 2001-10-21 Ravi Pratap <ravi@ximian.com>
23890 * interface.cs (FindMembers): Implement to work around S.R.E
23893 * typemanager.cs (IsInterfaceType): Implement.
23895 (FindMembers): Update to handle interface types too.
23897 * expression.cs (ImplicitReferenceConversion): Re-write bits which
23898 use IsAssignableFrom as that is not correct - it doesn't work.
23900 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23901 and accordingly override EmitStatement.
23903 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23904 using the correct logic :-)
23906 2001-10-19 Ravi Pratap <ravi@ximian.com>
23908 * ../errors/cs-11.cs : Add to demonstrate error -11
23910 2001-10-17 Miguel de Icaza <miguel@ximian.com>
23912 * assign.cs (Assign::Resolve): Resolve right hand side first, and
23913 then pass this as a hint to ResolveLValue.
23915 * expression.cs (FieldExpr): Add Location information
23917 (FieldExpr::LValueResolve): Report assignment to readonly
23920 (Expression::ExprClassFromMemberInfo): Pass location information.
23922 (Expression::ResolveLValue): Add new method that resolves an
23925 (Expression::DoResolveLValue): Default invocation calls
23928 (Indexers): New class used to keep track of indexers in a given
23931 (IStackStore): Renamed from LValue, as it did not really describe
23932 what this did. Also ResolveLValue is gone from this interface and
23933 now is part of Expression.
23935 (ElementAccess): Depending on the element access type
23937 * typemanager.cs: Add `indexer_name_type' as a Core type
23938 (System.Runtime.CompilerServices.IndexerNameAttribute)
23940 * statement.cs (Goto): Take a location.
23942 2001-10-18 Ravi Pratap <ravi@ximian.com>
23944 * delegate.cs (Delegate::VerifyDelegate): New method to verify
23945 if two delegates are compatible.
23947 (NewDelegate::DoResolve): Update to take care of the case when
23948 we instantiate a delegate from another delegate.
23950 * typemanager.cs (FindMembers): Don't even try to look up members
23951 of Delegate types for now.
23953 2001-10-18 Ravi Pratap <ravi@ximian.com>
23955 * delegate.cs (NewDelegate): New class to take care of delegate
23958 * expression.cs (New): Split the delegate related code out into
23959 the NewDelegate class.
23961 * delegate.cs (DelegateInvocation): New class to handle delegate
23964 * expression.cs (Invocation): Split out delegate related code into
23965 the DelegateInvocation class.
23967 2001-10-17 Ravi Pratap <ravi@ximian.com>
23969 * expression.cs (New::DoResolve): Implement delegate creation fully
23970 and according to the spec.
23972 (New::DoEmit): Update to handle delegates differently.
23974 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23975 because of which we were printing out arguments in reverse order !
23977 * delegate.cs (VerifyMethod): Implement to check if the given method
23978 matches the delegate.
23980 (FullDelegateDesc): Implement.
23982 (VerifyApplicability): Implement.
23984 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23985 delegate invocations too.
23987 (Invocation::Emit): Ditto.
23989 * ../errors/cs1593.cs : Added.
23991 * ../errors/cs1594.cs : Added.
23993 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23995 2001-10-16 Ravi Pratap <ravi@ximian.com>
23997 * typemanager.cs (intptr_type): Core type for System.IntPtr
23999 (InitCoreTypes): Update for the same.
24001 (iasyncresult_type, asynccallback_type): Ditto.
24003 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24006 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24009 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24010 the builders for the 4 members of a delegate type :-)
24012 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24015 * expression.cs (New::DoResolve): Implement guts for delegate creation.
24017 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24019 2001-10-15 Miguel de Icaza <miguel@ximian.com>
24021 * statement.cs (Break::Emit): Implement.
24022 (Continue::Emit): Implement.
24024 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
24025 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
24026 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
24027 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
24030 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24031 properties that track the label for the current loop (begin of the
24032 loop and end of the loop).
24034 2001-10-15 Ravi Pratap <ravi@ximian.com>
24036 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24037 use of emitting anything at all.
24039 * class.cs, rootcontext.cs : Get rid of calls to the same.
24041 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24043 (Populate): Define the constructor correctly and set the implementation
24046 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24049 (AddDelegateType): Implement.
24051 (IsDelegateType): Implement helper method.
24053 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24055 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24056 and accordingly handle it.
24058 * delegate.cs (Populate): Take TypeContainer argument.
24059 Implement bits to define the Invoke method. However, I still haven't figured out
24060 how to take care of the native int bit :-(
24062 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24063 Qualify the name of the delegate, not its return type !
24065 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24068 (StandardConversionExists): Checking for array types turns out to be recursive.
24070 (ConvertReferenceExplicit): Implement array conversion.
24072 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24074 2001-10-12 Ravi Pratap <ravi@ximian.com>
24076 * cs-parser.jay (delegate_declaration): Store the fully qualified
24077 name as it is a type declaration.
24079 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24082 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24083 as TypeContainer::DefineType.
24085 (Populate): Method in which all the definition of the various methods (Invoke)
24088 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24091 (CloseDelegate): Finally creates the delegate.
24093 * class.cs (TypeContainer::DefineType): Update to define delegates.
24094 (Populate, Emit and CloseType): Do the same thing here too.
24096 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24097 delegates in all these operations.
24099 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24101 * expression.cs: LocalTemporary: a new expression used to
24102 reference a temporary that has been created.
24104 * assign.cs: Handle PropertyAccess back here, so that we can
24105 provide the proper semantic access to properties.
24107 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24108 a few more explicit conversions.
24110 * modifiers.cs: `NEW' modifier maps to HideBySig.
24112 * expression.cs (PropertyExpr): Make this into an
24113 ExpressionStatement, and support the EmitStatement code path.
24115 Perform get/set error checking, clean up the interface.
24117 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24118 them into toplevel access objects.
24120 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24122 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24125 * typemanager.cs: Keep track here of our PropertyBuilders again to
24126 work around lameness in SRE.
24128 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24130 * expression.cs (LValue::LValueResolve): New method in the
24131 interface, used to perform a second resolution pass for LValues.
24133 (This::DoResolve): Catch the use of this in static methods.
24135 (This::LValueResolve): Implement.
24137 (This::Store): Remove warning, assigning to `this' in structures
24140 (Invocation::Emit): Deal with invocation of
24141 methods on value types. We need to pass the address to structure
24142 methods rather than the object itself. (The equivalent code to
24143 emit "this" for structures leaves the entire structure on the
24144 stack instead of a pointer to it).
24146 (ParameterReference::DoResolve): Compute the real index for the
24147 argument based on whether the method takes or not a `this' pointer
24148 (ie, the method is static).
24150 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24151 value types returned from functions when we need to invoke a
24152 method on the sturcture.
24155 2001-10-11 Ravi Pratap <ravi@ximian.com>
24157 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24158 defining the type in the Modulebuilder or Typebuilder. This is to take
24159 care of nested types which need to be defined on the TypeBuilder using
24160 DefineNestedMethod.
24162 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24163 methods in RootContext, only ported to be part of TypeContainer.
24165 (TypeContainer::GetInterfaceOrClass): Ditto.
24167 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24169 * interface.cs (Interface::DefineInterface): New method. Does exactly
24170 what RootContext.CreateInterface did earlier, only it takes care of nested types
24173 (Interface::GetInterfaces): Move from RootContext here and port.
24175 (Interface::GetInterfaceByName): Same here.
24177 * rootcontext.cs (ResolveTree): Re-write.
24179 (PopulateTypes): Re-write.
24181 * class.cs (TypeContainer::Populate): Populate nested types too.
24182 (TypeContainer::Emit): Emit nested members too.
24184 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24185 instead just use the name argument passed in as it is already fully
24188 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24189 to TypeContainer mapping to see if a type is user-defined.
24191 * class.cs (TypeContainer::CloseType): Implement.
24193 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24194 the default constructor.
24196 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24199 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24201 * interface.cs (CloseType): Create the type here.
24203 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24206 Remove all the methods which are now in TypeContainer.
24208 2001-10-10 Ravi Pratap <ravi@ximian.com>
24210 * delegate.cs (Define): Re-write bits to define the delegate
24213 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24215 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24217 * expression.cs (ImplicitReferenceConversion): handle null as well
24218 as a source to convert to any reference type.
24220 * statement.cs (Return): Perform any implicit conversions to
24221 expected return type.
24223 Validate use of return statement.
24225 * codegen.cs (EmitContext): Pass the expected return type here.
24227 * class.cs (Method, Constructor, Property): Pass expected return
24228 type to EmitContext.
24230 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24232 * expression.cs: Make DoResolve take an EmitContext instead of a
24235 Replaced `l' and `location' for `loc', for consistency.
24237 (Error, Warning): Remove unneeded Tc argument.
24239 * assign.cs, literal.cs, constant.cs: Update to new calling
24242 * codegen.cs: EmitContext now contains a flag indicating whether
24243 code is being generated in a static method or not.
24245 * cs-parser.jay: DecomposeQI, new function that replaces the old
24246 QualifiedIdentifier. Now we always decompose the assembled
24247 strings from qualified_identifier productions into a group of
24250 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24252 * rootcontext.cs: Deal with field-less struct types correctly now
24253 by passing the size option to Define Type.
24255 * class.cs: Removed hack that created one static field.
24257 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24259 * statement.cs: Moved most of the code generation here.
24261 2001-10-09 Ravi Pratap <ravi@ximian.com>
24263 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24266 (ElementAccess): Remove useless bits for now - keep checks as the spec
24269 2001-10-08 Ravi Pratap <ravi@ximian.com>
24271 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24272 and start performing checks according to the spec.
24274 2001-10-07 Ravi Pratap <ravi@ximian.com>
24276 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24277 rank_specifiers instead.
24279 (rank_specifiers): Change the order in which the rank specifiers are stored
24281 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24283 * expression.cs (ElementAccess): Implement the LValue interface too.
24285 2001-10-06 Ravi Pratap <ravi@ximian.com>
24287 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24288 except that user defined conversions are not included.
24290 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
24291 perform the conversion of the return type, if necessary.
24293 (New::DoResolve): Check whether we are creating an array or an object
24294 and accordingly do the needful.
24296 (New::Emit): Same here.
24298 (New::DoResolve): Implement guts of array creation.
24300 (New::FormLookupType): Helper function.
24302 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24304 * codegen.cs: Removed most of the code generation here, and move the
24305 corresponding code generation bits to the statement classes.
24307 Added support for try/catch/finalize and throw.
24309 * cs-parser.jay: Added support for try/catch/finalize.
24311 * class.cs: Catch static methods having the flags override,
24312 virtual or abstract.
24314 * expression.cs (UserCast): This user cast was not really doing
24315 what it was supposed to do. Which is to be born in fully resolved
24316 state. Parts of the resolution were being performed at Emit time!
24320 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24322 * expression.cs: Implicity convert the result from UserCast.
24324 2001-10-05 Ravi Pratap <ravi@ximian.com>
24326 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24327 prevented it from working correctly.
24329 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24330 merely ConvertImplicit.
24332 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24334 * typemanager.cs: Make the LookupTypeContainer function static,
24335 and not per-instance.
24337 * class.cs: Make static FindMembers (the one that takes a Type
24340 * codegen.cs: Add EmitForeach here.
24342 * cs-parser.jay: Make foreach a toplevel object instead of the
24343 inline expansion, as we need to perform semantic analysis on it.
24345 2001-10-05 Ravi Pratap <ravi@ximian.com>
24347 * expression.cs (Expression::ImplicitUserConversion): Rename to
24348 UserDefinedConversion.
24350 (Expression::UserDefinedConversion): Take an extra argument specifying
24351 whether we look for explicit user conversions too.
24353 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24355 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24357 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24358 with the appropriate arguments.
24360 * cs-parser.jay (cast_expression): Record location too.
24362 * expression.cs (Cast): Record location info.
24364 (Expression::ConvertExplicit): Take location argument.
24366 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24367 to determine if we are doing explicit conversions.
24369 (UserCast::Emit): Update accordingly.
24371 (Expression::ConvertExplicit): Report an error if everything fails.
24373 * ../errors/cs0030.cs : Add.
24375 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24377 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24378 virtual and newslot bits.
24380 * class.cs (TypeContainer::RegisterRequiredImplementations):
24381 Record methods we need.
24383 (TypeContainer::MakeKey): Helper function to make keys for
24384 MethodBases, since the Methodbase key is useless.
24386 (TypeContainer::Populate): Call RegisterRequiredImplementations
24387 before defining the methods.
24389 Create a mapping for method_builders_to_methods ahead of time
24390 instead of inside a tight loop.
24392 (::RequireMethods): Accept an object as the data to set into the
24393 hashtable so we can report interface vs abstract method mismatch.
24395 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24397 * report.cs: Make all of it static.
24399 * rootcontext.cs: Drop object_type and value_type computations, as
24400 we have those in the TypeManager anyways.
24402 Drop report instance variable too, now it is a global.
24404 * driver.cs: Use try/catch on command line handling.
24406 Add --probe option to debug the error reporting system with a test
24409 * report.cs: Add support for exiting program when a probe
24410 condition is reached.
24412 2001-10-03 Ravi Pratap <ravi@ximian.com>
24414 * expression.cs (Binary::DoNumericPromotions): Fix the case when
24415 we do a forcible conversion regardless of type, to check if
24416 ForceConversion returns a null.
24418 (Binary::error19): Use location to report error.
24420 (Unary::error23): Use location here too.
24422 * ../errors/cs0019.cs : Check in.
24424 * ../errors/cs0023.cs : Check in.
24426 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24427 case of a non-null MethodInfo object with a length of 0 !
24429 (Binary::ResolveOperator): Flag error if overload resolution fails to find
24430 an applicable member - according to the spec :-)
24431 Also fix logic to find members in base types.
24433 (Unary::ResolveOperator): Same here.
24435 (Unary::report23): Change name to error23 and make first argument a TypeContainer
24436 as I was getting thoroughly confused between this and error19 :-)
24438 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24439 (::FindMostEncompassedType): Implement.
24440 (::FindMostEncompassingType): Implement.
24441 (::StandardConversionExists): Implement.
24443 (UserImplicitCast): Re-vamp. We now need info about most specific
24444 source and target types so that we can do the necessary conversions.
24446 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24447 mathematical union with no duplicates.
24449 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24451 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24452 in order from base classes to child classes, so that we can in
24453 child classes look up in our parent for method names and
24454 attributes (required for handling abstract, virtual, new, override
24455 constructs: we need to instrospect our base class, and if we dont
24456 populate the classes in order, the introspection might be
24457 incorrect. For example, a method could query its parent before
24458 the parent has any methods and would determine that the parent has
24459 no abstract methods (while it could have had them)).
24461 (RootContext::CreateType): Record the order in which we define the
24464 2001-10-02 Miguel de Icaza <miguel@ximian.com>
24466 * class.cs (TypeContainer::Populate): Also method definitions can
24467 fail now, keep track of this.
24469 (TypeContainer::FindMembers): Implement support for
24470 DeclaredOnly/noDeclaredOnly flag.
24472 (Constructor::Emit) Return the ConstructorBuilder.
24474 (Method::Emit) Return the MethodBuilder.
24475 Check for abstract or virtual methods to be public.
24477 * rootcontext.cs (RootContext::CreateType): Register all the
24478 abstract methods required for the class to be complete and the
24479 interface methods that must be implemented.
24481 * cs-parser.jay: Report error 501 (method requires body if it is
24482 not marked abstract or extern).
24484 * expression.cs (TypeOf::Emit): Implement.
24486 * typemanager.cs: runtime_handle_type, new global type.
24488 * class.cs (Property::Emit): Generate code for properties.
24490 2001-10-02 Ravi Pratap <ravi@ximian.com>
24492 * expression.cs (Unary::ResolveOperator): Find operators on base type
24493 too - we now conform exactly to the spec.
24495 (Binary::ResolveOperator): Same here.
24497 * class.cs (Operator::Define): Fix minor quirk in the tests.
24499 * ../errors/cs0215.cs : Added.
24501 * ../errors/cs0556.cs : Added.
24503 * ../errors/cs0555.cs : Added.
24505 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24507 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24508 single integer which is really efficient
24510 2001-10-01 Ravi Pratap <ravi@ximian.com>
24512 * expression.cs (Expression::ImplicitUserConversion): Use location
24513 even in the case when we are examining True operators.
24515 * class.cs (Operator::Define): Perform extensive checks to conform
24516 with the rules for operator overloading in the spec.
24518 * expression.cs (Expression::ImplicitReferenceConversion): Implement
24519 some of the other conversions mentioned in the spec.
24521 * typemanager.cs (array_type): New static member for the System.Array built-in
24524 (cloneable_interface): For System.ICloneable interface.
24526 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24527 we start resolving the tree and populating types.
24529 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24531 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24533 * expression.cs (Expression::ExprClassFromMemberInfo,
24534 Expression::Literalize): Create literal expressions from
24535 FieldInfos which are literals.
24537 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24538 type casts, because they were wrong. The test suite in tests
24541 (ImplicitNumericConversion): ushort to ulong requires a widening
24544 Int32 constant to long requires widening cast as well.
24546 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24547 for integers because the type on the stack is not i4.
24549 2001-09-30 Miguel de Icaza <miguel@ximian.com>
24551 * expression.cs (report118): require location argument.
24553 * parameter.cs: Do not dereference potential null value.
24555 * class.cs: Catch methods that lack the `new' keyword when
24556 overriding a name. Report warnings when `new' is used without
24557 anything being there to override.
24559 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24561 * class.cs: Only add constructor to hashtable if it is non-null
24562 (as now constructors can fail on define).
24564 (TypeManager, Class, Struct): Take location arguments.
24566 Catch field instance initialization in structs as errors.
24568 accepting_filter: a new filter for FindMembers that is static so
24569 that we dont create an instance per invocation.
24571 (Constructor::Define): Catch errors where a struct constructor is
24574 * cs-parser.jay: Pass location information for various new
24577 * delegate.cs (Delegate): take a location argument.
24579 * driver.cs: Do not call EmitCode if there were problesm in the
24580 Definition of the types, as many Builders wont be there.
24582 * decl.cs (Decl::Decl): Require a location argument.
24584 * cs-tokenizer.cs: Handle properly hex constants that can not fit
24585 into integers, and find the most appropiate integer for it.
24587 * literal.cs: Implement ULongLiteral.
24589 * rootcontext.cs: Provide better information about the location of
24590 failure when CreateType fails.
24592 2001-09-29 Miguel de Icaza <miguel@ximian.com>
24594 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24597 * expression.cs (Binary::CheckShiftArguments): Add missing type
24599 (Binary::ResolveOperator): Add type to the logical and and logical
24600 or, Bitwise And/Or and Exclusive Or code paths, it was missing
24603 (Binary::DoNumericPromotions): In the case where either argument
24604 is ulong (and most signed types combined with ulong cause an
24605 error) perform implicit integer constant conversions as well.
24607 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24609 * expression.cs (UserImplicitCast): Method should always be
24611 (Invocation::BetterConversion): Simplified test for IntLiteral.
24613 (Expression::ImplicitNumericConversion): Split this routine out.
24614 Put the code that performs implicit constant integer conversions
24617 (Expression::Resolve): Become a wrapper around DoResolve so we can
24618 check eclass and type being set after resolve.
24620 (Invocation::Badness): Remove this dead function
24622 (Binary::ResolveOperator): Do not compute the expensive argumnets
24623 unless we have a union for it.
24625 (Probe::Emit): Is needs to do an isinst and then
24626 compare against null.
24628 (::CanConvert): Added Location argument. If the Location argument
24629 is null (Location.Null), then we do not report errors. This is
24630 used by the `probe' mechanism of the Explicit conversion. We do
24631 not want to generate an error for something that the user
24632 explicitly requested to be casted. But the pipeline for an
24633 explicit cast first tests for potential implicit casts.
24635 So for now, if the Location is null, it means `Probe only' to
24636 avoid adding another argument. Might have to revise this
24639 (ClassCast): New class used to type cast objects into arbitrary
24640 classes (used in Explicit Reference Conversions).
24642 Implement `as' as well.
24644 Reverted all the patches from Ravi below: they were broken:
24646 * The use of `level' as a mechanism to stop recursive
24647 invocations is wrong. That was there just to catch the
24648 bug with a strack trace but not as a way of addressing
24651 To fix the problem we have to *understand* what is going
24652 on and the interactions and come up with a plan, not
24653 just get things going.
24655 * The use of the type conversion cache that I proposed
24656 last night had an open topic: How does this work across
24657 protection domains. A user defined conversion might not
24658 be public in the location where we are applying the
24659 conversion, a different conversion might be selected
24660 (ie, private A->B (better) but public B->A (worse),
24661 inside A, A->B applies, but outside it, B->A will
24664 * On top of that (ie, even if the above is solved),
24665 conversions in a cache need to be abstract. Ie, `To
24666 convert from an Int to a Short use an OpcodeCast', not
24667 `To convert from an Int to a Short use the OpcodeCast on
24668 the variable 5' (which is what this patch was doing).
24670 2001-09-28 Ravi Pratap <ravi@ximian.com>
24672 * expression.cs (Invocation::ConversionExists): Re-write to use
24673 the conversion cache
24675 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24676 cache all conversions done, not just user-defined ones.
24678 (Invocation::BetterConversion): The real culprit. Use ConversionExists
24679 to determine if a conversion exists instead of acutually trying to
24680 perform the conversion. It's faster too.
24682 (Expression::ConvertExplicit): Modify to use ConversionExists to check
24683 and only then attempt the implicit conversion.
24685 2001-09-28 Ravi Pratap <ravi@ximian.com>
24687 * expression.cs (ConvertImplicit): Use a cache for conversions
24688 already found. Check level of recursion and bail out if necessary.
24690 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24692 * typemanager.cs (string_concat_string_string, string_concat_object_object):
24693 Export standard methods that we expect for string operations.
24695 * statement.cs (Block::UsageWarning): Track usage of variables and
24696 report the errors for not used variables.
24698 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24701 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24703 * codegen.cs: remove unnneded code
24705 * expression.cs: Removed BuiltinTypeAccess class
24707 Fix the order in which implicit conversions are
24710 The previous fixed dropped support for boxed conversions (adding a
24711 test to the test suite now)
24713 (UserImplicitCast::CanConvert): Remove test for source being null,
24714 that code is broken. We should not feed a null to begin with, if
24715 we do, then we should track the bug where the problem originates
24716 and not try to cover it up here.
24718 Return a resolved expression of type UserImplicitCast on success
24719 rather than true/false. Ravi: this is what I was talking about,
24720 the pattern is to use a static method as a "constructor" for
24723 Also, do not create arguments until the very last minute,
24724 otherwise we always create the arguments even for lookups that
24725 will never be performed.
24727 (UserImplicitCast::Resolve): Eliminate, objects of type
24728 UserImplicitCast are born in a fully resolved state.
24730 * typemanager.cs (InitCoreTypes): Init also value_type
24731 (System.ValueType).
24733 * expression.cs (Cast::Resolve): First resolve the child expression.
24735 (LValue): Add new method AddressOf to be used by
24738 Change the argument of Store to take an EmitContext instead of an
24739 ILGenerator, because things like FieldExpr need to be able to call
24740 their children expression to generate the instance code.
24742 (Expression::Error, Expression::Warning): Sugar functions for
24745 (Expression::MemberLookup): Accept a TypeContainer instead of a
24746 Report as the first argument.
24748 (Expression::ResolvePrimary): Killed. I still want to improve
24749 this as currently the code is just not right.
24751 (Expression::ResolveMemberAccess): Simplify, but it is still
24754 (Unary::Resolve): Catch errors in AddressOf operators.
24756 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24757 index to a byte for the short-version, or the compiler will choose
24758 the wrong Emit call, which generates the wrong data.
24760 (ParameterReference::Emit, ::Store): same.
24762 (FieldExpr::AddressOf): Implement.
24764 * typemanager.cs: TypeManager: made public variable instead of
24767 * driver.cs: document --fatal.
24769 * report.cs (ErrorMessage, WarningMessage): new names for the old
24770 Error and Warning classes.
24772 * cs-parser.jay (member_access): Turn built-in access to types
24773 into a normal simplename
24775 2001-09-27 Ravi Pratap <ravi@ximian.com>
24777 * expression.cs (Invocation::BetterConversion): Fix to cope
24778 with q being null, since this was introducing a bug.
24780 * expression.cs (ConvertImplicit): Do built-in conversions first.
24782 2001-09-27 Ravi Pratap <ravi@ximian.com>
24784 * expression.cs (UserImplicitCast::Resolve): Fix bug.
24786 2001-09-27 Ravi Pratap <ravi@ximian.com>
24788 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24789 I had introduced long ago (what's new ?).
24791 * expression.cs (UserImplicitCast::CanConvert): Static method to do
24792 the work of all the checking.
24793 (ConvertImplicit): Call CanConvert and only then create object if necessary.
24794 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24796 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24797 that is the right way.
24799 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
24800 overloading resolution. Use everywhere instead of cutting and pasting code.
24802 (Binary::ResolveOperator): Use MakeUnionSet.
24804 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
24805 we have to convert to bool types. Not complete yet.
24807 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24809 * typemanager.cs (TypeManager::CSharpName): support ushort.
24811 * expression.cs (Expression::TryImplicitIntConversion): Attempts
24812 to provide an expression that performsn an implicit constant int
24813 conversion (section 6.1.6).
24814 (Expression::ConvertImplicitRequired): Reworked to include
24815 implicit constant expression conversions.
24817 (Expression::ConvertNumericExplicit): Finished.
24819 (Invocation::Emit): If InstanceExpression is null, then it means
24820 that we perform a call on this.
24822 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24824 * expression.cs (Unary::Emit): Remove some dead code.
24825 (Probe): Implement Resolve and Emit for `is'.
24826 (Expression::ConvertImplicitRequired): Attempt to do constant
24827 expression conversions here. Maybe should be moved to
24828 ConvertImplicit, but I am not sure.
24829 (Expression::ImplicitLongConstantConversionPossible,
24830 Expression::ImplicitIntConstantConversionPossible): New functions
24831 that tell whether is it possible to apply an implicit constant
24832 expression conversion.
24834 (ConvertNumericExplicit): Started work on explicit numeric
24837 * cs-parser.jay: Update operator constants.
24839 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24840 (Parameters::GetSignature): Hook up VerifyArgs here.
24841 (Parameters::VerifyArgs): Verifies that no two arguments have the
24844 * class.cs (Operator): Update the operator names to reflect the
24845 ones that the spec expects (as we are just stringizing the
24848 * expression.cs (Unary::ResolveOperator): Fix bug: Use
24849 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24850 previous usage did only work for our methods.
24851 (Expression::ConvertImplicit): Handle decimal implicit numeric
24852 conversions as well.
24853 (Expression::InternalTypeConstructor): Used to invoke constructors
24854 on internal types for default promotions.
24856 (Unary::Emit): Implement special handling for the pre/post
24857 increment/decrement for overloaded operators, as they need to have
24858 the same semantics as the other operators.
24860 (Binary::ResolveOperator): ditto.
24861 (Invocation::ConversionExists): ditto.
24862 (UserImplicitCast::Resolve): ditto.
24864 2001-09-26 Ravi Pratap <ravi@ximian.com>
24866 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24867 operator, return after emitting body. Regression tests pass again !
24869 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24870 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24871 (Invocation::OverloadResolve): Ditto.
24872 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24874 * everywhere : update calls to the above methods accordingly.
24876 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24878 * assign.cs (Assign): Make it inherit from ExpressionStatement.
24880 * expression.cs (ExpressionStatement): New base class used for
24881 expressions that can appear in statements, so that we can provide
24882 an alternate path to generate expression that do not leave a value
24885 (Expression::Emit, and all the derivatives): We no longer return
24886 whether a value is left on the stack or not. Every expression
24887 after being emitted leaves a single value on the stack.
24889 * codegen.cs (EmitContext::EmitStatementExpression): Use the
24890 facilties of ExpressionStatement if possible.
24892 * cs-parser.jay: Update statement_expression.
24894 2001-09-25 Miguel de Icaza <miguel@ximian.com>
24896 * driver.cs: Change the wording of message
24898 2001-09-25 Ravi Pratap <ravi@ximian.com>
24900 * expression.cs (Binary::ResolveOperator): Had forgottten to set
24901 the type of the expression to the return type of the method if
24902 we have an overloaded operator match ! The regression tests pass again !
24903 (Unary::ResolveOperator): Ditto.
24905 * expression.cs (Invocation::ConversionExists): Correct the member lookup
24906 to find "op_Implicit", not "implicit" ;-)
24907 (UserImplicitCast): New class to take care of user-defined implicit conversions.
24908 (ConvertImplicit, ForceConversion): Take TypeContainer argument
24910 * everywhere : Correct calls to the above accordingly.
24912 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24913 (ConvertImplicit): Do user-defined conversion if it exists.
24915 2001-09-24 Miguel de Icaza <miguel@ximian.com>
24917 * assign.cs: track location.
24918 (Resolve): Use implicit conversions on assignment.
24920 * literal.cs: Oops. Not good, Emit of short access values should
24921 pass (Bytes) or the wrong argument will be selected.
24923 * expression.cs (Unary::Emit): Emit code for -expr.
24925 (Unary::ResolveOperator): Handle `Substract' for non-constants
24926 (substract from zero from the non-constants).
24927 Deal with Doubles as well.
24929 (Expression::ConvertImplicitRequired): New routine that reports an
24930 error if no implicit conversion exists.
24932 (Invocation::OverloadResolve): Store the converted implicit
24933 expressions if we make them
24935 2001-09-24 Ravi Pratap <ravi@ximian.com>
24937 * class.cs (ConstructorInitializer): Take a Location argument.
24938 (ConstructorBaseInitializer): Same here.
24939 (ConstructorThisInitializer): Same here.
24941 * cs-parser.jay : Update all calls accordingly.
24943 * expression.cs (Unary, Binary, New): Take location argument.
24944 Update accordingly everywhere.
24946 * cs-parser.jay : Update all calls to the above to take a location
24949 * class.cs : Ditto.
24951 2001-09-24 Ravi Pratap <ravi@ximian.com>
24953 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24954 (Invocation::BetterConversion): Same here
24955 (Invocation::ConversionExists): Ditto.
24957 (Invocation::ConversionExists): Implement.
24959 2001-09-22 Ravi Pratap <ravi@ximian.com>
24961 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24962 Also take an additional TypeContainer argument.
24964 * All over : Pass in TypeContainer as argument to OverloadResolve.
24966 * typemanager.cs (CSharpName): Update to check for the string type and return
24969 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24972 2001-09-21 Ravi Pratap <ravi@ximian.com>
24974 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24975 (Invocation::BetterFunction): Implement.
24976 (Invocation::BetterConversion): Implement.
24977 (Invocation::ConversionExists): Skeleton, no implementation yet.
24979 Okay, things work fine !
24981 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24983 * typemanager.cs: declare and load enum_type, delegate_type and
24986 * expression.cs (Expression::Emit): Now emit returns a value that
24987 tells whether a value is left on the stack or not. This strategy
24988 might be reveted tomorrow with a mechanism that would address
24989 multiple assignments.
24990 (Expression::report118): Utility routine to report mismatches on
24993 (Unary::Report23): Report impossible type/operator combination
24996 (Unary::IsIncrementableNumber): Whether the type can be
24997 incremented or decremented with add.
24998 (Unary::ResolveOperator): Also allow enumerations to be bitwise
25000 (Unary::ResolveOperator): Implement ++, !, ~,
25002 (Invocation::Emit): Deal with new Emit convetion.
25004 * All Expression derivatives: Updated their Emit method to return
25005 whether they leave values on the stack or not.
25007 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25008 stack for expressions that are statements.
25010 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25012 * expression.cs (LValue): New interface. Must be implemented by
25014 (LocalVariableReference, ParameterReference, FieldExpr): Implement
25017 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25018 interface for generating code, simplifies the code.
25020 2001-09-20 Ravi Pratap <ravi@ximian.com>
25022 * expression.cs (everywhere): Comment out return statements in ::Resolve
25023 methods to avoid the warnings.
25025 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25027 * driver.cs (parse): Report error 2001 if we can not open the
25030 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25033 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25036 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25037 otherwise nested blocks end up with the same index.
25039 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25041 * expression.cs: Instead of having FIXMEs in the Resolve
25042 functions, throw exceptions so it is obvious that we are facing a
25045 * cs-parser.jay (invocation_expression): Pass Location information.
25047 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25048 Use a basename for those routines because .NET does not like paths
25051 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25054 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25056 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25057 are loading the correct data types (throws an exception if not).
25058 (TypeManager::InitCoreTypes): Use CoreLookupType
25060 * expression.cs (Unary::ResolveOperator): return the child
25061 expression for expressions which are just +expr.
25062 (Unary::ResolveOperator): Return negative literals for -LITERAL
25063 expressions (otherwise they are Unary {Literal}).
25064 (Invocation::Badness): Take into account `Implicit constant
25065 expression conversions'.
25067 * literal.cs (LongLiteral): Implement long literal class.
25068 (IntLiteral): export the `Value' of the intliteral.
25070 2001-09-19 Ravi Pratap <ravi@ximian.com>
25072 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25074 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25075 instead of 'Operator'
25077 * expression.cs (Binary::ResolveOperator): Update accordingly.
25078 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25081 * cs-parser.jay (unary_expression): Update to use the new names.
25083 * gen-treedump.cs (GetUnary): Same here.
25085 * expression.cs (Unary::Resolve): Implement.
25086 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25087 operators are found instead of making noise ;-)
25088 (Unary::ResolveOperator): New method to do precisely the same thing which
25089 Binary::ResolveOperator does for Binary expressions.
25090 (Unary.method, .Arguments): Add.
25091 (Unary::OperName): Implement.
25092 (Unary::ForceConversion): Copy and Paste !
25094 * class.cs (Operator::Define): Fix a small bug for the case when we have
25097 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25098 for the inbuilt operators. Only overloading works for now ;-)
25100 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25102 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25103 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25105 * expression.cs (This::Emit): Implement.
25106 (This::Resolve): Implement.
25107 (TypeOf:Resolve): Implement.
25108 (Expression::ResolveSimpleName): Add an implicit this to instance
25110 (MemberAccess::Resolve): Deal with Parameters and Fields.
25111 Bind instance variable to Field expressions.
25112 (FieldExpr::Instance): New field used to track the expression that
25113 represents the object instance.
25114 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25116 (FieldExpr::Emit): Implement.
25118 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25119 the last instruction contains a return opcode to avoid generating
25120 the last `ret' instruction (this generates correct code, and it is
25121 nice to pass the peverify output).
25123 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25124 initializer for static and instance variables.
25125 (Constructor::Emit): Allow initializer to be null in the case of
25126 static constructors. Only emit initializer for instance
25129 (TypeContainer::FindMembers): Return a null array if there are no
25132 Also fix the code for the MemberTypes.Method branch, as it was not
25133 scanning that for operators (or tried to access null variables before).
25135 * assign.cs (Assign::Emit): Handle instance and static fields.
25139 * driver.cs: Stop compilation if there are parse errors.
25141 * cs-parser.jay (constructor_declaration): Provide default base
25142 initializer for non-static constructors.
25143 (constructor_declarator): Do not provide a default base
25144 initializers if none was specified.
25145 Catch the fact that constructors should not have parameters.
25147 * class.cs: Do not emit parent class initializers for static
25148 constructors, that should be flagged as an error.
25150 2001-09-18 Ravi Pratap <ravi@ximian.com>
25152 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25153 Move back code into TypeContainer::Populate.
25155 2001-09-18 Ravi Pratap <ravi@ximian.com>
25157 * class.cs (TypeContainer::AddConstructor): Fix the check to
25158 compare against Name, not Basename.
25159 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25161 * cs-parser.jay : Update accordingly.
25163 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25164 for methods, don't forget to look into the operators too.
25165 (RegisterMethodBuilder): Helper method to take care of this for
25166 methods, constructors and operators.
25167 (Operator::Define): Completely revamp.
25168 (Operator.OperatorMethod, MethodName): New fields.
25169 (TypeContainer::Populate): Move the registering of builders into
25170 RegisterMethodBuilder.
25171 (Operator::Emit): Re-write.
25173 * expression.cs (Binary::Emit): Comment out code path to emit method
25174 invocation stuff for the case when we have a user defined operator. I am
25175 just not able to get it right !
25177 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25179 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25182 (Expression::MemberLookup): Provide a version that allows to
25183 specify the MemberTypes and BindingFlags.
25185 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25186 so it was not fetching variable information from outer blocks.
25188 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25189 Beforefieldinit as it was buggy.
25191 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25192 that Ravi put here.
25194 * class.cs (Constructor::Emit): Only emit if block is not null.
25195 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25196 deal with this by semantically definining it as if the user had
25199 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25200 constructors as we now "emit" them at a higher level.
25202 (TypeContainer::DefineDefaultConstructor): Used to define the
25203 default constructors if none was provided.
25205 (ConstructorInitializer): Add methods Resolve and Emit.
25207 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25209 2001-09-17 Ravi Pratap <ravi@ximian.com>
25211 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25212 the default constructor builder with our hashtable for methodbuilders
25215 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25216 and argument_count is 0 in which case we have a match.
25217 (Binary::ResolveOperator): More null checking and miscellaneous coding
25220 2001-09-17 Ravi Pratap <ravi@ximian.com>
25222 * rootcontext.cs (IsNameSpace): Compare against null.
25224 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25226 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25227 and Unary::Operator.
25229 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25232 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25233 we have overloaded operators.
25234 (Binary::ResolveOperator): Implement the part which does the operator overload
25237 * class.cs (Operator::Emit): Implement.
25238 (TypeContainer::Emit): Emit the operators we have too.
25240 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25241 the case when we have a user-defined operator.
25243 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25245 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25247 2001-09-16 Ravi Pratap <ravi@ximian.com>
25249 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25250 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25251 (Constructor::Emit): Implement.
25252 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25253 if we have no work to do.
25254 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25257 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25258 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25260 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25263 2001-09-15 Ravi Pratap <ravi@ximian.com>
25265 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25267 (Tree::RecordNamespace): Method to do what the name says ;-)
25268 (Tree::Namespaces): Property to get at the namespaces hashtable.
25270 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25273 * rootcontext.cs (IsNamespace): Fixed it :-)
25275 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25277 * class.cs (TypeContainer::FindMembers): Add support for
25279 (MethodCore): New class that encapsulates both the shared aspects
25280 of a Constructor and a Method.
25281 (Method, Constructor): Factored pieces into MethodCore.
25283 * driver.cs: Added --fatal which makes errors throw exceptions.
25284 Load System assembly as well as part of the standard library.
25286 * report.cs: Allow throwing exceptions on errors for debugging.
25288 * modifiers.cs: Do not use `parent', instead use the real type
25289 container to evaluate permission settings.
25291 * class.cs: Put Ravi's patch back in. He is right, and we will
25292 have to cope with the
25294 2001-09-14 Ravi Pratap <ravi@ximian.com>
25296 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25297 FamORAssem, not FamANDAssem.
25299 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25301 * driver.cs: Added --parse option that only parses its input files
25304 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25305 incorrect. IsTopLevel is not used to tell whether an object is
25306 root_types or not (that can be achieved by testing this ==
25307 root_types). But to see if this is a top-level *class* (not
25308 necessarly our "toplevel" container).
25310 2001-09-14 Ravi Pratap <ravi@ximian.com>
25312 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25313 parent instead of a direct call to GetType.
25315 2001-09-14 Ravi Pratap <ravi@ximian.com>
25317 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25318 Modifiers.TypeAttr. This should just be a call to that method.
25320 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25321 object so that we can determine if we are top-level or not.
25323 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25326 * enum.cs (Enum::Define): Ditto.
25328 * modifiers.cs (FieldAttr): Re-write.
25330 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25331 (TypeContainer::HaveStaticConstructor): New property to provide access
25332 to precisely that info.
25334 * modifiers.cs (MethodAttr): Re-write.
25335 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25337 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25338 of top-level types as claimed.
25340 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25342 * expression.cs (MemberLookup): Fruitless attempt to lookup
25343 constructors. Maybe I need to emit default constructors? That
25344 might be it (currently .NET emits this for me automatically).
25345 (Invocation::OverloadResolve): Cope with Arguments == null.
25346 (Invocation::EmitArguments): new function, shared by the new
25347 constructor and us.
25348 (Invocation::Emit): Handle static and instance methods. Emit
25349 proper call instruction for virtual or non-virtual invocations.
25350 (New::Emit): Implement.
25351 (New::Resolve): Implement.
25352 (MemberAccess:Resolve): Implement.
25353 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25354 to track instances.
25355 (FieldExpr::Resolve): Set type.
25357 * support.cs: Handle empty arguments.
25359 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25360 SimpleLookup): Auxiliary routines to help parse a qualifier
25363 Update qualifier_identifier rule.
25365 * codegen.cs: Removed debugging messages.
25367 * class.cs: Make this a global thing, this acts just as a "key" to
25368 objects that we might have around.
25370 (Populate): Only initialize method_builders_to_methods once.
25372 * expression.cs (PropertyExpr): Initialize type from the
25375 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25376 Resolve pattern. Attempt to implicitly convert value to boolean.
25379 * expression.cs: Set the type for the int32/int32 argument case.
25380 (Binary::ResolveOperator): Set the return type to boolean for
25381 comparission operators
25383 * typemanager.cs: Remove debugging print code.
25385 (Invocation::Resolve): resolve type.
25387 * class.cs: Allocate a MemberInfo of the correct size, as the code
25388 elsewhere depends on the test to reflect the correct contents.
25390 (Method::) Keep track of parameters, due to System.Reflection holes
25392 (TypeContainer::Populate): Keep track of MethodBuilders to Method
25395 (TypeContainer::FindMembers): Use ArrayList and then copy an array
25396 of the exact size and return that.
25398 (Class::LookupMethodByBuilder): New function that maps
25399 MethodBuilders to its methods. Required to locate the information
25400 on methods because System.Reflection bit us again.
25402 * support.cs: New file, contains an interface ParameterData and
25403 two implementations: ReflectionParameters and InternalParameters
25404 used to access Parameter information. We will need to grow this
25407 * expression.cs (Invocation::GetParameterData): implement a cache
25408 and a wrapper around the ParameterData creation for methods.
25409 (Invocation::OverloadResolve): Use new code.
25411 2001-09-13 Ravi Pratap <ravi@ximian.com>
25413 * class.cs (TypeContainer::EmitField): Remove and move into
25414 (Field::Define): here and modify accordingly.
25415 (Field.FieldBuilder): New member.
25416 (TypeContainer::Populate): Update accordingly.
25417 (TypeContainer::FindMembers): Implement.
25419 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25421 * statement.cs: (VariableInfo::VariableType): New field to be
25422 initialized with the full type once it is resolved.
25424 2001-09-12 Miguel de Icaza <miguel@ximian.com>
25426 * parameter.cs (GetParameterInfo): Use a type cache to compute
25427 things only once, and to reuse this information
25429 * expression.cs (LocalVariableReference::Emit): Implement.
25430 (OpcodeCast::Emit): fix.
25432 (ParameterReference::Resolve): Implement.
25433 (ParameterReference::Emit): Implement.
25435 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25436 that are expressions need to stay as Expressions.
25438 * typemanager.cs (CSharpName): Returns the C# name of a type if
25441 * expression.cs (Expression::ConvertImplicit): New function that
25442 implements implicit type conversions.
25444 (Expression::ImplicitReferenceConversion): Implements implicit
25445 reference conversions.
25447 (EmptyCast): New type for transparent casts.
25449 (OpcodeCast): New type for casts of types that are performed with
25450 a sequence of bytecodes.
25452 (BoxedCast): New type used for casting value types into reference
25453 types. Emits a box opcode.
25455 (Binary::DoNumericPromotions): Implements numeric promotions of
25456 and computation of the Binary::Type.
25458 (Binary::EmitBranchable): Optimization.
25460 (Binary::Emit): Implement code emission for expressions.
25462 * typemanager.cs (TypeManager): Added two new core types: sbyte
25465 2001-09-12 Ravi Pratap <ravi@ximian.com>
25467 * class.cs (TypeContainer::FindMembers): Method which does exactly
25468 what Type.FindMembers does, only we don't have to use reflection. No
25469 implementation yet.
25471 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25472 typecontainer objects as we need to get at them.
25473 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25475 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25476 typecontainer object.
25478 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25479 of just a Report object.
25481 2001-09-11 Ravi Pratap <ravi@ximian.com>
25483 * class.cs (Event::Define): Go back to using the prefixes "add_" and
25485 (TypeContainer::Populate): Now define the delegates of the type too.
25486 (TypeContainer.Delegates): Property to access the list of delegates defined
25489 * delegates.cs (Delegate::Define): Implement partially.
25491 * modifiers.cs (TypeAttr): Handle more flags.
25493 2001-09-11 Ravi Pratap <ravi@ximian.com>
25495 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25497 (Operator::Define): Re-write logic to get types by using the LookupType method
25498 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25499 (Indexer::Define): Ditto.
25500 (Event::Define): Ditto.
25501 (Property::Define): Ditto.
25503 2001-09-10 Ravi Pratap <ravi@ximian.com>
25505 * class.cs (TypeContainer::Populate): Now define operators too.
25506 (TypeContainer.Operators): New property to access the list of operators
25508 (Operator.OperatorMethodBuilder): New member to hold the method builder
25509 for the operator we are defining.
25510 (Operator::Define): Implement.
25512 2001-09-10 Ravi Pratap <ravi@ximian.com>
25514 * class.cs (Event::Define): Make the prefixes of the accessor methods
25515 addOn_ and removeOn_
25517 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25518 of the location being passed in too. Ideally, this should go later since all
25519 error reporting should be done through the Report object.
25521 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25522 (Populate): Iterate thru the indexers we have and define them too.
25523 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25524 for the get and set accessors.
25525 (Indexer::Define): Implement.
25527 2001-09-09 Miguel de Icaza <miguel@ximian.com>
25529 * expression.cs (Binary::Resolve): Beginning of it. I scratched
25530 my previous implementation, did not work.
25532 * typemanager.cs: Add a couple of missing types (the longs).
25534 * literal.cs: Use TypeManager.bool_type instead of getting it.
25536 * expression.cs (EventExpr): New kind of expressions.
25537 (Expressio::ExprClassFromMemberInfo): finish
25539 2001-09-08 Miguel de Icaza <miguel@ximian.com>
25541 * assign.cs: Emit stores to static fields differently.
25543 2001-09-08 Ravi Pratap <ravi@ximian.com>
25545 * Merge in changes and adjust code to tackle conflicts. Backed out my
25546 code in Assign::Resolve ;-)
25548 2001-09-08 Ravi Pratap <ravi@ximian.com>
25550 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25551 instead Report.Error and also pass in the location.
25552 (CSharpParser::Lexer): New readonly property to return the reference
25553 to the Tokenizer object.
25554 (declare_local_variables): Use Report.Error with location instead of plain
25558 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25559 (Operator.CheckBinaryOperator): Ditto.
25561 * cs-parser.jay (operator_declarator): Update accordingly.
25563 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25564 (CheckBinaryOperator): Same here.
25566 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25567 on the name without any prefixes of namespace names etc. This is because we
25568 already might have something already fully qualified like
25569 'System.Console.WriteLine'
25571 * assign.cs (Resolve): Begin implementation. Stuck ;-)
25573 2001-09-07 Ravi Pratap <ravi@ximian.com>
25575 * cs-tokenizer.cs (location): Return a string which also contains
25578 * expression.cs (ElementAccess): New class for expressions of the
25579 type 'element access.'
25580 (BaseAccess): New class for expressions of the type 'base access.'
25581 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25584 * cs-parser.jay (element_access): Implement action.
25585 (base_access): Implement actions.
25586 (checked_expression, unchecked_expression): Implement.
25588 * cs-parser.jay (local_variable_type): Correct and implement.
25589 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25591 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25593 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25594 name and the specifiers.
25596 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25598 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
25599 making them all public ;-)
25601 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25604 2001-09-07 Miguel de Icaza <miguel@ximian.com>
25606 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25608 (FieldExpr, PropertyExprs): New resolved expressions.
25609 (SimpleName::MemberStaticCheck): Perform static checks for access
25610 to non-static fields on static methods. Maybe this should be
25611 generalized for MemberAccesses.
25612 (SimpleName::ResolveSimpleName): More work on simple name
25615 * cs-parser.jay (primary_expression/qualified_identifier): track
25616 the parameter index.
25618 * codegen.cs (CodeGen::Save): Catch save exception, report error.
25619 (EmitContext::EmitBoolExpression): Chain to expression generation
25620 instead of temporary hack.
25621 (::EmitStatementExpression): Put generic expression code generation.
25623 * assign.cs (Assign::Emit): Implement variable assignments to
25624 local variables, parameters and fields.
25626 2001-09-06 Miguel de Icaza <miguel@ximian.com>
25628 * statement.cs (Block::GetVariableInfo): New method, returns the
25629 VariableInfo for a variable name in a block.
25630 (Block::GetVariableType): Implement in terms of GetVariableInfo
25632 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25633 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25635 2001-09-06 Ravi Pratap <ravi@ximian.com>
25637 * cs-parser.jay (operator_declaration): Continue on my quest : update
25638 to take attributes argument.
25639 (event_declaration): Ditto.
25640 (enum_declaration): Ditto.
25641 (indexer_declaration): Ditto.
25643 * class.cs (Operator::Operator): Update constructor accordingly.
25644 (Event::Event): Ditto.
25646 * delegate.cs (Delegate::Delegate): Same here.
25648 * enum.cs (Enum::Enum): Same here.
25650 2001-09-05 Ravi Pratap <ravi@ximian.com>
25652 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25654 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25656 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25657 being passed around as an arraylist.
25658 (Attributes::AddAttribute): Method to add attribute sections.
25660 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25661 (struct_declaration): Update accordingly.
25662 (constant_declaration): Update.
25663 (field_declaration): Update.
25664 (method_header): Update.
25665 (fixed_parameter): Update.
25666 (parameter_array): Ditto.
25667 (property_declaration): Ditto.
25668 (destructor_declaration): Ditto.
25670 * class.cs (Struct::Struct): Update constructors accordingly.
25671 (Class::Class): Ditto.
25672 (Field::Field): Ditto.
25673 (Method::Method): Ditto.
25674 (Property::Property): Ditto.
25675 (TypeContainer::OptAttribute): update property's return type.
25677 * interface.cs (Interface.opt_attributes): New member.
25678 (Interface::Interface): Update to take the extra Attributes argument.
25680 * parameter.cs (Parameter::Parameter): Ditto.
25682 * constant.cs (Constant::Constant): Ditto.
25684 * interface.cs (InterfaceMemberBase): New OptAttributes field.
25685 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
25686 the attributes as a parameter.
25687 (InterfaceProperty): Update constructor call.
25688 (InterfaceEvent): Ditto.
25689 (InterfaceMethod): Ditto.
25690 (InterfaceIndexer): Ditto.
25692 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
25693 pass the attributes too.
25694 (interface_event_declaration): Ditto.
25695 (interface_property_declaration): Ditto.
25696 (interface_method_declaration): Ditto.
25697 (interface_declaration): Ditto.
25699 2001-09-05 Miguel de Icaza <miguel@ximian.com>
25701 * class.cs (Method::Define): Track the "static Main" definition to
25702 create an entry point.
25704 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25705 EntryPoint if we find it.
25707 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25708 (EmitContext::ig): Make this variable public.
25710 * driver.cs: Make the default output file be the first file name
25711 with the .exe extension.
25713 Detect empty compilations
25715 Handle various kinds of output targets. Handle --target and
25716 rename -t to --dumper.
25718 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25719 methods inherited from Expression return now an Expression. This
25720 will is used during the tree rewriting as we resolve them during
25723 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25724 the spec. Missing entirely is the information about
25725 accessability of elements of it.
25727 (Expression::ExprClassFromMemberInfo): New constructor for
25728 Expressions that creates a fully initialized Expression based on
25729 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25732 (Invocation::Resolve): Begin implementing resolution of invocations.
25734 * literal.cs (StringLiteral): Implement Emit.
25736 2001-09-05 Ravi Pratap <ravi@ximian.com>
25738 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25741 2001-09-04 Ravi Pratap <ravi@ximian.com>
25743 * cs-parser.jay (attribute_arguments): Implement actions.
25744 (attribute): Fix bug in production. Implement action.
25745 (attribute_list): Implement.
25746 (attribute_target): Implement.
25747 (attribute_target_specifier, opt_target_specifier): Implement
25748 (CheckAttributeTarget): New method to check if the attribute target
25750 (attribute_section): Implement.
25751 (opt_attributes): Implement.
25753 * attribute.cs : New file to handle attributes.
25754 (Attribute): Class to hold attribute info.
25756 * cs-parser.jay (opt_attribute_target_specifier): Remove production
25757 (attribute_section): Modify production to use 2 different rules to
25758 achieve the same thing. 1 s/r conflict down !
25759 Clean out commented, useless, non-reducing dimension_separator rules.
25761 * class.cs (TypeContainer.attributes): New member to hold list
25762 of attributes for a type.
25763 (Struct::Struct): Modify to take one more argument, the attribute list.
25764 (Class::Class): Ditto.
25765 (Field::Field): Ditto.
25766 (Method::Method): Ditto.
25767 (Property::Property): Ditto.
25769 * cs-parser.jay (struct_declaration): Update constructor call to
25770 pass in the attributes too.
25771 (class_declaration): Ditto.
25772 (constant_declaration): Ditto.
25773 (field_declaration): Ditto.
25774 (method_header): Ditto.
25775 (fixed_parameter): Ditto.
25776 (parameter_array): Ditto.
25777 (property_declaration): Ditto.
25779 * constant.cs (Constant::Constant): Update constructor similarly.
25780 Use System.Collections.
25782 * parameter.cs (Parameter::Parameter): Update as above.
25784 2001-09-02 Ravi Pratap <ravi@ximian.com>
25786 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25787 (TypeContainer.delegates): New member to hold list of delegates.
25789 * cs-parser.jay (delegate_declaration): Implement the action correctly
25790 this time as I seem to be on crack ;-)
25792 2001-09-02 Miguel de Icaza <miguel@ximian.com>
25794 * rootcontext.cs (RootContext::IsNamespace): new function, used to
25795 tell whether an identifier represents a namespace.
25797 * expression.cs (NamespaceExpr): A namespace expression, used only
25798 temporarly during expression resolution.
25799 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25800 utility functions to resolve names on expressions.
25802 2001-09-01 Miguel de Icaza <miguel@ximian.com>
25804 * codegen.cs: Add hook for StatementExpressions.
25806 * class.cs: Fix inverted test for static flag in methods.
25808 2001-09-02 Ravi Pratap <ravi@ximian.com>
25810 * class.cs (Operator::CheckUnaryOperator): Correct error number used
25811 to make it coincide with MS' number.
25812 (Operator::CheckBinaryOperator): Ditto.
25814 * ../errors/errors.txt : Remove error numbers added earlier.
25816 * ../errors/cs1019.cs : Test case for error # 1019
25818 * ../errros/cs1020.cs : Test case for error # 1020
25820 * cs-parser.jay : Clean out commented cruft.
25821 (dimension_separators, dimension_separator): Comment out. Ostensibly not
25822 used anywhere - non-reducing rule.
25823 (namespace_declarations): Non-reducing rule - comment out.
25825 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25826 with TypeContainer::AddEnum.
25828 * delegate.cs : New file for delegate handling classes.
25829 (Delegate): Class for declaring delegates.
25831 * makefile : Update.
25833 * cs-parser.jay (delegate_declaration): Implement.
25835 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
25837 * class.cs (Event::Define): Implement.
25838 (Event.EventBuilder): New member.
25840 * class.cs (TypeContainer::Populate): Update to define all enums and events
25842 (Events): New property for the events arraylist we hold. Shouldn't we move to using
25843 readonly fields for all these cases ?
25845 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25847 * class.cs (Property): Revamp to use the convention of making fields readonly.
25848 Accordingly modify code elsewhere.
25850 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25851 the Define method of the Property class.
25853 * class.cs : Clean up applied patch and update references to variables etc. Fix
25855 (TypeContainer::Populate): Update to define all the properties we have. Also
25856 define all enumerations.
25858 * enum.cs (Define): Implement.
25860 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25862 * cs-parser.jay (overloadable_operator): The semantic value is an
25863 enum of the Operator class.
25864 (operator_declarator): Implement actions.
25865 (operator_declaration): Implement.
25867 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25868 validity of definitions.
25869 (Operator::CheckBinaryOperator): Static method to check for binary operators
25870 (TypeContainer::AddOperator): New method to add an operator to a type.
25872 * cs-parser.jay (indexer_declaration): Added line to actually call the
25873 AddIndexer method so it gets added ;-)
25875 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
25876 already taken care of by the MS compiler ?
25878 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25880 * class.cs (Operator): New class for operator declarations.
25881 (Operator::OpType): Enum for the various operators.
25883 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25885 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25886 ostensibly handle this in semantic analysis.
25888 * cs-parser.jay (general_catch_clause): Comment out
25889 (specific_catch_clauses, specific_catch_clause): Ditto.
25890 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25891 (catch_args, opt_catch_args): New productions.
25892 (catch_clause): Rewrite to use the new productions above
25893 (catch_clauses): Modify accordingly.
25894 (opt_catch_clauses): New production to use in try_statement
25895 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25896 and re-write the code in the actions to extract the specific and
25897 general catch clauses by being a little smart ;-)
25899 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25900 Hooray, try and catch statements parse fine !
25902 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25904 * statement.cs (Block::GetVariableType): Fix logic to extract the type
25905 string from the hashtable of variables.
25907 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25908 I end up making that mistake ;-)
25909 (catch_clauses): Fixed gross error which made Key and Value of the
25910 DictionaryEntry the same : $1 !!
25912 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25914 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25916 * cs-parser.jay (event_declaration): Correct to remove the semicolon
25917 when the add and remove accessors are specified.
25919 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25921 * cs-parser.jay (IndexerDeclaration): New helper class to hold
25922 information about indexer_declarator.
25923 (indexer_declarator): Implement actions.
25924 (parsing_indexer): New local boolean used to keep track of whether
25925 we are parsing indexers or properties. This is necessary because
25926 implicit_parameters come into picture even for the get accessor in the
25927 case of an indexer.
25928 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25930 * class.cs (Indexer): New class for indexer declarations.
25931 (TypeContainer::AddIndexer): New method to add an indexer to a type.
25932 (TypeContainer::indexers): New member to hold list of indexers for the
25935 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25937 * cs-parser.jay (add_accessor_declaration): Implement action.
25938 (remove_accessor_declaration): Implement action.
25939 (event_accessors_declaration): Implement
25940 (variable_declarators): swap statements for first rule - trivial.
25942 * class.cs (Event): New class to hold information about event
25944 (TypeContainer::AddEvent): New method to add an event to a type
25945 (TypeContainer::events): New member to hold list of events.
25947 * cs-parser.jay (event_declaration): Implement actions.
25949 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25951 * cs-parser.jay (dim_separators): Implement. Make it a string
25952 concatenating all the commas together, just as they appear.
25953 (opt_dim_separators): Modify accordingly
25954 (rank_specifiers): Update accordingly. Basically do the same
25955 thing - instead, collect the brackets here.
25956 (opt_rank_sepcifiers): Modify accordingly.
25957 (array_type): Modify to actually return the complete type string
25958 instead of ignoring the rank_specifiers.
25959 (expression_list): Implement to collect the expressions
25960 (variable_initializer): Implement. We make it a list of expressions
25961 essentially so that we can handle the array_initializer case neatly too.
25962 (variable_initializer_list): Implement.
25963 (array_initializer): Make it a list of variable_initializers
25964 (opt_array_initializer): Modify accordingly.
25966 * expression.cs (New::NType): Add enumeration to help us
25967 keep track of whether we have an object/delegate creation
25968 or an array creation.
25969 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25970 members to hold data about array creation.
25971 (New:New): Modify to update NewType
25972 (New:New): New Overloaded contructor for the array creation
25975 * cs-parser.jay (array_creation_expression): Implement to call
25976 the overloaded New constructor.
25978 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25980 * class.cs (TypeContainer::Constructors): Return member
25981 constructors instead of returning null.
25983 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25985 * typemanager.cs (InitCoreTypes): Initialize the various core
25986 types after we have populated the type manager with the user
25987 defined types (this distinction will be important later while
25988 compiling corlib.dll)
25990 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25991 on Expression Classification. Now all expressions have a method
25992 `Resolve' and a method `Emit'.
25994 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25995 generation from working. Also add some temporary debugging
25998 2001-08-24 Miguel de Icaza <miguel@ximian.com>
26000 * codegen.cs: Lots of code generation pieces. This is only the
26001 beginning, will continue tomorrow with more touches of polish. We
26002 handle the fundamentals of if, while, do, for, return. Others are
26003 trickier and I need to start working on invocations soon.
26005 * gen-treedump.cs: Bug fix, use s.Increment here instead of
26008 * codegen.cs (EmitContext): New struct, used during code
26009 emission to keep a context. Most of the code generation will be
26012 * cs-parser.jay: Add embedded blocks to the list of statements of
26013 this block. So code generation proceeds in a top down fashion.
26015 2001-08-23 Miguel de Icaza <miguel@ximian.com>
26017 * statement.cs: Add support for multiple child blocks.
26019 2001-08-22 Miguel de Icaza <miguel@ximian.com>
26021 * codegen.cs (EmitCode): New function, will emit the code for a
26022 Block of code given a TypeContainer and its ILGenerator.
26024 * statement.cs (Block): Standard public readonly optimization.
26025 (Block::Block constructors): Link children.
26026 (Block::Child): Child Linker.
26027 (Block::EmitVariables): Emits IL variable declarations.
26029 * class.cs: Drop support for MethodGroups here, delay until
26031 (Method::): Applied the same simplification that I did before, and
26032 move from Properties to public readonly fields.
26033 (Method::ParameterTypes): Returns the parameter types for the
26034 function, and implements a cache that will be useful later when I
26035 do error checking and the semantic analysis on the methods is
26037 (Constructor::GetCallingConvention): Renamed from CallingConvetion
26038 and made a method, optional argument tells whether this is a class
26039 or a structure to apply the `has-this' bit.
26040 (Method::GetCallingConvention): Implement, returns the calling
26042 (Method::Define): Defines the type, a second pass is performed
26043 later to populate the methods.
26045 (Constructor::ParameterTypes): implement a cache similar to the
26046 one on Method::ParameterTypes, useful later when we do semantic
26049 (TypeContainer::EmitMethod): New method. Emits methods.
26051 * expression.cs: Removed MethodGroup class from here.
26053 * parameter.cs (Parameters::GetCallingConvention): new method.
26055 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26057 * class.cs (TypeContainer::Populate): Drop RootContext from the
26060 (Constructor::CallingConvention): Returns the calling convention.
26061 (Constructor::ParameterTypes): Returns the constructor parameter
26064 (TypeContainer::AddConstructor): Keep track of default constructor
26065 and the default static constructor.
26067 (Constructor::) Another class that starts using `public readonly'
26068 instead of properties.
26070 (Constructor::IsDefault): Whether this is a default constructor.
26072 (Field::) use readonly public fields instead of properties also.
26074 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26075 track of static constructors; If none is used, turn on
26076 BeforeFieldInit in the TypeAttributes.
26078 * cs-parser.jay (opt_argument_list): now the return can be null
26079 for the cases where there are no arguments.
26081 (constructor_declarator): If there is no implicit `base' or
26082 `this', then invoke the default parent constructor.
26084 * modifiers.cs (MethodAttr): New static function maps a set of
26085 modifiers flags into a MethodAttributes enum
26086 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26087 MethodAttr, TypeAttr to represent the various mappings where the
26088 modifiers are used.
26089 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26091 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26093 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26096 * interface.cs (PopulateIndexer): Implemented the code generator
26097 for interface indexers.
26099 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26101 * interface.cs (InterfaceMemberBase): Now we track the new status
26104 (PopulateProperty): Implement property population. Woohoo! Got
26105 Methods and Properties going today.
26107 Removed all the properties for interfaces, and replaced them with
26108 `public readonly' fields.
26110 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26112 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26113 initialize their hashtables/arraylists only when they are needed
26114 instead of doing this always.
26116 * parameter.cs: Handle refs and out parameters.
26118 * cs-parser.jay: Use an ArrayList to construct the arguments
26119 instead of the ParameterCollection, and then cast that to a
26122 * parameter.cs: Drop the use of ParameterCollection and use
26123 instead arrays of Parameters.
26125 (GetParameterInfo): Use the Type, not the Name when resolving
26128 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26130 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26131 and instead use public readonly fields.
26133 * class.cs: Put back walking code for type containers.
26135 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26137 * class.cs (MakeConstant): Code to define constants.
26139 * rootcontext.cs (LookupType): New function. Used to locate types
26142 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26144 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26145 this System.Reflection code is. Kudos to Microsoft
26147 * typemanager.cs: Implement a type cache and avoid loading all
26148 types at boot time. Wrap in LookupType the internals. This made
26149 the compiler so much faster. Wow. I rule!
26151 * driver.cs: Make sure we always load mscorlib first (for
26152 debugging purposes, nothing really important).
26154 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26155 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26157 * rootcontext.cs: Lookup types on their namespace; Lookup types
26158 on namespaces that have been imported using the `using' keyword.
26160 * class.cs (TypeContainer::TypeAttr): Virtualize.
26161 (Class::TypeAttr): Return attributes suitable for this bad boy.
26162 (Struct::TypeAttr): ditto.
26163 Handle nested classes.
26164 (TypeContainer::) Remove all the type visiting code, it is now
26165 replaced with the rootcontext.cs code
26167 * rootcontext.cs (GetClassBases): Added support for structs.
26169 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26171 * interface.cs, statement.cs, class.cs, parameter.cs,
26172 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26173 Drop use of TypeRefs, and use strings instead.
26175 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26179 * class.cs (Struct::Struct): set the SEALED flags after
26180 checking the modifiers.
26181 (TypeContainer::TypeAttr): new property, returns the
26182 TypeAttributes for a class.
26184 * cs-parser.jay (type_list): Oops, list production was creating a
26185 new list of base types.
26187 * rootcontext.cs (StdLib): New property.
26188 (GetInterfaceTypeByName): returns an interface by type name, and
26189 encapsulates error handling here.
26190 (GetInterfaces): simplified.
26191 (ResolveTree): Encapsulated all the tree resolution here.
26192 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26195 * driver.cs: Add support for --nostdlib, to avoid loading the
26196 default assemblies.
26197 (Main): Do not put tree resolution here.
26199 * rootcontext.cs: Beginning of the class resolution.
26201 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26203 * rootcontext.cs: Provide better error reporting.
26205 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26207 * rootcontext.cs (CreateInterface): Handle the case where there
26208 are no parent interfaces.
26210 (CloseTypes): Routine to flush types at the end.
26211 (CreateInterface): Track types.
26212 (GetInterfaces): Returns an array of Types from the list of
26213 defined interfaces.
26215 * typemanager.c (AddUserType): Mechanism to track user types (puts
26216 the type on the global type hash, and allows us to close it at the
26219 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26221 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26222 RecordInterface instead.
26224 * cs-parser.jay: Updated to reflect changes above.
26226 * decl.cs (Definition): Keep track of the TypeBuilder type that
26227 represents this type here. Not sure we will use it in the long
26228 run, but wont hurt for now.
26230 * driver.cs: Smaller changes to accomodate the new code.
26232 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26235 * rootcontext.cs (CreateInterface): New method, used to create
26236 the System.TypeBuilder type for interfaces.
26237 (ResolveInterfaces): new entry point to resolve the interface
26239 (CodeGen): Property, used to keep track of the code generator.
26241 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26243 * cs-parser.jay: Add a second production for delegate_declaration
26246 (enum_body): Put an opt_comma here instead of putting it on
26247 enum_body or enum_member_declarations so we can handle trailing
26248 commas on enumeration members. Gets rid of a shift/reduce.
26250 (type_list): Need a COMMA in the middle.
26252 (indexer_declaration): Tell tokenizer to recognize get/set
26254 * Remove old targets.
26256 * Re-add the parser target.
26258 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26260 * cs-parser.jay: Add precendence rules for a number of operators
26261 ot reduce the number of shift/reduce conflicts in the grammar.
26263 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26265 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26268 Get rid of old crufty code.
26270 * rootcontext.cs: Use this to keep track of the parsed
26271 representation and the defined types available to the program.
26273 * gen-treedump.cs: adjust for new convention.
26275 * type.cs: Split out the type manager, and the assembly builder
26278 * typemanager.cs: the type manager will live here now.
26280 * cil-codegen.cs: And the code generator here.
26282 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
26284 * makefile: Fixed up for easy making.
26286 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26288 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26291 (unary_expression): Expand pre_increment_expression and
26292 post_decrement_expression to reduce a shift/reduce.
26294 2001-07-11 Simon Cozens
26296 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26298 Improve allow_keyword_as_indent name.
26300 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26302 * Adjustments for Beta2.
26304 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26306 * decl.cs: Added `Define' abstract method.
26307 (InTransit): new property, used to catch recursive definitions.
26309 * interface.cs: Implement `Define'.
26311 * modifiers.cs: Map Modifiers.constants to
26312 System.Reflection.TypeAttribute flags.
26314 * class.cs: Keep track of types and user-defined types.
26315 (BuilderInit): New method for creating an assembly
26316 (ResolveType): New function to launch the resolution process, only
26317 used by interfaces for now.
26319 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26320 that are inserted into the name space.
26322 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26324 * ARGH. I have screwed up my tree so many times due to the use of
26325 rsync rather than using CVS. Going to fix this at once.
26327 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26330 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26332 * Experiment successful: Use System.Type rather that our own
26335 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26337 * cs-parser.jay: Removed nsAliases from here.
26339 Use new namespaces, handle `using XXX;'
26341 * namespace.cs: Reimplemented namespace handling, use a recursive
26342 definition of the class. Now we can keep track of using clauses
26343 and catch invalid using clauses.
26345 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26347 * gen-treedump.cs: Adapted for all the renaming.
26349 * expression.cs (Expression): this class now has a Type property
26350 which returns an expression Type.
26352 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26353 `Type', as this has a different meaning now in the base
26355 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26357 * interface.cs, class.cs: Removed from all the sources the
26358 references to signature computation, as we can not do method
26359 signature computation during the parsing time, as we are not
26360 trying to solve at that point distinguishing:
26364 void a (NS.Blah x) {}
26367 Which depending on the context might be valid or not, as we do not
26368 know if Blah is the same thing as NS.Blah at that point.
26370 * Redid everything so the code uses TypeRefs now instead of
26371 Types. TypeRefs are just temporary type placeholders, that need
26372 to be resolved. They initially have a pointer to a string and the
26373 current scope in which they are used. This is used later by the
26374 compiler to resolve the reference to an actual Type.
26376 * DeclSpace is no longer a CIR.Type, and neither are
26377 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26378 are all DeclSpaces, but no Types.
26380 * type.cs (TypeRefManager): This implements the TypeRef manager,
26381 which keeps track of all the types that need to be resolved after
26382 the parsing has finished.
26384 2001-05-13 Miguel de Icaza <miguel@ximian.com>
26386 * ARGH. We are going to have to store `foreach' as a class rather
26387 than resolving it, as we need to verify error 1579 after name
26388 resolution. *OR* we could keep a flag that says `This request to
26389 IEnumerator comes from a foreach statement' which we can then use
26390 to generate the error.
26392 2001-05-10 Miguel de Icaza <miguel@ximian.com>
26394 * class.cs (TypeContainer.AddMethod): we now add methods to the
26395 MethodGroup instead of the method hashtable.
26397 * expression.cs: Add MethodGroup abstraction, which gets us one
26398 step closer to the specification in the way we handle method
26401 * cs-parser.jay (primary_expression): qualified_identifier now
26402 tried to match up an identifier to a local variable reference or
26403 to a parameter reference.
26405 current_local_parameters is now a parser global variable that
26406 points to the current parameters for the block, used during name
26409 (property_declaration): Now creates an implicit `value' argument to
26412 2001-05-09 Miguel de Icaza <miguel@ximian.com>
26414 * parameter.cs: Do not use `param' arguments as part of the
26415 signature, per the spec.
26417 2001-05-08 Miguel de Icaza <miguel@ximian.com>
26419 * decl.cs: Base class for classes, structs and interfaces. This
26420 is the "Declaration Space"
26422 * cs-parser.jay: Use CheckDef for checking declaration errors
26423 instead of having one on each function.
26425 * class.cs: Factor out some code for handling error handling in
26426 accordance to the "Declarations" section in the "Basic Concepts"
26427 chapter in the ECMA C# spec.
26429 * interface.cs: Make all interface member classes derive from
26430 InterfaceMemberBase.
26432 2001-05-07 Miguel de Icaza <miguel@ximian.com>
26434 * Many things: all interfaces are parsed and generated in
26435 gen-treedump. Support for member variables, constructors,
26436 destructors, properties, constants is there.
26438 Beginning of the IL backend, but very little done, just there for
26441 2001-04-29 Miguel de Icaza <miguel@ximian.com>
26443 * cs-parser.jay: Fix labeled statement.
26445 * cs-tokenizer.cs (escape): Escape " and ' always.
26446 ref_line, ref_name: keep track of the line/filename as instructed
26447 by #line by the compiler.
26450 2001-04-27 Miguel de Icaza <miguel@ximian.com>
26452 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26453 to match the values in System.CodeDOM.
26455 Divid renamed to Divide.
26457 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26459 (Statements.set): remove.
26461 * System.CodeDOM/CodeCatchClause.cs: always have a valid
26464 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26465 falseStatements always have valid values.
26467 * cs-parser.jay: Use System.CodeDOM now.