1 2006-08-17 Miguel de Icaza <miguel@novell.com>
3 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4 #52019 and #79064, the use of the \uXXXX sequence in source code
5 to represent unicode characters.
7 2006-08-15 Marek Safar <marek.safar@seznam.cz>
9 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
11 * class.cs, ecore.cs, statement.cs: Merged to one error message.
13 2006-08-13 Miguel de Icaza <miguel@novell.com>
15 * assign.cs: Catch attempts to assign to a method groups in += and
18 2006-08-13 Marek Safar <marek.safar@seznam.cz>
21 * cs-parser.jay: Don't destroy current array type by typeof of array's.
23 2006-08-12 Marek Safar <marek.safar@seznam.cz>
25 * class.cs (Method.Define): Issue a warning when generic method looks like
27 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
30 2006-08-09 Marek Safar <marek.safar@seznam.cz>
32 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
34 * decl.cs (MemberCache.FindMembers): When container is interface we need to
35 search all base interfaces as a member can be ambiguous.
36 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
37 Constructor member type filter.
38 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
39 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
40 reporting for returned memberinfos.
42 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
43 version to work on all runtimes.
44 (TypeManager.RealMemberLookup): Removed members filtering.
46 2006-08-08 Raja R Harinath <rharinath@novell.com>
48 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
49 (PropertyExpr.EmitAssign): Likewise.
50 * expression.cs (Indirection.EmitAssign): Likewise.
51 (LocalVariableReference.EmitAssign): Likewise.
52 (ParameterReference.EmitAssign): Likewise.
53 (Invocation.EmitArguments): Likewise.
54 (ArrayAccess.EmitAssign): Likewise.
55 (IndexerAccess.EmitAssign): Likewise.
56 (This.EmitAssign): Likewise.
57 (ConditionalLogicalOperator.Emit): Likewise.
60 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
61 instead of ArrayList. If the hashtable has a LocalBuilder, don't
62 leave it in after returning it.
63 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
65 2006-08-06 Marek Safar <marek.safar@seznam.cz>
67 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
70 2006-08-03 Raja R Harinath <rharinath@novell.com>
72 Fix cs0146-3.cs and cs0146-4.cs.
73 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
74 enclosing types don't depend on the current type.
76 2006-08-02 Raja R Harinath <rharinath@novell.com>
79 * class.cs (TypeContainer.DoDefineMembers): Use
80 FindBaseMemberWithSameName on Parent, since we're interested in
81 whether we hide inherited members or not.
82 (FindBaseMemberWithSameName): Make slightly more robust.
84 Fix the non-generic testcase from #77396
85 * decl.cs (DeclSpace.DeclContainer): Remove override.
87 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
88 declspaces for doppelgangers too.
89 (UsingEntry): Implement IResolveContext.
90 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
91 'this' as the resolve context.
92 (LocalAliasEntry): Likewise.
94 Implement parts of #77403
95 * roottypes.cs (RootDeclSpace): New. Used to represent the
96 toplevel declaration space. Each namespace declaration introduces
97 a "partial" root declaretion space.
98 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
99 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
100 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
101 from 'current_namespace.SlaveDeclSpace'.
102 (namespace_declaration): Likewise.
103 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
104 check. It can't happen now.
105 * decl.cs (DeclSpace.LookupType): Likewise.
106 * driver.cs (MainDriver): Sanity check.
108 2006-08-01 Raja R Harinath <rharinath@novell.com>
110 * decl.cs (DeclSpace.FindNestedType): Remove.
111 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
112 LookupTypeContainer to get the container of the nested type.
113 * class.cs (TypeContainer.FindNestedType): Make non-override.
115 2006-07-31 Raja R Harinath <rharinath@novell.com>
117 * decl.cs (DeclSpace.PartialContainer): Move field from ...
118 * class.cs (TypeContainer.PartialContainer): ... here.
119 (TypeContainer.AddBasesForPart): New helper.
120 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
122 * cs-parser.jay (current_class): Convert to DeclSpace.
123 (struct_declaration, interface_declaration, class_declaration):
124 Use AddBasesForPart instead of .Bases directly.
125 * const.cs, iterators.cs: Update to changes.
127 2006-07-28 Raja R Harinath <rharinath@novell.com>
129 * class.cs (TypeContainer.AddMemberType): Rename from
131 (TypeContainer.AddMember): Rename from AddToMemberContainer.
132 (AddTypeContainer): New. Combine AddClassOrStruct and
134 (AddPartial): Update. Add 'is_partial' argument.
135 * roottypes.cs: Update to changes.
136 * cs-parser.jay (push_current_class): New helper for handling
137 current_container and current_class.
138 (struct_declaration, interface_declaration, class_declaration):
141 2006-07-26 Raja R Harinath <rharinath@novell.com>
143 * roottypes.cs: Rename from tree.cs.
145 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
146 * tree.cs (Tree, ITreeDump): Remove types.
147 * rootcontext.cs (tree, Tree): Remove fields.
148 (root, ToplevelTypes): New.
149 * *.cs: Update to rename.
151 * tree.cs (Tree.RecordDecl): Remove.
152 (RootTypes.AddToTypeContainer): Record the toplevel type in its
154 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
156 2006-07-23 Raja R Harinath <harinath@gmail.com>
158 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
159 DoFlowAnalysis and OmitStructFlowAnalysis here.
160 (ec.With): Rename from WithUnsafe and generalize.
161 (ec.WithCheckState): Remove. All users can be handled by 'With'.
162 (ec.WithFlowAnalyis): New.
163 * ecore.cs, expression.cs, statement.cs: Update.
165 2006-07-22 Raja R Harinath <harinath@gmail.com>
167 * statement.cs (Block.ResolveMeta): Simplify slightly.
169 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
170 multiple boolean fields. Convert InUnsafe, constant_check_state,
171 check_state to flags.
172 (CheckState, ConstantCheckState): Update.
173 (InUnsafe): New read-only property.
174 (FlagsHandle): Rename from CheckStateHandle and convert to handle
176 (WithUnsafe): New helper similar to WithCheckState.
177 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
178 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
180 2006-07-21 Raja R Harinath <rharinath@novell.com>
182 Make comparisons use the same IL irrespective of whether they're
183 in a 'checked' or 'unchecked' context: one of the issues in #78899
184 * codegen.cs (EmitContext.CheckState): Make read-only property.
185 (EmitContext.ConstantCheckState): Likewise.
186 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
187 helper that implement a save/restore stack for CheckState
188 values. This is the only way to change check-state.
189 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
190 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
191 (CheckedExpr.EmitBranchable): New forwarding method.
192 (UnCheckedExpr): Likewise.
193 * statement.cs (Block.ResolveMeta): Use WithCheckState.
194 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
195 (Checked.Resolve, checked.DoEmit): Likewise.
197 2006-07-20 Miguel de Icaza <miguel@novell.com>
199 * anonymous.cs: Cache the resolved anonymous delegate, and return
200 this so that the ResolveTopBlock is only triggered once, not
203 Currently we trigger ResolvetopBlock twice due to a first pass of
204 argument check compatibility, and a second pass that does the
207 2006-07-16 Marek Safar <marek.safar@seznam.cz>
210 * driver.cs (MainDriver): When a file extension is missing,
213 2006-07-15 Marek Safar <marek.safar@seznam.cz>
215 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
217 * rootcontext.cs (Reset): Add helper_classes.
219 2006-07-15 Marek Safar <marek.safar@seznam.cz>
222 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
225 2006-07-13 Miguel de Icaza <miguel@novell.com>
227 * statement.cs (Lock): Handle expressions of type
228 TypeManager.null_type specially. Fixes #78770
230 2006-07-08 Marek Safar <marek.safar@seznam.cz>
232 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
235 2006-07-08 Marek Safar <marek.safar@seznam.cz>
237 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
238 for accessors as well.
239 * ecore.cs (EventExpr): Add AccessorTable.
241 2006-07-01 Marek Safar <marek.safar@seznam.cz>
244 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
245 for CS0122 where appropriate.
246 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
248 (Filter): Assembly can be null in the case of top level attributes.
250 2006-06-25 Marek Safar <marek.safar@seznam.cz>
254 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
255 is done at global level.
257 2006-06-24 Marek Safar <marek.safar@seznam.cz>
259 A fix for #77002, Implemented TypeForwarder support.
261 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
262 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
263 * typemanager.cs (): Add type_forwarder_attr_type.
265 2006-06-24 Marek Safar <marek.safar@seznam.cz>
267 * report.cs: Add CS0469 warning.
269 2006-06-21 Martin Baulig <martin@ximian.com>
271 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
272 the `try'-block, so we also report CS0016 etc. there.
274 2006-06-21 Martin Baulig <martin@ximian.com>
277 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
279 2006-06-21 Martin Baulig <martin@ximian.com>
281 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
282 also report CS1686 for parameters.
284 2006-06-21 Martin Baulig <martin@ximian.com>
286 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
287 instead of an error if the value is not implicitly convertible to
288 the switch types; fixes #77964.
290 2006-06-21 Raja R Harinath <rharinath@novell.com>
293 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
294 FieldBuilder is null.
297 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
298 'left' and 'right' before error-checking.
300 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
302 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
304 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
305 (FieldExpr.DoResolve): likewise.
306 (PropertyExpr.InstanceResolve): likewise.
307 (EventExpr.InstanceResolve): likewise.
309 2006-06-04 Marek Safar <marek.safar@seznam.cz>
311 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
312 attribute applicable tests for attribute argument.
314 2006-06-02 Raja R Harinath <rharinath@novell.com>
317 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
318 (Binary.OverloadResolve_PredefinedIntegral): New.
319 (Binary.OverloadResolve_PredefinedFloating): New.
320 (Binary.OverloadResolve_PredefinedString): New.
321 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
322 Follow the standard more closely, and treat numeric promotions in
323 terms of overload resolution.
324 (Binary.CheckShiftArguments): Simplify.
326 2006-06-01 Raja R Harinath <rharinath@novell.com>
328 * flowanalysis.cs (MyBitVector): Simplify representation.
329 (MyBitVector.Clone): Avoid allocating BitArray.
330 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
331 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
332 (*): Update. Change all references to MyBitVector.And and
333 MyBitVector.Or to &= and |=.
335 2006-05-29 Raja R Harinath <rharinath@novell.com>
338 * cs-parser.jay (formal_parameter_list): Extend the pattern below
339 to param arguments too.
341 2006-05-26 Miguel de Icaza <miguel@novell.com>
343 * cs-parser.jay: Catch another parsing form for arglist being
344 followed by other arguments. Fixes #78313.
346 2006-05-24 Raja R Harinath <rharinath@novell.com>
348 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
349 checking of out parameters to ...
350 (FlowBranchingToplevel.Merge): ... here.
351 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
352 set, propagate the origin upward, and only complain if there was
354 (FlowBranchingException.AddContinueOrigin): Likewise.
355 (FlowBranchingException.AddReturnOrigin): Likewise.
356 (FlowBranchingException.AddGotoOrigin): Likewise.
358 2006-05-23 Raja R Harinath <rharinath@novell.com>
360 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
361 unreachable, skip it.
362 (FlowBranchingException.Merge): Always propagate jumps, even if
363 the finally block renders subsequent code unreachable.
365 2006-05-18 Raja R Harinath <rharinath@novell.com>
368 * statement.cs (Goto.Resolve): Move responsibility for resolving
369 'goto' to FlowBranching.AddGotoOrigin.
370 (Goto.SetResolvedTarget): New. Callback to set the
371 LabeledStatement that's the target of the goto.
372 (Goto.DoEmit): Use Leave instead of Br when crossing an
373 unwind-protect boundary.
374 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
375 LookupLabel and adjust to new semantics.
376 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
377 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
378 Goto.SetResolvedTarget to update target.
379 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
380 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
381 AddBreakOrigin & co. Delay propagation until ...
382 (FlowBranchingException.Merge): ... this.
384 * statement.cs (Block.Resolve): Always depend on flow-branching to
385 determine unreachability. Kill workaround that originally emitted
386 only one statement after an "unreachable" label (see infloop in
389 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
390 This is still "wrong", but anything better would probably need a
391 multi-pass algorithm.
392 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
393 usage vector. Force current usage vector to be reachable, to
394 optimistically signify backward jumps.
395 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
397 (FlowBranchingLabeled.Merge): New. If no backward jump was
398 detected, return the original salted-away usage vector instead,
399 updated with appropriate changes. Print unreachable warning if
401 * statement.cs (Block.Resolve): Don't print unreachable warning on
404 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
406 * driver.cs: Pass filename without path to AssemblyBuilder's
407 AddResourceFile. Fixes bug #78407.
409 2006-05-17 Raja R Harinath <rharinath@novell.com>
411 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
412 * flowanalysis.cs (FlowBranchingLabeled): ... here.
413 (FlowBranching.MergeChild): Overwrite
414 reachability information from Labeled branchings too.
416 2006-05-16 Raja R Harinath <rharinath@novell.com>
418 * statement.cs (Goto.Resolve): Merge jump origins here ...
419 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
421 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
422 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
423 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
424 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
426 * statement.cs (Goto.Resolve): ... not here.
427 (Goto.Emit): Remove CS1632 check.
429 2006-05-14 Marek Safar <marek.safar@seznam.cz>
431 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
434 2006-05-11 Raja R Harinath <rharinath@novell.com>
436 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
437 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
438 (FlowBranchingException.Label): Likewise.
440 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
442 (MyBitVector.Or): Use it to avoid losing information (Count).
443 (FlowBranching.MergeOrigins): Likewise.
445 * flowanalysis.cs (UsageVector.IsDirty): Remove.
446 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
447 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
448 (UsageVector.ToString): Simplify.
449 (UsageVector.MergeSiblings): Move here from ...
450 (FlowBranching.Merge): ... here.
451 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
454 2006-05-10 Raja R Harinath <rharinath@novell.com>
456 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
457 null bitvector is treated as all-true.
459 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
460 (MyBitVector): Rationalize invariants. 'vector != null' implies
461 that we have our own copy of the bitvector. Otherwise,
462 'InheritsFrom == null' implies all inherited bits are true.
464 2006-05-09 Marek Safar <marek.safar@seznam.cz>
466 * statement.cs (LocalInfo): Add IsConstant.
467 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
468 local variable for constants.
470 2006-05-09 Raja R Harinath <rharinath@novell.com>
472 * flowanalysis.cs (MyBitVector.Empty): New.
473 (MyBitVector): Don't allow InheritedFrom to be null.
474 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
475 (UsageVector, FlowBranching): Update to changes.
477 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
478 recursion. The 'Parent == null' condition isn't sufficient for
480 (FlowBranching.AddBreakOrigin): Likewise.
481 (FlowBranching.AddContinueOrigin): Likewise.
482 (FlowBranching.AddReturnOrigin): Likewise.
483 (FlowBranching.StealFinallyClauses): Likewise.
484 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
485 (FlowBranching.CheckOutParameters): Likewise.
486 (FlowBranchingToplevel): Terminate all the above recursions here.
487 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
488 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
490 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
492 (FlowBranchingToplevel): New. Empty for now.
493 (FlowBranching.MergeTopBlock): Update.
494 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
495 branching for the anonymous delegate.
496 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
498 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
499 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
500 information at the start of the merge. Reorganize.
502 2006-05-07 Marek Safar <marek.safar@seznam.cz>
504 * class.cs (MethodData.Define): Method cannot implement interface accessor.
506 2006-05-07 Marek Safar <marek.safar@seznam.cz>
508 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
509 to newly introduced ctor.
511 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
512 message to one place.
513 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
516 2006-05-07 Marek Safar <marek.safar@seznam.cz>
518 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
520 * ecore.cs (Expression.ResolveAsConstant): Updated.
522 * statement.cs (ResolveMeta): Updated.
524 2006-05-06 Marek Safar <marek.safar@seznam.cz>
526 * cs-parser.jay: __arglist cannot be used in initializer.
528 2006-05-06 Marek Safar <marek.safar@seznam.cz>
531 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
534 2006-05-05 Raja R Harinath <rharinath@novell.com>
536 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
537 (LabeledStatement): Add 'name' parameter.
538 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
539 (Block.AddLabel): Update to changes.
540 * cs-parser.jay (labeled_statement): Likewise.
542 * flowanalysis.cs (BranchingType.Labeled): New.
543 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
544 (FlowBranchingLabeled): New. Does nothing for now, but will
545 eventually handle 'goto' flows.
546 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
547 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
548 that's terminated ...
549 (Block.Resolve): ... here.
551 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
552 (UsageVector.MergeFinallyOrigins): Likewise.
553 (FlowBranching.InTryOrCatch): Likewise.
554 (FlowBranching.AddFinallyVector): Likewise.
555 (FlowBranchingException): Update to changes.
558 * statement.cs (Return.Resolve): Move error checking to ...
559 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
560 (FlowBranchingException): Handle return origins like break and
562 (FlowBranching.UsageVector.CheckOutParameters): Remove.
564 2006-05-04 Marek Safar <marek.safar@seznam.cz>
567 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
570 2006-05-04 Marek Safar <marek.safar@seznam.cz>
573 * class.cs (MethodData.Define): Do public accessor check only when method
574 implements an interface.
576 2006-05-04 Raja R Harinath <rharinath@novell.com>
578 Remove special handling of 'break'
579 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
580 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
581 (UsageVector.Break): Remove.
582 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
584 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
586 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
587 UsageVector.Breaks (). Don't set NeedsReturnLabel.
589 2006-05-03 Marek Safar <marek.safar@seznam.cz>
592 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
593 be the interface member.
595 2006-05-03 Marek Safar <marek.safar@seznam.cz>
598 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
599 for emitting small (int) values.
601 2006-05-03 Raja R Harinath <rharinath@novell.com>
604 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
605 control-flow passes through the 'finally' after merging-in all the
606 control-flows from 'try' and the 'catch' clauses.
608 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
609 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
610 always true at the only non-recursive entry point.
611 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
612 FlowBranchingBreakable.
613 (FlowBranchingLoop): Remove.
614 * statement.cs (Return.DoResolve): Update to changes.
617 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
618 (FlowBranching.CreateBranching): Handle it: create a
619 FlowBranchingContinuable.
620 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
621 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
622 except that it handles the 'continue' command.
623 (FlowBranching.UsageVector.MergeOrigins): Rename from
625 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
626 except that it overrides AddContinueOrigin.
627 (FlowBranchingException): Override AddContinueOrigin, similar to
629 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
630 Create a new branching around the embedded statement.
631 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
632 control flow after the embedded statement.
633 (Continue.Resolve): Move all error checking to AddContinueOrigin.
635 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
636 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
637 FlowBranchingBreakable.
638 (FlowBranchingSwitch): Remove.
641 * statement.cs (Break.Resolve): Simplify. Move responsibility for
642 error reporting to ...
643 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
644 Rename from 'AddBreakVector'. Add new location argument. Return
645 a bool indicating whether the 'break' crosses an unwind-protect.
646 (FlowBranchingException.AddBreakOrigin): Add.
647 (FlowBranchingException.Merge): Propagate 'break's to surrounding
648 flowbranching after updating with the effects of the 'finally'
650 (FlowBranchingBreakable): New common base class for
651 FlowBranchingLoop and FlowBranchingSwitch.
653 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
655 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
657 2006-05-02 Raja R Harinath <rharinath@novell.com>
659 * statement.cs (Do.Resolve): If the loop is infinite, set the
661 (While.Resolve, For.Resolve): Set a barrier after the embedded
662 statement. There's no direct control flow that goes from the end
663 of the embedded statement to the end of the loop.
664 * flowanalysis.cs (FlowBranching.Infinite): Remove.
665 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
666 above ensure that the reachability is correctly computed.
668 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
669 (UsageVector.MergeBreakOrigins): If the current path is
670 unreachable, treat it as if all parameters/locals are initialized.
671 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
672 infinite loops before merging-in break origins.
674 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
675 (Reachability.Reachable): Split part into ...
676 (Reachability.Unreachable): ... this. Simplify.
677 (Reachability.IsUnreachable): Use 'Unreachable' instead.
679 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
680 (Reachability.SetThrowsSometimes): Likewise.
681 (FlowBranchingBlock.MergeTopBlock): Don't compare against
682 TriState.Always, use corresponding property.
683 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
684 (Block.Resolve): Likewise. Remove some redundant checks.
686 2006-05-02 Raja R Harinath <harinath@gmail.com>
688 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
689 (Reachability.Meet): Don't bother checking AlwaysThrows --
690 barrier is always set.
691 (FlowBranchingBlock.Merge): Likewise.
693 2006-05-01 Raja R Harinath <harinath@gmail.com>
695 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
696 checks for unreachable.
698 2006-05-01 Marek Safar <marek.safar@seznam.cz>
701 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
703 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
704 whether field is really assigned.
706 2006-04-30 Raja R Harinath <harinath@gmail.com>
708 * flowanalysis.cs (Reachability): Make 4-argument constructor
710 (Reachability.Meet): Rename from 'And'. Remove static variant.
711 (Reachability.Always): Rename from the highly misleading
712 'Reachability.Never'.
713 (FlowBranching.Merge): Update to changes. Mark an impossible
714 situation with a 'throw'.
715 (*): Update to changes.
717 2006-04-29 Raja R Harinath <harinath@gmail.com>
719 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
721 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
722 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
723 (*): Update to changes.
724 * statement.cs: Update to changes.
726 2006-04-28 Marek Safar <marek.safar@seznam.cz>
729 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
731 2006-04-28 Raja R Harinath <harinath@gmail.com>
733 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
736 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
737 argument to two arguments: an usage-vector and a bool. Move call
738 to FlowBranching.Merge () ...
739 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
741 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
742 handling of loop and switch reachability to ...
743 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
745 2006-04-27 Raja R Harinath <harinath@gmail.com>
747 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
748 handling to FlowBranchingLoop.InLoop.
749 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
751 2006-04-26 Marek Safar <marek.safar@seznam.cz>
754 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
755 anonymous method is allowed from AnonymousContainer here.
757 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
759 2006-04-24 Raja R Harinath <rharinath@novell.com>
762 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
764 2006-04-23 Marek Safar <marek.safar@seznam.cz>
767 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
768 (DoubleConstant.Reduce): Ditto.
770 2006-04-23 Raja R Harinath <rharinath@novell.com>
772 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
773 Remove 'lvalue_right_side' argument. Move parts to ...
774 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
775 (LocalVariable.DoResolveLValue): ... these.
777 2006-04-21 Raja R Harinath <rharinath@novell.com>
780 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
781 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
782 (LocalVariableReference.DoResolveBase): Use it to implement new
784 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
785 (Argument.Resolve): Simplify. Move CS1510 check ...
786 * ecore.cs (Expression.ResolveLValue): ... here.
787 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
788 (PropertyExpr.DoResolveLValue): Likewise.
789 (FieldExpr.Report_AssignToReadonly): Likewise.
790 (FieldExpr.DoResolve): Add 'out_access' argument. Use
791 LValueMemberAccess or LValueMemberOutAccess on instance depending
793 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
794 DoResolve as appropriate.
796 2006-04-20 Raja R Harinath <rharinath@novell.com>
799 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
800 implicit conversions on 'out' and 'ref' arguments.
802 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
803 improve clarity. Remove dead code.
806 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
807 (Catch.Resolve): Resolve VarBlock if it exists.
809 2006-04-19 Miguel de Icaza <miguel@novell.com>
811 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
812 twice, this was some residual code, the enumerator was emitted
813 properly in the two branche of if later.
815 2006-04-19 Raja R Harinath <rharinath@novell.com>
817 * expression.cs (Cast.ResolveLValue): Remove. The result of a
818 cast is never an lvalue.
819 (Cast.DoResolve, Cast.ResolveRest): Combine.
820 (Argument.Emit): Simplify slightly. Move 'Expr is
821 IMemoryLocation' check ...
822 (Argument.Resolve): ... here.
823 (Argument.Error_LValueRequired): Remove. Inline into only user.
825 Simplifications. Fix cs0191-2.cs
826 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
827 CS1649 and CS1651 to ...
828 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
829 the actual selection of the error code and message to a lookup
830 table. Add a dummy return value to simplify callsites.
831 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
832 readonly fields of other instances of the same type. Move CS0197
834 * expression.cs (Argument.Resolve): ... here. Simplify code.
835 Ensure that ec.InRefOutArgumentResolving is only set during LValue
836 resolution of an out or ref argument. The code simplification
837 above uses this invariant.
839 2006-04-18 Raja R Harinath <rharinath@novell.com>
841 Possibly fix #77752. Fix cs1690-[4-7].cs.
842 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
843 CheckMarshallByRefAccess. Drop parameter.
844 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
846 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
848 * report.cs (AllWarnings): Add CS1690.
849 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
851 (LocalVariableReference.DoResolveBase): Update.
853 2006-04-09 Marek Safar <marek.safar@seznam.cz>
855 * class.cs (MethodOrOperator): Moved common parts from method class.
856 detect obsolete attributes.
857 (Method.Define): Simplified as it reuses code from base.
858 (Constructor.ValidAttributeTargets): Fixed issue found during
860 (Destructor.ValidAttributeTargets): Fixed issue found during
862 (Operator): Finished refactoring set off by #78020. Operator class is now
863 ordinary method class.
865 * anonymous.cs: Updated.
867 * decl.cs (DeclSpace): Add IsGeneric
869 2006-04-09 Marek Safar <marek.safar@seznam.cz>
871 * class.cs (Constructor.Emit): Don't emit the attributes twice.
873 2006-04-09 Marek Safar <marek.safar@seznam.cz>
875 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
876 detect obsolete attributes.
877 (Method.CreateEmitContext): Moved to MethodOrOperator.
879 2006-04-09 Marek Safar <marek.safar@seznam.cz>
882 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
883 customized exception to make crash detection easier.
884 (MethodOrOperator): Started to work on new base class for methods and
886 (Method): Derives from MethodOrOperator.
887 (Constructor.Emit): Emits its own attributes.
888 (AbstractPropertyEventMethod.Emit): Ditto.
889 (Operator): Derives from MethodOrOperator, will refactor fully in extra
891 (Operator.Emit): It's temporary more tricky than should be.
893 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
895 * report.cs (InternalErrorException): Add ctor with inner exception.
897 2006-04-08 Marek Safar <marek.safar@seznam.cz>
900 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
903 2006-04-07 Marek Safar <marek.safar@seznam.cz>
906 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
909 2006-04-06 Marek Safar <marek.safar@seznam.cz>
911 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
912 attribute is present and Guid not.
913 (Interface.ApplyAttributeBuilder): Ditto.
915 * attribute.cs: Add error message.
917 2006-04-06 Marek Safar <marek.safar@seznam.cz>
921 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
922 sources (it's composite) so hold them in extra array as they are used in
923 Emit phase only. It worked in the previous versions by mistake.
924 (Attribute.Emit): Emit attribute for more owners when exist.
926 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
927 it has now different behaviour.
929 2006-04-04 Marek Safar <marek.safar@seznam.cz>
931 * constant.cs (Constant.IsDefaultInitializer): New method.
935 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
936 re-initialize default values. It saves KBs almost for every assembly.
937 Thanks Zoltan for the idea.
938 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
939 (ArrayCreation.DoResolve): Resolve only once.
940 (ArrayCreation.Emit): Emit static initializer only when it is faster.
941 (ArrayCreation.GetAttributableValue): Cope with optimized values.
943 2006-04-03 Zoltan Varga <vargaz@gmail.com>
945 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
948 2006-04-01 Marek Safar <marek.safar@seznam.cz>
950 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
951 in an embedded statement too.
953 2006-04-01 Raja R Harinath <rharinath@novell.com>
956 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
958 2006-04-01 Marek Safar <marek.safar@seznam.cz>
962 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
965 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
967 2006-03-31 Marek Safar <marek.safar@seznam.cz>
969 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
972 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
973 LocalTemporary change.
975 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
977 (ClassOrStruct.DefineFieldInitializers): Implemented static field
978 initializers optimization.
979 (ClassOrStruct.TypeAttr): Moved from modifiers.
980 (Constructor.CheckBase): Don't crash when static ctor has parameters.
981 (FieldBase.ResolveInitializer): Resolves initializer.
982 (FieldBase.HasDefaultInitializer): New property.
984 * cs-parser.jay: Removed message.
986 * expression.cs (CompilerGeneratedThis): New specialization.
988 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
990 2006-03-28 Marek Safar <marek.safar@seznam.cz>
992 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
994 2006-03-27 Marek Safar <marek.safar@seznam.cz>
996 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
997 be now EnumConstants only.
999 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1001 * attribute.cs, driver.cs: Reset more caches.
1003 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1005 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1007 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1009 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1010 for easier reuse. Updated all overrides.
1011 (IntegralConstant): New base class for all integral constants.
1012 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1013 of the constant range, report custom error.
1014 (UIntConstant.Reduce): Fixed uint conversion.
1016 * ecore.cs, literal.cs: Reduce updates.
1018 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1022 * class.cs (Constructor.Define): Removed extra if for default ctors.
1023 A patch from Atsushi Enomoto.
1025 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1027 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1028 GetAttributableValue.
1030 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1033 * convert.cs (ImplicitConversionRequired): Error message moved to
1036 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1037 automatic implicit conversion of an output value.
1038 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1040 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1042 (TypeOf.GetAttributableValue): Add extra handling for object type.
1044 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1045 special error message.
1047 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1049 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1051 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1052 compatible with MS runtime.
1054 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1056 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1057 attribute arguments here.
1059 * class.cs (Indexer.Define): The check was moved to attribute class.
1061 2006-03-22 Marek Safar <marek.safar@seznam.cz>
1063 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1064 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1067 2006-03-22 Raja R Harinath <rharinath@novell.com>
1069 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1070 mcs to keep code differences small.
1071 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1072 * typemanager.cs (parameter_default_value_attribute_type): New.
1073 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1076 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1078 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1080 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1082 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1084 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1087 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1089 * doc-bootstrap.cs : fix build.
1091 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1093 * expression.cs (StringConcat.Append): Issue a warning when empty string
1096 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1098 * assign.cs (CompoundAssign.ResolveSource): Removed.
1100 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1103 * class.cs (TypeContainer.FindMethods): Removed.
1104 (TypeContainer.CheckMemberUsage): Made static.
1106 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1108 * constant.cs (CheckRange): Removed unused type argument.
1109 (CheckUnsigned): Removed unused type argument.
1111 * cs-parser.jay: Updated after MemberAccess clean up.
1112 Uses Length for empty string test.
1114 * cs-tokenizer.cs: Uses Length for empty string test.
1115 (IsCastToken): Made static.
1116 (is_hex): Made static.
1117 (real_type_suffix): Made static.
1119 * decl.cs (SetupCache): Made static.
1120 (OnGenerateDocComment): Removed unused ds argument.
1122 * delegate.cs (VerifyDelegate): Removed unused argument.
1124 * doc.cs: Uses Length for empty string test.
1126 * driver.cs: Uses Length for empty string test.
1128 * enum.cs (IsValidEnumType): Made static
1130 * expression.cs (EnumLiftUp): Removed unused argument.
1131 (ResolveMethodGroup): Ditto.
1132 (BetterConversion): Ditto.
1133 (GetVarargsTypes): Ditto.
1134 (UpdateIndices): Ditto.
1135 (ValidateInitializers): Ditto.
1136 (MemberAccess.ctor): Ditto.
1137 (GetIndexersForType): Ditto.
1139 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1141 * iterators.cs: Updated after MemberAccess clean up.
1143 * location.cs: Uses Length for empty string test.
1145 * namespace.cs: Uses Length for empty string test.
1147 * report.cs (CheckWarningCode): Made static.
1149 * statement.cs (LabeledStatement): Removed unused argument.
1151 * typemanager.cs (FilterNone): Removed.
1153 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1155 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1158 * class.cs: Updated.
1160 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1162 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1164 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1168 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1169 reporting, it's more tricky than I thought.
1171 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1175 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1177 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1178 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1179 Add more error reporting; Fixed issue with params.
1181 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1183 * cs-parser.jay: AnonymousMethod requires host container.
1185 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1187 2006-03-18 Raja R Harinath <harinath@gmail.com>
1189 * class.cs: Change 'TypeContainer ds' constructor argument to
1190 'DeclSpace parent'. Some classes were missed below due to
1191 different naming convention.
1193 * class.cs (MemberCore.Parent): Delete. This makes the
1194 ParentContainer changes below enforceable by the compiler.
1196 Treat pointers to enclosing declaration space as 'DeclSpace', not
1198 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1199 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1201 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1203 (Block.AddThisVariable): Likewise.
1204 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1205 (AbstractPropertyEventMethod.Emit): Likewise.
1206 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1207 (GetMethod.Define, SetMethod.Define): Likewise.
1208 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1209 (DelegateMethod.EmitMethod): Likewise.
1211 Fix regression test-partial-13.cs.
1212 Rationalize use of PartialContainer. Ensure that the partial
1213 class semantics can be tied to type-correctness, i.e., any
1214 violation will cause a compile error.
1215 * class.cs, const.cs: Access all fields that belong to class
1216 TypeContainer via ParentContainer. Arguments of EmitContexts and
1217 Resolve()-like functions still use 'Parent'.
1219 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1220 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1221 (PropertyMethod.CheckModifiers): Remove unused argument.
1222 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1225 2006-03-17 Raja R Harinath <harinath@gmail.com>
1227 Make semantics of PartialContainer simpler.
1228 * decl.cs (DeclSpace.IsPartial): Remove.
1229 * class.cs (TypeContainer.IsPartial): Likewise.
1230 (TypeContainer..ctor): Set PartialContainer to point to self.
1231 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1232 (TypeContainer.FindNestedType): Likewise.
1233 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1235 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1237 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1239 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1241 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1244 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1246 * class.cs (Operator.Define): An error for base conversion was not
1249 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1251 * iterator.cs : yield break is allowed in try statement which has
1252 catch clauses. Fixed bug #77767.
1254 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1256 A fix for #77593, #77574.
1258 * class.cs (MethodCore.CheckBase): Another if for operator.
1260 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1262 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1265 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1266 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1269 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1272 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1273 Updated after another emitcontext usage was clean up. It should help us to
1274 synchronize with gmcs easier.
1276 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1280 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1281 (Event.Define): ditto
1282 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1284 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1285 Removed redundant code and set NewSlot for Invoke method too.
1287 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1288 (Parameters.MergeGenerated): New method. Use this method when you merge
1289 compiler generated argument with user arguments.
1291 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1293 * attribute.cs (ResolveAsTypeTerminal): Removed.
1295 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1296 specialization for predefined types; 30% speed up.
1297 Finally placed obsolete check to right place.
1298 (Expression.ResolveType): Removed.
1300 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1301 Updated after ResolveType was removed.
1303 * expression.cs (Cast.ctor): Check void cast.
1304 (Binary.ResolveAsTypeTerminal): Is never type.
1305 (Conditional.ResolveAsTypeTerminal): Is never type.
1307 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1309 2006-03-01 Raja R Harinath <rharinath@novell.com>
1312 * expression.cs (ParameterReference.DoResolveBase): Change return
1314 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1318 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1321 * typemanager.cs (GetFullNameSignature): Don't nullref on
1322 protected accessors.
1324 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1326 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1327 these two separated members to simplify the code.
1328 (Attribute.Resolve): Refactored to use new fields and methods.
1329 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1330 implemented obsolete attribute checking.
1331 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1332 implemented obsolete checking again. It look line never ending quest ;-)
1333 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1335 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1337 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1339 *class.cs (Property.Define): Add RegisterProperty call.
1341 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1342 argument groups (only 2).
1344 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1345 encoding expression to arguments.
1346 (Expression.ExprClassToResolveFlags): Just turned to property.
1348 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1349 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1350 optimized as well as implemented support for zero-length attributes.
1352 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1353 Add caching of PropertyInfo's.
1355 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1357 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1358 error multiple times.
1360 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1362 New partial class implementation.
1363 A fix for #77027, #77029, #77403
1365 * attribute.cs (Attributable): Made attributes protected.
1367 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1368 the replacements of ClassPart and PartialContainer.
1369 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1370 (TypeContainer.AddInterface): Ditto.
1371 (TypeContainer.AddPartial): The main method for partial classes. It checks
1372 for errors and merges ModFlags and attributes. At the end class is added to
1374 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1376 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1377 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1378 from the rest of partial classes.
1379 (TypeContainer.GetClassBases): Simplified.
1380 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1382 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1383 (TypeContainer.HasExplicitLayout): Uses Flags now.
1384 (PartialContainer): Removed.
1385 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1386 (StaticClass): Was merged with Class.
1387 (Class.GetClassBases): class and static class bases are verified here.
1388 (Class.TypeAttr): Added static attributes when class is static.
1389 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1390 (MemberBase): In some cases we need to call parent container for partial
1391 class. It should be eliminated but it's not easy now.
1393 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1395 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1396 partial classed to accumulate class comments.
1397 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1399 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1401 * driver.cs (MainDriver): Tree.GetDecl was removed.
1403 * modifiers.cs (Modifiers): Add partial modifier.
1405 * tree.cs (Tree.decl): Removed.
1406 (RootTypes): Started to use this class more often for root types
1409 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1413 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1414 external interface does not have an attribute.
1416 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1418 Another prerequisites for new partial classs implementation.
1420 * attribute.cs (Attribute.Equal): Implemented.
1421 (Attribute.Emit): Changed as attributes can be applied more than twice.
1422 (Attributes.Emit): Check for duplicate attributes here.
1424 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1425 as a parameter, clean-up.
1427 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1431 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1432 contains obsolete attribute check which can in some cases look for base
1433 type of current class which is not initialized yet.
1434 (TypeContainer.BaseType): Replacement of ptype.
1436 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1438 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1440 First of prerequisites for new partial classs implemention.
1442 * attribute.cs (Attributable): Extended by ResolveContext;
1443 Attributes finally have correct context for resolving in all cases.
1444 (AttachTo): Attribute owner is assigned here.
1446 * codegen.cs (IResolveContext): Introduce new interface to hold
1447 all information needed in resolving phase.
1448 (EmitContext): Implements IResolveContext; more clean-up needed here.
1450 * decl.cs (MemberCore): Implemented IResolveContext.
1452 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1453 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1454 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1455 Refactored to use new IResolveContext instead of EmitContext; cleanup
1457 2006-02-06 Miguel de Icaza <miguel@novell.com>
1459 * codegen.cs (EmitScopeInitFromBlock): check here the
1460 capture_context, there is no need to make two calls to the
1463 * anonymous.cs: Add some debugging messages that might help me
1464 track other instances of this problem in the future (the
1465 regression of test 467).
1467 * cs-parser.jay: track the variable block, as we need to initalize
1468 any captured variables declared in this block for the "catch"
1469 portion of the "Try" statement.
1471 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1472 scope initialization for captured variables.
1474 Also, move the emit for the variables after the block location has
1477 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1479 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1481 2006-02-02 Miguel de Icaza <miguel@novell.com>
1483 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1484 commit yesterday, the initialization for the roots is necessary.
1485 What is not necessary is the scope activation.
1487 2006-02-02 Raja R Harinath <rharinath@novell.com>
1489 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1490 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1492 (Argument.Resolve): Remove CS0206 checks.
1494 2006-02-01 Miguel de Icaza <miguel@novell.com>
1496 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1497 scopes for all the roots, the scopes will now be emitted when the
1498 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1500 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1501 code. This reduces a lot of existing cruft.
1503 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1504 that the ScopeInfo is generated as we enter the scope, not at the
1505 time of use, which is what we used to do before.
1507 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1508 every time a Block is about to be emitted if we have a
1511 2006-02-01 Raja R Harinath <rharinath@novell.com>
1513 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1515 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1517 * typemanager.cs (cons_param_array_attribute): Make private.
1518 (Reset): Set it to null.
1519 (InitCoreHelpers): Don't initialize it.
1520 (ConsParamArrayAttribute): New. Initialize it as needed.
1521 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1523 2006-01-31 Miguel de Icaza <miguel@novell.com>
1525 * expression.cs: There might be errors reported during the
1526 selection of applicable methods. If there are errors, do not
1527 continue execution as it will lead the compiler to crash.
1529 2006-01-30 Miguel de Icaza <miguel@novell.com>
1531 * expression.cs: Member access is not allowed on anonymous
1532 methods. Fixes #77402.
1534 2006-01-30 Raja R Harinath <rharinath@novell.com>
1537 * cs-parser.jay (VariableDeclaration): Don't set
1538 current_array_type to null.
1539 (field_declaration, event_declaration, declaration_statement):
1540 Set it to null here.
1542 2006-01-28 Raja R Harinath <harinath@gmail.com>
1544 * typemanager.cs (GenericParameterPosition): New.
1547 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1549 * doc.cs : To process "include" elements, first we should create
1550 another list than XmlNodeList, because it could result in node
1551 removal, which could result in that the XmlNodeList gives up
1554 (Also made code identical to gmcs again.)
1556 2006-01-25 Miguel de Icaza <miguel@novell.com>
1558 * ecore.cs: Introduce an error report that we were not catching
1559 before, if not silent, we must report the error. Gonzalo ran into
1562 2006-01-23 Miguel de Icaza <miguel@novell.com>
1564 A fix for bug: #76957
1566 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1567 ComputeMethodHost before creating the method, this is a new
1570 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1571 that this method references (RegisterScope). The actual scope
1572 where the method is hosted is computed with the ComputeMethodHost
1573 before we create the method.
1575 Moved the Deepest routine here.
1577 (AnonymousContainer.ComputeMethodHost): New routine used to
1578 compute the proper ScopeInfo that will host the anonymous method.
1580 (ScopeInfo): Deal with multiple roots. The problem was that we
1581 did not have a unique root where all ScopeInfos could be hanged
1582 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1585 Remove AdjustMethodScope which is now computed at the end. Remove
1586 LinkScope which did a partial link, instead link all ScopeInfos
1587 before code generation from the new "LinkScopes" routine.
1589 Simplify all the Add* routines as they no longer need to maintain
1590 the tree, they just need to record that they are using variables
1593 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1594 routines to produce the forest of ScopeInfo trees.
1596 * class.cs (TypeContainer.AppendMethod): This is just like
1597 AddMethod, but ensures that an interface implementation method
1598 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1599 methods, but at the end.
1601 We use this functionality to ensure that the generated MoveNext
1602 method in the iterator class is resolved/emitted before the
1603 enumerator methods created.
1605 This is required because the MoveNext method computes the right
1606 ScopeInfo for the method. And the other methods will eventually
1607 need to resolve and fetch information computed from the anonymous
1610 2006-01-21 Raja R Harinath <harinath@gmail.com>
1611 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1614 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1616 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1617 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1619 2006-01-18 Raja R Harinath <rharinath@novell.com>
1621 Fix #76656, cs0231-2.cs.
1622 * cs-parser.jay (formal_parameter_list): Make error case catch
1624 (parenthesized_expression_0): Add CS1026 check.
1625 (invocation_expression): Remove unused { $$ = lexer.Location }.
1627 2006-01-17 Raja R Harinath <rharinath@novell.com>
1630 * cs-parser.jay (statement_expression): Don't list out the
1631 individual statement-expressions. Convert syntax error into
1634 2006-01-16 Raja R Harinath <rharinath@novell.com>
1637 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1638 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1639 CheckIntermediateModification.
1640 (FieldExpr.DoResolve): Add new two-argument version that
1641 allows us to resolve the InstanceExpression as an lvalue.
1642 The one-argument variant is now just a wrapper.
1643 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1644 Resolve the lhs as an lvalue if the it has a value type.
1645 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1646 from Assign.DoResolve.
1647 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1648 resolved as an lvalue.
1649 (PropertyExpr.DoResolve): Update.
1650 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1651 has a value type. Move CS1612 check here from
1652 CheckIntermediateModification.
1653 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1654 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1655 'right_side' of a ResolveLValue on an 'out' argument.
1656 (EmptyExpression.LValueMemberAccess): New. Used as the
1657 'right_side' of a propagated ResolveLValue on a value type.
1658 (LocalVariableReference.DoResolveBase): Recognize
1659 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1661 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1662 EmptyExpression.Null.
1664 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1666 * typemanager.cs : added IsGenericParameter(). In mcs it always
1668 * doc.cs : for generic parameters, use GenericParameterPosition,
1671 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1673 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1675 2006-01-12 Miguel de Icaza <miguel@novell.com>
1677 This fixes the problem where we used ldfld instead of ldflda to
1678 load the "THIS" pointer on captured parameters, when THIS is a
1679 value type. See bug #77205.
1681 * iterators.cs (CapturedThisReference.Emit): Pass false to
1682 EmitThis (we do not need the address).
1684 * codegen.cs (EmitThis): it needs to know whether we need the
1685 address of `this' or not. This is used by value types.
1687 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1688 every other call passes false.
1690 2006-01-12 Raja R Harinath <rharinath@novell.com>
1693 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1695 * expression.cs (Invocation.OverloadResolve): Update.
1696 (Invocation.DoResolve): Avoid double resolution of invocation.
1698 2006-01-11 Raja R Harinath <rharinath@novell.com>
1701 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1702 unary negation of floating point types as 0-expr; negation cannot
1703 overflow in floating point types.
1706 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1707 on operands of 'void' type.
1710 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1711 and ExclusiveOr for boolean constants too.
1713 2006-01-09 Raja R Harinath <rharinath@novell.com>
1716 * expression.cs (Invocation.OverloadResolve): Replace reflected
1717 override methods with their base virtual methods, rather than
1719 * typemanager.cs (TypeManager.GetOverride): New.
1721 2006-01-05 Jb Evain <jbevain@gmail.com>
1723 * class.cs (Property.Define, Indexer.Define): do not tag the
1724 properties as SpecialName | RTSpecialName.
1726 2006-01-04 Miguel de Icaza <miguel@novell.com>
1728 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1729 doing a low-level comparission of parameter types. It was lacking
1730 a check for __argslist.
1732 2005-12-30 Miguel de Icaza <miguel@novell.com>
1734 * expression.cs (ParameterReference.DoResolveBase): Allow
1735 reference parameters if they are local to this block.
1737 This allows the ref and out parameters of a delegate to be used in
1738 an anonymous method, for example:
1740 delegate void set (out int x);
1742 set s = delegate (out int x){
1746 This is used by functionality introduced late in the C# language.
1748 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1749 method that take ref and out parameters.
1751 Fixes #77119 which was a late change in the spec.
1753 2005-12-23 Miguel de Icaza <miguel@novell.com>
1755 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1756 parent if its the same scope. Fixes #77060.
1758 2005-12-21 Miguel de Icaza <miguel@novell.com>
1760 * driver.cs: Report the case of no source files and no -out:
1763 2005-12-20 Raja R Harinath <rharinath@novell.com>
1766 * expression.cs (ComposedCast.GetSignatureForError): Define.
1768 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1772 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1773 ListDictionary, to contain the ExternAliasEntry entries (in
1774 addition to the NamespaceEntry.aliases hashtable). This field is
1775 shared between the original entry and its doppelganger (bodyless
1777 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1778 extern_aliases field.
1779 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1780 lookup in extern_aliases.
1782 2005-12-16 Raja R Harinath <rharinath@novell.com>
1785 * class.cs (TypeContainer.Mark_HasEquals): New.
1786 (TypeContainer.Mark_HasGetHashCode): New.
1787 (ClassPart): Override them.
1788 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1791 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1792 'parent' argument to the base constructor.
1794 Remove all mention of TypeContainer from decl.cs.
1795 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1796 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1797 (DeclSpace.DeclSpace): Likewise.
1798 (DeclSpace.DefineMembers): Remove unused argument.
1799 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1800 debugging check -- we don't care if the debug code throws an
1801 InvalidCastException instead of an InternalErrorException.
1802 * class.cs (TypeContainer.DefineMembers): Update to changes.
1803 (TypeContainer.DoDefineMembers): Likewise.
1804 (TypeContainer.GetMethods): Likewise.
1805 (PropertyMember.Define): Likewise.
1806 (MemberBase.Parent): New property that forwards to
1807 MemberCore.Parent, but ensures that we get a TypeContainer.
1808 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1809 (RootContext.PopulateTypes): Likewise. Remove special case code
1810 for !RootContext.StdLib: DefineMembers is idempotent.
1812 2005-12-14 Miguel de Icaza <miguel@novell.com>
1814 * convert.cs (ExplicitConversionCore): Check the return value from
1815 ExplicitConversionCore which can return null on failure. Fixes #76914
1817 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1819 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1821 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1823 * doc.cs : The search for referenced namespace was insufficient to
1824 get global one as it used to do. Fixed bug #76965.
1826 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1828 * doc.cs : check name in cref in the last phase that whether it is
1831 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1833 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1836 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1838 * doc.cs : so it turned out that we cannot skip override check for
1839 interface members. Fixed bug #76954.
1841 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1843 * cs-tokenizer.cs : fixed bug #75984:
1844 - #warning and #error should not be handled when the source line
1846 - #line is not checked strictly when the source line is disabled.
1847 - #define and #undef is on the other hand checked strictly at any
1850 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1852 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1855 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1857 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1859 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1861 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1862 (FieldBase.Initializer): Initializer is now optional.
1863 (EventField.Define): Only event field can have initializer.
1865 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1867 * const.cs (Const): Reuse initializer.
1869 * cs-parser.jay: Updated after FieldBase changes.
1870 Added current_array_type to simplify array initializers.
1872 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1874 * expression.cs, iterators.cs: Updated.
1876 * namespace.cs (NamespaceEntry): Made UsingFound private.
1878 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1880 * parameterCollection.cs: Obsolete, removed.
1881 * parser.cs: Obsolete, removed.
1883 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1886 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1888 * enum.cs (Enum.Define): Set obsolete context here.
1890 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1893 - FindDocumentedMember() now expects 1) paramList as null
1894 when "we don't have to check the number of parameters" and
1895 2) Type.EmptyTypes when "there is no arguments".
1896 - Introduced FoundMember struct to hold the exact type which was
1897 used to find the documented member (the above change broke
1898 test-xml-044; it might be better just to use DeclaringType than
1899 what MS does, like this change does, but it depends on usage.)
1901 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1903 * doc.cs : documented member might be from DeclaringType for nested
1904 types. Fixed bug #76782.
1906 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1908 * anonymous.cs: Have the param code handle leaving copies on the
1909 stack etc. Allows anonymous params to take part in the assignment
1910 code (++, +=, etc). Fixes bug #76550
1912 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1913 it down to the anon code.
1915 * iterators.cs: Use dummy var here
1917 * codegen.cs: Handle new vars
1919 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1922 * class.cs (MethodData.Define): Set proper Obsolete context.
1924 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1926 (FieldExpr.DoResolve): Ditto.
1928 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1931 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1932 parent is not obsolete.
1934 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1936 * doc.cs : (FindDocumentedMember) find parameterless members first
1937 and get CS0419 in the early stage. Fixed first case of bug #76727.
1939 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1942 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1943 no error was reported.
1945 *expression.cs (Binary.DoResolve): left can be null.
1947 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1950 * class.cs (MethodData.Emit): Parameters should be labeled first.
1952 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1955 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1957 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1959 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1961 * class.cs (MethodCore): Parameter clean up.
1962 (IMethodData): Added ParameterInfo.
1963 (MethodData): Parameter clean up.
1964 (Indexer.Define): Parameter clean up.
1976 * typemanager.cs: Parameter clean up.
1978 * delegate.cs (Define): Get rid of duplicated code.
1980 * expression.cs (ParameterReference): Removed useless parameters
1982 (Invocation): Ditto.
1984 * parameter.cs (ParamsParameter): New class, params specialization.
1985 (ArglistParameter): Attemp to separate arglist.
1986 (Parameter): Refactored to be reusable and faster.
1987 (Parameter.Modifier): Made understandable.
1988 (Parameters): Changed to be used as a class for `this' assembly
1989 parameters. Refactored to use new specialized classes.
1991 * support.cs (ParameterData): Added Types property.
1992 (InternalParameters): Deleted.
1994 2005-08-20 Martin Baulig <martin@ximian.com>
1996 Merging this patch from GMCS to fix #75867.
1998 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1999 scope if we don't already have it.
2001 2005-11-17 Martin Baulig <martin@ximian.com>
2004 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2005 inherit the scope from our parent. Fixes #76653.
2007 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2009 * doc.cs : the previous patch does not actually fix the bug.
2010 PropertyInfo override check is now implemented and really fixed it.
2011 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2013 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2015 * doc.cs : apply "override filter" also to properties.
2018 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2020 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2021 no need to check overrides. For classes, omit those results from
2022 interfaces since they must exist in the class. Fixed bug #76726.
2024 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2026 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2027 with different parameters. Fixed the second problem in #76685.
2029 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2031 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2032 get expected 'protected' access in CheckValidFamilyAccess()).
2035 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2037 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2038 Fixed bug #76705. CS1569 was incorrectly commented out.
2040 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2042 * doc.cs : use Invocation.IsOverride() to do real override check.
2043 * expression.cs : made Invocation.IsOverride() internal.
2045 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2047 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2048 TypeBuilder.FindMembers() and filter overriden base members out.
2051 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2053 * doc.cs : ref/out parameters are represented as '@' (instead of
2054 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2056 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2058 * doc.cs : when there was no '.' in cref to methods in doc comment,
2059 then parameters were missing in the output. Fixed bug #76691.
2061 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2063 * driver.cs : don't output docs when there is an error.
2066 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2069 Now it should detect indexers. Fixed primary concern in bug #76685.
2070 Fixed CS0419 message to not show the identical member signature in
2073 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2075 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2076 instead of Type.FindMembers() since it does not handle events.
2079 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2081 * codegen.cs: Fixed typo (speficied -> specified).
2083 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2086 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2088 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2090 * attribute.cs: Changed error message.
2092 * cs-tokenizer.cs: One more check.
2094 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2096 * statement.cs (Block.Resolve): Ignore empty statement.
2098 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2100 * report.cs: Made error/warning methods more strict to avoid
2103 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2104 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2105 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2106 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2108 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2110 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2111 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2113 * class.cs (TypeContainer.IsComImport): New property.
2114 (Constructor.Define): Create proper ctor for ComImport types.
2116 * expression.cs (New.CheckComImport): Fixed.
2118 2005-11-07 Miguel de Icaza <miguel@novell.com>
2120 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2121 that a parameter has been captured does not mean that we do not
2122 have to do the rest of the processing. This fixes the second part
2123 of #76592. If there was another anonymous method capturing
2124 values in the past, the Scope would never be set for the second
2125 method that captured the same parameter.
2127 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2128 properly manipulate the stack. Second part of fix for #76592.
2130 * expression.cs (New): Add support for invoking "new" on
2131 interfaces that have been flagged with the ComImport attribute and
2132 the CoClass. Fixes #76637
2134 * statement.cs (Try.DoEmit): When a variable is captured, do not
2135 try to emit the vi.LocalBuilder variable as it has been captured.
2136 Create a temporary variable and store the results on the
2137 FieldBuilder. Fixes #76642
2139 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2141 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2143 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2145 * expression.cs (Binary.DoResolve): Added && optimalization.
2147 * typemanager.cs (AddUserType): Removed useless argument.
2149 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2151 * statement.cs (Block.variables): Uses ListDictionary.
2153 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2156 * class.cs (PartialContainer.EmitType): Customized to emit
2157 security attributes.
2158 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2159 for partial classes.
2161 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2164 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2165 access has to be fixed.
2167 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2169 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2172 * ecore.cs (NullCast.Reduce): Implemented.
2174 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2177 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2179 (Foreach.Resolve): Catch null properly.
2181 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2183 * cs-tokenizer.cs: Warning text fix.
2185 * driver.cs: AllWarningNumbers exposed on public interface.
2187 * report.cs (): Reviewed warning numbers.
2188 (IsValidWarning): Use binary search.
2190 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2192 * driver.cs: Implemeted resource visibility.
2193 (Resources): New class for code sharing between /res: and
2196 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2199 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2202 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2205 * ecore.cs (NullCast): Child is contant only.
2207 * literal.cs (NullLiteral.Reduce): null can be converted to any
2210 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2212 * driver.cs: Use Encoding.Default as default code page instead
2215 2005-10-27 Raja R Harinath <rharinath@novell.com>
2218 * expression.cs (Invocation.Error_InvalidArguments): Handle
2219 __arglist parameters.
2220 (Invocation.VerifyArgumentsCompat): Likewise.
2221 * support.cs (ReflectionParameters.GetSignatureForError): Print
2222 __arglist parameters.
2223 (InternalParamters.GetSignatureForError): Likewise.
2224 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2226 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2228 * attribute.cs (GetPropertyValue): Made public.
2230 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2232 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2234 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2237 * driver.cs: Reflect method name change.
2239 * statement.cs (Try.Resolve): Warn when try has both general
2242 * typemanager.cs: runtime_compatibility_attr_type new predefined
2245 2005-10-26 Raja R Harinath <harinath@gmail.com>
2248 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2249 treat it as an empty parameter list.
2251 2005-10-26 Raja R Harinath <rharinath@novell.com>
2254 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2255 ResolveAsTypeStep silent.
2256 * statement.cs (Block.AddConstant): Mark block as used.
2257 (Block.ResolveMeta): Avoid piling on error messages
2258 if a constant initializer resolution fails.
2260 2005-10-25 Raja R Harinath <rharinath@novell.com>
2262 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2264 (NamespaceEntry.VerifyAllUsing): New.
2265 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2266 behaviour. Delegates actual resolution of alias to ...
2267 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2268 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2270 * driver.cs (Driver.MainDriver): Update.
2272 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2273 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2275 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2277 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2278 RootNamespace.DefineNamespacesForAll.
2280 2005-10-24 Raja R Harinath <harinath@gmail.com>
2282 * typemanager.cs (assemblies, external_aliases, modules)
2283 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2284 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2285 overhead. Move resposibility ...
2286 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2287 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2289 2005-10-23 Raja R Harinath <harinath@gmail.com>
2291 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2292 cached_namespaces. Improve usage.
2293 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2294 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2295 Move from GlobalRootNamespace and simplify.
2296 (RootNamespace.Global): Make instance variable.
2297 (RootNamespace.RootNamespace): Add "alias name" parameter.
2298 (GlobalRootNamespace): Simplify drastically.
2299 (Namespace.Lookup): Don't use GetNamespace.
2300 * typemanager.cs (GetRootNamespace): Rename from
2301 ComputeNamespaceForAlias.
2302 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2304 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2306 * anonymous.cs (AnonymousContainer): Don't crash when container
2309 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2311 * expression.cs (Binary.DoResolve): Warn when comparing same
2314 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2317 * expression.cs (Binary.DoResolve): It looks like there are no
2318 convetsion rules in enum context.
2320 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2322 Add support for extern alias qualifiers.
2323 * typemanager.cs: Move some LookupTypeReflection code
2324 to namespace.cs, to have cleaner code. Added some methods
2325 to help us keep track of the extern aliased references.
2326 * driver.cs: Add suport for extern alias assemblies on command
2327 line and check for their warnings/errors. Also keep track of the
2328 extern aliased assemblies.
2329 * namespace.cs: Move the global functionality of Namespace
2330 to GlobalRootNamespace/RootNamespace. Now the global namespace
2331 is GlobalRootNamespace.Globa. Also the code moved from
2332 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2333 Finally added LocalAliasEntry (AliasEntry before) and
2334 ExternAliasEntry, to handle alias statements.
2335 * cs-parser.jay: Add support in the grammar for extern alias
2337 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2338 Update callings to Namespace (now in GlobalRootNamespace).
2340 2005-10-18 Raja R Harinath <rharinath@novell.com>
2343 * class.cs (TypeContainer.DefineType): Move updating of
2344 topological sort earlier in the code.
2345 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2347 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2350 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2352 * constant.cs (Constant.TryReduce): Moved from Cast class.
2353 (Reduce): Made little bit more OO and fixed missing conversions.
2355 * ecore.cs (Reduce): Implemented.
2356 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2358 * literal.cs (Reduce): Implemented.
2360 * class.cs: Reverted Miguel's wrong commit.
2362 2005-10-14 Miguel de Icaza <miguel@novell.com>
2364 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2366 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2368 * cs-parser.jay, expression.cs : CS0214 was missing error location
2369 for constants. Fixed bug #76404.
2371 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2374 * convert.cs (ExplicitConversionCore): Fixed object->enum
2377 2005-10-10 Raja R Harinath <rharinath@novell.com>
2379 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2381 (PropertyExpr.EmitCall): Likewise.
2382 * expression.cs (Invocation.EmitArguments): Handle case where
2384 (Invocation.EmitCall): Avoid allocating temporary variable if
2385 there are no arguments.
2387 2005-10-07 Raja R Harinath <rharinath@novell.com>
2390 * convert.cs (ImplicitConversionStandard): Move conversion of
2391 void* to arbitrary pointer types ...
2392 (ExplicitConversionStandard): .. here.
2393 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2394 error to always print typenames.
2396 2005-10-07 Raja R Harinath <rharinath@novell.com>
2398 * convert.cs (GetConversionOperator): Rename from
2399 GetConversionOperators. Move operator selection code from ...
2400 (UserDefinedConversion): ... here.
2402 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2404 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2407 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2409 * assign.cs (Assign.DoResolve): Error method changed.
2411 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2413 * const.cs (ResolveValue): Reset in_transit immediately.
2415 * constant.cs: Error method changed.
2417 * convert.cs: Removed useless location parameter.
2418 (ExplicitNumericConversion): Don't do double enum check.
2419 (ExplicitConversionCore): Renamed from ExplicitConversion.
2420 (ExplicitUnsafe): Extracted from ExplicitConversion.
2421 (ExplicitConversion): Uses for error reporting.
2423 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2425 (ResolveBoolean): Uses common error method.
2426 (CastToDecimal): Get rid of ec.
2427 (CastFromDecimal): Optimized.
2428 (ConvCast): Get rid of ec.
2430 * enum.cs (ResolveValue): Reset in_transit immediately.
2431 (Emit): Return after first error.
2433 * expression.cs: Convert changes.
2435 * literal.cs: Error method changed.
2437 * statement.cs: Error method changed.
2439 2005-10-03 Raja R Harinath <rharinath@novell.com>
2441 * support.cs (SeekableStreamReader.Position): Don't error out when
2442 the requested position is just beyond the end of the current
2445 2005-09-28 Raja R Harinath <rharinath@novell.com>
2447 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2448 try to keep in sync with the byte count of the underlying Stream.
2449 However, this limits us to a window size of 2048 characters: i.e.,
2450 the maximum lookahead of our lexer/parser can be 2048 characters.
2452 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2455 * driver.cs: Fix compilation files with full root path.
2457 2005-09-25 Miguel de Icaza <miguel@novell.com>
2459 * report.cs (SymbolRelatedToPreviousError): Format the output so
2460 it does not use an open parenthesis that is never closed.
2462 * driver.cs: Follow coding guidelines
2464 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2467 * const.cs (Const.ResolveValue): Check for assigning non-null
2468 value to reference type.
2470 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2472 * anonymous.cs: Implemented ExprClassName.
2474 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2477 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2480 * class.cs (StaticClass.DefineContainerMembers): Report protected
2483 * codegen.cs: if(ed) PRODUCTION.
2485 * convert.cs (Error_CannotImplicitConversion): Better error
2488 * cs-parser.jay: More error checks.
2490 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2492 * driver.cs (CSCParseOption): Enabled wrong option check.
2494 * ecore.cs (Expression.ExprClassName): Turned to property.
2495 (MemberExpr.CheckIntermediateModification): For checking boxed
2496 value types modification.
2498 * statement.cs (Fixed.Resolve): Expression type must be
2499 convertible to fixed type.
2500 (CollectionForeach.GetEnumeratorFilter,TryType):
2501 Small refactoring for easier error checking.
2503 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2505 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2508 * class.cs (GeneratedBaseInitializer): New class for customization
2509 compiler generated initializers.
2510 (MemberBase.DoDefine): Check Obsolete attribute here.
2511 (FieldMember.DoDefine): Ditto.
2513 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2516 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2517 (MemberCore.GetObsoleteAttribute): Removed argument.
2518 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2519 (MemberCore.CheckObsoleteType): New helper.
2523 * statement.cs: Updates after MemberCore changes.
2525 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2526 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2528 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2529 obsolete attribute for compiler construct.
2530 (As.DoResolve): Cache result.
2532 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2534 2005-09-26 Raja R Harinath <rharinath@novell.com>
2537 * expression.cs (This.VerifyFixed): In a value type T, the type of
2538 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2539 value type R, 'this' is treated as a value parameter.
2541 2005-09-22 Miguel de Icaza <miguel@novell.com>
2543 * statement.cs (Lock): Use the TemporaryVariable class instead of
2544 manually using local variables as those do not work when variables
2547 * ecore.cs: Moved the TemporaryVariable class from being a nested
2548 class inside Foreach to be a public class that can be employed in
2551 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2553 * cs-parser.jay: interface_accessors replaced by
2554 accessor_declarations.
2556 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2559 * statement.cs (GotoCase.Resolve): Convert null constant to
2561 (SwitchLabel.ResolveAndReduce): Ditto.
2562 (SwitchLabel.NullStringCase): Custom null stamp.
2563 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2565 typemanager.cs (CSharpSignature): Don't skip first argument
2568 2005-09-18 Miguel de Icaza <miguel@novell.com>
2570 * driver.cs: Set InEmacs based on the environment variable EMACS.
2572 * location.cs (InEmacs): in this mode, do not report column
2573 location as it confuses Emacs.
2575 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2577 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2578 expression.cs, iterators.cs, literal.cs: Store constants and
2581 * class.cs (MemberBase.ShortName): Pass location.
2583 * cs-parser.jay: Some location fixes.
2585 * ecore.cs (Expression.Location): Made virtual.
2587 2005-09-05 Miguel de Icaza <miguel@novell.com>
2589 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2590 if the underlying types are the same, otherwise we need to produce
2591 code that will do the proper cast.
2593 This was exposed by Marek's constant rewrite which produced
2594 invalid code for the call site:
2597 void Method (X v) {}
2601 This fixes test-49.cs
2603 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2605 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2606 Type/Object should be allowed as well. Fixed bug #75968.
2608 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2610 * expression.cs : (Binary.DoResolve): when one is enum constant and
2611 another is constant 0, then return enum one *as enum type*.
2614 2005-09-02 Raja R Harinath <rharinath@novell.com>
2616 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2620 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2621 flow-branching for LocalVariableReferences in case we were invoked
2622 from a MemberAccess.
2623 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2625 (LocalVariableReference.DoResolveBase): ... this.
2626 (MemberAccess.Resolve): Do the check that was disabled during
2629 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2632 (PartialContainer.Create): check abstract/sealed/static strictly
2633 but abstract/sealed can exist only at one side. Fixed bug #75883.
2635 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2638 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2639 specified, don't default to UnmanagedType.I4.
2641 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2643 * expression.cs : conditional operator should check possibly
2644 incorrect assign expression. Fixed bug #75946.
2646 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2648 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2649 Reverting the change. gmcs is much complex than mcs on this matter.
2651 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2653 * cs-tokenizer.cs : To read another token ahead of the actual
2654 consumption, use new SavedToken and cache token instead of moving
2655 back the stream with SeekableStreamReader (it seemed problematic).
2657 driver.cs : Thus use StreamReader directly.
2658 * support.cs : Thus removed SeekableStreamReader.
2660 2005-08-30 Raja R Harinath <rharinath@novell.com>
2663 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2664 (ScopeInfo.EmitScopeType): Use it to construct field names from
2665 names of captured locals.
2668 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2669 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2670 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2671 (ExplicitConversion): Remove enum cases already handled by
2672 implicit conversion. Move implicit conversion check to the beginning.
2673 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2674 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2675 Don't treat System.Enum as a struct.
2677 2005-08-30 Jb Evain <jbevain@gmail.com>
2679 * attribute.cs: handles as expression in parameters.
2681 2005-08-30 Raja R Harinath <rharinath@novell.com>
2684 * class.cs (TypeContainer.VerifyClsName): Don't use a
2685 PartialContainer when verifying CLS compliance.
2686 (AbstractPropertyEventMethod): Set Parent here, ...
2687 (PropertyMethod): ... not here.
2689 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2691 * attribute.cs : escaped attribute name should not be allowed to be
2692 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2694 2005-08-29 Raja R Harinath <rharinath@novell.com>
2697 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2698 when converting a long constant to unsigned long.
2699 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2700 detect where IsApplicable and VerifyArgumentsCompat disagree.
2702 2005-08-29 Raja R Harinath <rharinath@novell.com>
2703 and Carlos Alberto Cortez <carlos@unixmexico.org>
2706 * class.cs (TypeContainer.CanElideInitializer): New helper.
2707 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2708 can safely emitting the initializer of a field.
2710 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2712 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2713 allowed inside a switch (without loop). Fixed bug #75433.
2715 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2717 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2718 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2720 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2722 * driver.cs : kinda reverting the default encoding changes (not exact
2723 revert since I noticed that "codepage:reset" might not work fine).
2725 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2727 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2728 Location. Now getter and setter store location correctly.
2729 (errors/cs0111-12.cs now reports the expected location.)
2731 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2733 * driver.cs : Use default encoding on the environment.
2734 Removed (now that) extra parameter for SeekableStreamReader.
2735 * support.cs : (SeekableStreamReader) third .ctor() argument for
2736 StreamReader is not required (always true). preamble size could
2737 be acquired in simpler and safe way.
2739 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2741 * cs-parser.jay: report CS0642 at warning level 3
2742 and report CS0642 for an if else statement also
2743 fixes bug #74745. Patch by John Luke (and a bit
2745 Removed extra CS0642 warning check for "while",
2747 * statement.cs: In Block.Resolve(), CS0642 check
2748 is reimplemented to check a sequence of an empty
2749 statement and a block.
2751 Both fix bug #66777.
2753 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2755 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2756 detection until I fix it.
2758 * cs-tokenizer.cs: Changed error message.
2760 * cs-parser.jay: Fixed 2 error locations.
2762 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2763 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2766 * enum.cs (GetSignatureForError): Fixed.
2768 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2772 * typemanager.cs (RegisterProperty): Removed.
2774 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2776 2005-08-24 Raja R Harinath <rharinath@novell.com>
2779 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2780 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2782 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2784 * expression.cs : tiny fix is required for not warning positive ulong.
2787 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2789 * expression.cs : add CS0652 check for constant and integral
2790 expression. Fixed bug #53974.
2792 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2794 * expression.cs : in DoNumericPromotions(), check if there is implicit
2795 conversion overload for string (to check CS0034). Fixed bug #52492.
2797 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2799 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2801 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2803 * ecore.cs : report location when it is *not* Null.
2805 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2811 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2812 correctly. Fixed bug #75721.
2814 2005-08-23 Raja R Harinath <rharinath@novell.com>
2816 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2817 loop that performs 'min (pos, char_count)'.
2820 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2821 converted value in Operator.OnesComplement.
2823 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2825 * anonymous.cs: If the anon method is pulled into a helper class,
2826 it needs to be `internal' not `private'. Fixes runtime behavior on
2829 2005-08-20 Martin Baulig <martin@ximian.com>
2831 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2832 scope if we don't already have it.
2834 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2835 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2838 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2841 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2844 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2846 The big constants rewrite
2847 Fix #75746, #75685 and more
2848 As a side effect saved 1MB for MWF ;-)
2850 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2851 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2852 enum based for corlib compilation.
2854 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2857 * class.cs (FixedField.Define): Use ResolveAsConstant.
2859 * const.cs (IConstant): Interface constants and enums.
2860 (Const.ResolveValue): New method for constant resolvning.
2861 (ExternalConstant): Constants from imported assemblies.
2863 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2864 conversion; like enums.
2865 (Constant.ToType): Converts this constant to different type.
2866 (Constant.Increment): Adds 1.
2868 * convert.cs (ImplicitConversionRequired): Simplified.
2870 * cs-parser.jay: Create EnumMember directly.
2872 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2874 * doc.cs (GenerateEnumDocComment): Removed.
2876 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2877 (ConvertIntLiteral): Removed.
2878 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2880 * enum.cs (EnumMember): Implement IConstant.
2881 (Enum.IsValidEnumConstant): Removed.
2882 (Enum.GetNextDefaultValue): Removed.
2883 (Enum.FindMembers): Updated.
2884 (Enum.GenerateDocComment): Iterate enum members.
2886 * expression.cs (Cast.TryReduce): Handle enums correctly.
2887 (New.Constantify): Made public.
2888 (MemberAccess.DoResolve): Removed contant specific if(s).
2890 * literal.cs (NullLiteral): Implement new abstract methods.
2892 * statement.cs (GotoCase.Resolve): Use new constant methods.
2893 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2895 * typemanager.cs (LookupEnum): Removed.
2896 (IsEnumType): Fixed to work with corlib.
2897 (RegisterConstant): Removed.
2898 (LookupConstant): Removed.
2899 (GetConstant): Changed to work with IConstant.
2901 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2903 * location.cs : Fixed overflown (>255) column number.
2905 2005-08-03 Raja R Harinath <rharinath@novell.com>
2907 First cut of the qualified-alias-member feature.
2908 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2910 * cs-parser.jay (DOUBLE_COLON): New token.
2911 (namespace_or_type_name): Add rule for recognizing
2912 qualified-alias-members.
2913 (primary_expression): Likewise.
2914 (element_access): Allow QualifiedAliasMember as a possible
2915 type-bearing expression.
2916 (local_variable_type, local_variable_pointer_type): Likewise.
2917 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2918 aliases in the current and enclosing namespace declarations.
2919 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2920 * decl.cs (MemberName.is_double_colon): New.
2921 (MemberName.MemberName): Add new constructor for alias-member.
2922 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2923 * expression.cs (QualifiedAliasMember): New expression type.
2925 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2927 * location.cs : it borked when no argument was specified.
2929 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2931 * location.cs : tiny ToString() format fix.
2933 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2935 * statement.cs : oops, it was missing.
2937 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2939 A set of fixes for precise line/column location.
2942 "token" field now holds a file/line "delta", a line number offset
2943 from the segment, and a column number. See also:
2944 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2945 December/009508.html
2946 Removed static IsNull. Use instance IsNull property instead.
2948 For some tokens it stores Location. For Identifier it stores
2949 LocatedToken which is a pair of string name and location.
2950 Column numbers are adjusted only at getChar().
2952 Use Location.ToString() for reporting (it now contains column).
2954 Largely modified to use LocatedToken instead of
2955 string (IDENTIFIER), and to acquire Location from some tokens.
2956 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2957 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2959 Now MemberName holds Location. DeclSpace.ctor() receives Location
2960 as a parameter. Removed extra parameters to all derived classes.
2961 Replaced Location.IsNull() with instance property.
2962 * assign.cs, expression.cs :
2963 Added .ctor() overload that omits Location.
2965 Added "nameEscaped" flag that indicates the identifier was escaped
2966 in the source file. This fixes bug #57047.
2968 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2970 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2971 New method, looking for lo-case imported cls type.
2973 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2976 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2978 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2980 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2982 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2984 Optimized to save 3.5 MB for SWF compilation.
2986 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2988 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2989 (PartialContainer.Create): Moved logic AddToContainer.
2990 (PartialContainer.MarkForDuplicationCheck): Shares name.
2992 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2995 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2997 (Namespace.GetSignatureForError): New method.
2999 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3000 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3002 2005-08-01 Raja R Harinath <rharinath@novell.com>
3005 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3006 member lookup rather than qualifier_type, since qualifier_type can
3009 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3011 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3014 2005-07-31 Miguel de Icaza <miguel@novell.com>
3016 * statement.cs: Copy the local exception into the exception
3017 captured local. Fixes 75674
3019 2005-07-31 Raja R Harinath <harinath@gmail.com>
3022 * expression.cs (Invocation.OverloadResolve): Don't report error
3023 CS1501 if error CS1502 has been reported.
3024 (New.DoResolve): Delegate CS1501 reporting to
3025 Invocation.OverloadResolve.
3028 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3029 invariant-meaning-in-block property in an enclosing block if
3032 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3034 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3035 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3036 (Switch.CheckSwitch): Just save 50kb for SWF.
3038 2005-07-27 Martin Baulig <martin@ximian.com>
3040 * anonymous.cs (CaptureContext.AddField): Added
3041 `AnonymousContainer am' argument; compute its toplevel scope if
3042 it's not already computed. Fixes #75649.
3044 2005-07-26 Raja R Harinath <rharinath@novell.com>
3047 * class.cs (Constructor.Emit): Reset block to null if the block
3050 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3052 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3054 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3056 * class.cs (MethodData.Define): Check whether accessor implementing
3057 interface is public.
3059 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3061 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3064 * namespace.cs (LookupType): Moved same type check to...
3066 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3069 2005-07-21 Raja R Harinath <rharinath@novell.com>
3071 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3072 already found a typebuilder.
3073 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3074 MemberNames, not strings.
3076 * const.cs (Error_ExpressionMustBeConst):
3077 Rename from Error_EpressionMustBeConst.
3078 * const.cs, class.cs, statement.cd: Update.
3080 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3084 * const.cs (Const.LookupConstantValue): Report missing contant expression
3086 (Error_EpressionMustBeConstant): Only one error method.
3088 * class.cs, statement.c: Updated.
3090 2005-07-20 Raja R Harinath <rharinath@novell.com>
3092 * statement.cs (Block.Flags): Add back HasVarargs.
3093 (Block.flags): Make protected.
3094 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3096 * typemanager.cs (types, typecontainers, user_types): Remove.
3097 (UserTypes, TypeContainers): Likewise.
3098 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3099 (CleanUp, Reset): Update.
3100 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3101 (GetNestedType): Use Type.GetNestedType.
3102 (CoreLookupType): Take two arguments, the namespace and the
3103 basename of the type. Update to use the Namespace.Lookup
3105 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3106 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3107 string concatenation and substring matches.
3108 * class.cs, enum.cs, delegate.cs: Update to changes.
3110 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3112 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3113 Expression and made virtual.
3115 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3116 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3118 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3120 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3123 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3126 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3129 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3130 AssemblyCultureAttribute is not used on executable.
3133 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3135 2005-07-16 Raja R Harinath <rharinath@novell.com>
3138 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3139 New. Reports CS0252/CS0253.
3140 Mostly taken from preliminary patch by Duncak Mak.
3141 (Binary.DoResolveOperator): Store results of operator lookup.
3142 Use them to detect if we need to warn about unintended reference
3145 2005-07-15 Raja R Harinath <rharinath@novell.com>
3148 * namespace.cs (Namespace.Lookup): Add back location parameter.
3149 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3150 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3152 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3153 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3154 (Namespace.LookupType): ... this.
3155 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3157 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3158 purported to handle pointers.
3159 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3162 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3164 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3167 2005-07-15 Raja R Harinath <rharinath@novell.com>
3169 * namespace.cs (Namespace.Lookup): Drop location parameter.
3170 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3171 (NamespaceEntry.Lookup): ... this.
3172 (NamespaceEntry.Error_AmbiguousTypeReference):
3173 Move here from DeclSpace.
3174 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3176 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3177 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3178 Move to NamespaceEntry.
3179 * delegate.cs, expression.cs: Update to changes.
3181 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3183 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3184 CheckAttributeType and refactored.
3185 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3186 ResolveAsTypeTerminal error handling.
3187 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3189 (GetSignatureForError): Print errors in same way.
3192 * codegen.cs: Reflect attribute GetSignatureForError change.
3195 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3197 * namespace.cs (UsingEntry): Refactored to make fields private.
3200 statement.cs: Error_UnexpectedKind has extra parameter.
3202 2005-07-14 Raja R Harinath <rharinath@novell.com>
3204 * ecore.cs (IAlias): Remove.
3205 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3206 that implement the interface.
3207 * namespace.cs (Namespace): Likewise.
3208 (Namespace.declspaces): Renamed from 'defined_names'.
3209 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3210 DeclSpace instead of an IAlias.
3211 * tree.cs (Tree.AddDecl): Update.
3213 2005-07-12 Raja R Harinath <rharinath@novell.com>
3215 * statement.cs (Block.Flags); Remove HasVarargs.
3216 (Block.HasVarargs): Move to ToplevelBlock.
3217 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3218 (Block.Variables): Make protected. Initialize variable hashtable
3220 (Block.AddVariable): Update.
3221 (Block.Resolve): Update to changes.
3222 (ToplevelBlock.HasVarargs): New boolean.
3223 (ToplevelBlock.ThisVariable): Move here from Block.
3224 (ToplevelBlock.AddThisVariable): Likewise.
3225 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3226 * expression.cs (This.ResolveBase): Update to changes.
3227 (ArglistAccess.DoResolve): Likewise.
3229 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3232 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3234 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3235 not used and not used & assigned.
3236 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3238 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3241 * expression.cs (Is.DoResolve): null is never provided type.
3243 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3246 * cs-parser.jay: Less strict event error rule to catch more errors.
3248 2005-07-08 Martin Baulig <martin@ximian.com>
3250 Fix test-iter-10.cs - distinguish whether we `yield' in a property
3251 gettter (allowed) or setter (not allowed).
3253 * class.cs (Accessor): Implement IIteratorContainer.
3254 (Accessor.Yields): New public field.
3255 (PropertyBase.PropertyMethod.Define): Handle iterators on a
3259 (get_accessor_declaration, set_accessor_declaration): Set the
3260 `yields' flag on the accessor, not the property.
3261 (property_declaration): Do the iterators check on a per-accessor
3262 basis and not for the whole property.
3264 2005-07-08 Martin Baulig <martin@ximian.com>
3266 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3267 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3269 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3272 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3273 (ExtractSecurityPermissionSet): Cope with self referencing security
3274 attributes properly.
3276 * driver.cs (SetOutputFile): Made public property OutputFile.
3278 2005-07-07 Raja R Harinath <rharinath@novell.com>
3281 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3282 has_nonstatic_fields. Make into a FieldBase pointer.
3283 (TypeContainer.AddField): Add CS0282 check.
3284 (TypeContainer.EmitType): Update.
3286 2005-07-06 Miguel de Icaza <miguel@novell.com>
3288 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3289 compare if they start with __.
3291 2005-07-06 Raja R Harinath <rharinath@novell.com>
3293 * statement.cs (Switch.SwitchGoverningType): Only look at
3294 UserCasts that don't need implicit standard conversions to one of
3295 the allowed switch types (Fixes test-322.cs).
3296 (LocalInfo.Resolve): Re-enable sanity-test.
3298 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3300 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3302 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3304 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3306 2005-07-06 Raja R Harinath <rharinath@novell.com>
3309 * ecore.cs (SimpleName.GetSignatureForError): Add.
3310 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3311 (MemberAccess.GetSignatureForError): Add.
3313 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3315 The big error and warning messages review.
3345 * typemanager.cs: Updated.
3347 * class.cs: (MethodCore.SetYields): Moved here to share.
3348 (PropertyMethod.Define): Moved iterator setup here.
3350 * iterators.cs: Add orig_method to have full access to parent
3353 2005-07-05 Raja R Harinath <rharinath@novell.com>
3355 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3356 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3357 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3358 variable of struct type.
3359 * expression.cs (Unary.ResolveOperator): Update to change.
3360 (Indirection.VerifyFixed): Likewise.
3361 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3362 (ParameterReference.VerifyFixed): Value parameters are fixed.
3363 (This.VerifyFixed): Treat 'this' as a value parameter.
3364 * statement.cs (LocalInfo.IsFixed): Remove.
3366 2005-07-01 Martin Baulig <martin@ximian.com>
3368 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3369 `ec.EmitThis ()' to get the correct scope.
3371 2005-07-01 Martin Baulig <martin@ximian.com>
3373 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3374 instance is a ParameterReference; fixes #75299.
3376 2005-07-01 Martin Baulig <martin@ximian.com>
3378 Reverted Marek's latest patch (r46725):
3379 - it contains structural changes which are neither mentioned in
3380 the ChangeLog nor explained anywhere; for example the additional
3381 argument of EmitContext's and Iterator's .ctor's and the
3382 TypeContainer.DefineMembers() change.
3383 - structural changes like this should go in in seperate patches
3384 and not be hidden in a huge patch which just seems to affect
3385 warnings and errors.
3386 a big and hard to understand patch.
3387 - it breaks iterators and causes regressions, for instance in
3390 2005-06-30 Raja R Harinath <rharinath@novell.com>
3393 * expression.cs (Indexers.map): Remove.
3394 (Indexers.Append): Filter out inaccessible setters and getters.
3395 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3398 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3400 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3401 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3402 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3403 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3405 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3408 * class.cs (FieldBase.GetInitializerExpression): One more field
3411 2005-06-28 Miguel de Icaza <miguel@novell.com>
3413 * pending.cs: Do not define a proxy if the base method is virtual,
3414 it will be picked up by the runtime (bug 75270).
3416 2005-06-08 Martin Baulig <martin@ximian.com>
3418 The big Iterators rewrite :-)
3420 * iterators.cs: Rewrite this to use the anonymous methods framework.
3422 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3423 before the TypeContainers; see 2test-21.cs.
3426 (TypeContainer.DefineType): Don't create a new EmitContext if we
3427 already have one (this only happens if we're an Iterator).
3428 (TypeContainer.Define): Also call Define() on all our iterators.
3429 (Method.CreateEmitContext): Added support for iterators.
3432 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3433 (AnonymousContainer.CreateMethodHost): Moved here from
3434 AnonymousMethod and made abstract.
3435 (AnonymousContainer.CreateScopeType): New abstract method.
3436 (AnonymousContainer.IsIterator): New public property.
3437 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3438 get the ScopeTypeBuilder rather than manually defining it here.
3439 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3442 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3443 before RootContext.DefineTypes().
3445 * codegen.cs (EmitContext.RemapToProxy): Removed.
3446 (EmitContext.CurrentAnonymousMethod): Changed type from
3447 AnonymousMethod -> AnonymousContainer.
3448 (EmitContext.ResolveTopBlock): Protect from being called twice.
3449 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3450 (EmitContext.EmitThis): Removed the iterators hacks; use the
3451 anonymous methods framework for that.
3454 (ToplevelBlock.Container): Make this a property, not a field.
3455 (ToplevelBlock.ReParent): New public method; move the
3456 ToplevelBlock into a new container.
3457 (Foreach.TemporaryVariable): Simplify.
3459 2005-06-05 Martin Baulig <martin@ximian.com>
3461 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3462 (Block.AddTemporaryVariable): New public method; creates a new
3463 `LocalInfo' for a temporary variable.
3464 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3466 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3467 non-iterator variables.
3469 2005-06-05 Martin Baulig <martin@ximian.com>
3471 * statement.cs (Foreach.TemporaryVariable): Create the
3472 LocalBuilder in the Emit phase and not in Resolve since in some
3473 situations, we don't have an ILGenerator during Resolve; see
3474 2test-19.cs for an example.
3476 2005-06-04 Martin Baulig <martin@ximian.com>
3478 **** Merged r45395 from GCS ****
3480 The big Foreach rewrite - Part II.
3482 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3483 with `PropertyInfo ienumerator_getcurrent'.
3485 * codegen.cs (VariableStorage): Removed.
3488 (Foreach): Derive from Statement, not ExceptionStatement.
3489 (Foreach.CollectionForeach): New nested class. Moved all the code
3490 dealing with collection foreach here.
3491 (Foreach.ForeachHelperMethods): Removed.
3492 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3494 2005-05-23 Martin Baulig <martin@ximian.com>
3496 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3497 don't need to. Fix #75014.
3499 2005-05-20 Martin Baulig <martin@ximian.com>
3501 Merged r44808 from GMCS.
3503 * class.cs (TypeContainer.CircularDepException): Removed.
3504 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3505 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3506 (CS0146) and interface (CS0529) dependencies here.
3508 2005-06-21 Raja R Harinath <rharinath@novell.com>
3510 * expression.cs (Invocation.EmitCall): Fix initialization
3511 'this_call' to reflect current behaviour. Fix indentation.
3513 * convert.cs (FindMostEncompassedType): Add two trivial special
3514 cases (number_of_types == 0 || number_of_types == 1).
3515 (FindMostEncompasingType): Likewise.
3517 2005-06-17 Raja R Harinath <rharinath@novell.com>
3519 Some cleanups preparing for the fix of #75283.
3520 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3522 (EventExpr.InstanceResolve): Likewise.
3523 (EventExpr.DoResolve): Remove redundant checks.
3525 2005-06-10 Duncan Mak <duncan@novell.com>
3527 * cs-tokenizer.cs (process_directives): New flag for controlling
3528 the processing of preprocessor directives.
3529 (x_token): After seeing a '#', return Token.NONE instead of going
3530 to handle_preprocessing_directive() when not processing
3531 directives. This avoids unnecessary processing during the token peek in
3536 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3537 the existing error reporting methods instead of Report.Error.
3539 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3540 after Raja's rewrite.
3542 2005-06-08 Miguel de Icaza <miguel@novell.com>
3544 * class.cs: Small fix.
3546 2005-06-08 Raja R Harinath <rharinath@novell.com>
3549 * class.cs (GetPartialBases): Fix return value check of
3552 2005-06-07 Raja R Harinath <rharinath@novell.com>
3554 Ensure that partial classes are registered in their enclosing
3555 namespace. Initial part of fix of #75160.
3556 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3557 Register declspace with namespace here, not in
3558 DeclSpace.RecordDecl.
3559 * cs-parser.jay: Pass namespace to RecordDecl.
3560 * class.cs (PartialContainer.Create): Likewise.
3561 (ClassPart.DefineType): New sanity-check. Throws an exception if
3563 * decl.cs (Declspace.RecordDecl): Remove.
3564 * namespace.cs (NamespaceEntry.DefineName): Remove.
3566 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3568 * rootcontext.cs: Reset TargetExt as well.
3570 2005-06-03 Raja R Harinath <rharinath@novell.com>
3572 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3575 2005-06-02 Raja R Harinath <rharinath@novell.com>
3577 Fix #75080, cs0119.cs.
3578 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3580 (Expression.Resolve): ... this. Use it. Remove bogus code
3581 allowing ExprClass.Type and ExprClass.Namespace for
3582 ResolveFlags.VariableOrValue.
3583 (Expression.Resolve) [1-argument variant]: Change default resolve
3584 flags based on language version.
3585 (Expression.Error_UnexpectedKind): Use a simple string array
3586 rather than an ArrayList.
3587 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3589 (TypeOfVoid.DoResolve): Likewise.
3590 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3591 flags argument -- it always has the same value.
3593 2005-05-31 Raja R Harinath <rharinath@novell.com>
3596 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3597 Use it in the error message.
3598 * assign.cs, expression.cs, statement.cs: Update.
3600 2005-05-30 Raja R Harinath <rharinath@novell.com>
3603 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3604 the "almostMatchedMember" case too.
3605 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3606 that failed the accessibility checks to 'almost_match'.
3608 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3610 * attribute.cs: Use internal MethodBuilder methods to set
3611 ExactSpelling and SetLastError on PInvoke methods, instead
3612 of passing them via charset. Fixes #75060.
3614 2005-05-27 Raja R Harinath <rharinath@novell.com>
3616 * parameter.cs (Parameter): Remove TODO comment.
3617 (Parameter.DefineParameter): Remove Location parameter.
3618 (Parameters.LabelParameters): Likewise.
3619 * class.cs (Constructor.Emit): Update to change.
3620 (MethodData.Emit): Likewise.
3621 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3622 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3624 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3627 Removed Parameters.Location and added Parameter.Location instead.
3628 Removed Location parameter from Emit() and GetSignature().
3635 Modified all related calls.
3637 2005-05-26 Raja R Harinath <rharinath@novell.com>
3639 Improve user-defined conversion handling.
3640 * convert.cs (GetConversionOperators): Rewrite. Return only the
3641 applicable operators.
3642 (AddConversionOperators): New. Helper for GetConversionOperators.
3643 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3644 there is only one most encompassed/encompassing type.
3645 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3646 "applicable operator" handling.
3647 (UserConversion): Move cache here from GetConversionOperators.
3648 Directly cache the chosen operator, rather than the whole
3650 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3651 case. Allow conversion of decimal to sbyte and byte too.
3652 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3653 New static methods. Used to avoid allocating EmptyExpressions in
3656 2005-05-24 Duncan Mak <duncan@novell.com>
3658 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3659 another class, used in Convert.ExplicitNumericConversion.
3660 (CastToDecimal): New class, similar to above, but casts to
3661 System.Decimal, used in Convert.ImplicitNumericConversion and also
3662 in explicit convesion from double/float to decimal.
3664 * convert.cs (ImplicitNumericConversion): Handle implicit
3665 conversions to System.Decimal.
3666 (ExplicitNumericConversion): handle explicit conversions to
3671 2005-05-20 Miguel de Icaza <miguel@novell.com>
3673 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3674 know the type at this stage, just break through. Fixes #75008
3676 2005-05-19 Martin Baulig <martin@ximian.com>
3679 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3680 to disable error reporting.
3682 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3683 here since we don't want to report an error; see the new test-336.cs.
3685 2005-05-19 Raja R Harinath <rharinath@novell.com>
3687 * statement.cs (ToplevelBlock.GetParameterReference)
3688 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3689 Move here from class Block.
3690 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3691 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3693 2005-05-18 Martin Baulig <martin@ximian.com>
3698 (FlowBranching.Reachability): Add non-static public And() and Or()
3700 (FlowBranchingSwitch): New class; do the `break_origins' thing
3701 like in FlowBranchingLoop.
3702 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3703 reachability, not just locals and parameters.
3704 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3705 switch; MergeBreakOrigins() now takes care of that.
3707 2005-05-18 Martin Baulig <martin@ximian.com>
3709 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3710 a loop and may leave it, reset the barrier; fixes #74974.
3712 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3714 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3717 * cs-parser.jay: Catch more lexical errors.
3719 * report.cs: Add one more Error method.
3722 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3724 2005-05-17 Martin Baulig <martin@ximian.com>
3726 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3729 2005-05-16 Raja R Harinath <rharinath@novell.com>
3731 Fix test-382.cs. Emit values of decimal constants.
3732 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3734 (TypeContainer.AddField): ... this.
3735 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3736 with initializers to include 'Const's.
3737 (ClassPart.RegisterFieldForInitialization): Forward to
3739 * const.cs (Const.Const): Pass initializer to base class.
3740 (Const.Define): In case of decimal constants, register them for
3741 initialization in a static constructor.
3743 2005-05-14 Martin Baulig <martin@ximian.com>
3745 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3746 do not call ResolveUnreachable() on unreachable statements in
3747 here, see the comment in the source code.
3749 2005-05-13 Raja R Harinath <rharinath@novell.com>
3752 * expression.cs (BinaryResolveOperator): If one of the operands of
3753 an equality comparison is 'null' and the other is a pointer type,
3754 convert the null to a NullPointer.
3755 * convert.cs (ImplicitReferenceConversion): If the expression is a
3756 NullLiteral and the target type is a pointer type, return a
3757 NullPointer instead.
3758 (ImplicitConversionStandard): Likewise.
3760 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3762 * cs-parser.jay: Set readonly context based on special constructs.
3764 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3765 readonly variable error handling.
3767 * rootcontext.cs (EmitCode): Don't verify members when error
3770 * statement.cs (LocalInfo): Add reaodnly context information.
3771 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3773 2005-05-13 Raja R Harinath <rharinath@novell.com>
3775 * statement.cs (Block.Resolve): Revert change below. Modify fix
3776 for #74041 to initialize 'resolved' to false only for explicit
3777 blocks. Fixes #74873.
3779 2005-05-12 Raja R Harinath <harinath@gmail.com>
3782 * typemanager.cs (unmanaged_enclosing_types): New.
3783 (IsUnmanagedType): Avoid infloops by using
3784 'unmanaged_enclosing_types' to talk with recursive invocations.
3786 2005-05-13 Martin Baulig <martin@ximian.com>
3788 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3789 instance variable, not a local. Fix #74873.
3790 (Block.ResolveUnreachable): Set it to true here.
3792 2005-05-11 Duncan Mak <duncan@novell.com>
3794 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3795 continuing to process for 'arg'.
3796 (handle_preprocessing_directive): Check the argument of the #endif
3797 directive and report error CS1025 if there are any trailing
3800 According to the C# spec, having even whitespace after the #endif
3801 directive is illegal; however, because we call arg.TrimEnd ()
3802 beforehand, we have the same behavior as csc, allowing whitespace
3803 after the directive.
3807 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3811 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3812 (Constructor.GetObsoleteAttribute): Implemented correctly.
3814 2005-05-10 Martin Baulig <martin@ximian.com>
3816 * support.cs (ReflectionParameters.ParameterModifier): Use
3817 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3818 and `ParameterAttributes.In'. Fixes #74884.
3820 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3822 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3824 * expression.cs (Argument.GetParameterModifier): Turned to property.
3825 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3827 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3830 2005-05-09 Raja R Harinath <rharinath@novell.com>
3833 * decl.cs (MemberCache.AddMethods): Register override methods,
3834 rather than non-override methods.
3835 * typemanager.cs (RegisterOverride): New.
3836 (IsOverride): Update.
3838 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3842 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3843 recursive declaration.
3845 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3847 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3849 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3851 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3853 2005-05-05 Raja R Harinath <rharinath@novell.com>
3856 * decl.cs (DeclSpace.FamilyAccessible):
3857 Use TypeManager.IsNestedFamilyAccessible.
3859 Fix reopened #64812.
3860 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3863 2005-05-04 Raja R Harinath <rharinath@novell.com>
3864 Abin Thomas <projectmonokochi@rediffmail.com>
3865 Anoob V E <projectmonokochi@rediffmail.com>
3866 Harilal P R <projectmonokochi@rediffmail.com>
3869 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3870 allow access to all static members.
3872 2005-05-04 Martin Baulig <martin@ximian.com>
3874 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3876 2005-05-04 Martin Baulig <martin@ximian.com>
3880 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3881 section at the end; make things work if `default' is not the last
3884 2005-05-04 Martin Baulig <martin@ximian.com>
3888 * statement.cs (Switch): Replaced the `got_default' field with a
3889 `default_section' one.
3890 (Switch.CheckSwitch): Set `default_section' here.
3891 (Switch.Resolve): If we're a constant switch and the constant is
3892 not found, use the default section.
3894 2005-05-03 Martin Baulig <martin@ximian.com>
3896 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3898 * statement.cs (Foreach.ArrayForeach): New nested class.
3899 (Foreach.TemporaryVariable): New nested class.
3900 (Foreach.EmitArrayForeach): Removed; this is now in the new
3903 2005-05-03 Raja R Harinath <rharinath@novell.com>
3905 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3907 (VerifyPendingMethods): Revert change below.
3909 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3910 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3911 that used to trigger warning -28. Remove warning -28.
3912 * expression.cs (Invocation.OverloadResolve): Use
3913 TypeManager.IsOverride to distinguish override methods.
3916 * pending.cs (VerifyPendingMethods): If a base type implements the
3917 requested interface, don't bother checking individual methods of
3918 the base type. As a side-effect, this prevents the creation of
3919 unnecessary proxies.
3921 2005-05-02 Martin Baulig <martin@ximian.com>
3925 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3926 Also `And' the locals if the old vector is null.
3927 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3928 null; in this case we basically reset all the variables.
3930 2005-05-02 Martin Baulig <martin@ximian.com>
3934 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3935 Added `FlowBranching branching' argument; always `and' the
3936 variables instead of `or'ing them unless we're an infinite loop.
3938 * statement.cs (While.Resolve): Create a new sibling unless we're
3941 2005-05-02 Martin Baulig <martin@ximian.com>
3945 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3946 arguments; use it instead of creating a new TopLevelBlock.
3947 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3948 our ConstructorInitializer.
3951 (TopLevelBlock.TopLevelBranching): New public property.
3952 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3953 and create our `TopLevelBranching'.
3955 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3956 anonymous method host, use `block.TopLevelBranching' rather than
3957 creating a new branching.
3959 2005-04-20 Miguel de Icaza <miguel@novell.com>
3961 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3962 a ScopeInfo, if any of the current children is a child of the new
3963 entry, move those children there.
3965 2005-04-30 Martin Baulig <martin@ximian.com>
3967 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3968 at the beginning of a SwitchSection. Fix #73335.
3970 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3973 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3975 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3976 (FieldExpr.DoResolve): Obsolete members are ignored for field
3979 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3981 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3982 of arrays detection.
3984 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3986 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3988 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3991 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3993 * cs-parser.jay: Use the prefered version of -unsafe in error
3996 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3998 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4001 2005-04-20 John Luke <john.luke@gmail.com>
4003 * driver.cs: fix typo in error message, --outout to --output
4005 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4007 * codegen.cs (InRefOutArgumentResolving): New field.
4009 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4010 fields outside contructor.
4012 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4014 2005-04-19 Miguel de Icaza <miguel@novell.com>
4016 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4017 parameter code was not completed ever, so it was not as up-to-date
4018 as local variables. Must finish it.
4020 The bug fix was to compare the Toplevel of the block, not the
4021 current block. Thanks for Ben for pointing this out.
4023 2005-04-19 Raja R Harinath <rharinath@novell.com>
4025 * decl.cs (AddMethods): Use the declaring type of the problem
4026 method to determine if we want to squash a warning.
4028 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4030 * attribute.cs: Removed debug output.
4032 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4034 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4037 2005-04-18 Raja R Harinath <rharinath@novell.com>
4040 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4041 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4042 all null comparisons against reference types.
4044 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4047 * class.cs (TypeContainer.CircularDepException) New nested
4049 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4050 (TypeContainer.DefineType): Removed error, reset InTransit before
4052 (Class.DefineType): Throw exception when is in Transit.
4053 Catch exception and report error.
4054 (Struct.DefineType): Throw exception when is in Transit.
4055 Catch exception and report error.
4056 (Interface.DefineType): Throw exception when is in Transit.
4057 Catch exception and report error.
4059 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4060 handle nested exception handlers.
4062 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4065 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4066 InFinally and InCatch storage.
4068 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4069 (Catch.Resolve): Set and Restore ec.InCatch.
4070 (Try.Resolve): Set and Restore ec.InFinally.
4071 (Try.HasCatch): True when try has catch.
4073 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4075 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4076 for the same event member, so exclude such cases from warning 419.
4079 2005-04-16 Miguel de Icaza <miguel@novell.com>
4081 * expression.cs (Binary.ResolveOperator): Apply patch from John
4082 Luke to fix bug 59864: operators &, | and ^ on enumerations
4083 require that the same enum type on both sides.
4085 * driver.cs: Add warnings to old flag usage, this is to assist
4086 people who produce Makefiles and hope that the Makefiles will be
4089 * class.cs (TypeContainer.EmitType): Moved the definition of the
4090 special $PRIVATE$ field from the resolve phase to the Emit phase.
4091 During resolve we do not know if we are a struct with
4092 HasExplicitLayout, we know this only after the attributes for the
4095 Set the FieldOffset to zero on the dummy field that we create for
4096 the class. Fixes 74590.
4098 2005-04-16 Raja R Harinath <rharinath@novell.com>
4101 * ecore.cs (PropertyExpr.resolved): New.
4102 (DoResolve): Use it to handle a case of double resolution here.
4103 Handle a case of identical-name-and-type-name.
4104 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4105 resolution by storing the results of expression resolution back
4106 into the "probes" array.
4108 2005-04-15 Raja R Harinath <rharinath@novell.com>
4110 Fix cs0208-7.cs and cs0208-8.cs.
4111 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4112 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4113 error reporting to point out the reason a struct is not unmanaged.
4115 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4117 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4118 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4120 2005-04-13 Raja R Harinath <rharinath@novell.com>
4123 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4124 IdenticalNameAndTypeName here.
4125 (EventExpr.InstanceResolve): Likewise.
4127 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4129 C# 2.0 DefaultCharSetAttribute implementation
4131 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4132 which allows us to set GlobalNamespace for every resolve.
4133 (Attribute.ResolveArguments): Cut from Resolve.
4134 (Attribute.GetCharSetValue): Returns CharSet named argument.
4135 (Attribute.DefinePInvokeMethod): Gets default charset from
4137 (GlobalAttribute.ResolveAsTypeStep): Override.
4138 (GlobalAttribute.ResolveArguments): Override.
4140 * class.cs (TypeAttr): Is protected.
4142 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4143 (ModuleClass.DefaultCharSetType): New memeber.
4144 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4146 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4147 charset from module.
4149 * delegate.cs (TypeAttr): Override.
4150 (Delegate.DefineType): Use this TypeAttr.
4152 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4153 at very early stage (before types are defined) to resolve model
4154 module attributes. It will probably not work with corlib but it
4157 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4158 charset from module.
4160 * typemanager.cs (default_charset_type): New type.
4162 2005-04-13 Raja R Harinath <rharinath@novell.com>
4164 * decl.cs (MemberCache.AddMethods): Don't warn if
4165 System.Object.Finalize has buggy MethodAttributes.
4167 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4170 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4172 * doc.cs : detect ambiguous reference to overloaded members.
4173 Fixed bug #71603. MS 1.1 csc does not detect it.
4175 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4177 * doc.cs : delegates must not be referenced with parameters.
4180 2005-04-12 Miguel de Icaza <miguel@novell.com>
4182 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4184 2005-04-10 Miguel de Icaza <miguel@novell.com>
4186 * driver.cs (MainDriver): Stop processing if the CLS stage found
4189 (CompilerCallableEntryPoint.InvokeCompiler): Always
4190 reset after execution; Take a TextWriter argument for the
4193 * report.cs: Use the error stream instead of hardcoding stderr.
4195 2005-04-09 Miguel de Icaza <miguel@novell.com>
4197 * class.cs: Reduce code paths to test, too small of an
4198 optimization to make it worth the extra testing. Always perform
4201 2005-04-08 Raja R Harinath <rharinath@novell.com>
4204 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4205 operators that had errors reported on them.
4207 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4209 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4211 (Attribute.Resolve): Add named argument type checking.
4213 * class.cs (FixedField.Define): Use IsPrimitiveType
4215 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4217 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4218 unsafe parameter types.
4220 * statement.cs (Using.ResolveExpression): Add better error description.
4222 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4224 2005-04-08 Raja R Harinath <rharinath@novell.com>
4227 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4228 AttributeUsageAttribute in the emitcontext of the attribute class,
4229 not in the emitcontext of the attributable entity it was attached to.
4230 * cs-parser.jay: Use 'current_class', not 'current_container',
4231 when creating a GlobalAttribute.
4233 2005-04-08 Alp Toker <alp@atoker.com>
4235 * pending.cs: The fix to #58413 failed to compile methods implementing
4236 interfaces with/without params modifiers and vice versa, even though
4237 params modifiers aren't part of the signature. Make the modifier check
4238 less strict as in csc.
4240 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4241 Anoob V E <projectmonokochi@rediffmail.com>
4242 Harilal P R <projectmonokochi@rediffmail.com>
4245 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4246 modifiers of pending methods.
4247 (PendingImplementation.PendingImplementation): Initialize it.
4248 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4249 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4250 with ParameterData. Add check for modifiers.
4251 * class.cs (MethodData.Define): Update to changes.
4253 2005-04-07 Raja R Harinath <rharinath@novell.com>
4255 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4257 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4259 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4262 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4265 * typemanager.cs: Registered RequiredAttributeAttribute.
4267 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4269 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4270 Warning CS0169 is back at level 3.
4271 (IMethodData.SetMemberIsUsed): New method.
4273 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4274 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4276 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4278 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4280 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4283 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4286 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4287 to avoid the problems with nested types.
4289 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4290 Anoob V.E <projectmonokochi@rediffmail.com>
4291 Harilal P.R <projectmonokochi@rediffmail.com>
4292 Raja R Harinath <rharinath@novell.com>
4295 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4297 * typemanager (GetConstructor): Make public.
4299 2005-04-05 John Luke <john.luke@gmail.com>
4300 Raja R Harinath <rharinath@novell.com>
4303 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4304 struct too. Return false quicker in a few cases.
4305 (VerifyUnManaged): Use it.
4307 2005-04-05 Raja R Harinath <rharinath@novell.com>
4310 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4311 not 'unreachable_seen'.
4313 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4315 * attribute.cs (Attribute.GetValue): Removed unused.
4317 * codegen.cs (CodeGen.TrimExt): Removed unused.
4319 * cs-parser.jay (output): Removed unused.
4321 * cs-tokenizer.cs (hex_digits): Removed unused.
4323 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4325 * expression.cs (Indirection.LoadExprValue): Removed unused.
4326 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4328 * iterators.cs (Iterator.param_types): Removed unused.
4330 * statement.cs (Goto.block): Removed unused.
4331 (ToplevelBlock.did): Removed unused.
4332 (Switch.ResolveConstantSwitch): Removed unused.
4334 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4336 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4339 2005-04-01 Raja R Harinath <rharinath@novell.com>
4341 Fix #74232 and cs0208-3.cs.
4342 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4343 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4344 unmanaged type. Don't use FieldBuilders when 't' is a
4345 TypeBuilder. Use ModFlags and MemberType fields.
4346 * class.cs (MemberBase.member_type): Rename from MemberType.
4347 (MemberBase.MemberType): New property. Determines member_type on
4349 (MemberBase.DoDefine): Don't initialize MemberType here.
4350 (FieldMember.Define): Likewise.
4352 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4355 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4356 Attributes are emitted there.
4358 2005-04-01 Raja R Harinath <rharinath@novell.com>
4360 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4361 keyword in 'partial enum' too.
4362 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4364 Report from Kamil Skalski <nazgul@omega.pl>.
4367 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4368 have partial containers too.
4370 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4371 in block' checks to Block.CheckInvariantMeaningInBlock.
4372 * statement.cs (Block.GetKnownVariableInfo): Make private.
4373 (Block.IsVariableUsedInChildBlock): Remove.
4374 (Block.IsVariableUsedInBlock): Likewise.
4375 (Block.CheckInvariantMeaningInBlock): New. Show location of
4376 conflicting declaration.
4377 (Block.AddVariable): Make error messages less long-winded and more
4378 specific. Show location of conflicting declaration.
4379 * parameter.cs (Parameters.Location): New readonly property.
4381 2005-03-31 Raja R Harinath <rharinath@novell.com>
4383 Clean up semantics of invoking ResolveMemberAccess.
4384 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4385 can have an instance, ensure that we pass in a non-TypeExpression
4386 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4387 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4388 argument. Update to changes and simplify.
4389 (FieldExpr.Emitinstance): Remove CS0120 check.
4390 (PropertyExpr.EmitInstance): Likewise.
4391 * expression.cs (Argument.Resolve): Likewise.
4392 (Invocation.DoResolve): Update to changes in semantics of
4395 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4398 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4401 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4403 2005-03-31 Raja R Harinath <rharinath@novell.com>
4405 Fix difference in behaviour with commandline invocation.
4406 * driver.cs (Driver.Reset): New.
4407 (CompilerCallableEntryPoint): Call it.
4409 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4410 variable" warnings if the boolean expression failed to resolve.
4412 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4414 * attribute.cs: Fix the union of several permissions when some of them
4415 are unrestricted (so the result isn't an unrestricted permission set).
4418 2005-03-30 Raja R Harinath <rharinath@novell.com>
4420 * ecore.cs (MemberExpr): New class. Convert from interface
4422 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4423 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4425 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4426 (MethodGroupExpr.IsExplicitImpl): Remove.
4427 (Expression.GetFieldFromEvent): Remove.
4428 (SimpleName.MemberStaticCheck): Remove.
4429 (SimpleName.DoSimpleNameResolve): Update to changes.
4430 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4431 (MemberAccess.IdenticalNameAndTypeName): Remove.
4432 (MemberAccess.error176): Move to MemberExpr.
4433 (MemberAccess.DoResolve): Update to changes.
4434 (BaseAccess.DoResolve): Likewise.
4436 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4438 C# 2.0 Conditional attribute class implementation
4440 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4441 Analyzes class whether it has attribute which has ConditionalAttribute
4442 and its condition is not defined.
4444 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4445 (Class.IsExcluded): New method. Search for at least one defined
4446 condition in ConditionalAttribute of attribute class.
4448 2005-03-30 Raja R Harinath <rharinath@novell.com>
4450 * ecore.cs (PropertyExpr): Derive from Expression, not
4451 ExpressionStatement.
4452 (PropertyExpr.EmitStatement): Remove.
4454 2005-03-29 Raja R Harinath <rharinath@novell.com>
4457 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4458 internal field "value__" of an enum be private. The examples for
4459 "value__" that I found on MSDN all used FieldAttributes.Private.
4461 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4462 Don't mention IL method attribute names.
4464 Fix #47991. Remove a TODO.
4465 * statement.cs (Block.Toplevel): Make into a field.
4466 (Block.Parameters): Move into ToplevelBlock.
4467 (Block.known_variables): Rename from child_variable_names.
4468 (Block.Block): Remove variants that take Parameters. Initialize
4469 'Toplevel' with the immediately surrounding toplevel block.
4470 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4471 LocalInfo parameter.
4472 (Block.GetKnownVariableInfo): New.
4473 (Block.IsVariableNameUsedInChildBlock): Update.
4474 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4475 the block, even though it may not be in scope.
4476 (Block.AddVariable): Remove Parameters parameter. Use
4477 Toplevel.Parameters instead.
4478 (Block.AddConstant): Remove Parameters parameter.
4479 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4480 (Block.IsParamaterReference): Likewise.
4481 (Block.IsLocalParameter): Likewise. Simplify a lot.
4482 (ToplevelBlock.Parameters): New. Moved from Block.
4483 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4484 initialize Parameters to a non-null value.
4485 * cs-parser.jay: Update to changes.
4486 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4487 simple names that mean different things in the same block. Use
4488 Block.IsVariableNameUsedInBlock.
4490 2005-03-28 Raja R Harinath <rharinath@novell.com>
4492 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4493 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4494 GetTypeHandle. It is possible for a reflected type to derive from
4495 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4496 System.Array during mscorlib compilation).
4497 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4498 contain a method_hash, don't create one either. Don't create a
4499 deep copy of the base cache's method_hash.
4500 (MemberCache.SetupCache): Rename back from DeepCopy.
4501 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4502 already initialized. If we see an override function, add its
4503 underlying base virtual function to the member_hash too.
4505 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4507 2005-03-26 Raja R Harinath <harinath@acm.org>
4510 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4511 fails to resolve, ensure that the LHS is still resolved as an
4514 2005-03-25 Raja R Harinath <harinath@acm.org>
4516 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4518 (Enum.current_ec): Remove.
4519 (Enum.LookupEnumValue): Remove EmitContext argument.
4520 Just uses the one created during DefineType.
4521 (Enum.FindMembers): Update.
4522 * expression.cs (MemberAccess.DoResolve): Update.
4524 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4526 * assign.cs (Assign.DoResolve): Check for CS1717 when
4527 source and target are same (uses Equals).
4529 * expression.cs (LocalVariableReference, ParameterReference,
4530 This): Implemented Equals, GetHashCode.
4532 * statement.cs (Block.GetParameterReference): Removed useless
4535 2005-03-22 Raja R Harinath <rharinath@novell.com>
4538 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4539 blocks before deciding whether the error is cs0136 or cs0128.
4541 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4542 (using_alias_directive, using_namespace_directive): Pass
4543 MemberName, not an expression to Namespace.UsingAlias and
4545 (MakeName): Use the MemberName of the namespace.
4546 * namespace.cs (Namespace.MemberName): New.
4547 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4548 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4550 * decl.cs (MemberName.Name): Make readonly.
4551 (MemberName.FromDotted): New "constructor".
4552 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4553 (MemberCore.Name): Compute from MemberName on demand.
4554 (MemberCore.SetMemberName): Provide a way to change the
4556 (MemberCore.AddToContainer): Don't take a fullname parameter.
4557 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4558 fully qualified name of the container to the member name.
4559 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4560 only if the type is a member of the root container.
4561 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4562 MemberName.Left rather than searching for an embedded ".".
4563 (PartialContainer.CreatePart): Update to changes in RootContext.
4564 (MemberBase.ShortName): Turn into a property. Use
4565 MemberCore.SetMemberName.
4566 (MemberBase.ExplicitInterfaceName): Remove.
4567 (MemberBase.UpdateMemberName): Remove.
4568 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4569 (PropertyBase.SetMemberName): New override.
4570 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4571 (Tree.GetDecl): New.
4572 (Tree.AllDecls): Rename from Decls.
4573 * attribute.cs, enum.cs, report.cs: Update to changes.
4574 * driver.cs (MainDriver): Use MemberName.FromDotted on
4575 RootContext.MainClass.
4577 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4579 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4582 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4584 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4586 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4587 property accessor modifiers.
4589 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4590 fixed buffer attribute (CS1716).
4591 (PropertyMethod.HasCustomAccessModifier): When property accessor
4592 has custom modifier.
4594 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4596 (PropertyExpr.DoResolveLValue): Add CS0272.
4598 2005-03-17 Miguel de Icaza <miguel@novell.com>
4600 * convert.cs: When converting to a pointer, use the proper Conv.U
4601 or Conv.I depending on the source data type.
4603 * cs-tokenizer.cs: Make the size for large decimal constants,
4606 2005-03-17 Martin Baulig <martin@ximian.com>
4608 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4609 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4611 2005-03-17 Martin Baulig <martin@ximian.com>
4613 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4614 to bool so we can return an error condition.
4615 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4618 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4620 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4623 2005-03-16 Raja R Harinath <rharinath@novell.com>
4625 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4626 Refactor to avoid traversing the list of assemblies, and to avoid
4627 string concatenation.
4628 * typemanager.cs (guid_attr_type): Remove.
4629 (negative_hits, pointers, references): Remove hashes.
4631 (GetConstructedType): New. Uses type_hash to handle constructed
4632 types (arrays, references, pointers).
4633 (GetReferenceType, GetPointerType): Use it.
4634 (GetNestedType): New. Uses type_hash to handle nested types of
4636 (LookupType, LookupTypeDirect): Remove.
4637 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4638 'types' hash and LookupTypeReflection directly.
4639 (params_string, params_object): Use GetConstructedType.
4640 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4642 (Namespace.Lookup): Use cached_types.
4643 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4644 provided by old TypeManager.LookupType.
4645 * rootcontext.cs (MakeFQN): Remove.
4646 * decl.cs (DeclSpace.MakeFQN): Likewise.
4647 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4648 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4649 TypeManager.GetConstructedType.
4650 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4652 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4654 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4657 * cs-parser.jay: Reports CS1527 for any namespace element.
4659 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4662 * expression.cs (ParameterReference.IsAssigned): Changed error to
4664 (Error_WrongNumArguments): Moved CS0245 detection here.
4666 * statement.cs (Return.Resolve): Add CS1622 report.
4668 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4670 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4672 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4674 * attribute.cs expression.cs: Get rid of some allocations.
4676 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4678 * doc.cs : just eliminate the latest change.
4680 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4682 * doc.cs : commented out the latest change. It breaks xml-030.cs
4684 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4686 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4687 fail. So invoke CreateType() in FindDocumentedType().
4689 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4691 * cs-tokenizer.cs : added IsKeyword().
4692 * doc.cs : Detect keyword incorrectly used as identifier.
4693 Allow identifiers prefixed by @.
4695 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4697 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4698 It caused exception in namespace resolving (again!).
4700 * class.cs (Class.ctor): Removed exit.
4701 (PropertyMethod.ctor): ditto.
4703 * codegen.cs (Codegen.Reset): Reset static data.
4704 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4706 * cs-tokenizer.cs (Cleanup): Removed.
4708 * driver.cs (GetSystemDir): Rewrote to one line command.
4709 It caused problem with unloaded dynamic modules.
4710 (UnixParseOption): Removed Exit.
4711 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4712 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4713 Now can be mcs used as library.
4715 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4718 * location.cs (Reset): Reset static data.
4720 * namespace.cs (Reset): Reset static data.
4722 * report.cs (Report.Reset): Reset static data.
4724 * rootcontext.cs (RootContext.Reset): Reset static data.
4726 * tree.cs (RootTypes.ctor): Use Location.Null
4728 * typemanager.cs (TypeManager.Reset): Reset static data.
4729 (CoreLookupType): Removed Exit.
4730 (TypeHandle.Reset): Reset static data.
4732 2005-03-10 Raja R Harinath <rharinath@novell.com>
4735 * typemanager.cs (ComputeNamespaces): Import namespaces from
4736 referenced modules too.
4738 2005-03-09 Raja R Harinath <rharinath@novell.com>
4740 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4743 2005-03-09 Raja R Harinath <rharinath@novell.com>
4745 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4746 enclosing DeclSpace. This ensures that a name-lookup populates
4747 more caches and there are fewer 'TypeExpression's. Carve out
4748 nested type lookup into ...
4749 (LookupNestedTypeInHierarchy): ... this.
4751 2005-03-09 Raja R Harinath <rharinath@novell.com>
4753 Clean up a few partial-class semantics.
4754 Fixes test-357.cs and cs1618-2.cs.
4755 * cs-parser.jay (struct_declaration): Use 'current_class' as
4756 parent of newly-created struct. Remove call to Register ().
4757 Use 'pop_current_class' to complete handing the current struct.
4758 (interface_declaration): Likewise.
4759 (class_declaration): Likewise.
4760 (enum_declaration): Use 'current_class' as parent of newly created
4762 (delegate_declaration): Likewise.
4763 (pop_current_class): New function. This is used to handle closing
4764 up the 'current_class' and 'current_container', and pointing them
4765 to the enclosing class/container.
4766 (CSharpParser): Initialize 'current_class' too.
4767 * decl.cs (MemberCore): Add check for invariant: a partial
4768 container is not a parsed entity, and thus does not enclose any
4770 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4771 (DeclSpace.BaseTypeExpr): Use it.
4772 (DeclSpace.LookupType): Add check for invariant.
4773 * class.cs (TypeContainer): Add check for invariant: a nested
4774 class should have the same NamespaceEntry as its enclosing class.
4775 (TypeContainer.EmitFieldInitializers): Make virtual.
4776 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4778 (TypeContainer.Register): Remove.
4779 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4780 null. Use TypeResolveEmitContext for resolving base types and
4781 interfaces. Move initialization of Parts.TypeBuilder here from
4783 (TypeContainer.DefineNestedTypes): ... here.
4784 (PartialContainer): Take a Namespace not a NamespaceEntry.
4785 (PartialContainer.Create): Don't use Register. Call the
4786 appropriate Add... function directly.
4787 (ClassPart): Take both the PartialContainer and the enclosing
4788 class as constructor arguments.
4789 (ClassPart.EmitFieldInitializers): Override.
4790 (ClassPart.PartFindNestedTypes): Remove.
4791 (FieldBase.GetInitializerExpression): Resolve the initializer
4792 expression in the emit context of the enclosing class.
4793 * tree.cs (RootTypes): Remove Register ().
4795 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4797 * cs-parser.jay: Removed CS0134.
4799 * driver.cs: Removed CS1901.
4801 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4802 for predefined types.
4804 2005-03-07 Duncan Mak <duncan@novell.com>
4806 * codegen.cs (Save): Catch UnauthorizedAccessException as
4807 well. Fixes bug #73454.
4809 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4811 * cs-tokenizer.cs (xtoken): Add CS1035.
4813 * class.cs (MethodData.Define): Add CS0683.
4814 (FieldMember.ctor): Add CS0681.
4816 2005-03-07 Raja R Harinath <rharinath@novell.com>
4818 * ecore.cs (SimpleName.DoResolve): Rename from
4819 SimpleName.DoResolveAllowStatic.
4820 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4821 Pass 'intermediate' flag to MemberStaticCheck.
4822 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4823 of "intermediate" lookups via MemberAccess.
4824 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4825 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4827 2005-03-07 Raja R Harinath <rharinath@novell.com>
4830 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4831 slipped in because of variable names that are identical to a
4832 builtin type's BCL equivalent ('string String;', 'int Int32;').
4833 (PropertyExpr.EmitInstance): Likewise.
4835 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4837 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4839 * report.cs (warning_ignore_table): Made public.
4841 2005-03-04 Raja R Harinath <rharinath@novell.com>
4844 * class.cs (MethodData.Emit): Pass 'container' to
4845 container.GetObsoleteAttribute instead of 'container.Parent'.
4847 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4849 * cs-parser.jay: Add 1534 error test.
4851 * iterators.cs (Yield.CheckContext): Add error 1629.
4852 (Iterator.ctor): Save unsafe modifier.
4853 (MoveNextMethod.DoEmit): Restore unsafe context.
4855 * namespace.cs (UsingAlias): Better error message.
4857 2005-03-03 Dan Winship <danw@novell.com>
4859 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4860 the warning message [#73219]
4862 2005-03-03 Raja R Harinath <rharinath@novell.com>
4864 Fix compile with MCS 1.0.0.0.
4865 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4866 w_restore to not depend on string constant folding.
4868 2005-03-03 Raja R Harinath <rharinath@novell.com>
4870 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4871 CS0246 check to users who passed 'silent = false'.
4872 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4874 (SimpleName.SimpleNameResolve): Update.
4875 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4876 (MemberAccess.IdenticalNameAndTypeName): Update.
4877 * doc.cs (FindDocumentedTypeNonArray): Update.
4879 2005-03-03 Raja R Harinath <rharinath@novell.com>
4881 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4882 * parameters.cs (ComputeAndDefineParameters): Remove.
4883 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4884 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4885 Use GetParameterInfo.
4887 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4889 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4891 2005-03-02 Raja R Harinath <rharinath@novell.com>
4893 Unify DeclSpace.LookupType and DeclSpace.FindType.
4894 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4895 is in charge of defining nested types on demand.
4896 (DeclSpace.LookupType): Use it when the current_type is a
4897 TypeBuilder. Use LookupTypeDirect for reflected types.
4898 (DeclSpace.FindType): Remove.
4899 (DeclSpace.LookupInterfaceOrClass): Likewise.
4900 (DeclSpace.DefineTypeAndParents): Likewise.
4901 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4902 DeclSpace.LookupType.
4903 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4904 * typemanager.cs (LookupType): Simplify.
4905 (AddUserType): Remove type from negative_hits.
4906 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4907 * class.cs (TypeContainer.FindMembers): Move handling of nested
4909 (TypeContainer.FindMembers_NestedTypes): ... here.
4910 (TypeContainer.FindNestedType): Implement override.
4911 (ClassPart.FindNestedType): Delegate to PartialContainer.
4912 (ClassPart.PartFindNestedType): Looks up the nested types of the
4915 2005-03-02 Martin Baulig <martin@ximian.com>
4917 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4918 static constructor in static classes.
4920 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4922 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4923 sizeParamIndex is not specified.
4925 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4928 * report.cs (WarningMessage.IsEnabled): Missing null check.
4930 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4932 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4933 in the fields and not in the properties.
4935 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4937 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4940 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4942 * attribute.cs: Small refactoring (improved robustness).
4943 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4944 (ValidateGuid): Removed.
4945 (Resolve): Removed referenced to above mentioned.
4946 (GetAttributeUsage): Made private and changed to work without
4948 (GetIndexerAttributeValue): Don't crash.
4949 (GetConditionalAttributeValue): Ditto.
4950 (GetClsCompliantAttributeValue): Ditto.
4951 (ExtractSecurityPermissionSet): All attributes exceptions are
4953 (GetPropertyValue): New helper.
4954 (GetMethodImplOptions): New method.
4955 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4956 some missing properties.
4958 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4959 (Method.ApplyAttributeBuilder): Updated.
4961 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4964 2005-02-28 Raja R Harinath <rharinath@novell.com>
4967 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4968 non-simple types (array, pointer, reference).
4970 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4972 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4974 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4976 (Method.CheckBase): Catch wrong destructor here.
4977 (MethodData.Define): Add errors 550, 668.
4979 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4981 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4983 * pending.cs (VerifyPendingMethods): Add error 551.
4985 * typemanager.cs (CSharpName): Next error report helper.
4987 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4989 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4990 attributes. Removed useless attribute double check.
4991 It saves almost 2MBs for corlib.
4993 2005-02-25 Raja R Harinath <rharinath@novell.com>
4996 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4997 called twice in case of error.
4999 2005-02-23 Chris Toshok <toshok@ximian.com>
5001 Fix compiler portions of #72827.
5002 * statement.cs (Block.Emit): call Begin/EndScope on the
5003 EmitContext instead of the ILGenerator.
5005 * codegen.cs (EmitContext.BeginScope): new method, call
5006 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5008 (EmitContext.BeginScope): same, but EndScope and CloseScope
5010 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5011 offset and call the superclass's OpenScope(int) with it.
5012 (SymbolWriter.CloseScope): get the current il
5013 offset and call superclass's CloseScope(int) with it.
5015 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5017 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5018 CS1677 for out and ref as well.
5020 * class.cs (Method.Define): Add error CS1599 detection.
5022 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5024 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5026 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5028 * support.cs.cs (ModifierDesc): New helper method.
5030 2005-02-23 Raja R Harinath <rharinath@novell.com>
5031 Abin Thomas <projectmonokochi@rediffmail.com>
5032 Anoob V E <projectmonokochi@rediffmail.com>
5033 Harilal P R <projectmonokochi@rediffmail.com>
5036 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5037 MemberLookup (used for error reporting) actually returns a result.
5038 Fix error report number (122, not 112).
5040 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5041 Anoob V E <projectmonokochi@rediffmail.com>
5042 Harilal P R <projectmonokochi@rediffmail.com>
5045 * pending.cs (PendingImplementation.GetAbstractMethods):
5046 Find NonPublic members too.
5048 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5050 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5053 * class.cs (MethodCore.CheckMethodAgainstBase):
5054 Add error 239 report.
5056 2005-02-21 Raja R Harinath <rharinath@novell.com>
5059 * expression.cs (Invocation.IsApplicable): Make public.
5060 (Invocation.IsParamsMethodApplicable): Likewise.
5061 * delegate.cs (Delegate.VerifyApplicability): Don't use
5062 Invocation.VerifyArgumentCompat for parameter applicability
5063 testing. Use Invocation.IsApplicable and
5064 Invocation.IsParamsMethodApplicable.
5066 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5068 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5070 * class.cs (Operator.Define): Add error 217 report.
5072 2005-02-21 Raja R Harinath <rharinath@novell.com>
5074 * namespace.cs (UsingEntry.Resolve): Undo change below.
5076 2005-02-21 Raja R Harinath <rharinath@novell.com>
5079 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5080 disable the error message when the extended MemberLookup also
5082 (Expression.MemberLookupFinal): Update.
5083 (SimpleName.DoSimpleNameResolve): Update.
5084 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5085 Don't use MemberLookupFinal.
5086 (New.DoResolve): Update.
5087 (BaseAccess.CommonResolve): Update.
5089 2005-02-21 Raja R Harinath <rharinath@novell.com>
5092 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5093 occured previously, don't resolve again.
5095 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5098 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5099 argument. Call ResolveAttributeUsage for unresolved.
5100 when types doesn't match ctor arguments.
5102 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5103 for nested attribute classes.
5104 (Class.attribute_usage): Removed.
5105 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5106 for attribute class.
5108 * ecore.cs (IsAttribute): Removed.
5110 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5112 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5114 (attribute_types): Removed.
5115 (EmitCode): Global attributes are emited as the latest.
5117 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5119 * class.cs (EmitFieldInitializers): Don't emit field initializer
5120 for default values when optimilization is on.
5122 * constant.cs (Constant.IsDefaultValue): New property.
5124 * driver.cs: Add /optimize handling.
5128 * literal.cs: Implement new IsDefaultValue property.
5130 * rootcontext.cs (Optimize): New field, holds /optimize option.
5132 2005-02-18 Raja R Harinath <rharinath@novell.com>
5134 Fix crasher in re-opened #72347.
5135 * namespace.cs (Namespace.Lookup): Return null if
5136 DeclSpace.DefineType returns null.
5139 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5141 2005-02-18 Raja R Harinath <rharinath@novell.com>
5143 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5144 now returns null if it cannot resolve to an lvalue.
5145 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5146 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5147 returned null. Remove check for SimpleName.
5148 (EventExpr.DoResolveLValue): New.
5149 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5150 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5152 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5154 (Unary.ResolveOperator): Move CS0211 check ...
5155 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5157 (Unary.DoResolveLValue): Simplify.
5158 (AddressOf.DoResolveLValue): New.
5159 (ArrayAccess.DoResolveLValue): New.
5161 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5163 * attribute.cs (Attribute.Resolve): Add arguments casting for
5164 when types doesn't match ctor arguments.
5166 2005-02-16 Raja R Harinath <rharinath@novell.com>
5168 Fix parts of #63202.
5169 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5170 lookup of operator in base type. Ensure that all checks happen
5171 when the operator resolves to an "op_..." method.
5173 2005-02-15 Raja R Harinath <rharinath@novell.com>
5176 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5177 'ignore_cs0104' parameter. Pass it to ...
5178 (NamespaceEntry.Lookup): ... this.
5179 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5180 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5181 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5182 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5183 Update. Request that cs0104 errors be ignored.
5184 (ComposedCast.ResolveAsTypeStep): Update.
5186 2005-02-14 Raja R Harinath <rharinath@novell.com>
5189 * expression.cs (Invocation.BetterFunction): Remove support for
5190 comparing virtual functions and their overrides.
5191 (Invocation.IsOverride): New.
5192 (Invocation.OverloadResolve): Don't consider 'override' functions
5193 during candidate selection. Store them in a lookaside list.
5194 If the selected method is a 'virtual' function, use the list to
5195 find any overrides that are closer to the LHS type.
5197 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5199 * expression.cs (New.DoResolve): Add complex core type reduction.
5200 (New.Constantify): Converts complex core type syntax like 'new int ()'
5203 2005-02-14 Raja R Harinath <rharinath@novell.com>
5205 * decl.cs (EntryType.EntryType): New constructor to create an
5206 updated copy of a cache entry.
5207 (MemberCache.AddMethods): Use it.
5208 (MemberCache.ClearDeclaredOnly): Remove.
5209 (MemberCache.MemberCache): Update.
5211 2005-02-11 Miguel de Icaza <miguel@novell.com>
5213 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5214 variable. This one is represents the actual low-level declaration
5215 of the method, as opposed to the semantic level `IsStatic'.
5217 An anonymous method which is hosted into a static method might be
5218 actually an instance method. IsStatic would reflect the
5219 container, while MethodIsStatic represents the actual code
5222 * expression.cs (ParameterReference): Use the new MethodIsStatic
5223 instead of IsStatic.
5225 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5226 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5227 set on the current EmitContext.
5229 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5230 resolve our casted expression as an LValue. This triggers the
5231 proper LValue processing that is later required by Assign.
5235 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5237 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5239 C# 2.0 Fixed buffer implementation
5241 * anonymous.cs: Update after RegisterHelperClass renaming.
5243 * attribute.cs (AttributeTester.fixed_buffer_cache):
5244 Cache of external fixed buffers.
5245 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5246 implementation if field is fixed buffer else null.
5249 (TypeContainer.AddField): Accept FieldMember instead of Field.
5250 (FieldBase.IsFieldClsCompliant): Extracted code from
5251 VerifyClsCompliance descendant customization.
5252 (FixedField): New class handles fixed buffer fields.
5253 (FixedFieldExternal): Keeps information about imported fixed
5255 (IFixedField): Make access to internal or external fixed buffer
5258 * cs-parser.jay: Add fixed buffer parsing.
5260 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5263 * expression.cs (Indirection): Extended implementation to accept
5265 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5266 (ElementAccess.MakePointerAccess): Get type as parameter.
5267 (DoResolve): Add fixed buffer field expression conversion.
5268 (DoResolveLValue): Ditto.
5269 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5270 (ArrayPtr): Derives from FixedBufferPtr.
5271 (ArrayPtr.Emit): Add extra emit for array elements.
5273 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5275 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5276 for compiler generated types.
5277 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5279 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5280 and consume less memory.
5281 (Fixed.Resolve): Add fixed buffer case.
5283 * typemanager.cs (compiler_generated_attr_ctor,
5284 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5285 (HasElementType): Add our own implementation to work on every
5288 2005-02-11 Miguel de Icaza <miguel@novell.com>
5290 * anonymous.cs (CaptureContext): Track whether `this' has been
5293 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5294 only captured `this' if it was implicitly done (instance
5295 methods/variables were used).
5297 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5298 `this' must be captured.
5300 2005-01-30 Miguel de Icaza <miguel@novell.com>
5302 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5303 is null it means that there has been no need to capture anything,
5304 so we just create a sibling.
5306 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5308 Just a partial fix. The other half is fairly elusive.
5310 2005-02-10 Raja R Harinath <rharinath@novell.com>
5312 Fix #52586, cs0121-4.cs.
5313 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5314 and return a hashtable.
5315 (MemberCache.ClearDeclaredOnly): New.
5316 (MemberCache.MemberCache): Update to change. Make a deep copy of
5317 the method_hash of a base type too.
5318 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5319 type methods. Overwrite entries with the same MethodHandle so
5320 that the ReflectedType is correct. The process leaves in base
5321 virtual functions and their overrides as distinct entries.
5322 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5323 matters since it was boxed in a ArrayList before.
5324 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5326 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5327 case of a virtual function and its override (choose the overload
5329 (Invocation.OverloadResolve): Avoid 'override' members during
5330 'applicable_type' calculation.
5332 2005-02-09 Raja R Harinath <rharinath@novell.com>
5334 Combine two near-redundant caches.
5335 * typemanager.cs (method_params): Rename from method_internal_params.
5336 (TypeManager.GetParameterData): New. Replace
5337 Invocation.GetParameterData.
5338 (TypeManager.LookupParametersByBuilder): Remove.
5339 * expression.cs (Invocation.method_parameter_cache): Remove.
5340 (Invocation.GetParameterData): Remove.
5342 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5345 2005-02-08 Raja R Harinath <rharinath@novell.com>
5348 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5349 TypeManager.multicast_delegate_type is null, resolve it by looking
5350 up "System.MulticastDelegate".
5351 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5353 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5354 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5355 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5358 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5359 (LabeledStatement.AddReference): New. Set 'referenced'.
5360 (Goto.Resolve): Use it.
5362 2005-02-05 John Luke <john.luke@gmail.com>
5364 * driver.cs: remove duplicate -doc line in Usage ()
5366 2005-02-04 Raja R Harinath <rharinath@novell.com>
5368 * location.cs (Location.AddFile): Fix CS2002 error report.
5370 2005-02-02 Martin Baulig <martin@ximian.com>
5372 * delegate.cs (Delegate.DefineType): Report an internal error if
5373 TypeManager.multicast_delegate_type is null. See bug #72015 for
5376 2005-02-02 Raja R Harinath <rharinath@novell.com>
5378 Fix a crasher in a variant of #31984.
5379 * const.cs (Constant.CheckBase): New override that defers the
5380 new-or-override check in case the base type hasn't been populated
5382 (Constant.Define): Ensure the new-or-override check is performed.
5384 2005-02-01 Duncan Mak <duncan@ximian.com>
5386 * const.cs (LookupConstantValue): Check that `ce' is not null
5387 before calling GetValue ().
5389 2005-02-01 Raja R Harinath <rharinath@novell.com>
5391 Fix test-334.cs (#69519).
5392 * cs-parser.jay (using_alias_directive): Pass in an expression to
5393 NamespaceEntry.UsingAlias.
5394 (using_namespace_directive): Pass in an expression to
5395 NamespaceEntry.Using.
5396 (namespace_name): Don't flatten to a string.
5397 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5398 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5400 (NamespaceEntry.UsingEntry): Likewise.
5401 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5403 (NamespaceEntry.LookupForUsing): Remove.
5404 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5406 (NamespaceEntry.Lookup): Remove support for dotted names.
5408 2005-02-01 Raja R Harinath <rharinath@novell.com>
5410 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5412 (NamespaceEntry.ImplicitParent): Compute on demand.
5413 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5414 parallels the current.
5415 (NamespaceEntry.LookupForUsing): Use it.
5416 (NamespaceEntry.Lookup): If the current namespace-entry is
5417 implicit, don't search aliases and using tables.
5419 2005-02-01 Raja R Harinath <rharinath@novell.com>
5422 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5424 (TypeContainer.BaseCache): Compute on demand.
5425 (TypeContainer.FindMembers): Define constants and types if they're
5426 not already created.
5427 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5429 * const.cs (Constant.Define): Make idempotent.
5431 2005-01-29 Miguel de Icaza <miguel@novell.com>
5433 * pending.cs: Produce better code (no nops produced by using Ldarg
5436 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5437 i - 1' it should be arg + 1.
5441 2005-01-28 Raja R Harinath <rharinath@novell.com>
5443 * attribute.cs (Attribute.CheckAttributeType): Make private
5445 (Attribute.ResolveType): Make virtual.
5446 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5447 handling of RootContext.Tree.Types.
5449 2005-01-27 Raja R Harinath <rharinath@novell.com>
5451 Update attribute-handling to use the SimpleName/MemberAccess
5453 * cs-parser.jay (attribute): Pass in an expression to the
5454 constructors of Attribute and GlobalAttribute.
5455 * attribute.cs (Attribute): Take an expression for the name.
5456 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5457 passed in attribute name expression.
5458 (Attribute.CheckAttributeType): Use it.
5459 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5460 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5461 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5462 argument to prevent error messages if the lookup fails.
5464 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5466 * expression.cs (Indirection): Implemented IVariable interface
5467 to support indirection in AddressOf operator.
5468 (PointerArithmetic.Emit): Add optimalization for case where
5469 result can be precomputed.
5471 2005-01-26 Martin Baulig <martin@ximian.com>
5473 * class.cs (TypeContainer.AttributeTargets): Return the correct
5474 AttributeTargets depending on our `Kind' instead of throwing an
5475 exception; fixes #71632.
5477 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5480 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5483 2005-01-25 Raja R Harinath <rharinath@novell.com>
5486 * expression.cs (MemberAccess.DoResolve): Don't complain with
5487 cs0572 when the LHS of a member access has identical name and type
5490 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5493 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5495 Create custom PermissionSet only for PermissionSetAttribute.
5497 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5500 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5501 delegates in static class.
5503 2005-01-24 Martin Baulig <martin@ximian.com>
5505 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5506 merging an implicit block, just use its reachability.
5508 * statement.cs (Block.Resolve): Make the unreachable code check
5509 work wrt. implicit blocks; see test-337 from #63842.
5511 2005-01-21 Alp Toker <alp@atoker.com>
5513 * cs-parser.jay: destructor_declaration's container is PartialContainer
5514 not Class when partial types are used, so use Kind prop instead of
5517 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5519 * cs-parser.jay: Improve error reporting when an interface
5522 2005-01-20 Dick Porter <dick@ximian.com>
5524 * support.cs: SeekableStreamReader fix from Sandor Dobos
5525 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5526 chars are read. Fixes bug 70369.
5528 2005-01-20 Raja R Harinath <rharinath@novell.com>
5530 * cs-parser.jay (catch_clause): Simplify current_block handling
5533 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5535 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5536 code with ImplicitStandardConversion to handle the implicit
5537 conversion of method groups into valid delegate invocations.
5539 The problem is that in parameter handling we were using this code
5540 path. Fixes bug #64698
5542 2005-01-19 Raja R Harinath <rharinath@novell.com>
5544 * cs-parser.jay: Fix several infelicities.
5545 - Avoid assigning to the parser value stack. Code like
5546 '$3 = null' is unclean. Synthesize a value for the code block
5548 - Avoid using oob_stack for storing location information. Use ...
5549 (_mark_): ... this. New (empty) rule. Saves the current location
5551 (foreach_statement): Avoid using oob_stack for current_block
5552 handling. Use technique used in for_statement and
5553 using_statement. Synthesize a value for the code block to store
5554 additional intermediate information.
5556 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5558 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5559 of a different type is only allowed to private fields of a
5560 containing type, not on fields of a base class.
5562 See test-174.cs and error cs0122-9.cs
5564 2005-01-13 Raja R Harinath <rharinath@novell.com>
5566 Fix test-335.cs (bug #58126).
5567 * cs-parser.jay (argument): Split out non-expression parts of the
5568 rule into 'non_simple_argument'.
5569 (invocation_expression): Support parenthesized invocations with
5570 multiple arguments, and with single non-simple arguments.
5572 2005-01-13 Raja R Harinath <rharinath@novell.com>
5574 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5577 2005-01-12 Raja R Harinath <rharinath@novell.com>
5579 Fix cs0038-1.cs, cs1640-6.cs.
5580 * ecore.cs (Expression.Resolve): Remove special-case for
5581 SimpleName in error-handling.
5582 (Expression.almostMatchedMembers): Relax access permission to
5584 (Expression.MemberLookupFailed): Handle duplicates in
5585 almostMatchedMembers list.
5586 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5587 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5588 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5589 overload if the passed in MemberInfo is a MethodBase.
5591 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5594 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5595 for non-CAS & merge permission sets properly.
5597 2005-01-11 Raja R Harinath <rharinath@novell.com>
5599 Improve standard-compliance of simple name and member access
5600 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5601 * ecore.cs (FullNamedExpression): New abstract base class
5602 for Namespaces and TypeExpressions.
5603 (ResolveFlags.SimpleName): Remove.
5604 (SimpleName): Remove support for dotted names.
5605 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5606 DeclSpace.FindType and DeclSpace.LookupType.
5607 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5608 (Expression.ExprClassName): Make member function.
5609 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5610 a namespace. Remove creation of dotted "SimpleName"s.
5611 (MemberAccess.DoResolve): Likewise.
5612 * decl.cs (DeclSpace.Cache): Make private.
5613 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5614 (DeclSpace.FindType): Update.
5615 (DeclSpace.LookupType): Move here from RootContext. Return a
5616 FullNamedExpression.
5617 * namespace.cs (Namespace): Derive from FullNamedExpression
5618 so that it can be part of expression resolution.
5619 (Namespace.Lookup): Return an FullNamedExpression.
5620 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5622 * rootcontext.cs (NamespaceLookup): Remove.
5623 (LookupType): Move to DeclSpace.
5624 * attribute.cs (CheckAttributeType): Update.
5625 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5626 (FindDocumentedTypeNonArray): Likewise.
5628 2005-01-11 Raja R Harinath <rharinath@novell.com>
5630 Fix cs0509.cs, cs1632.cs.
5631 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5632 is the same as IsInterface.
5633 (TypeContainer.GetClassBases): Likewise.
5634 * statement.cs (LabeledStatement.ig): New field.
5635 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5637 (LabeledStatement.DoEmit): Check that the label was created with
5638 the same ILGenerator.
5640 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5643 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5644 accessors to its properties.
5646 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5647 from accessors to property.
5649 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5652 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5655 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5657 * attribute.cs: Check for null and empty strings.
5659 I have lost another battle to Paolo.
5661 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5664 * class.cs (PropertyMethod): Set Parent field in ctors.
5665 (SetMethod.InternalParameters): Add unsafe switch hack.
5666 Override MarkForDuplicationCheck where it is appropriate.
5668 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5669 It says whether container allows members with the same name.
5671 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5672 Removed is_method parameter.
5674 2005-01-06 Duncan Mak <duncan@ximian.com>
5676 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5677 because the previous change led to incorrect reporting of CS1032
5678 ("Cannot define/undefine preprocessor symbols after first token in
5679 file"). Instead of using `tokens_seen' as the only flag that
5680 triggers CS1040, introduce `comments_seen'. This new flag is used
5681 to signify having seen comments on the current line, so it is
5682 unset after a newline.
5684 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5686 * doc.cs : When searching for a type, find nested type too.
5687 This fixes bug #71040.
5689 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5692 - Warn missing member comment on those classes which also does not
5693 have doc comments. Fixed bug #71041.
5694 - Don't warn missing doc comment on default constructor.
5697 2005-01-06 Duncan Mak <duncan@ximian.com>
5699 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5700 comments, set `tokens_seen' to true. This allows us to detect
5701 misplaced preprocessor directives (i.e. not at the beginning of
5702 the a line, nor after whitespaces). In that case, report error
5703 CS1040. This fixes bug #56460.
5705 * cs-parser.jay (interface_member_declaration): Add checks for
5706 IsExplicitImpl, and report CS0541 error if an interface member is
5707 defined as an explicit interface declaration.
5709 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5712 * class.cs (PropertyMethod): Set Parent field in ctors.
5713 (SetMethod.InternalParameters): Add unsafe switch hack.
5715 * decl.cs (MemberCore.Parent): Cannot be readonly.
5717 2005-01-06 Raja R Harinath <rharinath@novell.com>
5719 * decl.cs (DeclSpace.ResolveType): Remove.
5720 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5721 Merge in code from ...
5722 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5723 * class.cs, enum.cs: Update to changes.
5725 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5727 * anonymous.cs: Ensure that we init the scope of our parent if it
5728 has not been initialized yet.
5730 2004-12-30 Duncan Mak <duncan@ximian.com>
5732 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5733 if field.FieldBuilder is null. Fixes #70758.
5735 * convert.cs: Fixed some typos and updated some of the comments.
5736 (ImplicitStandardConversionExists):
5737 (TryImplicitIntConversion): If `target_type' is an interface and
5738 the type of `ic' implements this interface, return true or a new
5739 BoxedCast instead of null. This fixes #70468.
5741 2004-12-29 Duncan Mak <duncan@ximian.com>
5743 * expression.cs (Argument.Emit): Check that Expr is
5744 IMemoryLocation before casting to it, and report CS1510 otherwise.
5748 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5750 * statement.cs (Block.ThisVariable): remove the recursion here, to
5751 make the --profile more sane.
5753 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5755 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5756 assembly, by JB Evain.
5758 2004-12-17 Raja R Harinath <rharinath@novell.com>
5760 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5761 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5762 "parent" refers to enclosing type/class. "base" refers to superclass.
5764 2004-12-17 Raja R Harinath <rharinath@novell.com>
5766 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5767 Ensure that we only have GlobalAttributes.
5768 * attribute.cs (Attribute.Emit): Make non-virtual.
5769 (GlobalAttribute.Emit): Remove.
5770 (Attribute.Resolve): Make virtual.
5771 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5772 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5773 the argument. Don't create one.
5774 (Attribute.GetObsoleteAttribute): Likewise.
5775 (Attribute.GetClsCompliantAttributeValue): Likewise.
5776 * class.cs, decl.cs: Update to changes.
5778 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5780 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5782 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5784 * statement.cs (Foreach.Resolve): Add error 186 report.
5786 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5788 * expression.cs (Conditional.DoResolve): Add warning 429.
5790 * statement.cs (If.Resolve): Add warning 665.
5792 2004-12-16 Raja R Harinath <rharinath@novell.com>
5794 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5795 except when in the parser, and in GlobalAttribute.
5796 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5797 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5798 RootContext.Tree.Types.NamespaceEntry once work is done.
5799 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5800 and resets RootContext.Tree.Types.NamespaceEntry.
5802 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5804 * cs-parser.jay: Don't create a block for every variable.
5806 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5808 * location.cs: Provide extra information.
5810 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5811 variables from the captured environment, it is the ldarg_0.
5813 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5815 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5818 * class.cs: Changed warning level for 169 to avoid developer
5819 displeasure from warning flooding. It will be changed back when they
5820 fix most of current BCL warnings.
5822 * RootContext.cs: Pushed default WarningLevel to 3.
5824 * statement.cs: Removed unused variable.
5826 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5828 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5829 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5830 Add error 502 report.
5831 (StaticClass.DefineType): Add error 441 report.
5832 (Class.AllowedModifiersProp): New virtual property as temporary
5833 extension to AllowedModifiers.
5834 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5835 to share implementation with StaticClass and don't call virtual
5838 * driver.cs (MainDriver): Add error 1558 test.
5840 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5841 report. Moved error 36 test here.
5843 * statement.cs (Throw.Resolve): Add error 724 report.
5845 * typemanager.cs: Add out_attribute_type core type.
5847 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5849 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5851 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5853 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5856 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5858 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5859 Add error 3023 report.
5860 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5862 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5865 2004-12-12 John Luke <john.luke@gmail.com>
5867 * driver.cs (AddArgs): take -- into account when
5868 adding arguments, fixes bug 65710
5870 2004-12-12 Martin Baulig <martin@ximian.com>
5872 * expression.cs (Unary.TryReduceNegative): Added support for
5873 SByteConstant and ByteConstant.
5874 (Unary.Reduce): Check error values from TryReduceNegative().
5876 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5878 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5879 and report exception as error 182.
5881 2004-12-10 Raja R Harinath <rharinath@novell.com>
5883 * driver.cs (Main): Fix message when there are warnings.
5885 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5887 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5889 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5891 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5892 Reduced number of warnings.
5894 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5896 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5898 * driver.cs: Removed message.
5900 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5902 2004-12-08 <vargaz@freemail.hu>
5904 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5906 2004-12-08 Martin Baulig <martin@ximian.com>
5908 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5909 instead of a CS3002 for properties and indexer.
5911 2004-12-08 Martin Baulig <martin@ximian.com>
5913 * decl.cs (MemberName.ToString): Make this work again.
5915 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5917 * attribute.cs (Resolve): Add error 591 detection.
5919 * class.cs (FieldMember.Define): Add error 1547 detection.
5920 (Indexer.Define): Add error 620 detection.
5921 (Operator.Define): Add error 590 detection.
5923 * ecore.cs: Missing argument for error 79.
5925 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5928 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5931 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5934 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5936 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5937 Some operator comments were suppressed.
5938 * doc.cs : Implicit/explicit operator name in doc comments are like
5939 "op_Explicit(type)~returnType", so added suffix handling.
5941 2004-12-07 Martin Baulig <martin@ximian.com>
5944 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5945 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5946 (DeclSpace.ec): New protected field; store the EmitContext here.
5947 (DeclSpace.EmitContext): New public property; moved here from
5949 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5952 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5953 (Enum.Emit): Don't create a new EmitContext.
5955 * delegate.cs (Delegate.DefineType): Always create the
5958 * iterators.cs (Iterators.DefineIterator): Create a new
5959 EmitContext and store it in `ec'.
5961 2004-08-24 Martin Baulig <martin@ximian.com>
5964 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5965 this for accessibility checks.
5966 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5967 IsNestedFamilyAccessible.
5968 (TypeManager.IsSubclassOf): New method, do what the name actually
5971 2004-12-06 Raja R Harinath <rharinath@novell.com>
5973 Fix crash on cs0657-17.cs.
5974 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5975 Use RootContext.Tree.Types, not 'new RootTypes ()'.
5976 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5977 the case where the NamespaceEntry gets overwritten.
5979 2004-12-06 Marek Safar <marek.safar@seznam.cz>
5981 Fixed #69195, #56821
5982 * ecore.cs (ResolveBoolean): Tiny refactoring.
5984 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5985 of right expression resolving when left is false constant and
5986 operator is LogicalAnd OR true constant and operator is LogicalOr.
5988 * statement.cs (ResolveUnreachable): Always reports warning.
5990 2004-12-05 Miguel de Icaza <miguel@ximian.com>
5992 * class.cs: Distinguish between 1721 and 1722 (just a little help
5993 for the programmer).
5995 2004-12-03 Miguel de Icaza <miguel@ximian.com>
5997 * delegate.cs: Only allow this on new versions of the language.
5999 2004-12-02 Duncan Mak <duncan@ximian.com>
6001 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6003 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6004 here as a static method. Take an additional bool out parameter
6005 `must_do_cs1540_check' for signaling to InstanceResolve.
6006 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6007 member field from PropertyExpr class and made it an argument of
6009 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6010 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6011 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6012 and `remove_accessor' as well as InstanceResolve: report CS0122
6017 2004-12-03 Raja R Harinath <rharinath@novell.com>
6019 Fix test-327.cs, test-328.cs, and put in early infrastructure
6020 for eventually fixing #52697.
6021 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6022 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6024 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6025 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6026 (VerifyUsing, error246): Update.
6027 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6028 'NamespaceEntry.LookupNamespaceOrType'.
6030 2004-12-03 Martin Baulig <martin@ximian.com>
6032 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6033 method as our child, call AnonymousMethod.Compatible() on it.
6035 2004-12-03 Raja R Harinath <rharinath@novell.com>
6037 Disable XML documentation support in 'basic' profile.
6038 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6039 Redirect XmlElement to System.Object.
6040 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6041 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6042 * mcs.exe.sources: Add doc-bootstrap.cs.
6043 * doc-bootstrap.cs: New file. Contains empty stub implementation
6046 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6048 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6049 comments are allowed.
6051 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6053 * delegate.cs: Add checks for subtypes in paramaters and return values
6054 in VerifyMethod () to add support for Covariance/Contravariance
6057 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6059 * report.cs: Remove extra closing parenthesis.
6061 * convert.cs (Error_CannotImplicitConversion): If the name of the
6062 types are the same, provide some extra information.
6064 * class.cs (FieldBase): Use an unused bit field from the field to
6065 encode the `has_offset' property from the FieldMember. This saves
6066 a couple of Ks on bootstrap compilation.
6068 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6069 method as our child, return the AnonymousMethod resolved
6072 * expression.cs (New.DoResolve): Allow return values from
6073 NewDelegate to also include AnonymousMethods.
6077 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6080 * attribute.cs (Resolve): Improved implementation of params
6081 attribute arguments.
6083 * support.cs (ParameterData): Add HasParams to be faster.
6085 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6087 all things are for /doc support:
6089 * doc.cs: new file that supports XML documentation generation.
6090 * mcs.exe.sources: added doc.cs.
6092 Handle /doc command line option.
6093 Report error 2006 instead of 5 for missing file name for /doc.
6094 Generate XML documentation when required, after type resolution.
6096 Added support for picking up documentation (/// and /** ... */),
6097 including a new XmlCommentState enumeration.
6099 Added lines to fill Documentation element for field, constant,
6100 property, indexer, method, constructor, destructor, operator, event
6101 and class, struct, interface, delegate, enum.
6102 Added lines to warn incorrect comment.
6104 Added Documentation field (passed only when /doc was specified).
6106 Added DocComment, DocCommentHeader, GenerateDocComment() and
6107 OnGenerateDocComment() and some supporting private members for
6108 /doc feature to MemberCore.
6110 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6112 Added overriden DocCommentHeader.
6114 Added overriden DocCommentHeader and GenerateDocComment().
6116 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6118 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6119 unwrapping the enumeration values, chain to
6120 DoConstantNumericPromotions again, so we can promote things to the
6121 fundamental types (takes care of enums that are bytes, sbytes).
6125 2004-12-01 Raja R Harinath <rharinath@novell.com>
6127 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6128 Fix long-standing bug in type-lookup. Use FindType instead of
6129 LookupType when ec.ResolvingTypeTree.
6130 (Attribute.ResolveType, Attribute.Resolve)
6131 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6133 (Attributes.Search): Remove internal version. Update.
6134 (Attributes.SearchMulti): Update.
6135 (Attributes.GetClsCompliantAttribute): Remove.
6136 (Attributes.GetIndexerNameAttribute): Remove.
6137 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6138 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6139 * class.cs (Indexer.Define): Likewise.
6141 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6144 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6145 MarshallByReference members access.
6147 * expression.cs: Use CheckMarshallByRefAccess;
6148 Better error CS0197 message.
6150 * report.cs: Print whole related error message.
6152 2004-11-30 Raja R Harinath <rharinath@novell.com>
6154 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6155 the current directory to help debugging.
6157 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6159 * class (GetClassBases): Better error 60 report.
6160 (EventProperty): Disabled warning 67 detection.
6162 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6165 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6167 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6170 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6173 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6175 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6177 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6179 * attribute.cs (Attribute.Resolve): Refine error reporting and
6180 report a cs0117 if the identifier does not exist, to distinguish
6181 from 0617 which is a miss-use of the actual identifier.
6183 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6184 between cs0070 and cs0079.
6186 * class.cs (MemberBase.DoDefine): When reporting a wrong
6187 accessibility level, we use MethodCore to compare instead of
6188 Method (this was a regression in some refactoring effort).
6190 So now we correctly report cs0056 again.
6192 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6193 testing the target_type (which was known to be object_type) and
6194 not the source type (which is anonymous_method).
6196 Fixed reporting of error cs1660.
6198 * expression.cs (UserCast.Source): Expose the underlying cast.
6200 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6201 allowed types to find a match to int32 first (most common).
6203 In addition, it ignores any ImplicitUserConversions that did an
6204 internal implicit conversion (as the switch statement allows only
6205 one integral conversion to exist).
6207 * class.cs (PartialContainer.Create): rename `name' to
6208 `member_name' for clarity. Then replace the string calls with a
6209 call to MemberName.GetPartialName, as now using
6210 MemberName.ToString is an error (this is due to the side effects
6211 it had, that were fixed in the past).
6213 This will restore the error reporting on a number of partial class
6214 errors that were missusing this (and getting an exception as a
6215 results, which is now just a plain textual warning, because
6216 yyparse debug output would crash otherwise).
6218 2004-11-26 Raja R Harinath <rharinath@novell.com>
6220 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6222 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6224 * rootcontext.cs (LookupType): Make sure to cache lookups that
6225 don't give us a negative result. This saves about 5% of corlib
6228 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6230 * report.cs (AbstractMessage.Print): messages are sent to stderr
6232 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6233 non-interface in the list of interfaces (at this point, either
6234 parent was properly set, or a base class is being listed in the
6235 interfaces section).
6237 This flags error 1722, and resolves the crash from bug 69259.
6239 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6241 * statement.cs (Using.EmitExpressionFinally): make this work right
6242 for valuetypes. Fixes 69926.
6244 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6246 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6247 converted to an enum" here, before we try to change the underlying
6248 type. This code exists, but it is a different code path than the
6249 one used while encoding constants.
6251 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6252 old bug: when converting from the null literal to a pointer,
6253 return an EmptyCast, not the NullLiteral.
6255 This fixes #69921, the recent null_type changes probably made this
6258 (ImplicitReferenceConversionExists): In addition, resynchronized
6259 the code here, so it matches the same code in
6260 ImplicitReferenceConversionExists for the `from any class-type S
6261 to any interface-type T'.
6264 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6266 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6268 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6270 * cs-parser.jay: Use verbosity accordingly.
6272 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6274 * expression.cs (Unary.ResolveOperator): Do not report warning;
6275 AddressOf reads from variable.
6277 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6279 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6283 * attribute.cs (Attributable): Removed CheckTargets.
6284 (Attributes.Emit): Explicit attribute targets are tested here.
6286 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6287 not enabled for interfaces.
6289 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6290 (GetAssemblyName): Ouch next bug there.
6292 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6294 * expression.cs: Error 275 added.
6296 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6298 Fix bug #69177 (Implemented decimal constant support)
6300 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6301 (BinaryFold): Add DecimalConstant.
6303 * const.cs (Define): Decimal constant
6305 (ChangeType): Add decimal type handling.
6306 (LookupConstantValue): Don't set value for decimal type but
6307 emit DecimalConstantAttribute. Needed for constant optimization.
6309 * constant.cs (ToDecimal): New method.
6310 (ConvertToDecimal): New method.
6311 (IntConstant): Implemented ConvertToDecimal.
6312 (DecimalConstant.Emit): Emit optimized version for decimals in
6315 * expression.cs (ResolveOperator): Changed order of constant
6316 reduction to work correctly with native types which have
6317 overloaded operators.
6318 (ResolveMemberAccess): Extract constant value from attribute
6321 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6323 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6324 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6325 (ChangeType): Decimal is special.
6326 (TypeToCoreType): Add decimal type.
6328 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6330 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6333 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6335 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6338 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6340 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6342 * pending.cs (PendingImplementation): Grab only interfaces.
6344 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6346 * statement.cs (ForeachHelperMethods): Add location member and
6347 error 202 detection.
6349 2004-11-19 Raja R Harinath <rharinath@novell.com>
6351 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
6352 automatically handled by executable.make.
6353 (PROGRAM): Make profile-specific.
6355 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6357 * expression.cs (DoResolveBase): Fixed wrong warning for out
6360 2004-11-18 Martin Baulig <martin@ximian.com>
6362 Merged latest changes into gmcs. Please keep this comment in
6363 here, it makes it easier for me to see what changed in MCS since
6364 the last time I merged.
6366 2004-11-17 Raja R Harinath <rharinath@novell.com>
6368 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6369 (TypeHandle.GetMemberCache): New.
6370 (TypeHandle.TypeHandle): Update.
6371 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6372 (TypeManager.LookupParentInterfacesCache):
6373 Rename from LookupInterfaceCache. Optimize slightly.
6374 (TypeManager.MemberLookup_FindMembers): Update.
6375 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6377 (AddCacheContents): Rename from AddHashtable.
6378 * class.cs (TypeContainer.parent_container): Remove.
6379 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6380 (TypeContainer.DoDefineMembers): Don't initialize it.
6381 Update to name changes.
6383 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6385 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6386 that factors the code to check access modifiers on override.
6388 (PropertyBase): Use the code here.
6390 Patch from Lluis S'anchez, fixes bug #69361.
6392 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6394 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6395 routine that is used to report the use of a captured variable
6396 whose address has been taken.
6398 There are two checks: one when variables are being captured and
6399 the other check is when the address of a variable is taken.
6401 (because an anonymous methods might be resolved before *or* after
6402 the address has been taken) and
6404 * expression.cs (Conditional.DoResolve): Remove the special
6405 casing that Martin added to trueExpr and falseExpr being both
6406 NullLiteral. We get the right behavior now just by introducing
6407 the null_type into the compiler.
6409 * convert.cs (ExplicitConversion): Change the code to use
6410 null_type instead of testing `expr is NullLiteral'.
6411 (ImplicitConversionStandard): use null_type too.
6412 (ImplicitReferenceConversionExists): use null_type too.
6413 (ImplicitReferenceConversion): use null_type too.
6415 * literal.cs: The type of `NullLiteral' is now null_type instead
6417 (Resolve): Set the type here.
6419 * typemanager.cs: Introduce null_type.
6421 2004-11-17 Martin Baulig <martin@ximian.com>
6423 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6424 direction, like FindMembers() does. Fixes #69546, testcase is in
6427 2004-11-16 Martin Baulig <martin@ximian.com>
6429 This is based on a patch from Marek Safar, see bug #69082.
6430 Fixes bugs #63705 and #67130.
6432 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6433 method; create a MemberCache for an interface type and cache the
6436 * decl.cs (IMemberContainer.ParentContainer): Removed.
6437 (IMemberContainer.ParentCache): New property.
6438 (MemberCache.SetupCacheForInterface): Removed.
6439 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6440 to create a cache for an interface's "parent".
6442 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6445 2004-11-16 Martin Baulig <martin@ximian.com>
6447 Merged back from gmcs; these changes already went into gmcs a
6448 couple of weeks ago.
6451 (TypeManager.AddUserType): Removed the `ifaces' argument.
6452 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6454 (TypeManager.AddUserInterface): Removed.
6455 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6457 (TypeManager.GetInterfaces): Likewise.
6458 (TypeManager.GetExplicitInterfaces): Likewise.
6460 * ecore.cs (TypeExpr.GetInterfaces): Removed.
6462 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6463 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6465 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6467 * statement.cs: Avoid adding bools to a hashtable.
6469 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6471 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6472 calling an unsafe method from a safe location.
6474 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6477 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6479 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6481 * namespace.cs (VerifyUsing): use GetPartialName instead of
6484 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6486 * statement.cs (Return.Resolve): Fix regression in typo: if
6487 `in_exc', we have to request a NeedReturnLabel, this was a typo
6488 introduced in the anonymous method check-in. Fixes #69131.
6490 * Indexers were using the ShortName when defining themselves,
6491 causing a regression in the compiler bootstrap when applying the
6492 patch from 2004-11-02 (first part), now they use their full name
6493 and the bug is gone.
6495 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6497 * driver.cs: Strip the path from the names of embedded resources. Fixes
6500 2004-11-04 Raja R Harinath <rharinath@novell.com>
6502 Fix error message regression: cs0104-2.cs.
6503 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6504 (AliasEntry.Resolve): Update.
6505 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6507 (RootContext.LookupType): Update.
6509 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6511 * cs-parser.jay: Add support for handling accessor modifiers
6512 * class: Add support port accessor modifiers and error checking,
6513 define PropertyMethod.Define as virtual (not abstract anymore)
6514 * ecore.cs: Add checking for proeprties access with access modifiers
6515 * iterators.cs: Modify Accessor constructor call based in the modified
6517 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6519 * expression.cs (StringConcat): Handle being called twice,
6520 as when we have a concat in a field init with more than two
6523 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6525 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6526 special case explicit implementations, we should always produce
6527 the .property or .event declaration.
6529 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6530 since it will not return correct data if people use this
6531 unresolved in the presence of using statements (see test-313).
6533 * class.cs (MethodData.Define): If we are an explicit interface
6534 implementation, set the method name to the full name of the
6535 interface plus the name of the method.
6537 Notice that using the method.MethodName.GetFullName() does not
6538 work, as it will only contain the name as declared on the source
6539 file (it can be a shorthand in the presence of using statements)
6540 and not the fully qualifed type name, for example:
6544 class D : ICloneable {
6545 object ICloneable.Clone () {
6549 Would produce a method called `ICloneable.Clone' instead of
6550 `System.ICloneable.Clone'.
6552 * namespace.cs (Alias.Resolve): Use GetPartialName.
6554 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6556 * cs-parser.jay: Add error 1055 report.
6558 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6560 * assign.cs (Assign.DoResolve): Only do the transform of
6561 assignment into a New if the types are compatible, if not, fall
6562 through and let the implicit code deal with the errors and with
6563 the necessary conversions.
6565 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6567 * cs-parser.jay: Add error 1031 report.
6569 * cs-tokenizer.cs: Add location for error 1038.
6571 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6573 * cs-parser.jay: Add error 1016 report.
6575 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6577 * cs-parser.jay: Add errors 1575,1611 report.
6579 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6581 * cs-parser.jay: Add error 1001 report.
6583 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6586 * attribute.cs (GetMarshal): Add method argument for
6587 caller identification.
6589 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6590 agument for GetMarshal and RuntimeMissingSupport.
6592 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6594 * attribute.cs (ExtractSecurityPermissionSet): Removed
6595 TypeManager.code_access_permission_type.
6597 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6599 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6601 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6602 for obsolete use of a variable here. Fixes regression on errors
6603 cs0619-25 and cs0619-26.
6605 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6607 Fix #62358, implemented security attribute encoding.
6609 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6610 Tests permitted SecurityAction for assembly or other types.
6611 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6612 data from SecurityPermissionAttribute to PermisionSet class.
6614 * class.cs (ApplyAttributeBuilder): Added special handling
6615 for System.Security.Permissions.SecurityAttribute based types.
6617 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6618 special handling for System.Security.Permissions.SecurityAttribute
6621 * enum.cs (ApplyAttributeBuilder): Added special handling
6622 for System.Security.Permissions.SecurityAttribute based types.
6624 * parameter.cs (ApplyAttributeBuilder): Added special handling
6625 for System.Security.Permissions.SecurityAttribute based types.
6627 * rootcontext.cs: Next 2 core types.
6629 * typemanager.cs (TypeManager.security_permission_attr_type):
6630 Built in type for the SecurityPermission Attribute.
6631 (code_access_permission_type): Build in type.
6633 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6635 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6636 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6637 all of this information into
6638 EmitContext.EmitCapturedVariableInstance.
6640 * codegen.cs (EmitCapturedVariableInstance): move here the
6641 funcionality of emitting an ldarg.0 in the presence of a
6642 remapping. This centralizes the instance emit code.
6644 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6645 then emit a load of this: it means that we have reached the
6646 topmost ScopeInfo: the one that contains the pointer to the
6647 instance of the class hosting the anonymous method.
6649 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6650 captures to the topmost CaptureContext.
6652 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6654 * expression.cs (LocalVariableReference): Move the knowledge about
6655 the iterators into codegen's EmitCapturedVariableInstance.
6657 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6659 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6660 all code paths return a value from an anonymous method (it is the
6661 same as the 161 error, but for anonymous methods).
6663 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6665 The introduction of anonymous methods in the compiler changed
6666 various ways of doing things in the compiler. The most
6667 significant one is the hard split between the resolution phase
6668 and the emission phases of the compiler.
6670 For instance, routines that referenced local variables no
6671 longer can safely create temporary variables during the
6672 resolution phase: they must do so from the emission phase,
6673 since the variable might have been "captured", hence access to
6674 it can not be done with the local-variable operations from the runtime.
6678 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6679 is a toplevel block.
6681 (ToplevelBlock): A new kind of Block, these are the blocks that
6682 are created by the parser for all toplevel method bodies. These
6683 include methods, accessors and anonymous methods.
6685 These contain some extra information not found in regular blocks:
6686 A pointer to an optional CaptureContext (for tracking captured
6687 local variables and parameters). A pointer to the parent
6690 (Return.Resolve): Catch missmatches when returning a value from an
6691 anonymous method (error 1662).
6692 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6695 (Break.Resolve): ditto.
6697 (SwitchLabel): instead of defining the labels during the
6698 resolution phase, we now turned the public ILLabel and ILLabelCode
6699 labels into methods called GetILLabelCode() and GetILLabel() that
6700 only define the label during the Emit phase.
6702 (GotoCase): Track the SwitchLabel instead of the computed label
6703 (its contained therein). Emit the code by using
6704 SwitchLabel.GetILLabelCode ().
6706 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6707 whether the Local has been captured or not.
6709 (LocalInfo.IsCaptured): New property, used to tell whether the
6710 local has been captured.
6712 * anonymous.cs: Vastly updated to contain the anonymous method
6715 The main classes here are: CaptureContext which tracks any
6716 captured information for a toplevel block and ScopeInfo used to
6717 track the activation frames for various local variables.
6719 Each toplevel block has an optional capture context associated
6720 with it. When a method contains an anonymous method both the
6721 toplevel method and the anonymous method will create a capture
6722 context. When variables or parameters are captured, they are
6723 recorded on the CaptureContext that owns them, for example:
6727 MyDelegate d = delegate {
6732 Here `a' will be recorded as captured on the toplevel
6733 CapturedContext, the inner captured context will not have anything
6734 (it will only have data if local variables or parameters from it
6735 are captured in a nested anonymous method.
6737 The ScopeInfo is used to track the activation frames for local
6738 variables, for example:
6740 for (int i = 0; i < 10; i++)
6741 for (int j = 0; j < 10; j++){
6742 MyDelegate d = delegate {
6747 At runtime this captures a single captured variable `i', but it
6748 captures 10 different versions of the variable `j'. The variable
6749 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6750 recorded on a child.
6752 The toplevel ScopeInfo will also track information like the `this'
6753 pointer if instance variables were referenced (this is necessary
6754 as the anonymous method lives inside a nested class in the host
6755 type of the method).
6757 (AnonymousMethod): Expanded to track the Toplevel, implement
6758 `AnonymousMethod.Compatible' to tell whether an anonymous method
6759 can be converted to a target delegate type.
6761 The routine now also produces the anonymous method content
6763 (AnonymousDelegate): A helper class that derives from
6764 DelegateCreation, this is used to generate the code necessary to
6765 produce the delegate for the anonymous method that was created.
6767 * assign.cs: API adjustments for new changes in
6768 Convert.ImplicitStandardConversionExists.
6770 * class.cs: Adjustments to cope with the fact that now toplevel
6771 blocks are of type `ToplevelBlock'.
6773 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6774 insteda of standard blocks.
6776 Flag errors if params arguments are passed to anonymous methods.
6778 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6779 `CurrentAnonymousMethod' which points to the current Anonymous
6780 Method. The variable points to the AnonymousMethod class that
6781 holds the code being compiled. It is set in the new EmitContext
6782 created for the anonymous method.
6784 (EmitContext.Phase): Introduce a variable and an enumeration to
6785 assist in enforcing some rules about when and where we are allowed
6786 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6787 only one that enfonces this right now).
6789 (EmitContext.HaveCaptureInfo): new helper method that returns
6790 whether we have a CapturedContext initialized.
6792 (EmitContext.CaptureVariable): New method used to register that a
6793 LocalInfo must be flagged for capturing.
6795 (EmitContext.CapturedParameter): New method used to register that a
6796 parameters must be flagged for capturing.
6798 (EmitContext.CapturedField): New method used to register that a
6799 field must be flagged for capturing.
6801 (EmitContext.HaveCapturedVariables,
6802 EmitContext.HaveCapturedFields): Return whether there are captured
6803 variables or fields.
6805 (EmitContext.EmitMethodHostInstance): This is used to emit the
6806 instance for the anonymous method. The instance might be null
6807 (static methods), this (for anonymous methods that capture nothing
6808 and happen to live side-by-side with the current method body) or a
6809 more complicated expression if the method has a CaptureContext.
6811 (EmitContext.EmitTopBlock): Routine that drives the emission of
6812 code: it will first resolve the top block, then emit any metadata
6813 and then emit the code. The split is done so that we can extract
6814 any anonymous methods and flag any captured variables/parameters.
6816 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6817 during this phase, the ILGenerator should not be used as labels
6818 and local variables declared here might not be accessible to any
6819 code that is part of an anonymous method.
6821 Exceptions to this include the temporary variables that are
6822 created by some statements internally for holding temporary
6825 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6828 (EmitContext.TemporaryReturn): This method is typically called
6829 from the Emit phase, and its the only place where we allow the
6830 ReturnLabel to be defined other than the EmitMeta. The reason is
6831 that otherwise we would have to duplicate a lot of logic in the
6832 Resolve phases of various methods that today is on the Emit
6835 (EmitContext.NeedReturnLabel): This no longer creates the label,
6836 as the ILGenerator is not valid during the resolve phase.
6838 (EmitContext.EmitThis): Extended the knowledge in this class to
6839 work in anonymous methods in addition to iterators.
6841 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6842 code is necessary on the stack to access the instance to a local
6843 variable (the variable will be accessed as a field).
6845 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6846 EmitContext.EmitAddressOfParameter): Routines to support
6847 parameters (not completed at this point).
6849 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6850 will also remove the parameters.
6852 * convert.cs (Convert): Define a `ConstantEC' which points to a
6853 null. This is just to prefity some code that uses
6854 ImplicitStandardConversion code and do not have an EmitContext
6857 The idea is to flag explicitly that at that point in time, it is
6858 known that the conversion will not trigger the delegate checking
6859 code in implicit conversions (which requires a valid
6862 Everywhere: pass new EmitContext parameter since
6863 ImplicitStandardConversionExists now requires it to check for
6864 anonymous method conversions.
6866 (Convert.ImplicitStandardConversionExists): If the type of an
6867 expression is the anonymous_method_type, and the type is a
6868 delegate, we invoke the AnonymousMethod.Compatible method to check
6869 whether an implicit conversion is possible.
6871 (Convert.ImplicitConversionStandard): Only do implicit method
6872 group conversions if the language level is not ISO_1.
6874 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6875 MethodInfo for the Invoke method. used by Delegate and
6878 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6879 method conversions if the target type is a delegate.
6881 Removed extra debugging nops.
6883 (LocalVariableReference): Turn the `local_info' into a public
6886 Add `prepared' field, the same hack used for FieldExprs to cope
6887 with composed assignments, as Local variables do not necessarily
6888 operate purely on the stack as they used to: they can be captured
6891 Add `temp' for a temporary result, like fields.
6893 Refactor DoResolve and DoResolveLValue into DoResolveBase.
6895 It now copes with Local variables that are captured and emits the
6896 proper instance variable to load it from a field in the captured
6899 (ParameterReference.DoResolveBase): During the resolve phase,
6900 capture parameters if we are in an anonymous method.
6902 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6903 anonymous method, use the EmitContext helper routines to emit the
6904 parameter reference.
6906 * iterators.cs: Set RemapToProxy to true/false during the
6909 * parameters.cs (GetParameterByName): New helper method.
6911 * typemanager.cs (anonymous_method_type) a new type that
6912 represents an anonyous method. This is always an internal type,
6913 used as a fencepost to test against the anonymous-methodness of an
6916 2004-10-20 Marek Safar <marek.safar@seznam.cz>
6918 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6920 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6922 2004-10-18 Martin Baulig <martin@ximian.com>
6924 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6925 `Type' directly, but call ResolveType() on it.
6926 (Catch.Resolve): Likewise.
6927 (Foreach.Resolve): Likewise.
6929 2004-10-18 Martin Baulig <martin@ximian.com>
6931 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6932 `Type' directly, but call ResolveType() on it.
6933 (Probe.DoResolve): Likewise.
6934 (ArrayCreation.LookupType): Likewise.
6935 (TypeOf.DoResolve): Likewise.
6936 (SizeOf.DoResolve): Likewise.
6938 2004-10-18 Martin Baulig <martin@ximian.com>
6940 * expression.cs (Invocation.BetterFunction): Put back
6941 TypeManager.TypeToCoreType().
6943 2004-10-18 Raja R Harinath <rharinath@novell.com>
6945 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6948 2004-10-18 Martin Baulig <martin@ximian.com>
6950 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
6951 `Type' directly, but call ResolveType() on it.
6953 2004-10-18 Martin Baulig <martin@ximian.com>
6955 * class.cs (FieldMember.Define): Don't access the TypeExpr's
6956 `Type' directly, but call ResolveType() on it.
6957 (MemberBase.DoDefine): Likewise.
6959 * expression.cs (New.DoResolve): Don't access the TypeExpr's
6960 `Type' directly, but call ResolveType() on it.
6961 (ComposedCast.DoResolveAsTypeStep): Likewise.
6963 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6964 `Type' directly, but call ResolveType() on it.
6966 2004-10-17 John Luke <john.luke@gmail.com>
6968 * class.cs (Operator.GetSignatureForError): use CSharpName
6970 * parameter.cs (Parameter.GetSignatureForError): Returns
6971 correct name even if was not defined.
6973 2004-10-13 Raja R Harinath <rharinath@novell.com>
6976 * class.cs (TypeContainer.EmitContext): New property.
6977 (DefineNestedTypes): Create an emitcontext for each part.
6978 (MethodCore.DoDefineParameters): Use container's emitcontext.
6979 Pass type array to InternalParameters.
6980 (MemberBase.DoDefine): Use container's emitcontext.
6981 (FieldMember.Define): Likewise.
6982 (Event.Define): Likewise.
6983 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6984 Pass type array to InternalParameters.
6985 (SetIndexerMethod.GetParameterInfo): Likewise.
6986 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6987 * delegate.cs (Define): Pass emitcontext to
6988 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6989 array to InternalParameters.
6990 * expression.cs (ParameterReference.DoResolveBase): Pass
6991 emitcontext to GetParameterInfo.
6992 (ComposedCast.DoResolveAsTypeStep): Remove check on
6993 ec.ResolvingTypeTree.
6994 * parameter.cs (Parameter.Resolve): Change argument to
6995 EmitContext. Use ResolveAsTypeTerminal.
6996 (Parameter.GetSignature): Change argument to EmitContext.
6997 (Parameters.ComputeSignature): Likewise.
6998 (Parameters.ComputeParameterTypes): Likewise.
6999 (Parameters.GetParameterInfo): Likewise.
7000 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7001 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7002 * support.cs (InternalParameters..ctor): Remove variant that takes
7004 * typemanager.cs (system_intptr_expr): New.
7005 (InitExpressionTypes): Initialize it.
7007 2004-10-12 Chris Toshok <toshok@ximian.com>
7009 * cs-parser.jay: fix location for try_statement and catch_clause.
7011 2004-10-11 Martin Baulig <martin@ximian.com>
7013 * report.cs: Don't make --fatal abort on warnings, we have
7014 -warnaserror for that.
7016 2004-10-07 Raja R Harinath <rharinath@novell.com>
7018 More DeclSpace.ResolveType avoidance.
7019 * decl.cs (MemberCore.InUnsafe): New property.
7020 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7021 with newly created EmitContext.
7022 (FieldMember.Define): Likewise.
7023 * delegate.cs (Delegate.Define): Likewise.
7024 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7025 only if normal name-lookup fails.
7026 (TypeExpr.DoResolve): Enable error-checking.
7027 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7028 (SizeOf.DoResolve): Likewise.
7029 (ComposedCast.DoResolveAsTypeStep): Likewise.
7030 (StackAlloc.DoResolve): Likewise.
7031 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7032 (Block.Unsafe): New property.
7033 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7034 (Unsafe): Set 'unsafe' flag of contained block.
7035 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7036 (Fixed.Resolve): Likewise.
7037 (Catch.Resolve): Likewise.
7038 (Using.ResolveLocalVariableDecls): Likewise.
7039 (Foreach.Resolve): Likewise.
7041 2004-10-05 John Luke <john.luke@gmail.com>
7043 * cs-parser.jay: add location to error CS0175
7045 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7047 * ecore.cs (Expression.Constantity): Add support for turning null
7050 * const.cs (Const.Define): Allow constants to be reference types
7051 as long as the value is Null.
7053 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7055 * namespace.cs (NamespaceEntry.Using): No matter which warning
7056 level is set, check if this namespace name has already been added.
7058 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7060 * expression.cs: reftype [!=]= null should always use br[true,false].
7063 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7066 * attribute.cs: Enum conversion moved to
7067 GetAttributeArgumentExpression to be applied to the all
7070 2004-10-01 Raja R Harinath <rharinath@novell.com>
7072 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7073 * class.c (TypeContainer.DefineType): Flag error if
7074 base types aren't accessible due to access permissions.
7075 * decl.cs (DeclSpace.ResolveType): Move logic to
7076 Expression.ResolveAsTypeTerminal.
7077 (DeclSpace.ResolveTypeExpr): Thin layer over
7078 Expression.ResolveAsTypeTerminal.
7079 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7080 Refactor code into NestedAccess. Use it.
7081 (DeclSpace.NestedAccess): New.
7082 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7083 argument to silence errors. Check access permissions.
7084 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7085 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7086 (Cast.DoResolve): Likewise.
7087 (New.DoResolve): Likewise.
7088 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7089 (TypeOf.DoResolve): Likewise.
7091 * expression.cs (Invocation.BetterConversion): Return the Type of
7092 the better conversion. Implement section 14.4.2.3 more faithfully.
7093 (Invocation.BetterFunction): Make boolean. Make correspondence to
7094 section 14.4.2.2 explicit.
7095 (Invocation.OverloadResolve): Update.
7096 (Invocation): Remove is_base field.
7097 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7098 (Invocation.Emit): Likewise.
7100 2004-09-27 Raja R Harinath <rharinath@novell.com>
7102 * README: Update to changes.
7104 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7106 * cs-parser.jay: Reverted 642 warning fix.
7108 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7111 * decl.cs (FindMemberWithSameName): Indexer can have more than
7114 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7116 * expression.cs (LocalVariableReference.DoResolveLValue):
7117 Do not report warning 219 for out values.
7118 (EmptyExpression.Null): New member to avoid extra allocations.
7120 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7122 * cs-parser.jay: Fix wrong warning 642 report.
7124 * cs-tokenizer.cs (CheckNextToken): New helper;
7125 Inspect next character if is same as expected.
7127 2004-09-23 Martin Baulig <martin@ximian.com>
7129 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7130 (Convert.ImplicitReferenceConversionExists): Likewise.
7132 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7134 * class.cs (Operator.Define): Add error 448 and 559 report.
7136 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7138 * class.cs (MemberBase.IsTypePermitted): New protected
7139 method for checking error CS0610.
7141 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7143 * class.cs (TypeContainer.HasExplicitLayout): New property
7144 Returns whether container has StructLayout attribute set Explicit.
7145 (FieldMember): New abstract class for consts and fields.
7146 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7147 (Field): Reuse FieldMember.
7149 * const.cs (Const): Reuse FieldMember.
7151 * rootcontext.cs: EmitConstants call moved to class.
7153 2004-09-22 Martin Baulig <martin@ximian.com>
7155 Thanks to Peter Sestoft for this bug report.
7157 * expression.cs (Conditional): If both the `trueExpr' and the
7158 `falseExpr' is a NullLiteral, return a NullLiteral.
7160 2004-09-22 Martin Baulig <martin@ximian.com>
7162 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7163 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7164 for the "get_Current" call.
7166 2004-09-22 Martin Baulig <martin@ximian.com>
7168 Marek and me just fixed one of our oldest bugs: #28562 :-)
7170 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7172 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7173 we're an EnumConstant, just return that.
7174 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7175 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7176 to get the value which'll actually be written into the attribute.
7177 However, we have to use GetValue() to access the attribute's value
7180 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7182 * constant.cs (Constant.IsNegative): New abstract property
7185 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7186 (StackAlloc.DoResolve): Reused IsNegative.
7188 2004-09-21 Martin Baulig <martin@ximian.com>
7190 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7191 if we're used in an iterator, we may be called from different
7194 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7195 we actually have an exception block.
7197 2004-09-20 John Luke <jluke@cfl.rr.com>
7199 * class.cs, cs-parser.jay: Improve the error report for 1520:
7200 report the actual line where the error happens, not where the
7203 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7204 Pass location information that was available elsewhere.
7206 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
7208 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7209 runtime to delay sign assemblies.
7211 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7213 * cs-parser.jay: Do not report the stack trace, this is barely
7216 2004-08-22 John Luke <john.luke@gmail.com>
7218 * driver.cs : check that a resource id is not already used
7219 before adding it, report CS1508 if it is, bug #63637
7221 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7223 * ecore.cs: Removed dead code.
7225 2004-09-18 Marek Safar <marek.safar@seznam.cz>
7227 * class.cs: Do not report warning CS0067 on the interfaces.
7229 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7231 * cs-parser.jay: Add error 504 report.
7233 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7235 * rootcontext.cs: WarningLevel is 4 by default now.
7237 * statement.cs (Fixed.Resolve): Do not null
7240 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7243 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7244 deep search when property is not virtual.
7245 (PropertyExpr.ResolveAccessors): Make one call for both
7248 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7251 * statement.cs: Error 152 report constains also location.
7253 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7256 * const.cs: Explicitly set constant as static.
7258 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7261 * cs-parser.jay: Add error 1017 report.
7263 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7265 Fixed bug #59980, #64224
7266 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7268 * typemanager.cs (IsSpecialMethod): Simplified
7270 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7272 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7273 condition with better params.
7275 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7278 * attribute.cs (Resolve): Property has to have both
7281 2004-09-14 Martin Baulig <martin@ximian.com>
7283 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7285 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7288 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7289 called and is obsolete then this member suppress message
7290 when call is inside next [Obsolete] method or type.
7292 * expression.cs: Use TestObsoleteMethodUsage member.
7294 2004-09-14 Martin Baulig <martin@ximian.com>
7296 * cs-parser.jay: Sync a bit with the GMCS version.
7298 2004-09-14 Martin Baulig <martin@ximian.com>
7300 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7301 (CSharpParser.yacc_verbose_flag): New public field.
7303 * genericparser.cs: Removed.
7305 2004-09-14 Raja R Harinath <rharinath@novell.com>
7307 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7309 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7311 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7313 2004-09-10 Martin Baulig <martin@ximian.com>
7315 Backported my MemberName changes from GMCS into MCS.
7317 - we are now using a special `MemberName' class instead of using
7318 strings; in GMCS, the `MemberName' also contains the type
7321 - changed the grammar rules a bit:
7322 * the old `member_name' is now a `namespace_or_type_name':
7323 The rule is that we use `namespace_or_type_name' everywhere
7324 where we expect either a "member name" (GetEnumerator) or a
7325 "member name" with an explicit interface name
7326 (IEnumerable.GetEnumerator).
7327 In GMCS, the explicit interface name may include type arguments
7328 (IEnumerable<T>.GetEnumerator).
7329 * we use `member_name' instead of just `IDENTIFIER' for
7331 The rule is that we use `member_name' wherever a member may
7332 have type parameters in GMCS.
7334 * decl.cs (MemberName): New public class.
7335 (MemberCore.MemberName): New public readonly field.
7336 (MemberCore.ctor): Take a `MemberName' argument, not a string.
7337 (DeclSpace): Likewise.
7339 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7340 * enum.cs (Enum.ctor): Likewise.
7342 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7344 (AliasEntry.ctor): Take a MemberName, not an Expression.
7345 (AliasEntry.UsingAlias): Likewise.
7347 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7348 (IMethodData.MemberName): Changed type from string to MemberName.
7349 (MemberBase.ExplicitInterfaceName): Likewise.
7350 (AbstractPropertyEventMethod.SetupName): Make this private.
7351 (AbstractPropertyEventMethod.ctor): Added `string prefix'
7352 argument; compute the member name here.
7353 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7354 on the `member.MemberName' and the `prefix'.
7356 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7358 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7359 thus, we get a `MemberName' instead of a `string'. These
7360 declarations may have type parameters in GMCS.
7361 (interface_method_declaration, delegate_declaration): Likewise.
7362 (class_declaration, interface_declaration): Likewise.
7363 (method_header): Use `namespace_or_type_name' instead of
7364 `member_name'. We may be an explicit interface implementation.
7365 (property_declaration, event_declaration): Likewise.
7366 (member_name): This is now just an `IDENTIFIER', not a
7367 `namespace_or_type_name'.
7368 (type_name, interface_type): Removed.
7369 (namespace_or_type_name): Return a MemberName, not an Expression.
7370 (primary_expression): Use `member_name' instead of `IDENTIFIER';
7371 call GetTypeExpression() on the MemberName to get an expression.
7372 (IndexerDeclaration.interface_type): Changed type from string to
7374 (MakeName): Operate on MemberName's instead of string's.
7376 2004-09-13 Raja R Harinath <rharinath@novell.com>
7379 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7380 (NamespaceEntry.Lookup): Add new argument to flag if we want the
7381 lookup to avoid symbols introduced by 'using'.
7382 * rootcontext.cs (NamespaceLookup): Update.
7384 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7386 * class.cs (TypeContainer.DoDefineMembers): Do not call
7387 DefineDefaultConstructor for static classes.
7389 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7391 * attribute.cs (Attribute.Resolve): Add error 653 report.
7393 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7395 (Method.ApplyAttributeBuilder): Add error 685 report.
7396 (Operator.Define): Add error 564 report.
7398 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7400 * expression.cs (Invocation.DoResolve): Add error
7403 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7406 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7408 * class.cs (ConstructorInitializer.Resolve):
7409 Wrong error number (515->516).
7411 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7413 * class.cs (Indexer.Define): Add error 631 report.
7415 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7417 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7419 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7421 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7423 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7425 * cs-parser.jay: Added error CS0241 report.
7427 2004-09-10 Raja R Harinath <rharinath@novell.com>
7429 * cs-parser.jay (fixed_statement): Introduce a scope for the
7430 declaration in the 'fixed' statement.
7432 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7434 * cs-parser.jay: Added CS0230 error report.
7436 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7438 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7440 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7442 * expression.cs (Argument.Resolve): Added error CS0192 and
7445 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7447 C# 2.0 #pragma warning feature
7449 * cs-tokenizer.cs (PreProcessPragma): New method;
7450 Handles #pragma directive.
7452 * report.cs (WarningRegions): New class; Support
7453 class for #pragma warning directive. It tests whether
7454 warning is enabled for a given line.
7456 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7458 * const.cs: Add more descriptive error report, tahnks to
7461 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7463 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7465 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7467 * expression.cs: Apply patch from Ben: Remove dead code from
7468 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7469 as that code just threw an exception anwyays.
7471 * const.cs: Remove the call to the turnintoconstant, for details
7474 * literal.cs: The type of the null-literal is the null type; So
7475 we use a placeholder type (literal.cs:System.Null, defined here)
7478 * expression.cs (Conditional.DoResolve): Remove some old code that
7479 is no longer needed, conversions have been fixed.
7481 (ArrayCreationExpression.DoResolve): Return false if we fail to
7482 resolve the inner expression.
7484 2004-09-07 Raja R Harinath <rharinath@novell.com>
7487 * cs-parser.jay (delegate_declaration): Record a delegate
7488 declaration as a type declaration.
7489 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7491 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7493 * parameter.cs: Do not crash if the type can not be resolved.
7495 * expression.cs: Report errors with unsafe pointers, fixes #64896
7497 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7499 * expression.cs: Pointer arith always needs to do a conv.i
7500 if the operand is a long. fix 65320
7502 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7504 Fixed cs0619-37.cs, cs0619-38.cs
7506 * enum.cs (GetObsoleteAttribute): Removed.
7508 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7509 on Enum member is double staged. The first is tested member
7512 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7514 Fixed #56986, #63631, #65231
7516 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7517 adds member to name container.
7518 (TypeContainer.AddToTypeContainer): New method, adds type to
7520 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7521 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7522 AddOperator): Simplified by reusing AddToMemberContainer.
7523 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7525 (Method.CheckForDuplications): Fixed implementation to test all
7527 (MemberBase): Detection whether member is explicit interface
7528 implementation is now in constructor.
7529 (MemberBase.UpdateMemberName): Handles IndexerName.
7530 (Accessor): Changed to keep also location information.
7531 (AbstractPropertyEventMethod): Is derived from MemberCore.
7532 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7533 will be emited or not.
7534 (PropertyBase.AreAccessorsDuplicateImplementation):
7535 Tests whether accessors are not in collision with some method.
7536 (Operator): Is derived from MethodCore to simplify common
7539 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7541 (DeclSpace.AddToContainer): Adds the member to defined_names
7542 table. It tests for duplications and enclosing name conflicts.
7544 * enum.cs (EnumMember): Clean up to reuse the base structures
7546 2004-09-03 Martin Baulig <martin@ximian.com>
7548 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7549 into TypeContainer, to make partial classes work again.
7551 2004-09-03 Martin Baulig <martin@ximian.com>
7553 * rootcontext.cs (RootContext.V2): Removed.
7555 2004-03-23 Martin Baulig <martin@ximian.com>
7557 * expression.cs (Invocation.OverloadResolve): Added `bool
7558 may_fail' argument and use it instead of the Location.IsNull() hack.
7560 2004-09-03 Martin Baulig <martin@ximian.com>
7562 Merged latest changes into gmcs. Please keep this comment in
7563 here, it makes it easier for me to see what changed in MCS since
7564 the last time I merged.
7566 2004-09-03 Raja R Harinath <rharinath@novell.com>
7569 * expression.cs (BetterConversion): Don't allow either conversion
7570 to be null. Remove redundant implicit conversion test when 'q ==
7571 null' -- when this function is invoked, we already know that the
7572 implicit conversion exists.
7573 (BetterFunction): Assume that 'best' is non-null. Remove
7574 redundant reimplementation of IsApplicable when 'best' is null.
7575 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7576 number of arguments.
7577 (IsAncestralType): Extract from OverloadResolve.
7578 (OverloadResolve): Make robust to the MethodGroupExpr being
7579 unsorted. Implement all the logic of Section 14.5.5.1, and
7580 support overloading of methods from multiple applicable types.
7581 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7583 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7584 (RealError, Warning): Append type of report to related symbol.
7586 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7588 * enum.cs: Fixed CLS-Compliance checks for enum members.
7589 Error tests cs3008-8.cs, cs3014-8.cs
7591 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7593 Fixed bug #62342, #63102
7594 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7595 like ImplementMethod.
7597 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7599 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7602 2004-09-02 Martin Baulig <martin@ximian.com>
7604 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7605 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7608 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7610 C# 2.0 Static classes implemented
7612 * class.cs (TypeContainer): instance_constructors,
7613 initialized_fields, initialized_static_fields,
7614 default_constructor, base_inteface_types are protected to be
7615 accessible from StaticClass.
7616 (TypeContainer.DefineDefaultConstructor): New virtual method
7617 for custom default constructor generating
7618 (StaticClass): New class to handle "Static classes" feature.
7620 * cs-parser.jay: Handle static keyword on class like instance
7623 * driver.cs: Added "/langversion" command line switch with two
7624 options (iso-1, default).
7626 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7628 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7630 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7632 * delegate.cs: Style.
7634 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7636 * delegate.cs: Add seperate instance expr field for miguel.
7638 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7640 * PointerArithmetic (Resolve): make sure we are not doing
7641 pointer arith on void*. Also, make sure we are resolved
7642 by not setting eclass until resolve.
7644 All callers: Make sure that PointerArithmetic gets resolved.
7646 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7648 * ArrayCreation (LookupType): If the type does not resolve
7649 to an array, give an error.
7651 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7653 * statement.cs (Try.Resolve): Fixed bug #64222
7655 2004-08-27 Martin Baulig <martin@ximian.com>
7658 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7661 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7663 * ecore.cs (Constantify): Get underlying type via
7664 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7665 Windows in special cases.
7667 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7669 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7670 for obtaining also private methods.
7671 (GetRemoveMethod): Used GetRemoveMethod (true)
7672 for obtaining also private methods.
7674 2004-08-24 Martin Baulig <martin@ximian.com>
7676 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7677 MethodAttributes.HideBySig for operators.
7679 2004-08-23 Martin Baulig <martin@ximian.com>
7681 Back to the old error reporting system :-)
7683 * report.cs (Message): Removed.
7684 (Report.MessageData, ErrorData, WarningData): Removed.
7685 (Report.Error, Warning): Back to the old system.
7687 2004-08-23 Martin Baulig <martin@ximian.com>
7689 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7691 * class.cs (TypeContainer.ParentContainer): New public virtual
7692 method; replaces the explicit interface implementation.
7693 (ClassPart.ParentContainer): Override.
7695 2004-08-23 Martin Baulig <martin@ximian.com>
7697 * statement.cs (Switch): Added support for constant switches; see
7698 #59428 or test-285.cs.
7700 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7703 * statement.cs (GetEnumeratorFilter): Removed useless
7704 logic because C# specs is strict. GetEnumerator must be
7707 2004-08-22 Martin Baulig <martin@ximian.com>
7709 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7710 a switch and may break, reset the barrier. Fixes #59867.
7712 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7714 CLS-Compliance speed up (~5% for corlib)
7716 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7717 New method. Tests container for CLS-Compliant names
7719 * class.cs (TypeContainer.VerifyClsName): New method.
7720 Checks whether container name is CLS Compliant.
7721 (Constructor): Implements IMethodData.
7723 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7724 low-case table for CLS Compliance test.
7725 (MemberCache.VerifyClsParameterConflict): New method.
7726 Checks method parameters for CS3006 error.
7728 * enum.cs (EnumMember): Is derived from MemberCore.
7729 (Enum.VerifyClsName): Optimized for better performance.
7731 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7733 * report.cs: Renamed Error_T to Error and changed all
7736 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7738 * class.cs (TypeContainer.IndexerArrayList): New inner class
7739 container for indexers.
7740 (TypeContainer.DefaultIndexerName): New constant for default
7741 indexer name. Replaced all "Item" with this constant.
7742 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7744 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7745 DefaultMemberAttribute constructor.
7747 2004-08-05 Martin Baulig <martin@ximian.com>
7749 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7752 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7754 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7755 multi platforms problem.
7757 * compiler.csproj: Included shared files.
7759 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7761 Fix bug 60333, 55971 in the more general way
7762 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7763 Added arg_type argument for constant conversion.
7764 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7766 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7769 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7770 OperatorArrayList, MethodCoreArrayList for typecontainer
7771 containers. Changed class member types to these new types.
7772 (MethodArrayList.DefineMembers): Added test for CS0659.
7774 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7776 * cfold.cs: Synchronize the folding with the code in expression.cs
7777 Binary.DoNumericPromotions for uint operands.
7779 * attribute.cs: Revert patch from Raja, it introduced a regression
7780 while building Blam-1.2.1 (hard to isolate a test case).
7782 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7786 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7788 (MethodCore.parent_method): New member. The method we're overriding
7789 if this is an override method.
7790 (MethodCore.CheckBase): Moved from Method class and made common.
7791 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7793 (MethodCore.CheckForDuplications): New abstract method. For custom
7794 member duplication search in a container
7795 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7796 method and its return type.
7797 (Event.conflict_symbol): New member. Symbol with same name in the
7801 (MemberCache.FindMemberWithSameName): New method. The method
7802 is looking for conflict with inherited symbols.
7804 2004-08-04 Martin Baulig <martin@ximian.com>
7806 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7808 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7810 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7812 * report.cs (Message): New enum for better error, warning reference in
7814 (MessageData): New inner abstract class. It generally handles printing of
7815 error and warning messages.
7816 Removed unused Error, Warning, Message methods.
7818 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7820 Fix for cs0592-8.cs test
7822 (Attributable.ValidAttributeTargets): Made public.
7823 (Attribute.ExplicitTarget): New member for explicit target value.
7824 (Attribute.CheckTargets): Now we translate explicit attribute
7825 target to Target here.
7827 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7829 * ecore.cs (MethodGroupExpr): new IsBase property.
7831 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7833 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7834 rather than an instance expr.
7836 (DelegateCreation.Emit): Use the method group rather than
7837 the instance expression. Also, if you have base.Foo as the
7838 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7840 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7842 (NewDelegate.DoResolve): Only check for the existance of Invoke
7843 if the method is going to be needed. Use MethodGroupExpr.
7845 (NewDelegate.Emit): Remove, DelegateCreation implements this.
7847 * expression.cs: For pointer arith., make sure to use
7848 the size of the type, not the size of the pointer to
7851 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7854 * class.cs (Class): Added error CS0502 test.
7856 2004-08-03 John Luke <jluke@cfl.rr.com>
7857 Raja R Harinath <rharinath@novell.com>
7860 * attribute.cs (Attribute.complained_before): New flag.
7861 (Attribute.ResolveType, Attribute.Resolve),
7862 (Attribute.DefinePInvokeMethod): Set it.
7863 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7865 2004-08-03 Martin Baulig <martin@ximian.com>
7867 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7868 use a user-defined operator; we still need to do numeric
7869 promotions in case one argument is a builtin type and the other
7870 one has an implicit conversion to that type. Fixes #62322.
7872 2004-08-02 Martin Baulig <martin@ximian.com>
7874 * statement.cs (LocalInfo.Flags): Added `IsThis'.
7875 (LocalInfo.IsThis): New public property.
7876 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7878 2004-08-01 Martin Baulig <martin@ximian.com>
7880 * class.cs (TypeContainer.GetClassBases): Don't set the default
7881 here since we may get called from GetPartialBases().
7882 (TypeContainer.DefineType): If GetClassBases() didn't return a
7883 parent, use the default one.
7885 2004-07-30 Duncan Mak <duncan@ximian.com>
7887 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7889 2004-07-30 Martin Baulig <martin@ximian.com>
7891 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7893 * class.cs (SourceMethod): New public class, derive from the
7894 symbol writer's ISourceMethod.
7895 (Method): Use the new symbol writer API.
7897 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7898 as argument and use the new symbol writer.
7901 (SourceFile): Implement the symbol writer's ISourceFile.
7902 (Location.SymbolDocument): Removed.
7903 (Location.SourceFile): New public property.
7905 * symbolwriter.cs: Use the new symbol writer API.
7907 2004-07-30 Raja R Harinath <rharinath@novell.com>
7909 * Makefile (install-local): Remove. Functionality moved to
7912 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
7914 * Makefile: Install mcs.exe.config file together with mcs.exe.
7915 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7916 correct runtime version.
7918 2004-07-25 Martin Baulig <martin@ximian.com>
7921 (TypeContainer.RegisterOrder): Removed, this was unused.
7922 (TypeContainer, interface_order): Removed.
7923 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7924 TypeContainer as argument since we can also be called with a
7925 `PartialContainer' for a partial class/struct/interface.
7926 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7927 of checking whether we're an `Interface' - we could be a
7929 (PartialContainer.Register): Override; call
7930 AddClass()/AddStruct()/AddInterface() on our parent.
7932 * cs-parser.jay (interface_member_declaration): Add things to the
7933 `current_container', not the `current_class'.
7935 * rootcontext.cs (RegisterOrder): The overloaded version which
7936 takes an `Interface' was unused, removed.
7938 * typemanager.cs (TypeManager.LookupInterface): Return a
7939 `TypeContainer', not an `Interface'.
7940 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7941 contain a `PartialContainer' for an interface, so check it's
7942 `Kind' to figure out what it is.
7944 2004-07-25 Martin Baulig <martin@ximian.com>
7946 * class.cs (Class.DefaultTypeAttributes): New public constant.
7947 (Struct.DefaultTypeAttributes): Likewise.
7948 (Interface.DefaultTypeAttributes): Likewise.
7949 (PartialContainer.TypeAttr): Override this and add the
7950 DefaultTypeAttributes.
7952 2004-07-25 Martin Baulig <martin@ximian.com>
7954 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7955 we can just use the `Parent' field instead.
7957 2004-07-25 Martin Baulig <martin@ximian.com>
7959 * class.cs (TypeContainer.Emit): Renamed to EmitType().
7961 2004-07-25 Martin Baulig <martin@ximian.com>
7963 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7964 our parts before defining any methods.
7965 (TypeContainer.VerifyImplements): Make this virtual.
7966 (ClassPart.VerifyImplements): Override and call VerifyImplements()
7967 on our PartialContainer.
7969 2004-07-25 Martin Baulig <martin@ximian.com>
7971 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7973 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7974 argument, we can just use the `Parent' field instead.
7977 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
7978 (MemberBase.DoDefine): Likewise.
7980 2004-07-24 Martin Baulig <martin@ximian.com>
7982 * decl.cs (MemberCore.Parent): New public field.
7983 (DeclSpace.Parent): Moved to MemberCore.
7985 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7986 (MemberBase.ctor): Added TypeContainer argument, pass it to our
7988 (FieldBase, Field, Operator): Likewise.
7989 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7990 (EventField, Event): Likewise.
7992 2004-07-23 Martin Baulig <martin@ximian.com>
7994 * class.cs (PartialContainer): New public class.
7995 (ClassPart): New public class.
7996 (TypeContainer): Added support for partial classes.
7997 (TypeContainer.GetClassBases): Splitted some of the functionality
7998 out into GetNormalBases() and GetPartialBases().
8000 * cs-tokenizer.cs (Token.PARTIAL): New token.
8001 (Tokenizer.consume_identifier): Added some hacks to recognize
8002 `partial', but only if it's immediately followed by `class',
8003 `struct' or `interface'.
8005 * cs-parser.jay: Added support for partial clases.
8007 2004-07-23 Martin Baulig <martin@ximian.com>
8009 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8010 a `DeclSpace' and also made it readonly.
8011 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8012 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8013 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8015 * cs-parser.jay: Pass the `current_class', not the
8016 `current_container' (at the moment, this is still the same thing)
8017 to a new Method, Property, Event, Indexer or Constructor.
8019 2004-07-23 Martin Baulig <martin@ximian.com>
8021 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8022 and removed the `current_interface' one.
8023 (struct_declaration, class_declaration, interface_declaration):
8024 Set `current_class' to the newly created class/struct/interface;
8025 set their `Bases' and call Register() before parsing their body.
8027 2004-07-23 Martin Baulig <martin@ximian.com>
8029 * class.cs (Kind): New public enum.
8030 (TypeContainer): Made this class abstract.
8031 (TypeContainer.Kind): New public readonly field.
8032 (TypeContainer.CheckDef): New public method; moved here from
8034 (TypeContainer.Register): New public abstract method.
8035 (TypeContainer.GetPendingImplementations): New public abstract
8037 (TypeContainer.GetClassBases): Removed the `is_class' and
8038 `is_iface' parameters.
8039 (TypeContainer.DefineNestedTypes): Formerly known as
8041 (ClassOrStruct): Made this class abstract.
8043 * tree.cs (RootTypes): New public type.
8045 2004-07-20 Martin Baulig <martin@ximian.com>
8047 * tree.cs (Tree.RecordNamespace): Removed.
8048 (Tree.Namespaces): Removed.
8050 * rootcontext.cs (RootContext.IsNamespace): Removed.
8052 * cs-parser.jay (namespace_declaration): Just create a new
8053 NamespaceEntry here.
8055 2004-07-20 Martin Baulig <martin@ximian.com>
8057 * statement.cs (ExceptionStatement): New abstract class. This is
8058 now used as a base class for everyone who's using `finally'.
8059 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8060 our local variables before using them.
8062 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8063 virtual method. This is used by Yield.Resolve() to "steal" an
8064 outer block's `finally' clauses.
8065 (FlowBranchingException): The .ctor now takes an ExceptionStatement
8068 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8069 version which takes an ExceptionStatement. This version must be
8070 used to create exception branchings.
8073 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8074 (Iterator.EmitMoveNext): Added exception support; protect the
8075 block with a `fault' clause, properly handle 'finally' clauses.
8076 (Iterator.EmitDispose): Run all the `finally' clauses here.
8078 2004-07-20 Martin Baulig <martin@ximian.com>
8080 * iterator.cs: This is the first of a set of changes in the
8081 iterator code. Match the spec more closely: if we're an
8082 IEnumerable, then GetEnumerator() must be called. The first time
8083 GetEnumerator() is called, it returns the current instance; all
8084 subsequent invocations (if any) must create a copy.
8086 2004-07-19 Miguel de Icaza <miguel@ximian.com>
8088 * expression.cs: Resolve the constant expression before returning
8091 2004-07-19 Martin Baulig <martin@ximian.com>
8093 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8094 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8095 the return type of the new EmitContext.
8097 2004-07-18 Martin Baulig <martin@ximian.com>
8099 * class.cs (Property.Define): Fix iterators.
8101 * iterators.cs (Iterator.Define): Moved the
8102 `container.AddInterator (this)' call here from the .ctor; only do
8103 it if we resolved successfully.
8105 2004-07-17 Miguel de Icaza <miguel@ximian.com>
8107 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8108 `true' for preprocessing directives that we parse. The return
8109 value indicates whether we should return to regular tokenizing or
8110 not, not whether it was parsed successfully.
8112 In the past if we were in: #if false ... #line #endif, we would
8113 resume parsing after `#line'. See bug 61604.
8115 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8116 building: IsEnumType should return true only for enums, not for
8117 enums or System.Enum itself. This fixes #61593.
8119 Likely what happened is that corlib was wrong: mcs depended on
8120 this bug in some places. The bug got fixed, we had to add the
8121 hack, which caused bug 61593.
8123 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8124 that was a workaround for the older conditions.
8126 2004-07-16 Ben Maurer <bmaurer@ximian.com>
8128 * assign.cs: IAssignMethod has a new interface, as documented
8129 inline. All assignment code now uses this new api.
8131 * ecore.cs, expression.cs: All classes which implement
8132 IAssignMethod now use the new interface.
8134 * expression.cs (Invocation): add a hack to EmitCall so that
8135 IndexerAccess can be the target of a compound assignment without
8136 evaluating its arguments twice.
8138 * statement.cs: Handle changes in Invocation api.
8140 2004-07-16 Martin Baulig <martin@ximian.com>
8142 * iterators.cs: Rewrote this. We're now using one single Proxy
8143 class for both the IEnumerable and the IEnumerator interface and
8144 `Iterator' derives from Class so we can use the high-level API.
8146 * class.cs (TypeContainer.AddIterator): New method.
8147 (TypeContainer.DoDefineType): New protected virtual method, which
8148 is called from DefineType().
8149 (TypeContainer.DoDefineMembers): Call DefineType() and
8150 DefineMembers() on all our iterators.
8151 (TypeContainer.Emit): Call Emit() on all our iterators.
8152 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8154 * codegen.cs (EmitContext.CurrentIterator): New public field.
8156 2004-07-15 Martin Baulig <martin@ximian.com>
8159 (TypeManager.not_supported_exception_type): New type.
8161 2004-07-14 Martin Baulig <martin@ximian.com>
8163 * iterators.cs: Use real error numbers.
8165 2004-07-14 Martin Baulig <martin@ximian.com>
8167 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8168 requires this to be a System.Collection.IEnumerable and not a
8169 class implementing that interface.
8170 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8172 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8174 * class.cs: Fixed previous fix, it broke some error tests.
8176 2004-07-12 Martin Baulig <martin@ximian.com>
8178 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8181 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8183 * assign.cs (LocalTemporary): Add new argument: is_address,If
8184 `is_address' is true, then the value that we store is the address
8185 to the real value, and not the value itself.
8187 * ecore.cs (PropertyExpr): use the new local temporary
8188 stuff to allow us to handle X.Y += z (where X is a struct)
8190 2004-07-08 Martin Baulig <martin@ximian.com>
8192 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8193 not always return, just like we're doing in Using.Resolve().
8195 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8197 * cs-parser.jay (fixed_statement): flag this as Pinned.
8199 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8201 * typemanager.cs (TypeManager): Removed MakePinned method, this
8202 mechanism is replaced with the .NET 2.x compatible mechanism of
8203 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8205 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8206 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8207 `IsFixed' property which has a different meaning.
8209 2004-07-02 Raja R Harinath <rharinath@novell.com>
8211 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8212 visible from inside a nested class, not just the names of the
8213 immediately enclosing class.
8216 2004-06-24 Raja R Harinath <rharinath@novell.com>
8218 * expression.cs (BetterConversion): Remove buggy special-case
8219 handling of "implicit constant expression conversions". At this
8220 point, we already know that the conversion is possible -- we're
8221 only checking to see which is better.
8223 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8225 * cs-parser.jay: Added error CS0210 test.
8227 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8229 * cs-parser.jay: Added error CS0134 test.
8231 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8234 * cs-parser.jay: Added error CS0145 test.
8236 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8238 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8240 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8242 * expression.cs (StackAlloc.Resolve): The argument may not
8243 be a constant; deal with this case.
8245 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8247 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8248 GetIndexerAttributeValue.
8249 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8251 * class.cs (Indexer.Define): Added error tests for CS0415,
8254 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8256 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8259 2004-06-23 Martin Baulig <martin@ximian.com>
8261 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8262 neither return nor throw, reset the barrier as well. Fixes #60457.
8264 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8266 * class.cs : EventAttributes is now set to None by default.
8267 This fixes bug #60459.
8269 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8272 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8273 Don't throw exception but return null (it's sufficient now).
8275 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8277 * typemanager.cs (GetArgumentTypes): Faster implementation.
8279 2004-06-18 Martin Baulig <martin@ximian.com>
8281 * attribute.cs (Attribute.Resolve): Check whether we're an
8282 EmptyCast which a Constant child. Fixes #60333.
8284 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8286 * statement.cs (EmitCollectionForeach): Account for the fact that
8287 not all valuetypes are in areas which we can take the address of.
8288 For these variables, we store to a temporary variable. Also, make
8289 sure that we dont emit a `callvirt' on a valuetype method.
8291 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8293 * expression.cs (StackAlloc.DoReSolve): Added test for
8294 negative parameter (CS0247).
8296 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8299 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8301 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8304 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8307 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8309 Fix bug #58254 & cs1555.cs, cs1556.cs
8310 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8312 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8314 * cs-parser.jay: Added error CS1669 test for indexers.
8316 2004-06-11 Martin Baulig <martin@ximian.com>
8318 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8319 call this twice: for params and varargs methods.
8321 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8324 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8326 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8328 * attribute.cs (Attribute.GetValidTargets): Made public.
8331 (AbstractPropertyEventMethod): New class for better code sharing.
8332 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8334 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8336 2004-06-11 Raja R Harinath <rharinath@novell.com>
8339 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8340 that the call to Resolve is part of a MemberAccess.
8341 (Expression.Resolve): Use it for SimpleName resolution.
8342 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8343 Add 'intermediate' boolean argument.
8344 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
8345 error message when the SimpleName can be resolved ambiguously
8346 between an expression and a type.
8347 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8349 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8350 call on the left-side.
8352 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8355 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8357 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8359 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8361 2004-06-11 Martin Baulig <martin@ximian.com>
8363 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8364 varargs methods if applicable.
8366 2004-06-11 Martin Baulig <martin@ximian.com>
8368 * expression.cs (Invocation.EmitCall): Don't use
8369 `method.CallingConvention == CallingConventions.VarArgs' since the
8370 method could also have `CallingConventions.HasThis'.
8372 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8374 * class.cs (Event.GetSignatureForError): Implemented.
8375 Fixed crash in error test cs3010.cs
8377 2004-06-10 Miguel de Icaza <miguel@ximian.com>
8379 * cs-tokenizer.cs: Change the way we track __arglist to be
8380 consistent with the other keywords.
8382 2004-06-09 Miguel de Icaza <miguel@ximian.com>
8384 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8387 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
8389 * codegen.cs: Check that all referenced assemblies have a strongname
8390 before strongnaming the compiled assembly. If not report error CS1577.
8391 Fix bug #56563. Patch by Jackson Harper.
8392 * typemanager.cs: Added a method to return all referenced assemblies.
8393 Fix bug #56563. Patch by Jackson Harper.
8395 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8398 (Method.ApplyAttributeBuilder): Moved and added conditional
8399 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8402 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8404 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8407 * class.cs: (EventField.attribute_targets): Changed default target.
8409 2004-06-08 Martin Baulig <martin@ximian.com>
8411 * expression.cs (Invocation.EmitCall): Enable varargs methods.
8413 2004-06-08 Martin Baulig <martin@ximian.com>
8415 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8417 2004-06-07 Martin Baulig <martin@ximian.com>
8419 Added support for varargs methods.
8421 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8424 * cs-parser.jay: Added support for `__arglist'.
8426 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8428 * expression.cs (Argument.AType): Added `ArgList'.
8429 (Invocation): Added support for varargs methods.
8430 (ArglistAccess): New public class.
8431 (Arglist): New public class.
8433 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8435 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
8436 a method's top-level block if the method has varargs.
8438 * support.cs (ReflectionParameters, InternalParameters): Added
8439 support for varargs methods.
8441 2004-06-07 Miguel de Icaza <miguel@ximian.com>
8443 * class.cs: Provide location in indexer error report.
8445 * driver.cs: Use standard names.
8447 * namespace.cs: Catch the use of using after a namespace has been
8448 declared also on using aliases.
8450 2004-06-03 Raja R Harinath <rharinath@novell.com>
8453 * typemanager.cs (closure_private_ok, closure_invocation_type)
8454 (closure_qualifier_type, closure_invocation_assembly)
8455 (FilterWithClosure): Move to ...
8456 (Closure): New internal nested class.
8457 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8458 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8459 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8460 (MemberLookup, MemberLookupFailed): Use it.
8461 * expression.cs (New.DoResolve): Treat the lookup for the
8462 constructor as being qualified by the 'new'ed type.
8463 (Indexers.GetIndexersForTypeOrInterface): Update.
8465 2004-06-03 Marek Safar <marek.safar@seznam.cz>
8468 (GetConditionalAttributeValue): New method. Returns
8469 condition of ConditionalAttribute.
8470 (SearchMulti): New method. Returns all attributes of type 't'.
8471 Use it when attribute is AllowMultiple = true.
8472 (IsConditionalMethodExcluded): New method.
8475 (Method.IsExcluded): Implemented. Returns true if method has conditional
8476 attribute and the conditions is not defined (method is excluded).
8477 (IMethodData): Extended interface for ConditionalAttribute support.
8478 (PropertyMethod.IsExcluded): Implemented.
8481 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8484 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8487 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
8489 * expression.cs (ArrayCreationExpression): Make this just an
8490 `expression'. It can't be a statement, so the code here was
8493 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8496 * typemanager.cs (GetFullNameSignature): New method for
8499 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8502 * class.cs (MemberBase.GetSignatureForError): New virtual method.
8503 Use this method when MethodBuilder is null.
8504 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8505 Added test for error CS0626 (MONO reports error for this situation).
8506 (IMethodData.GetSignatureForError): Extended interface.
8508 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8511 (AttributeTester.GetObsoleteAttribute): Returns instance of
8512 ObsoleteAttribute when type is obsolete.
8515 (TypeContainer.VerifyObsoleteAttribute): Override.
8516 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8517 (MethodCode.VerifyObsoleteAttribute): Override.
8518 (MemberBase.VerifyObsoleteAttribute): Override.
8521 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8522 and report proper error.
8525 Delegate.VerifyObsoleteAttribute): Override.
8528 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8529 and report proper error.
8530 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8533 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8537 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8538 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8539 Added test for ObsoleteAttribute.
8542 (Catch): Derived from Statement.
8544 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8546 Fixed bug #59071 & cs0160.cs
8548 * statement.cs (Try.Resolve): Check here whether order of catch
8549 clauses matches their dependencies.
8551 2004-05-31 Miguel de Icaza <miguel@ximian.com>
8553 * Reverted patch to namespace.cs (Use lookuptypedirect). This
8554 caused a regression: #59343. Referencing nested classes from an
8555 assembly stopped working.
8557 2004-05-31 Martin Baulig <martin@ximian.com>
8559 MCS is now frozen for beta 2.
8561 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8563 * convert.cs: add a trivial cache for overload operator resolution.
8565 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8567 * decl.cs: If possible, use lookuptypedirect here. We can only do
8568 this if there is no `.' after the namespace. Avoids using
8569 LookupType, which does lots of slow processing.
8570 (FindNestedType) New method, does what it says :-).
8571 * namespace.cs: use LookupTypeDirect.
8572 * rootcontext.cs: use membercache, if possible.
8573 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8575 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8578 According to the spec,
8580 In a member access of the form E.I, if E is a single identifier,
8581 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8582 field, property, localvariable, or parameter with the same type as
8583 the meaning of E as a type-name (§3.8), then both possible
8584 meanings of E are permitted.
8586 We did not check that E as a simple-name had the same type as E as
8589 This trivial check gives us 5-7% on bootstrap time.
8591 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8593 * expression.cs (Invocation.OverloadResolve): Avoid the
8594 use of hashtables and boxing here by allocating on demand.
8596 2004-05-30 Martin Baulig <martin@ximian.com>
8598 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8599 we're doing a silent lookup. Don't try to lookup nested types in
8600 TypeManager.object_type (thanks to Ben Maurer).
8602 2004-05-30 Martin Baulig <martin@ximian.com>
8604 Committing a patch from Ben Maurer.
8606 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8608 2004-05-29 Martin Baulig <martin@ximian.com>
8610 * class.cs (IMethodData.ShouldIgnore): New method.
8612 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8613 `Location' argument, we don't need it anywhere. Use
8614 `IMethodData.ShouldIgnore ()' instead of
8615 `MethodData.GetMethodFlags ()'.
8616 (TypeManager.AddMethod): Removed.
8617 (TypeManager.AddMethod2): Renamed to AddMethod.
8619 2004-05-29 Martin Baulig <martin@ximian.com>
8621 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8623 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8624 converting from a class type S to an interface type and we already
8625 have an object on the stack, don't box it again. Fixes #52578.
8627 2004-05-29 Martin Baulig <martin@ximian.com>
8629 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8630 Added support for `params' parameters. Fixes #59267.
8632 2004-05-29 Martin Baulig <martin@ximian.com>
8634 * literal.cs (NullPointer): Provide a private .ctor which sets
8635 `type' to TypeManager.object_type. Fixes #59048.
8637 2004-05-29 Martin Baulig <martin@ximian.com>
8639 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8640 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8642 * ecore.cs (EventExpr.instance_expr): Make the field private.
8644 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8646 Fixed bug #50080 & cs0214-2.cs
8647 * expression.cs (Cast.DoResolve): Check unsafe context here.
8649 * statement.cs (Resolve.DoResolve): Likewise.
8651 2004-05-26 Martin Baulig <martin@ximian.com>
8653 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8655 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8656 (RootContext.LookupType): Pass down the `silent' flag.
8658 2004-05-25 Martin Baulig <martin@ximian.com>
8661 (MethodGroupExpr.IdenticalTypeName): New public property.
8662 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8663 expression actually refers to a type.
8665 2004-05-25 Martin Baulig <martin@ximian.com>
8667 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8668 for #56176 and made it actually work.
8670 2004-05-25 Martin Baulig <martin@ximian.com>
8672 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8673 (FieldExpr, PropertyExpr): Override and implement
8674 CacheTemporaries. Fixes #52279.
8676 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8678 * location.cs: In the new compiler listing a file twice is a
8679 warning, not an error.
8681 2004-05-24 Martin Baulig <martin@ximian.com>
8683 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8684 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8686 2004-05-24 Martin Baulig <martin@ximian.com>
8688 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8689 walking the `using' list. Fixes #53921.
8691 2004-05-24 Martin Baulig <martin@ximian.com>
8693 * const.cs (Const.LookupConstantValue): Added support for
8694 EmptyCast's; fixes #55251.
8696 2004-05-24 Martin Baulig <martin@ximian.com>
8698 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8699 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8700 which does the CS0135 check. The reason is that we first need to
8701 check whether the variable actually exists.
8703 2004-05-24 Martin Baulig <martin@ximian.com>
8705 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8706 than RootContext.LookupType() to find the explicit interface
8709 2004-05-24 Raja R Harinath <rharinath@novell.com>
8711 * Makefile: Simplify. Use executable.make.
8712 * mcs.exe.sources: New file. List of sources of mcs.exe.
8714 2004-05-24 Anders Carlsson <andersca@gnome.org>
8718 Use the invariant culture when doing String.Compare for CLS case
8721 2004-05-23 Martin Baulig <martin@ximian.com>
8723 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8724 don't have any dots. Fixes #52622, added cs0246-8.cs.
8726 * namespace.cs (NamespaceEntry.Lookup): Likewise.
8728 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8730 * class.cs (MemberBase.Define): Reuse MemberType member for
8731 resolved type. Other methods can use it too.
8733 2004-05-23 Martin Baulig <martin@ximian.com>
8735 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8736 the variable also exists in the current block (otherwise, we need
8737 to report a CS0103). Fixes #58670.
8739 2004-05-23 Martin Baulig <martin@ximian.com>
8741 * flowanalysis.cs (Reachability.Reachable): Compute this
8742 on-the-fly rather than storing it as a field.
8744 2004-05-23 Martin Baulig <martin@ximian.com>
8746 * flowanalysis.cs (Reachability.And): Manually compute the
8747 resulting `barrier' from the reachability.
8749 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8752 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8753 instance of ObsoleteAttribute when symbol is obsolete.
8756 (IMethodData): Extended interface for ObsoleteAttribute support.
8758 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8760 * attribute.cs: Fix bug #55970
8762 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8766 (GetObsoleteAttribute): New method. Creates the instance of
8768 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8769 ObsoleteAttribute when member is obsolete.
8770 (AttributeTester.Report_ObsoleteMessage): Common method for
8771 Obsolete error/warning reporting.
8774 (TypeContainer.base_classs_type): New member for storing parent type.
8777 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8778 for this MemberCore.
8780 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8782 * attribute.cs, const.cs: Fix bug #58590
8784 2004-05-21 Martin Baulig <martin@ximian.com>
8786 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8787 out parameters if the end of the method is unreachable. Fixes
8790 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8792 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8793 Hari was right, why extra method.
8795 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8797 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8799 2004-05-20 Martin Baulig <martin@ximian.com>
8801 Merged this back from gmcs to keep the differences to a minumum.
8803 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8804 instead of a Declspace.
8805 (Attribute.ResolveType): Likewise.
8806 (Attributes.Search): Likewise.
8807 (Attributes.Contains): Likewise.
8808 (Attributes.GetClsCompliantAttribute): Likewise.
8810 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8812 (MethodData.ApplyAttributes): Take an EmitContext instead of a
8815 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8817 Fix bug #58688 (MCS does not report error when the same attribute
8820 * attribute.cs (Attribute.Emit): Distinction between null and default.
8822 2004-05-19 Raja R Harinath <rharinath@novell.com>
8824 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8825 of a top-level attribute without an attribute target.
8826 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8828 (Attribute.Conditional_GetConditionName),
8829 (Attribute.Obsolete_GetObsoleteMessage): Update.
8830 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8831 part of ScanForIndexerName.
8832 (Attribute.CanIgnoreInvalidAttribute): New function.
8833 (Attribute.ScanForIndexerName): Move to ...
8834 (Attributes.ScanForIndexerName): ... here.
8835 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8836 (Attributes.Search): New internal variant that can choose not to
8837 complain if types aren't resolved. The original signature now
8839 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8840 complaints suppressed.
8841 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8842 only if it not useful.
8843 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8844 top-level for attributes that are shared between the assembly
8845 and a top-level class.
8846 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8847 * class.cs: Update to reflect changes.
8848 (DefineIndexers): Fuse loops.
8849 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
8850 a couple more variants of attribute names.
8852 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8854 Fix bug #52585 (Implemented explicit attribute declaration)
8857 (Attributable.ValidAttributeTargets): New abstract method. It gets
8858 list of valid attribute targets for explicit target declaration.
8859 (Attribute.Target): It holds target itself.
8860 (AttributeSection): Removed.
8861 (Attribute.CheckTargets): New method. It checks whether attribute
8862 target is valid for the current element.
8865 (EventProperty): New class. For events that are declared like
8866 property (with add and remove accessors).
8867 (EventField): New class. For events that are declared like field.
8870 * cs-parser.jay: Implemented explicit attribute target declaration.
8872 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
8873 Override ValidAttributeTargets.
8876 (ReturnParameter): Class for applying custom attributes on
8878 (ParameterAtribute): New class. Class for applying custom
8879 attributes on the parameter type.
8881 2004-05-17 Miguel de Icaza <miguel@ximian.com>
8883 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8886 (Method): Allow UNSAFE here.
8888 * modifiers.cs: Support unsafe reporting.
8890 2004-05-17 Marek Safar <marek.safar@seznam.cz>
8892 * decl.cs: Fix bug #58478.
8894 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8896 * statement.cs: When checking for unreachable code on an EmptyStatement,
8897 set the location. Fixes bug #58488.
8899 2004-05-13 Miguel de Icaza <miguel@ximian.com>
8901 * driver.cs: Add -pkg handling.
8903 From Gonzalo: UseShelLExecute=false
8905 2004-05-12 Marek Safar <marek.safar@seznam.cz>
8908 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8910 (Attribute.IsClsCompliaceRequired): Moved to base for better
8912 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8913 when attribute is AttributeUsageAttribute.
8914 (Attribute.GetValidTargets): Simplified.
8915 (Attribute.GetAttributeUsage): New method returns AttributeUsage
8916 attribute for this type.
8917 (Attribute.ApplyAttributes): Method renamed to Emit and make
8919 (GlobalAttributeSection): New class for special handling of global
8920 attributes (assembly, module).
8921 (AttributeSection.Emit): New method.
8923 * class.cs: Implemented Attributable abstract methods.
8924 (MethodCore.LabelParameters): Moved to Parameter class.
8925 (Accessor): Is back simple class.
8926 (PropertyMethod): Implemented Attributable abstract class.
8927 (DelegateMethod): Implemented Attributable abstract class.
8928 (Event): New constructor for disctintion between normal Event
8929 and Event with accessors.
8931 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8933 * codegen.cs, const.cs, decl.cs, delegate.cs:
8934 (CommonAssemblyModulClass): Implemented Attributable abstract class
8937 * enum.cs: Implement IAttributeSupport interface.
8938 (EnumMember): New class for emum members. Implemented Attributable
8942 (ParameterBase): Is abstract.
8943 (ReturnParameter): New class for easier [return:] attribute handling.
8945 * typemanager.cs: Removed builder_to_attr.
8947 2004-05-11 Raja R Harinath <rharinath@novell.com>
8950 * attribute.cs (Attribute.GetPositionalValue): New function.
8951 * class.cs (TypeContainer.VerifyMembers): New function.
8952 (TypeContainer.Emit): Use it.
8953 (ClassOrStruct): New base class for Class and Struct.
8954 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
8955 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8957 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8958 then each non-static field should have a FieldOffset attribute.
8959 Otherwise, none of the fields should have a FieldOffset attribute.
8960 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
8961 and FieldOffset attributes.
8962 * typemanager.cs (TypeManager.struct_layout_attribute_type)
8963 (TypeManager.field_offset_attribute_type): New core types.
8964 (TypeManager.InitCoreTypes): Initialize them.
8966 2004-05-11 Michal Moskal <malekith@pld-linux.org>
8968 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8969 Return correct type.
8972 2004-05-09 Miguel de Icaza <miguel@ximian.com>
8974 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8975 be implicitly converted to ulong.
8977 * expression.cs: The logic for allowing operator &, | and ^ worked
8978 was wrong, it worked before because we did not report an error in
8979 an else branch. Fixes 57895.
8981 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8982 allow volatile fields to be reference types.
8984 2004-05-07 Miguel de Icaza <miguel@ximian.com>
8986 * driver.cs: Add support for /debug-
8988 2004-05-07 Raja R Harinath <rharinath@novell.com>
8990 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
8991 Add a 'complain' parameter to silence errors.
8992 (Attribute.Resolve): Update to changes. Put in sanity check to catch
8993 silently overlooked type-resolutions.
8994 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8996 (Attributes.Search): New function.
8997 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8998 (Attributes.GetAttributeFullName): Remove hack.
8999 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9000 Update to reflect changes.
9001 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9002 Use Attributes.Search instead of nested loops.
9004 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9007 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9008 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9009 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9011 * report.cs: (Report.Warning): Renamed to Warning_T because of
9012 parameter collision.
9014 2004-05-05 Raja R Harinath <rharinath@novell.com>
9016 * expression.cs (MemberAccess.ResolveMemberAccess):
9017 Exit with non-zero status after Report.Error.
9018 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9020 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9022 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9024 * support.cs: Don't hang when the file is empty.
9026 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9028 * support.cs: In SeekableStreamReader, compute the preamble size of the
9029 underlying stream. Position changes should take into account that initial
9032 2004-05-03 Todd Berman <tberman@sevenl.net>
9034 * driver.cs: remove unused GetSysVersion function.
9036 2004-05-03 Todd Berman <tberman@sevenl.net>
9038 * driver.cs: Remove the hack from saturday, as well as the hack
9039 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9040 link_paths to get that bit proper.
9042 2004-05-01 Todd Berman <tberman@sevenl.net>
9044 * driver.cs: Try a LoadFrom before a Load, this checks the current
9045 path. This is currently a bug in mono that is be fixed, however, this
9046 provides a workaround for now. This will be removed when the bug
9049 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9051 * CryptoConvert.cs: Updated to latest version. Fix issue with
9052 incomplete key pairs (#57941).
9054 2004-05-01 Todd Berman <tberman@sevenl.net>
9056 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9059 2004-04-30 Jackson Harper <jackson@ximian.com>
9061 * codegen.cs: Open keys readonly.
9063 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9065 * typemanager.cs: don't report cyclic struct layout when a struct
9066 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9067 which has 2 Pango.Rectangle fields.
9069 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9071 * expression.cs: Handle IntPtr comparisons with IL code
9072 rather than a method call.
9074 2004-04-29 Martin Baulig <martin@ximian.com>
9076 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9077 the list of PropertyInfo's in class hierarchy and find the
9078 accessor. Fixes #56013.
9080 2004-04-29 Martin Baulig <martin@ximian.com>
9082 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9084 2004-04-29 Martin Baulig <martin@ximian.com>
9086 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9088 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9090 2004-04-29 Martin Baulig <martin@ximian.com>
9092 * class.cs (ConstructorInitializer.Resolve): Check whether the
9093 parent .ctor is accessible. Fixes #52146.
9095 2004-04-29 Martin Baulig <martin@ximian.com>
9097 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9099 * statement.cs (Using.EmitLocalVariableDecls): Use
9100 TypeManager.idisposable_type, not typeof (IDisposable).
9101 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9103 2004-04-29 Martin Baulig <martin@ximian.com>
9105 * class.cs (Event.Define): Don't emit the field and don't set
9106 RTSpecialName and SpecialName for events on interfaces. Fixes
9109 2004-04-29 Raja R Harinath <rharinath@novell.com>
9111 Refactor Attribute.ApplyAttributes.
9112 * attribute.cs (Attributable): New base class for objects that can
9113 have Attributes applied on them.
9114 (Attribute): Make AttributeUsage fields public.
9115 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9116 (Attribute.IsInternalCall): New property.
9117 (Attribute.UsageAttr): Convert to a public read-only property.
9118 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9119 (Attribute.ResolveType, Attribute.Resolve)
9120 (Attribute.ScanForIndexerName): Update to reflect changes.
9121 (Attribute.CheckAttributeTarget): Re-format.
9122 (Attribute.ApplyAttributes): Refactor, to various
9123 Attributable.ApplyAttributeBuilder methods.
9124 * decl.cs (MemberCore): Make Attributable.
9125 * class.cs (Accessor): Make Attributable.
9126 (MethodData.ApplyAttributes): Use proper attribute types, not
9128 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9129 (TypeContainer.ApplyAttributeBuilder)
9130 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9131 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9132 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9133 (Operator.ApplyAttributeBuilder): New factored-out methods.
9134 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9135 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9136 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9137 * parameter.cs (ParameterBase): New Attributable base class
9138 that can also represent Return types.
9139 (Parameter): Update to the changes.
9141 2004-04-29 Jackson Harper <jackson@ximian.com>
9143 * driver.cs: Prefer the corlib system version when looking for
9144 assemblies in the GAC. This is still a hack, but its a better hack
9147 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9149 * decl.cs, enum.cs: Improved error 3005 reporting.
9151 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9152 (related_symbols): New private member for list of symbols
9153 related to reported error/warning.
9155 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9157 2004-04-29 Martin Baulig <martin@ximian.com>
9159 * ecore.cs (Expression.Constantify): If we're an enum and
9160 TypeManager.TypeToCoreType() doesn't give us another type, use
9161 t.UnderlyingSystemType. Fixes #56178.
9163 2004-04-29 Martin Baulig <martin@ximian.com>
9165 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9166 interfaces and for each interface, only add members directly
9167 declared in that interface. Fixes #53255.
9169 2004-04-28 Martin Baulig <martin@ximian.com>
9171 * expression.cs (ConditionalLogicalOperator): Use a temporary
9172 variable for `left' to avoid that we evaluate it more than once;
9175 2004-04-28 Martin Baulig <martin@ximian.com>
9177 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9180 2004-04-28 Martin Baulig <martin@ximian.com>
9182 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9185 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9186 whether the type is not void (CS1547).
9188 2004-04-28 Martin Baulig <martin@ximian.com>
9190 * expression.cs (Unary.DoResolveLValue): Override this and report
9191 CS0131 for anything but Operator.Indirection.
9193 2004-04-28 Martin Baulig <martin@ximian.com>
9195 Committing a patch from Ben Maurer; see bug #50820.
9197 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9200 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9203 2004-04-28 Martin Baulig <martin@ximian.com>
9205 Committing a patch from Ben Maurer; see bug #50820.
9207 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9210 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9213 2004-04-28 Martin Baulig <martin@ximian.com>
9215 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9216 (Block.AddLabel): Call DoLookupLabel() to only search in the
9219 2004-04-28 Martin Baulig <martin@ximian.com>
9221 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9222 comparing StringConstants and NullLiterals in Equality and Inequality.
9224 2004-04-28 Jackson Harper <jackson@ximian.com>
9226 * driver.cs: Attempt to load referenced assemblies from the
9227 GAC. This is the quick and dirty version of this method that
9228 doesnt take into account versions and just takes the first
9229 canidate found. Will be good enough for now as we will not have more
9230 then one version installed into the GAC until I update this method.
9232 2004-04-28 Martin Baulig <martin@ximian.com>
9234 * typemanager.cs (TypeManager.CheckStructCycles): New public
9235 static method to check for cycles in the struct layout.
9237 * rootcontext.cs (RootContext.PopulateTypes): Call
9238 TypeManager.CheckStructCycles() for each TypeContainer.
9239 [Note: We only need to visit each type once.]
9241 2004-04-28 Martin Baulig <martin@ximian.com>
9243 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9245 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9246 success and added `out object value'. Use a `bool resolved' field
9247 to check whether we've already been called rather than
9248 `ConstantValue != null' since this breaks for NullLiterals.
9250 2004-04-28 Raja R Harinath <rharinath@novell.com>
9252 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9253 setting of this flag, since the 'set' method may be non-public.
9255 2004-04-28 Raja R Harinath <rharinath@novell.com>
9257 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9258 check on current_vector.Block.
9260 2004-04-27 Martin Baulig <martin@ximian.com>
9262 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9263 a field initializer. Fixes #56459.
9265 2004-04-27 Martin Baulig <martin@ximian.com>
9267 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9268 we're not attempting to use an indexer. Fixes #52154.
9270 2004-04-27 Martin Baulig <martin@ximian.com>
9272 * statement.cs (Return): Don't create a return label if we don't
9273 need it; reverts my change from January 20th. Thanks to Ben
9276 2004-04-27 Martin Baulig <martin@ximian.com>
9278 According to the spec, `goto' can only leave a nested scope, but
9281 * statement.cs (Block.LookupLabel): Only lookup in the current
9282 block, don't recurse into parent or child blocks.
9283 (Block.AddLabel): Check in parent and child blocks, report
9284 CS0140/CS0158 if we find a duplicate.
9285 (Block): Removed this indexer for label lookups.
9286 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9287 this already does the error reporting for us.
9290 (FlowBranching.UsageVector.Block): New public variable; may be null.
9291 (FlowBranching.CreateSibling): Added `Block' argument.
9292 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9293 label for the target of a `goto' and check whether we're not
9294 leaving a `finally'.
9296 2004-04-27 Martin Baulig <martin@ximian.com>
9298 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9299 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9302 2004-04-27 Martin Baulig <martin@ximian.com>
9304 * statement.cs (Block.AddLabel): Also check for implicit blocks
9305 and added a CS0158 check.
9307 2004-04-27 Martin Baulig <martin@ximian.com>
9309 * flowanalysis.cs (FlowBranchingLoop): New class.
9310 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9311 UsageVector's instead of an ArrayList.
9312 (FlowBranching.Label): Likewise.
9313 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9314 (FlowBranching.AddBreakVector): New method.
9316 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9318 * attribute.cs: Small regression fix: only convert the type if we
9319 the type is different, fixes System.Drawing build.
9321 2004-04-27 Martin Baulig <martin@ximian.com>
9323 * attribute.cs (Attribute.Resolve): If we have a constant value
9324 for a named field or property, implicity convert it to the correct
9327 2004-04-27 Raja R Harinath <rharinath@novell.com>
9329 * statement.cs (Block.Block): Implicit blocks share
9330 'child_variable_names' fields with parent blocks.
9331 (Block.AddChildVariableNames): Remove.
9332 (Block.AddVariable): Mark variable as "used by a child block" in
9333 every surrounding block.
9334 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9335 been used in a child block, complain about violation of "Invariant
9336 meaning in blocks" rule.
9337 * cs-parser.jay (declare_local_variables): Don't use
9338 AddChildVariableNames.
9339 (foreach_statement): Don't create an implicit block: 'foreach'
9342 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9344 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9345 converting from 0L to ulong. Fixes 57522.
9347 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9349 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9350 derived class hides via 'new' keyword field from base class (test-242.cs).
9351 TODO: Handle this in the more general way.
9353 * class.cs (CheckBase): Ditto.
9355 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9357 * decl.cs (caching_flags): New member for storing cached values
9359 (MemberCore.Flags): New enum where bit flags for caching_flags
9361 (MemberCore.cls_compliance): Moved to caching_flags.
9362 (DeclSpace.Created): Moved to caching_flags.
9364 * class.cs: Use caching_flags instead of DeclSpace.Created
9366 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9368 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9369 if we are only a derived class, not a nested class.
9371 * typemanager.cs: Same as above, but do this at the MemberLookup
9372 level (used by field and methods, properties are handled in
9373 PropertyExpr). Allow for the qualified access if we are a nested
9376 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9378 * class.cs: Refactoring.
9379 (IMethodData): New inteface; Holds links to parent members
9380 to avoid member duplication (reduced memory allocation).
9381 (Method): Implemented IMethodData interface.
9382 (PropertyBase): New inner classes for get/set methods.
9383 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9384 (Event): New inner classes for add/remove methods.
9385 (Event.DelegateMethod): Implemented IMethodData interface.
9387 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9388 EmitContext (related to class.cs refactoring).
9390 2004-04-21 Raja R Harinath <rharinath@novell.com>
9392 * delegate.cs (Delegate.VerifyApplicability): If the number of
9393 arguments are the same as the number of parameters, first try to
9394 verify applicability ignoring any 'params' modifier on the last
9398 2004-04-16 Raja R Harinath <rharinath@novell.com>
9400 * class.cs (TypeContainer.AddIndexer): Use
9401 'ExplicitInterfaceName' to determine if interface name was
9402 explicitly specified. 'InterfaceType' is not initialized at this time.
9403 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9404 Indexers array is already in the required order. Initialize
9405 'IndexerName' only if there are normal indexers.
9406 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9407 (TypeContainer.Emit): Emit DefaultMember attribute only if
9408 IndexerName is initialized.
9411 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9413 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9416 2004-04-15 Raja R Harinath <rharinath@novell.com>
9418 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9422 * attribute.cs (Attribute.Resolve): Check for duplicate named
9426 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9428 * iterators.cs (MarkYield): track whether we are in an exception,
9429 and generate code accordingly. Use a temporary value to store the
9430 result for our state.
9432 I had ignored a bit the interaction of try/catch with iterators
9433 since their behavior was not entirely obvious, but now it is
9434 possible to verify that our behavior is the same as MS .NET 2.0
9438 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9440 * iterators.cs: Avoid creating temporaries if there is no work to
9443 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9444 Enumerations, use TypeManager.EnumToUnderlying and call
9447 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9450 (This.Emit): Use EmitContext.EmitThis to emit our
9453 (This.EmitAssign): Ditto.
9455 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9456 codepaths, we will move all the functionality into
9459 (FieldExpr.EmitAssign): Ditto.
9461 This fixes several hidden bugs that I uncovered while doing a code
9462 review of this today.
9464 * codegen.cs (EmitThis): reworked so the semantics are more clear
9465 and also support value types "this" instances.
9467 * iterators.cs: Changed so that for iterators in value types, we
9468 do not pass the value type as a parameter.
9470 Initialization of the enumerator helpers is now done in the caller
9471 instead of passing the parameters to the constructors and having
9472 the constructor set the fields.
9474 The fields have now `assembly' visibility instead of private.
9476 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9478 * expression.cs (Argument.Resolve): Check if fields passed as ref
9479 or out are contained in a MarshalByRefObject.
9481 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9482 another compiler type.
9484 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9486 * class.cs (Indexer.Define): use the new name checking method.
9487 Also, return false on an error.
9488 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9489 (is_identifier_[start/part]_character): make static.
9491 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9493 * expression.cs (Binary.ResolveOperator): Do no append strings
9494 twice: since we can be invoked more than once (array evaluation)
9495 on the same concatenation, take care of this here. Based on a fix
9496 from Ben (bug #56454)
9498 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9500 * codegen.cs: Fix another case where CS1548 must be reported (when
9501 delay-sign isn't specified and no private is available #56564). Fix
9502 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9503 error when MCS is used on the MS runtime and we need to delay-sign
9504 (which seems unsupported by AssemblyBuilder - see #56621).
9506 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9508 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9509 (TypeManager.ComputeNamespaces): Faster implementation for
9512 * compiler.csproj: Updated AssemblyName to mcs.
9514 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9516 * rootcontext.cs: Add new types to the boot resolution.
9518 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9519 MulticastDelegate is not allowed.
9521 * typemanager.cs: Add new types to lookup: System.TypedReference
9524 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9525 check for TypedReference or ArgIterator, they are not allowed.
9527 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9528 makes us properly catch 1510 in some conditions (see bug 56016 for
9531 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9533 * CryptoConvert.cs: update from corlib version
9536 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9538 * class.cs (Indexer.Define): Check indexername declaration
9540 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9542 * attribute.cs (IsClsCompliant): Fixed problem with handling
9543 all three states (compliant, not-compliant, undetected).
9545 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9547 * attribute.cs (Attribute): Location is now public.
9548 (Resolve): Store resolved arguments (pos_values) in attribute class.
9549 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9550 (GetClsCompliantAttributeValue): New method that gets
9551 CLSCompliantAttribute value.
9552 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9553 if exists else null.
9554 (AttributeTester): New class for CLS-Compliant verification routines.
9556 * class.cs (Emit): Add CLS-Compliant verification.
9557 (Method.GetSignatureForError): Implemented.
9558 (Constructor.GetSignatureForError): Implemented
9559 (Constructor.HasCompliantArgs): Returns if constructor has
9560 CLS-Compliant arguments.
9561 (Constructor.Emit): Override.
9562 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9563 is needed to test only parameters.
9564 (FieldBase.GetSignatureForError): Implemented.
9565 (TypeContainer): New member for storing base interfaces.
9566 (TypeContainer.FindMembers): Search in base interfaces too.
9568 * codegen.cs (GetClsComplianceAttribute): New method that gets
9569 assembly or module CLSCompliantAttribute value.
9570 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9572 (ModuleClass.Emit): Add error 3012 test.
9574 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9576 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9577 state for all decl types.
9578 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9579 if CLS-Compliant tests are required.
9580 (IsClsCompliaceRequired): New method. Analyze whether code
9581 must be CLS-Compliant.
9582 (IsExposedFromAssembly): New method. Returns true when MemberCore
9583 is exposed from assembly.
9584 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9585 value or gets cached value.
9586 (HasClsCompliantAttribute): New method. Returns true if MemberCore
9587 is explicitly marked with CLSCompliantAttribute.
9588 (IsIdentifierClsCompliant): New abstract method. This method is
9589 used to testing error 3005.
9590 (IsIdentifierAndParamClsCompliant): New method. Common helper method
9591 for identifier and parameters CLS-Compliant testing.
9592 (VerifyClsCompliance): New method. The main virtual method for
9593 CLS-Compliant verifications.
9594 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9595 null. I don't know why is null (too many public members !).
9596 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9597 and get value of first CLSCompliantAttribute that found.
9599 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9600 (VerifyClsCompliance): Override and add extra tests.
9602 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9603 clscheck- disable CLS-Compliant verification event if assembly is has
9604 CLSCompliantAttribute(true).
9606 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9607 ApllyAttribute is now called in emit section as in the other cases.
9608 Possible future Emit integration.
9609 (IsIdentifierClsCompliant): New override.
9610 (VerifyClsCompliance): New override.
9611 (GetEnumeratorName): Returns full enum name.
9613 * parameter.cs (GetSignatureForError): Implemented.
9615 * report.cs (WarningData): New struct for Warning message information.
9616 (LocationOfPreviousError): New method.
9617 (Warning): New method. Reports warning based on the warning table.
9618 (Error_T): New method. Reports error based on the error table.
9620 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9621 verifications are done here.
9623 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9625 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9626 CLSCompliantAttribute.
9627 (all_imported_types): New member holds all imported types from other
9629 (LoadAllImportedTypes): New method fills static table with exported types
9630 from all referenced assemblies.
9631 (Modules): New property returns all assembly modules.
9633 2004-03-30 Miguel de Icaza <miguel@ximian.com>
9635 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9636 throwing a parser error.
9638 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9639 which removes the hardcoded get_/set_ prefixes for properties, as
9640 IL allows for the properties to be named something else.
9644 * expression.cs: Do not override operand before we know if it is
9647 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9649 * typemanager.cs: support for pinned variables.
9651 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9653 * decl.cs, typemanager.cs: Avoid using an arraylist
9654 as a buffer if there is only one result set.
9656 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9658 * expression.cs: Make sure you cant call a static method
9659 with an instance expression, bug #56174.
9661 2004-03-29 Miguel de Icaza <miguel@ximian.com>
9663 * class.cs (IsDuplicateImplementation): Improve error reporting to
9664 flag 663 (method only differs in parameter modifier).
9666 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9667 in preprocessor directives.
9669 * location.cs (LookupFile): Allow for the empty path.
9671 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
9672 better approach for some of that patch, but its failing with the
9673 CharSet enumeration. For now try/catch will do.
9675 * typemanager.cs: Do not crash if a struct does not have fields.
9678 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9680 * expression.cs: cs0213, cant fix a fixed expression.
9683 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9685 * cs-parser.jay: detect invalid embeded statements gracefully.
9688 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9690 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9693 the invocation type may not be a subclass of the tye of the item/
9694 The type of the item must be a subclass of the invocation item.
9699 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
9701 * attribute.cs: Added methods to get a string and a bool from an
9702 attribute. Required to information from AssemblyKeyFileAttribute,
9703 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9704 * codegen.cs: Modified AssemblyName creation to include support for
9705 strongnames. Catch additional exceptions to report them as CS1548.
9706 * compiler.csproj: Updated include CryptoConvert.cs.
9707 * compiler.csproj.user: Removed file - user specific configuration.
9708 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
9709 Mono.Security assembly. The original class is maintained and tested in
9710 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9711 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9712 like CSC 8.0 (C# v2) supports.
9713 * Makefile: Added CryptoConvert.cs to mcs sources.
9714 * rootcontext.cs: Added new options for strongnames.
9716 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
9718 * driver.cs: For --expect-error, report error code `2'
9719 if the program compiled with no errors, error code `1' if
9720 it compiled with an error other than the one expected.
9722 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
9724 * compiler.csproj: Updated for Visual Studio .NET 2003.
9725 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9726 * compiler.sln: Updated for Visual Studio .NET 2003.
9728 2004-03-24 Ravi Pratap M <ravi@ximian.com>
9730 * expression.cs: Fix bug #47234. We basically need to apply the
9731 rule that we prefer the conversion of null to a reference type
9732 when faced with a conversion to 'object' (csc behaviour).
9734 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9736 * statement.cs: Shorter form for foreach, eliminates
9737 a local variable. r=Martin.
9739 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9741 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9742 checks if we can use brtrue/brfalse to test for 0.
9743 * expression.cs: use the above in the test for using brtrue/brfalse.
9746 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9748 * expression.cs: Rewrite string concat stuff. Benefits:
9750 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9751 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9752 rather than a concat chain.
9754 * typemanager.cs: Add lookups for more concat overloads.
9756 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9758 * expression.cs: Emit shorter il code for array init.
9775 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
9777 * statement.cs: Before, two switch blocks would be merged if the
9778 total size of the blocks (end_item - begin_item + 1) was less than
9779 two times the combined sizes of the blocks.
9781 Now, it will only merge if after the merge at least half of the
9786 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
9788 * class.cs : csc build fix for GetMethods(). See bug #52503.
9790 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
9792 * expression.cs: Make sure fp comparisons work with NaN.
9793 This fixes bug #54303. Mig approved this patch a long
9794 time ago, but we were not able to test b/c the runtime
9797 2004-03-19 Miguel de Icaza <miguel@ximian.com>
9799 * ecore.cs (TypExpr.GetHashCode): implement this overload.
9801 2004-03-19 Martin Baulig <martin@ximian.com>
9803 * class.cs (MemberCore.IsDuplicateImplementation): Report the
9804 error here and not in our caller.
9806 2004-03-19 Martin Baulig <martin@ximian.com>
9808 * interface.cs: Completely killed this file.
9809 (Interface): We're now a TypeContainer and live in class.cs.
9811 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9812 argument; we're now also called for interfaces.
9813 (TypeContainer.DefineMembers): Allow this method being called
9815 (TypeContainer.GetMethods): New public method; formerly known as
9816 Interface.GetMethod(). This is used by PendingImplementation.
9817 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9818 it's now private and non-static.
9819 (Interface): Moved this here; it's now implemented similar to
9821 (Method, Property, Event, Indexer): Added `bool is_interface'
9822 argument to their .ctor's.
9823 (MemberBase.IsInterface): New public field.
9825 * cs-parser.jay: Create normal Method, Property, Event, Indexer
9826 instances instead of InterfaceMethod, InterfaceProperty, etc.
9827 (opt_interface_base): Removed; we now use `opt_class_base' instead.
9828 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9830 2004-03-19 Martin Baulig <martin@ximian.com>
9832 * class.cs (MethodCore.IsDuplicateImplementation): New private
9833 method which does the CS0111 checking.
9834 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9835 Use IsDuplicateImplementation().
9837 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9839 * decl.cs (FindMemberToOverride): New method to find the correct
9840 method or property to override in the base class.
9842 - Make Method/Property use the above method to find the
9843 version in the base class.
9844 - Remove the InheritableMemberSignatureCompare as it is now
9847 This patch makes large code bases much faster to compile, as it is
9848 O(n) rather than O(n^2) to do this validation.
9850 Also, it fixes bug 52458 which is that nested classes are not
9851 taken into account when finding the base class member.
9853 Reviewed/Approved by Martin.
9855 2004-03-17 Marek Safar <marek.safar@seznam.cz>
9857 * interface.cs: In all interface classes removed redundant
9858 member initialization.
9860 2004-03-16 Martin Baulig <martin@ximian.com>
9862 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9864 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9866 * decl.cs (DefineTypeAndParents): New helper method to define a
9867 type's containers before the type itself is defined; This is a
9868 bug exposed by the recent changes to Windows.Forms when an
9869 implemented interface was defined inside a class that had not been
9872 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9874 (Check): Loop correctly to report errors modifiers
9875 (UNSAFE was not in the loop, since it was the same as TOP).
9877 * interface.cs: Every interface member now takes a ModFlags,
9878 instead of a "is_new" bool, which we set on the base MemberCore.
9880 Every place where we called "UnsafeOk" in the interface, now we
9881 call the proper member (InterfaceMethod.UnsafeOK) instead to get
9882 the unsafe settings from the member declaration instead of the
9883 container interface.
9885 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
9887 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9888 `set_indexer_name' to the pending bits (one per type).
9890 We fixed a bug today that was picking the wrong method to
9891 override, since for properties the existing InterfaceMethod code
9892 basically ignored the method name. Now we make sure that the
9893 method name is one of the valid indexer names.
9895 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
9897 * support.cs (SeekableStreamReader): Keep track of stream byte
9898 positions and don't mix them with character offsets to the buffer.
9900 Patch from Gustavo Giráldez
9902 2004-03-15 Marek Safar <marek.safar@seznam.cz>
9904 * interface.cs (InterfaceSetGetBase): Removed double member
9905 initialization, base class does it as well.
9907 2004-03-13 Martin Baulig <martin@ximian.com>
9909 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9910 when compiling corlib.
9912 2004-03-13 Miguel de Icaza <miguel@ximian.com>
9914 * convert.cs (ExplicitConversion): We were reporting an error on
9915 certain conversions (object_type source to a value type, when the
9916 expression was `null') before we had a chance to pass it through
9917 the user defined conversions.
9919 * driver.cs: Replace / and \ in resource specifications to dots.
9922 * class.cs: Add check for duplicate operators. Fixes 52477
9924 2004-03-11 Miguel de Icaza <miguel@ximian.com>
9926 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9927 that are in the middle of the statements, not only at the end.
9930 * class.cs (TypeContainer.AddField): No longer set the
9931 `HaveStaticConstructor' flag, now we call it
9932 `UserDefineStaticConstructor' to diferentiate the slightly
9933 semantic difference.
9935 The situation is that we were not adding BeforeFieldInit (from
9936 Modifiers.TypeAttr) to classes that could have it.
9937 BeforeFieldInit should be set to classes that have no static
9942 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9944 And most importantly Zoltan's comment:
9946 http://bugzilla.ximian.com/show_bug.cgi?id=44229
9948 "I think beforefieldinit means 'it's ok to initialize the type sometime
9949 before its static fields are used', i.e. initialization does not need
9950 to be triggered by the first access to the type. Setting this flag
9951 helps the JIT to compile better code, since it can run the static
9952 constructor at JIT time, and does not need to generate code to call it
9953 (possibly lots of times) at runtime. Unfortunately, mcs does not set
9954 this flag for lots of classes like String.
9956 csc sets this flag if the type does not have an explicit static
9957 constructor. The reasoning seems to be that if there are only static
9958 initalizers for a type, and no static constructor, then the programmer
9959 does not care when this initialization happens, so beforefieldinit
9962 This bug prevents the AOT compiler from being usable, since it
9963 generates so many calls to mono_runtime_class_init that the AOT code
9964 is much slower than the JITted code. The JITted code is faster,
9965 because it does not generate these calls if the vtable is type is
9966 already initialized, which is true in the majority of cases. But the
9967 AOT compiler can't do this."
9969 2004-03-10 Miguel de Icaza <miguel@ximian.com>
9971 * class.cs (MethodData.Emit): Refactor the code so symbolic
9972 information is generated for destructors; For some reasons we
9973 were taking a code path that did not generate symbolic information
9976 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
9978 * class.cs: Create a Constructor.CheckBase method that
9979 takes care of all validation type code. The method
9980 contains some code that was moved from Define.
9982 It also includes new code that checks for duplicate ctors.
9983 This fixes bug #55148.
9985 2004-03-09 Joshua Tauberer <tauberer@for.net>
9987 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9988 a { ... }-style array creation invokes EmitStaticInitializers
9989 which is not good for reference-type arrays. String, decimal
9990 and now null constants (NullCast) are not counted toward
9991 static initializers.
9993 2004-03-05 Martin Baulig <martin@ximian.com>
9995 * location.cs (SourceFile.HasLineDirective): New public field;
9996 specifies whether the file contains or is referenced by a "#line"
9998 (Location.DefineSymbolDocuments): Ignore source files which
9999 either contain or are referenced by a "#line" directive.
10001 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10003 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10004 direct access to our parent, so check the method inline there.
10006 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10008 * expression.cs (Invocation.EmitCall): Miguel's last commit
10009 caused a regression. If you had:
10014 In Foo the implict this would be null.
10016 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10018 * expression.cs (Invocation.EmitCall): If the method is not
10019 virtual, do not emit a CallVirt to it, use Call.
10021 * typemanager.cs (GetFullNameSignature): Improve the method to
10022 cope with ".ctor" and replace it with the type name.
10024 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10025 as an argument the ConstructorBuilder where it is being defined,
10026 to catch the recursive constructor invocations.
10028 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10030 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10031 routines to check if a type is an enumerable/enumerator allow
10032 classes that implement the IEnumerable or IEnumerator interfaces.
10034 * class.cs (Property, Operator): Implement IIteratorContainer, and
10035 implement SetYields.
10037 (Property.Define): Do the block swapping for get_methods in the
10038 context of iterators. We need to check if Properties also
10039 include indexers or not.
10041 (Operator): Assign the Block before invoking the
10042 OperatorMethod.Define, so we can trigger the Iterator code
10045 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10046 Property and Operator classes are not created when we parse the
10047 declarator but until we have the block completed, so we use a
10048 singleton SimpleIteratorContainer.Simple to flag whether the
10049 SetYields has been invoked.
10051 We propagate this setting then to the Property or the Operator to
10052 allow the `yield' to function.
10054 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10056 * codegen.cs: Implemented attribute support for modules.
10057 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10058 Assembly/Module functionality.
10060 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10061 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10062 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10064 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10066 * interface.cs (FindMembers): The operation is performed on all base
10067 interfaces and not only on the first. It is required for future CLS Compliance patch.
10069 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10071 * statement.cs, codegen.cs:
10072 This patch deals with patterns such as:
10074 public class List : IEnumerable {
10076 public MyEnumerator GetEnumerator () {
10077 return new MyEnumerator(this);
10080 IEnumerator IEnumerable.GetEnumerator () {
10084 public struct MyEnumerator : IEnumerator {
10089 Before, there were a few things we did wrong:
10090 1) we would emit callvirt on a struct, which is illegal
10091 2) we emited ldarg when we needed to emit ldarga
10092 3) we would mistakenly call the interface methods on an enumerator
10093 type that derived from IEnumerator and was in another assembly. For example:
10095 public class MyEnumerator : IEnumerator
10097 Would have the interface methods called, even if there were public impls of the
10098 method. In a struct, this lead to invalid IL code.
10100 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10102 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10105 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10107 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10109 * cs-parser.jay: Fix small regression: we were not testing V2
10110 compiler features correctly.
10112 * interface.cs: If the emit context is null, then create one
10114 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10116 * decl.cs (GetSignatureForError): New virtual method to get full name
10117 for error messages.
10119 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10120 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10122 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10123 Duplicated members and code in these classes has been removed.
10124 Better encapsulation in these classes.
10126 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10128 * assign.cs (Assign.DoResolve): When dealing with compound
10129 assignments, there is a new rule in ECMA C# 2.4 (might have been
10130 there before, but it is documented here) that states that in:
10134 If b is of type int, and the `op' is a shift-operator, then the
10135 above is evaluated as:
10139 * expression.cs (Binary.ResolveOperator): Instead of testing for
10140 int/uint/long/ulong, try to implicitly convert to any of those
10141 types and use that in pointer arithmetic.
10143 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10144 method to print information for from the type, not from the
10145 null-method we were given.
10147 2004-02-01 Duncan Mak <duncan@ximian.com>
10149 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10150 parsing for cmd, fixes bug #53694.
10152 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10154 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10155 in the member name duplication tests. Property and operator name duplication
10156 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10158 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10160 * interface.cs (PopulateMethod): Fixed crash when interface method
10161 returns not existing type (error test cs0246-3.cs).
10163 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10165 * cs-parser.jay (interface_accessors): Re-write actions to also
10166 store attributes attached to get and set methods. Fix spelling
10169 (inteface_property_declaration): Modify accordingly.
10171 (InterfaceAccessorInfo): New helper class to store information to pass
10172 around between rules that use interface_accessors.
10174 * interface.cs (Emit): Apply attributes on the get and set
10175 accessors of properties and indexers too.
10177 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10178 right MethodBuilder when applying attributes to the get and set accessors.
10180 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10182 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10184 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10186 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10188 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10190 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10191 changes that treat `yield' specially when present before `break'
10192 or `return' tokens.
10194 * cs-tokenizer.cs: yield is no longer a keyword.
10196 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10198 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10199 setting for default constructors.
10200 For default constructors are almost every time set wrong Modifier. The
10201 generated IL code has been alright. But inside mcs this values was
10202 wrong and this was reason why several of my CLS Compliance tests
10205 2004-01-22 Martin Baulig <martin@ximian.com>
10207 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10208 not a QualifiedIdentifier. This is what `type_name_expression'
10209 was previously doing.
10210 (type_name_expression): Removed; the code is now in
10211 `namespace_or_type_name'.
10212 (qualified_identifier): Removed, use `namespace_or_type_name'
10214 (QualifiedIdentifier): Removed this class.
10216 2004-01-22 Martin Baulig <martin@ximian.com>
10218 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10219 not a string as alias name.
10221 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10223 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10224 #52730 bug, and instead compute correctly the need to use a
10225 temporary variable when requesting an address based on the
10226 static/instace modified of the field and the constructor.
10228 2004-01-21 Martin Baulig <martin@ximian.com>
10230 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10231 class and namespace before looking up aliases. Fixes #52517.
10233 2004-01-21 Martin Baulig <martin@ximian.com>
10235 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10236 assinged in a 'try'; fixes exception4.cs.
10238 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10239 * class.cs : Implemented parameter-less constructor for TypeContainer
10241 * decl.cs: Attributes are now stored here. New property OptAttributes
10243 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10245 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10247 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10249 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10250 (CSharpSignature): New method for indexer and property signature.
10252 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10254 * pending.cs (IsVirtualFilter): Faster implementation.
10256 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10258 * typemanager.cs: Avoid inclusion of same assembly more than once.
10260 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10262 * cs-parser.jay: Fixed problem where the last assembly attribute
10263 has been applied also to following declaration (class, struct, etc.)
10265 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10267 * class.cs: Added error CS0538, CS0539 reporting.
10268 Fixed crash on Microsoft runtime when field type is void.
10270 * cs-parser.jay: Added error CS0537 reporting.
10272 * pending.cs: Added error CS0535 reporting.
10273 Improved error report for errors CS0536, CS0534.
10275 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10277 Merge a few bits from the Anonymous Method MCS tree.
10279 * statement.cs (ToplevelBlock): New class for toplevel methods,
10280 will hold anonymous methods, lifted variables.
10282 * cs-parser.jay: Create toplevel blocks for delegates and for
10283 regular blocks of code.
10285 2004-01-20 Martin Baulig <martin@ximian.com>
10287 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10288 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10289 and `NeedExplicitReturn'; added `IsLastStatement'.
10290 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10291 have a `ReturnLabel' or we're not unreachable.
10293 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10294 child's reachability; don't just override ours with it. Fixes
10295 #58058 (lluis's example).
10296 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10297 InFinally(), InLoop(), InSwitch() and
10298 BreakCrossesTryCatchBoundary() methods.
10300 * statement.cs (Return): Do all error checking in Resolve().
10301 Unless we are the last statement in a top-level block, always
10302 create a return label and jump to it.
10303 (Break, Continue): Do all error checking in Resolve(); also make
10304 sure we aren't leaving a `finally'.
10305 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10306 statement in a top-level block.
10307 (Block.Flags): Added `IsDestructor'.
10308 (Block.IsDestructor): New public property.
10310 2004-01-20 Martin Baulig <martin@ximian.com>
10312 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10314 2004-01-20 Martin Baulig <martin@ximian.com>
10316 * statement.cs (Statement.ResolveUnreachable): New public method.
10317 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10318 (Block.Resolve): Resolve unreachable statements.
10320 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10322 * expression.cs: We need to fix the case where we do
10323 not have a temp variable here.
10325 * assign.cs: Only expression compound assignments need
10326 temporary variables.
10328 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10330 * flowanalysis.cs: Reduce memory allocation in a few ways:
10331 - A block with no variables should not allocate a bit
10333 - A method with no out parameters does not need any tracking
10334 for assignment of the parameters, so we need not allocate
10337 public readonly Type[] VariableTypes;
10338 public readonly string[] VariableNames;
10339 Are redundant. The data is already stored in the variable
10340 map, so we need not allocate another array for it.
10341 - We need to add alot of checks for if (params | locals) == null
10342 due to the first two changes.
10344 2004-01-18 Miguel de Icaza <miguel@ximian.com>
10346 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10347 implement IMemoryLocation, we store a copy on a local variable and
10348 take the address of it. Patch from Benjamin Jemlich
10350 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10351 to use a special "type_name_expression" rule which reduces the
10352 number of "QualifiedIdentifier" classes created, and instead
10353 directly creates MemberAccess expressions.
10355 2004-01-17 Miguel de Icaza <miguel@ximian.com>
10357 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10358 that fixes #52853. Null literal assignment to ValueType
10360 * class.cs (MethodData.Emit): Instead of checking the name of the
10361 method to determine if its a destructor, create a new derived
10362 class from Method called Destructor, and test for that.
10364 * cs-parser.jay: Create a Destructor object instead of a Method.
10366 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10370 2004-01-16 Miguel de Icaza <miguel@ximian.com>
10372 * expression.cs (Binary.ResolveOperator): Perform an implicit
10373 conversion from MethodGroups to their delegate types on the
10374 Addition operation.
10376 * delegate.cs: Introduce a new class DelegateCreation that is the
10377 base class for `NewDelegate' and `ImplicitDelegateCreation',
10378 factor some code in here.
10380 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10381 conversion from MethodGroups to compatible delegate types.
10383 * ecore.cs (Expression.Resolve): Do not flag error 654
10384 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10385 we allow conversions from MethodGroups to delegate types now.
10387 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10388 assignments in v2 either.
10390 2004-01-10 Miguel de Icaza <miguel@ximian.com>
10392 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10393 static read-only fields in ctors.
10395 Applied patch from Benjamin Jemlich
10397 * expression.cs (UnaryMutator): Avoid leaking local variables.
10399 2004-01-09 Miguel de Icaza <miguel@ximian.com>
10401 * cs-tokenizer.cs (IsCastToken): Allow the various native types
10402 here to return true, as they can be used like this:
10404 (XXX) int.MEMBER ()
10406 Fixed 49836 and all the other dups
10408 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
10410 * driver.cs: Implement /win32res and /win32icon.
10412 2004-01-08 Miguel de Icaza <miguel@ximian.com>
10414 * cs-parser.jay: Add a rule to improve error handling for the
10415 common mistake of placing modifiers after the type.
10417 2004-01-07 Miguel de Icaza <miguel@ximian.com>
10419 * cs-parser.jay (interface_event_declaration): Catch
10420 initialization of events on interfaces, and report cs0068
10422 * cs-parser.jay (interface_event_declaration): Catch
10423 initialization of events.
10425 * ecore.cs: Better report missing constructors.
10427 * expression.cs (Binary.ResolveOperator): My previous bug fix had
10428 the error reporting done in the wrong place. Fix.
10430 * expression.cs (Binary.ResolveOperator): Catch the
10431 operator + (E x, E y) error earlier, and later allow for implicit
10432 conversions in operator +/- (E e, U x) from U to the underlying
10435 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10436 52596, if the container class is abstract, the default constructor
10437 is protected otherwise its public (before, we were always public).
10439 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10442 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10443 Jemlich that fixes bug #52597, MCS was generating invalid code for
10444 idisposable structs. Thanks to Ben for following up with this
10447 2004-01-06 Miguel de Icaza <miguel@ximian.com>
10449 * driver.cs: Allow assemblies without code to be generated, fixes
10452 2004-01-07 Nick Drochak <ndrochak@gol.com>
10454 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10456 2004-01-05 Miguel de Icaza <miguel@ximian.com>
10458 * cs-parser.jay: Add rules to improve error reporting if fields or
10459 methods are declared at the namespace level (error 116)
10461 * Add rules to catch event add/remove
10463 2004-01-04 David Sheldon <dave-mono@earth.li>
10465 * expression.cs: Added matching ")" to error message for
10468 2004-01-03 Todd Berman <tberman@gentoo.org>
10470 * ecore.cs, attribute.cs:
10471 Applying fix from #52429.
10473 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10475 * ecore.cs, expression.cs, statement.cs:
10476 Total rewrite of how we handle branching. We
10477 now handle complex boolean expressions with fewer
10478 jumps. As well if (x == 0) no longer emits a ceq.
10480 if (x is Foo) is much faster now, because we generate
10483 Overall, we get a pretty big improvement on our benchmark
10484 tests. The code we generate is smaller and more readable.
10486 I did a full two-stage bootstrap. The patch was reviewed
10487 by Martin and Miguel.
10489 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10491 * cs-parser.jay: Make primary_expression not take a QI.
10492 we dont need this because the member_access rule covers
10493 us here. So we replace the rule with just IDENTIFIER.
10495 This has two good effects. First, we remove a s/r conflict.
10496 Second, we allocate many fewer QualifiedIdentifier objects.
10498 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10500 * attribute.cs: Handle MarshalAs attributes as pseudo, and
10501 set the correct information via SRE. This prevents
10502 hanging on the MS runtime. Fixes #29374.
10504 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10506 * convert.cs: correctly handle conversions to value types
10507 from Enum and ValueType as unboxing conversions.
10509 Fixes bug #52569. Patch by Benjamin Jemlich.
10511 2004-01-02 Ravi Pratap <ravi@ximian.com>
10513 * expression.cs (BetterConversion): Prefer int -> uint
10514 over int -> ulong (csc's behaviour). This fixed bug #52046.
10516 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10518 * decl.cs (MemberCache.FindMembers): now returns a
10521 * typemanager.cs: In general, go with with ^^.
10522 (CopyNewMethods): take an IList.
10523 (RealMemberLookup): Only allocate an arraylist
10524 if we copy from two sets of methods.
10526 This change basically does two things:
10527 1) Fewer array lists allocated due to CopyNewMethods.
10528 2) the explicit cast in MemberList costed ALOT.
10530 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10532 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10533 a hashtable to avoid needless string allocations when an identifier is
10534 used more than once (the common case).
10536 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10538 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10539 is broken, it will not return anything. So, we
10540 have to use the information we have in mcs to
10543 * typemanager.cs: Add a cache for GetInterfaces,
10544 since this will now be used more often (due to ^^)
10546 (GetExplicitInterfaces) New method that gets the
10547 declared, not effective, interfaces on a type
10548 builder (eg, if you have interface IFoo, interface
10549 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10552 This patch makes MCS able to bootstrap itself on
10555 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10557 * expression.cs: Remove the Nop's that Miguel put
10560 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10562 * report.cs, codegen.cs: Give the real stack trace to
10563 the error when an exception is thrown.
10565 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10567 * decl.cs: only allocate hashtables for ifaces if
10570 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10572 * expression.cs: fix the error from cs0121-2.cs
10573 (a parent interface has two child interfaces that
10574 have a function with the same name and 0 params
10575 and the function is called through the parent).
10577 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10579 * class.cs, rootcontext.cs, typmanager.cs: do not
10582 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10584 * codegen.cs: remove stack for the ec flow branching.
10585 It is already a linked list, so no need.
10587 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10589 * Makefile: Allow custom profiler here.
10591 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10593 * typemanager.cs (LookupType):
10594 - Use a static char [], because split takes
10595 a param array for args, so it was allocating
10597 - Do not store true in a hashtable, it boxes.
10599 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10601 * flowanalysis.cs: bytify common enums.
10603 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10605 * modifiers.cs: Add a new set of flags for the
10606 flags allowed on explicit interface impls.
10607 * cs-parser.jay: catch the use of modifiers in
10608 interfaces correctly.
10609 * class.cs: catch private void IFoo.Blah ().
10611 All related to bug #50572.
10613 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10615 * decl.cs: Rewrite the consistant accessability checking.
10616 Accessability is not linear, it must be implemented in
10617 a tableish way. Fixes #49704.
10619 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10621 * expression.cs: Handle negation in a checked context.
10622 We must use subtraction from zero. Fixes #38674.
10624 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10626 * class.cs: Ignore static void main in DLLs.
10627 * rootcontext.cs: Handle the target type here,
10628 since we are have to access it from class.cs
10629 * driver.cs: account for the above.
10631 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10633 * report.cs: Give line numbers and files if available.
10635 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10637 * driver.cs: Implement /addmodule.
10639 * typemanager.cs: Change 'modules' field so it now contains Modules not
10642 2003-12-20 Martin Baulig <martin@ximian.com>
10644 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10645 (FieldBase.IsAssigned): Removed this field.
10646 (FieldBase.SetAssigned): New public method.
10647 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10649 2003-12-20 Martin Baulig <martin@ximian.com>
10651 * expression.cs (LocalVariableReference.DoResolve): Don't set
10652 `vi.Used' if we're called from DoResolveLValue().
10654 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10655 returns the usage vector it just merged into the current one -
10656 pass this one to UsageWarning().
10657 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10658 of the `EmitContext', don't call this recursively on our children.
10660 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
10662 * driver.cs: Implement /target:module.
10664 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10666 * support.cs (CharArrayHashtable): New helper class.
10668 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
10669 char arrays, not strings, so we can avoid creating a string in
10670 consume_identifier if the identifier is a keyword.
10672 2003-12-16 Martin Baulig <martin@ximian.com>
10674 * statement.cs (LocalInfo.Assigned): Removed this property.
10675 (LocalInfo.Flags): Removed `Assigned'.
10676 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10677 and uses flow analysis.
10678 (Block.UsageWarning): Made this method private.
10679 (Block.Resolve): Call UsageWarning() if appropriate.
10681 * expression.cs (LocalVariableReference.DoResolve): Always set
10682 LocalInfo.Used here.
10684 2003-12-13 Martin Baulig <martin@ximian.com>
10686 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10687 any value here; we're now using flow analysis to figure out
10688 whether a statement/block returns a value.
10690 2003-12-13 Martin Baulig <martin@ximian.com>
10692 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10694 (FlowBranching.MergeFinally): Don't call
10695 `branching.CheckOutParameters()' here, this is called in
10697 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10698 when adding the `finally' vector.
10700 2003-12-13 Martin Baulig <martin@ximian.com>
10703 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10704 actually work and also fix #48962.
10706 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10708 * decl.cs: Do not check System.Object for nested types,
10709 since we know it does not have any. Big bang for buck:
10712 Run 1: 8.35 seconds
10713 Run 2: 8.32 seconds
10714 corlib: 17.99 seconds
10716 Run 1: 8.17 seconds
10717 Run 2: 8.17 seconds
10718 corlib: 17.39 seconds
10720 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10722 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10723 time we are returning 0 members, so we save alot here.
10725 2003-12-11 Martin Baulig <martin@ximian.com>
10727 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10728 `MergeChild()', also just take the `FlowBranching' as argument;
10729 call Merge() on it and return the result.
10730 (FlowBranching.Merge): We don't need to do anything if we just
10733 2003-12-11 Martin Baulig <martin@ximian.com>
10735 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10736 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10737 Maurer for this idea.
10739 2003-12-11 Martin Baulig <martin@ximian.com>
10741 * flowanalysis.cs (MergeResult): This class is now gone; we now
10742 use the `UsageVector' for this. The reason for this is that if a
10743 branching just has one sibling, we don't need to "merge" them at
10744 all - that's the next step to do.
10745 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10748 2003-12-11 Martin Baulig <martin@ximian.com>
10750 Reworked flow analyis and made it more precise and bug-free. The
10751 most important change is that we're now using a special `Reachability'
10752 class instead of having "magic" meanings of `FlowReturns'. I'll
10753 do some more cleanups and optimizations and also add some more
10754 documentation this week.
10756 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10757 largely reworked this class.
10758 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10759 the new `Reachability' class instead of having "magic" values here.
10760 (FlowBranching): We're now using an instance of `Reachability'
10761 instead of having separate `Returns', `Breaks' etc. fields.
10763 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10764 based on flow analysis; ignore the return value of block.Emit ().
10766 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10768 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10769 if they are private.
10771 2003-12-09 Martin Baulig <martin@ximian.com>
10773 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10774 call them directly on the UsageVector.
10776 2003-12-09 Martin Baulig <martin@ximian.com>
10778 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10779 Changed return type from `FlowReturns' to `Reachability'.
10781 2003-12-09 Martin Baulig <martin@ximian.com>
10783 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10784 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10785 `Reachable' fields with a single `Reachability' one.
10787 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10789 * class.cs (FindMembers): Remove foreach's.
10794 Run 1: 8.74 seconds
10795 Run 2: 8.71 seconds
10798 Run 1: 8.64 seconds
10799 Run 2: 8.58 seconds
10802 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10807 This patch does a few things:
10808 1. EmptyStatement is now a singleton, so it is never reallocated.
10809 2. All blah is EmptyStatement constructs have been changed to
10810 blah == EmptyStatement.Value, which is much faster and valid
10811 now that EmptyStatement is a singleton.
10812 3. When resolving a block, rather than allocating a new array for
10813 the non-empty statements, empty statements are replaced with
10814 EmptyStatement.Value
10815 4. Some recursive functions have been made non-recursive.
10816 Mainly the performance impact is from (3), however (1) and (2) are needed for
10817 this to work. (4) does not make a big difference in normal situations, however
10818 it makes the profile look saner.
10823 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10824 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10825 Total memory allocated: 56397 KB
10828 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10829 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10830 Total memory allocated: 55666 KB
10832 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10834 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10835 than the hashtable in a hashtable version
10837 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10838 we always end up concating a string. This results in a huge perf
10839 loss, because many strings have to be tracked by the GC. In this
10840 patch, we first use a hashtable that works with two keys, so that
10841 the strings do not need to be concat'ed.
10845 Run 1: 8.74 seconds
10846 Run 2: 8.71 seconds
10849 Run 1: 8.65 seconds
10850 Run 2: 8.56 seconds
10852 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10854 * Makefile: Add a new target `do-time' that does a quick and simple
10855 profile, leaving easy to parse output.
10857 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10859 * codegen.cs (Init): Create the dynamic assembly with
10860 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10862 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10864 * support.cs: Make the PtrHashtable use only one
10865 instance of its comparer.
10867 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10869 * typemanager.cs: Fix lookup of GetNamespaces.
10871 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10873 * expression.cs: Removed redundant line.
10875 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10876 ArrayLists, use for loops with bounds.
10878 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10881 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10882 arraylists, use for loop with bounds.
10884 The above three changes give us a 0.071 second performance
10885 improvement out of 3.294 seconds down to 3.223. On my machine
10886 the above changes reduced the memory usage by 1,387 KB during
10887 compiler bootstrap.
10889 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10890 QualifiedIdentifiers. Before we created a new string through
10891 concatenation, and mostly later on, the result would be
10892 manipulated by DecomposeQI through string manipulation.
10894 This reduced the compiler memory usage for bootstrapping from
10895 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10896 compile times in 0.05 seconds.
10898 2003-11-28 Dick Porter <dick@ximian.com>
10900 * support.cs: Do string compares with the Invariant culture.
10908 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10909 the comparison is done with the Invariant culture.
10911 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10913 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10914 GetEnumerator method.
10916 (ProbeCollectionType): Iterate starting at the most specific type
10917 upwards looking for a GetEnumerator
10919 * expression.cs: Shift count can be up to 31 for int/uint and 63
10922 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10924 * statement.cs (Block.LookupLabel): Also look for the label on the
10925 children blocks. Use a hash table to keep track of visited
10928 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10929 we actually did transform the other operand, otherwise fall back
10930 to the common codepath that casts to long.
10932 * cs-tokenizer.cs: Use the same code pattern as the int case.
10933 Maybe I should do the parsing myself, and avoid depending on the
10934 Parse routines to get this done.
10936 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10938 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10939 which fixes bug 51347. This time test it.
10941 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10942 attributes for example can not tell the difference between these.
10943 The difference was only a syntax feature of the language.
10945 * attribute.cs: Apply attributes to delegates.
10947 * delegate.cs: Call the apply attributes method.
10949 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10951 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10952 comparing 0 vs Byte.MinValue, not the value
10954 (ImplicitConversionRequired): When reporting a conversion error,
10955 use error 31 to print out the constant error instead of the
10958 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10959 which fixes bug 51347.
10961 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10963 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10964 which fixes the -warnaserror command line option.
10966 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10968 * cfold.cs (DoNumericPromotions): During constant folding of
10969 additions on UIntConstant, special case intconstants with
10970 IntConstants like we do on the expression binary operator.
10972 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10974 * convert.cs (ImplicitReferenceConversion): We were missing a case
10975 (System.Enum are not value types or class types, so we need to
10976 classify them separatedly).
10978 * driver.cs: We do not support error 2007.
10980 2003-11-12 Jackson Harper <jackson@ximian.com>
10982 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10983 system directory. Also use the full file name so users can
10984 libraries names mscorlib-o-tron.dll in a non system dir.
10986 2003-11-10 Martin Baulig <martin@ximian.com>
10988 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10989 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10990 calling `ResolveType()' on them, directly assign their `Type'.
10992 2003-11-08 Martin Baulig <martin@ximian.com>
10994 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10995 return value and the `out parent' parameter.
10996 (TypeContainer.DefineType): Moved the CS0644 check into
10997 GetClassBases(). Don't pass the interface types to the
10998 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10999 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11001 * ecore.cs (TypeExpr.IsAttribute): New property.
11002 (TypeExpr.GetInterfaces): New method.
11004 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11005 TypeExpr instead of a Type.
11006 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11007 (Interface.DefineType): Don't pass the interface types to the
11008 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11009 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11011 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11012 instead of a `Type[]'.
11013 (TypeManager.RegisterBuilder): Likewise.
11014 (TypeManager.AddUserInterface): Likewise.
11015 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11016 `Type[]' and also return a `TypeExpr[]'.
11017 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11019 2003-11-08 Martin Baulig <martin@ximian.com>
11021 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11024 2003-11-08 Martin Baulig <martin@ximian.com>
11026 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11027 TypeManager.ResolveExpressionTypes().
11029 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11030 instead of an Expression.
11031 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11032 (TypeExpression): New public class; formerly known as `TypeExpr'.
11034 * expression.cs (ComposedCast): Derive from TypeExpr.
11036 * typemanager.cs (TypeManager.system_*_expr): These are now
11037 TypExpr's instead of Expression's.
11038 (TypeManager.ResolveExpressionTypes): New public static function;
11039 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11042 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11044 * expression.cs (New.DoResolve): Do not dereference value that
11045 might be a null return.
11047 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11048 sure that the constant value has the right type. Fixes an
11049 unreported bug, similar to 50425.
11051 * const.cs (Const.LookupConstantValue): Call
11052 ImplicitStandardConversionExists before doing a conversion to
11053 avoid havng the TypeManager.ChangeType do conversions.
11055 Reduced the number of casts used
11057 (Const.ChangeType): New routine to enable reuse of the constant
11058 type changing code from statement.
11060 * typemanager.cs (ChangeType): Move common initialization to
11061 static global variables.
11065 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11066 every value type to go through, even if it was void. Fix that.
11068 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11069 character of the define, and the is_identifier_part_character for
11070 the rest of the string.
11072 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11074 * expression.cs (UnaryMutator.EmitCode): When I updated
11075 LocalVariableReference.DoResolve, I overdid it, and dropped an
11076 optimization done on local variable references.
11078 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11080 * ecore.cs: Convert the return from Ldlen into an int.
11082 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11084 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11085 the accessibility, this is a special case for toplevel non-public
11086 classes (internal for instance).
11088 2003-10-20 Nick Drochak <ndrochak@gol.com>
11090 * ecore.cs: Fix typo and build. Needed another right paren.
11092 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11094 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11095 `internal' case regular and protected, but not allowing protected
11096 to be evaluated later. Bug 49840
11098 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11100 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11101 to kb.Nlast, and not the kb.nFirst to isolate the switch
11104 Extract the underlying type, so enumerations of long/ulong are
11105 treated like long/ulong.
11107 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11109 * expression.cs (New): Overload the meaning of RequestedType to
11110 track the possible creation of the NewDelegate type, since
11111 DoResolve is invoked more than once for new constructors on field
11114 See bugs: #48800 and #37014
11116 * cs-parser.jay (declare_local_constants): Take an arraylist
11117 instead of a single constant.
11119 (local_constant_declaration): It should take a
11120 constant_declarators, not a constant_declarator. Fixes 49487
11122 * convert.cs: Fix error report.
11124 2003-10-13 Jackson Harper <jackson@ximian.com>
11126 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11129 2003-10-09 Martin Baulig <martin@ximian.com>
11131 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11133 (MethodCore.DoDefineParameters): Removed the TypeContainer
11134 argument; use the DeclSpace which was passed to the .ctor instead.
11135 (MethodCore.CheckParameter): Take a DeclSpace instead of a
11136 TypeContainer; we only need a DeclSpace here.
11138 2003-10-09 Martin Baulig <martin@ximian.com>
11140 * class.cs (MethodData): Added additional `DeclSpace ds' argument
11142 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11143 EmitContext's .ctor.
11145 2003-10-09 Martin Baulig <martin@ximian.com>
11147 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11148 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11149 AsAccessible(), moved them as well.
11151 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11153 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11155 * cs-parser.jay : Renamed yyName to yyNames related to jay.
11157 2003-10-07 Miguel de Icaza <miguel@ximian.com>
11159 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11160 generation for >=, as spotted by Paolo, bug 48679.
11161 Patch from David Waite.
11163 * cs-tokenizer.cs: Add handling for #pragma.
11165 * cs-parser.jay: Allow for both yield and yield return in the
11166 syntax. The anti-cobolization of C# fight will go on!
11168 * class.cs (TypeBuilder.DefineType): Catch error condition here
11169 (Parent.DefineType erroring out and returning null).
11171 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11172 coping with enumerations variables, we were mistakenly processing
11173 them as a regular value type instead of built-in types. Fixes the
11176 * typemanager.cs (IsBuiltinOrEnum): New method.
11178 2003-09-30 Miguel de Icaza <miguel@ximian.com>
11180 * cs-parser.jay: Upgrade: yield now needs the return clause.
11182 2003-09-19 Martin Baulig <martin@ximian.com>
11184 * decl.cs (MemberCache.SetupCacheForInterface): Take a
11185 `MemberCache parent' argument. Normally, an interface doesn't
11186 have a parent type except System.Object, but we use this in gmcs
11187 for generic type parameters.
11189 2003-09-18 Martin Baulig <martin@ximian.com>
11191 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11192 on `type.IsInterface'; don't check whether the type has a parent
11193 to determine whether it's an interface.
11195 2003-09-15 Martin Baulig <martin@ximian.com>
11197 * class.cs (TypeContainer.DefineType): Added an error flag to
11198 avoid reporting duplicate CS0146's ("class definition is
11201 * driver.cs (Driver.MainDriver): Abort if
11202 RootContext.ResolveTree() reported any errors.
11204 2003-09-07 Martin Baulig <martin@ximian.com>
11206 * report.cs (Error, Warning): Added overloaded versions which take
11207 a `params object[] args' and call String.Format().
11209 2003-09-07 Martin Baulig <martin@ximian.com>
11211 * decl.cs (DeclSpace..ctor): Don't call
11212 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11213 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
11214 (DeclSpace.RecordDecl): New method.
11216 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11218 2003-09-02 Ravi Pratap <ravi@ximian.com>
11220 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11221 value attributes to be applied to ParameterBuilders.
11223 * class.cs (MethodCore.LabelParameters): Make static and more
11224 generic so that it can be used from other places - like interface
11225 methods, for instance.
11227 * interface.cs (Interface.Emit): Call LabelParameters before
11228 emitting attributes on the InterfaceMethod.
11230 2003-08-26 Martin Baulig <martin@ximian.com>
11232 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11233 resolving aliases; fixes #47927.
11235 2003-08-26 Martin Baulig <martin@ximian.com>
11237 * statement.cs (Using.DoResolve): This is internally emitting a
11238 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11239 do not always return. Fixes #47681.
11241 2003-08-26 Martin Baulig <martin@ximian.com>
11243 * decl.cs (MemberCore): Moved WarningNotHiding(),
11244 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11246 (AdditionResult): Make this nested in DeclSpace.
11247 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11248 argument; call NamespaceEntry.Define() unless we're nested in a
11251 * namespace.cs (Namespace.DefineName): New public function. This
11252 is called from DeclSpace's .ctor to add
11253 (Namespace.Lookup): Include DeclSpaces in the lookup.
11255 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11257 * const.cs (Const): Derive from MemberBase, not MemberCore.
11259 2003-08-25 Martin Baulig <martin@ximian.com>
11261 * convert.cs (Convert.ExplicitReferenceConversion): When
11262 converting from an interface type to a class, unbox if the target
11263 type is a struct type. Fixes #47822.
11265 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11267 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11270 2003-08-22 Martin Baulig <martin@ximian.com>
11272 * class.cs (TypeManager.DefineType): When defining a nested type,
11273 call DefineType() on our parent; fixes #47801.
11275 2003-08-22 Martin Baulig <martin@ximian.com>
11277 * class.cs (MethodData.Define): While checking if a method is an
11278 interface implementation, improve the test a bit more to fix #47654.
11280 2003-08-22 Martin Baulig <martin@ximian.com>
11282 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11283 correctly; fixes #47722.
11285 2003-08-22 Martin Baulig <martin@ximian.com>
11287 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11288 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11290 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11292 2003-08-22 Martin Baulig <martin@ximian.com>
11294 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11295 can only be assigned in static constructors. Fixes #47161.
11297 2003-08-22 Martin Baulig <martin@ximian.com>
11299 Rewrote and improved the flow analysis code.
11301 * flowbranching.cs (FlowBranching): Make this class abstract.
11302 (FlowBranching.CreateBranching): New static function to create a
11303 new flow branching.
11304 (FlowBranchingBlock, FlowBranchingException): New classes.
11305 (FlowBranching.UsageVector.Type): New public readonly field.
11306 (FlowBranching.UsageVector.Breaks): Removed the setter.
11307 (FlowBranching.UsageVector.Returns): Removed the setter.
11308 (FlowBranching.UsageVector): Added Break(), Return(),
11309 NeverReachable() and Throw() methods to modify the reachability.
11310 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11311 done by FlowBranching.Merge().
11312 (FlowBranching.UsageVector.MergeChild): New method; merges the
11313 merge result into the current vector.
11314 (FlowBranching.Merge): New abstract method to merge a branching.
11316 2003-08-12 Martin Baulig <martin@ximian.com>
11318 * expression.cs (Indirection.CacheTemporaries): Create the
11319 LocalTemporary with the pointer type, not its element type.
11321 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11323 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11324 token was a keyword or not.
11326 Add `error' options where an IDENTIFIER was expected; Provide
11327 CheckToken and CheckIdentifierToken convenience error reporting
11330 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11332 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11333 NameSpaceEntry NameSpaceEntry.
11335 (LookupInterfaceOrClass): Avoid creating a full qualified name
11336 from namespace and name: avoid doing lookups when we know the
11337 namespace is non-existant. Use new Tree.LookupByNamespace which
11338 looks up DeclSpaces based on their namespace, name pair.
11340 * driver.cs: Provide a new `parser verbose' to display the
11341 exception thrown during parsing. This is turned off by default
11342 now, so the output of a failure from mcs is more graceful.
11344 * namespace.cs: Track all the namespaces defined in a hashtable
11347 (IsNamespace): New method
11349 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11351 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11352 we know that we need to concatenate (full typename can never be
11357 * statement.cs: Use a bitfield; Do not initialize to null things
11358 which are done by the constructor by default.
11360 * cs-parser.jay: bug fix, parameter was 4, not 3.
11362 * expression.cs: Just use the property;
11364 * statement.cs: No need for GetVariableInfo method.
11366 2003-08-08 Martin Baulig <martin@ximian.com>
11368 * flowanalysis.cs (FlowReturns): This is now nested in the
11369 `FlowBranching' class.
11370 (MyBitVector): Moved this here from statement.cs.
11371 (FlowBranching.SiblingType): New enum type.
11372 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11374 2003-08-07 Martin Baulig <martin@ximian.com>
11376 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11377 `FlowBranching' class and called `BranchingType'.
11379 2003-08-07 Martin Baulig <martin@ximian.com>
11381 * flowanalysis.cs: Moved all the control flow analysis code into
11384 2003-08-07 Martin Baulig <martin@ximian.com>
11386 * assign.cs (Assign.DoResolve): `target' must either be an
11387 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11390 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11392 * expression.cs (BinaryMethod): This kind of expression is created by the
11393 Binary class if it determines that the operator has to be handled
11396 (BinaryDelegate): This kind of expression is created if we are
11397 dealing with a + or - operator on delegates.
11399 (Binary): remove method, argumetns, and DelegateOperator: when
11400 dealing with methods,
11402 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11404 * statement.cs (Block): use bitfields for the three extra booleans
11405 we had in use. Remove unused topblock parameter.
11407 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11409 * assign.cs: Drop extra unneeded tests.
11411 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11413 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11415 * statement.cs (Foreach): Use VariableStorage instead of
11418 * codegen.cs (VariableStorage): New class used by clients that
11419 require a variable stored: locals or fields for variables that
11420 need to live across yield.
11422 Maybe provide a convenience api for EmitThis+EmitLoad?
11424 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11427 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11429 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11430 RemapParameterLValue): New methods that are used to turn a
11431 precomputed FieldInfo into an expression like this:
11435 The idea is to use this instead of making LocalVariableReference
11436 have more than one meaning.
11438 * cs-parser.jay: Add error production to BASE.
11440 * ecore.cs: Deal with TypeManager.GetField returning null, which
11441 is now a valid return value.
11443 (FieldExprNoAddress): New expression for Fields whose address can
11446 * expression.cs (LocalVariableReference): During the resolve
11447 phases, create new expressions if we are in a remapping context.
11448 Remove code that dealt with remapping here.
11450 (ParameterReference): same.
11452 (ProxyInstance): New expression, like the `This' expression, but
11453 it is born fully resolved. We know what we are doing, so remove
11454 the errors that are targeted to user-provided uses of `this'.
11456 * statement.cs (Foreach): our variable is now stored as an
11457 Expression; During resolution, follow the protocol, dont just
11458 assume it will return this.
11460 2003-08-06 Martin Baulig <martin@ximian.com>
11462 * support.cs (SeekableStreamReader.cs): New public class.
11464 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11465 SeekableStreamReader instead of the normal StreamReader.
11467 2003-08-04 Martin Baulig <martin@ximian.com>
11469 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11470 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11471 deambiguate casts and delegate invocations.
11472 (parenthesized_expression): Use the new tokens to ensure this is
11473 not a cast of method invocation.
11475 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11476 when reading a `)' and Deambiguate_CloseParens () was previously
11479 * expression.cs (ParenthesizedExpression): New class. This is
11480 just used for the CS0075 test.
11481 (Binary.DoResolve): Check for CS0075.
11483 2003-07-29 Ravi Pratap <ravi@ximian.com>
11485 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11486 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11487 reference comparison.
11489 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11490 examine the ReturnType for equality - this is necessary in the
11491 cases of implicit and explicit operators whose signature also
11492 includes the return type.
11494 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11496 * namespace.cs: Cache the result of the namespace computation,
11497 instead of computing it every time.
11499 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11501 * decl.cs: Use a global arraylist that we reuse over invocations
11502 to avoid excesive memory consumption. Reduces memory usage on an
11503 mcs compile by one meg (45 average).
11505 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11506 private, work around that.
11508 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11510 * literal.cs (IntLiteral): Define Zero and One static literals.
11512 * cs-parser.jay (integer_literal): use static literals to reduce
11513 memory usage for the most used literals (0, 1 and -1). 211kb
11514 reduced in memory usage.
11516 Replace all calls to `new ArrayList' with `new
11517 ArrayList(4)' which is a good average number for most allocations,
11518 and also requires only 16 bytes of memory for its buffer by
11521 This reduced MCS memory usage in seven megabytes for the RSS after
11524 2003-07-28 Ravi Pratap <ravi@ximian.com>
11526 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11527 handle params methods the correct way by forming only one
11528 applicable set with params and normal methods in them. Earlier we
11529 were looking at params methods only if we found no normal methods
11530 which was not the correct thing to do.
11532 (Invocation.BetterFunction): Take separate arguments indicating
11533 when candidate and the best method are params methods in their
11536 This fixes bugs #43367 and #46199.
11538 * attribute.cs: Documentation updates.
11540 (CheckAttribute): Rename to CheckAttributeTarget.
11541 (GetValidPlaces): Rename to GetValidTargets.
11543 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11544 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11548 2003-07-28 Martin Baulig <martin@ximian.com>
11550 * class.cs (TypeContainer.DefineMembers): Use the base type's full
11551 name when looking up the base class of a nested class. Fixes #46977.
11553 2003-07-26 Martin Baulig <martin@ximian.com>
11555 * expression.cs (Indexers.Indexer): New nested struct; contains
11556 getter, setter and the indexer's type.
11557 (Indexers.Properties): This is now an ArrayList of
11558 Indexers.Indexer's.
11559 (IndexerAccess.DoResolveLValue): Correctly set the type if the
11560 indexer doesn't have any getters.
11562 * assign.cs (Assign.DoResolve): Also do the implicit conversions
11563 for embedded property and indexer assignments.
11565 2003-07-26 Martin Baulig <martin@ximian.com>
11567 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11568 preprocessor directive is not the first non-whitespace character
11571 2003-07-26 Martin Baulig <martin@ximian.com>
11573 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11574 namespace parsing, follow the spec more closely.
11576 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11577 NamespaceEntry.Lookup().
11579 2003-07-25 Martin Baulig <martin@ximian.com>
11581 * MethodCore.cs (OverridesSomething): New public field; it's set
11582 from TypeContainer.DefineMembers if this method overrides
11583 something (which doesn't need to be a method). Fix #39462.
11585 2003-07-25 Ravi Pratap <ravi@ximian.com>
11587 * typemanager.cs (GetMembers): Ensure that the list of members is
11588 reversed. This keeps things in sync.
11590 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11591 find an AttributeUsage attribute.
11593 * expression.cs (Invocation.OverloadResolve): Perform the check
11594 which disallows Invoke to be directly called on a Delegate.
11596 (Error_InvokeOnDelegate): Report error cs1533.
11598 2003-07-25 Martin Baulig <martin@ximian.com>
11600 * expression.cs (Indexers.GetIndexersForType): Only look in the
11601 interface hierarchy if the requested type is already an
11602 interface. Fixes #46788 while keeping #46502 fixed.
11604 2003-07-25 Martin Baulig <martin@ximian.com>
11606 * class.cs (TypeContainer.DefineMembers): Check whether all
11607 readonly fields have been assigned and report warning CS0649 if
11610 * statement.cs (LocalInfo.IsFixed): Always return true if this is
11613 2003-07-24 Ravi Pratap <ravi@ximian.com>
11615 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11616 returned from GetMethods to make things consistent with the
11617 assumptions MCS makes about ordering of methods.
11619 This should comprehensively fix bug #45127 and it does :-)
11621 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11622 ordering is actually reverse.
11624 * Clean up some debug messages I left lying around.
11626 * interface.cs (Populate*): Get rid of code which emits attributes
11627 since the stage in which we emit attributes is the 'Emit' stage,
11628 not the define stage.
11630 (Emit): Move attribute emission for interface members here.
11632 2003-07-22 Ravi Pratap <ravi@ximian.com>
11634 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11635 closely: we eliminate methods in base types when we have an
11636 applicable method in a top-level type.
11638 Please see section 14.5.5.1 for an exact description of what goes
11641 This fixes bug #45127 and a host of other related to corlib compilation.
11643 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11644 array is the method corresponding to the top-level type (this is
11645 because of the changes made to icall.c) so we change this
11648 (MethodGroupExpr.Name): This too.
11650 * typemanager.cs (GetElementType): New method which does the right
11651 thing when compiling corlib.
11653 * everywhere: Make use of the above in the relevant places.
11655 2003-07-22 Martin Baulig <martin@ximian.com>
11657 * cs-parser.jay (invocation_expression): Moved
11658 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11659 `cast_expression', but create a InvocationOrCast which later
11660 resolves to either an Invocation or a Cast.
11662 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11663 method; call this before EmitStatement() to make sure that this
11664 expression can be used as a statement.
11666 * expression.cs (InvocationOrCast): New class; resolves to either
11667 an Invocation or a Cast.
11669 * statement.cs (StatementExpression): Call ResolveStatement() on
11670 the ExpressionStatement before emitting it.
11672 2003-07-21 Martin Baulig <martin@ximian.com>
11674 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11675 `ref' and `out' attributes match; fixes #46220.
11676 (MemberAccess.ResolveMemberAccess): You can't reference a type
11677 through an expression; fixes #33180.
11678 (Indexers.GetIndexersForType): Don't return the indexers from
11679 interfaces the class implements; fixes #46502.
11681 2003-07-21 Martin Baulig <martin@ximian.com>
11683 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11684 CS0661 checks; fixes bug #30442.
11686 2003-07-21 Martin Baulig <martin@ximian.com>
11688 * decl.cs (AdditionResult): Added `Error'.
11690 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11692 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11693 makes cs0031.cs actually work.
11695 2003-07-20 Martin Baulig <martin@ximian.com>
11697 * namespace.cs: Fixed that bug which caused a crash when compiling
11698 the debugger's GUI.
11700 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11702 * typemanager.cs (LookupTypeReflection): Never expose types which
11703 are NotPublic, NestedPrivate, NestedAssembly, or
11704 NestedFamANDAssem. We used to return these, and later do a check
11705 that would report a meaningful error, but the problem is that we
11706 would not get the real match, if there was a name override.
11708 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11710 * namespace.cs (Namespace, Name): Do not compute the namespace
11711 name dynamically, compute it in the constructor. This reduced
11712 memory usage by 1697 KB.
11714 * driver.cs: Use --pause to pause at the end.
11716 2003-07-17 Peter Williams <peter@newton.cx>
11718 * Makefile: Change the name of the test target so that it doesn't
11719 conflict with the recursive test target.
11721 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11723 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11724 AddressOf): Do not use EmitThis, that was wrong, use the actual
11727 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11729 * class.cs (MethodData.Define): While checking if a method is an
11730 interface implementation, improve the test: If we are not public
11731 (use new test here: use the computed MethodAttributes directly,
11732 instead of the parsed modifier flags) check if the `implementing'
11733 method comes from an interface or not.
11735 * pending.cs (VerifyPendingMethods): Slightly better error
11738 * makefile: add test target that does the mcs bootstrap.
11740 2003-07-16 Ravi Pratap <ravi@ximian.com>
11742 * interface.cs (Define): Do nothing here since there are no
11743 members to populate etc. Move the attribute emission out of here
11744 since this was just totally the wrong place to put it. Attribute
11745 application happens during the 'Emit' phase, not in the 'Define'
11748 (Emit): Add this method and move the attribute emission here
11750 * rootcontext.cs (EmitCode): Call the Emit method on interface
11753 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11755 * expression.cs (OverloadResolve): Report error only if Location
11756 is not 'Null' which means that there was a probe going on.
11758 2003-07-14 Martin Baulig <martin@ximian.com>
11760 * expression.cs (ConditionalLogicalOperator): New public class to
11761 implement user defined conditional logical operators.
11762 This is section 14.11.2 in the spec and bug #40505.
11764 2003-07-14 Martin Baulig <martin@ximian.com>
11766 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11768 2003-07-14 Martin Baulig <martin@ximian.com>
11770 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11772 * ecore.cs (IVariable.VerifyFixed): New interface method.
11774 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11775 operator, check whether the variable is actually fixed. Fixes bug
11776 #36055. Set a variable definitely assigned when taking its
11777 address as required by the spec.
11779 * statement.cs (LocalInfo.IsFixed): New field.
11780 (LocalInfo.MakePinned): Set `IsFixed' to true.
11782 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11784 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11785 for .ctors, ensure that we only ask for members declared in the
11786 attribute type (BindingFlags.DeclaredOnly).
11790 * expression.cs (Error_WrongNumArguments): Report error 1501
11791 correctly the way CSC does.
11793 2003-07-13 Martin Baulig <martin@ximian.com>
11795 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11796 lookup on the fully qualified name, to make things like "X.X" work
11797 where "X.X" is a fully qualified type name, but we also have a
11798 namespace "X" in the using list. Fixes #41975.
11800 2003-07-13 Martin Baulig <martin@ximian.com>
11802 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11803 function. If we're a CompoundAssign, we need to create an embedded
11804 CompoundAssign, not an embedded Assign.
11805 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11808 2003-07-13 Martin Baulig <martin@ximian.com>
11810 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11811 work to fix bug #46088.
11813 2003-07-13 Ravi Pratap <ravi@ximian.com>
11815 * class.cs (Operator.Emit): Do not emit attributes here - it is
11816 taken care of by the Method class that we delegate too. This takes
11817 care of bug #45876.
11819 2003-07-10 Martin Baulig <martin@ximian.com>
11821 * expression.cs (TypeOfVoid): New class.
11822 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11824 2003-07-10 Martin Baulig <martin@ximian.com>
11826 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11829 2003-07-10 Martin Baulig <martin@ximian.com>
11831 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11832 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11834 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11836 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11838 2003-07-10 Martin Baulig <martin@ximian.com>
11840 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11841 of decimal. Fixes #42850.
11843 NOTE: I also fixed the created byte blob, but this doesn't work on
11844 the MS runtime and csc never produces any byte blobs for decimal
11847 2003-07-10 Martin Baulig <martin@ximian.com>
11849 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11850 structs; fixes #32068.
11851 (Block.AddChildVariableNames): Fixed #44302.
11853 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11855 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11857 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11859 * attribute.cs: And this test is onger needed.
11861 2003-07-08 Martin Baulig <martin@ximian.com>
11863 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11864 inaccessible types. Fixes #36313.
11866 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11868 * namespace.cs (NamespaceEntry): Create implicit entries for all
11869 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11870 implicit entries for N1.N2 and N1.
11872 2003-07-08 Martin Baulig <martin@ximian.com>
11874 Rewrote the handling of namespaces to fix a lot of the issues
11875 wrt. `using' aliases etc.
11877 * namespace.cs (Namespace): Splitted this class into a
11878 per-assembly `Namespace' and a per-file `NamespaceEntry'.
11880 * typemanager.cs (TypeManager.IsNamespace): Removed.
11881 (TypeManager.ComputeNamespaces): Only compute namespaces from
11882 loaded assemblies here, not the namespaces from the assembly we're
11883 currently compiling.
11885 2003-07-08 Martin Baulig <martin@ximian.com>
11887 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11889 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11891 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11894 I thought about the memory savings here, but LookupTypeReflection
11895 is used under already very constrained scenarios. Compiling
11896 corlib or mcs only exposes one hit, so it would not really reduce
11897 any memory consumption.
11899 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11901 * typemanager.cs: fixes bug #45889 by only adding public types from
11902 other assemblies to the list of known types.
11904 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11906 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11907 on the type we resolved.
11909 2003-07-05 Martin Baulig <martin@ximian.com>
11911 * pending.cs (PendingImplementation.ParentImplements): Don't
11912 create the proxy if the parent is abstract.
11914 * class.cs (TypeContainer.DefineIndexers): Process explicit
11915 interface implementations first. Fixes #37714.
11917 2003-07-04 Miguel de Icaza <miguel@ximian.com>
11919 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11920 defined recursively; but since we modify the input parameters
11921 (left is set to `this' temporarily), we reset this value if the
11922 left_is_explicit is false, which gives the original semantics to
11925 * literal.cs (NullPointer): new class used to represent a null
11926 literal in a pointer context.
11928 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11929 type is a pointer, use a NullPointer object instead of a
11930 NullLiteral. Closes 43687
11932 (ExplicitConversion): Convert pointer values using
11933 the conv opcode to the proper type.
11935 * ecore.cs (New): change ValueTypeVariable property into a method,
11936 that returns whether the valuetype is suitable for being used.
11938 * expression.cs (Binary.DoNumericPromotions): Only return if we
11939 the int constant was a valid uint, and we can return both left and
11940 right as uints. If not, we continue processing, to trigger the
11941 type conversion. This fixes 39018.
11943 * statement.cs (Block.EmitMeta): During constant resolution, set
11944 the CurrentBlock property on the emitcontext, so that we resolve
11945 constants propertly.
11947 2003-07-02 Martin Baulig <martin@ximian.com>
11949 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11950 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11952 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11953 than emitting it here.
11955 * statement.cs: Fixed some more flow analysis bugs.
11957 2003-07-02 Martin Baulig <martin@ximian.com>
11959 * class.cs (MethodData.Define): When implementing interface
11960 methods, set Final unless we're Virtual.
11962 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11963 check work for interface methods.
11965 2003-07-01 Martin Baulig <martin@ximian.com>
11967 * ecore.cs (EmitContext.This): Replaced this property with a
11968 GetThis() method which takes a Location argument. This ensures
11969 that we get the correct error location for a CS0188.
11971 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11973 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11974 ImplicitStandardConversion.
11976 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11978 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11980 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11983 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11985 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11988 (MethodData.Define): Turn off initlocals for unsafe methods.
11990 2003-06-29 Miguel de Icaza <miguel@ximian.com>
11992 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11993 complete; Fixes #37521.
11995 * delegate.cs: Use Modifiers.TypeAttr to compute the
11996 TypeAttributes, instead of rolling our own. This makes the flags
11997 correct for the delegates.
11999 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12001 * class.cs (Constructor.Define): Set the private flag for static
12002 constructors as well.
12004 * cs-parser.jay (statement_expression): Set the return value to
12005 null, to avoid a crash when we catch an error.
12007 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12009 * cs-parser.jay: Applied patch from Jackson that adds support for
12010 extern and unsafe modifiers to destructor declarations.
12012 * expression.cs: Report error 21 if the user is trying to index a
12015 * driver.cs: Add an error message, suggested by the bug report.
12017 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12018 if we do not have a ": this ()" constructor initializer. Fixes 45149
12020 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12022 * namespace.cs: Add some information to reduce FAQs.
12024 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12026 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12027 underlying enumeration types. Fixes #43915.
12029 * expression.cs: Treat ushort/short as legal values to be used in
12030 bitwise operations.
12032 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12034 * delegate.cs: transfer custom attributes for paramenters from
12035 the delegate declaration to Invoke and BeginInvoke.
12037 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12039 * attribute.cs: handle custom marshalers and emit marshal info
12042 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12044 * makefile.gnu: Added anonymous.cs to the compiler sources.
12046 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12048 * iterators.cs: Change the name of the proxy class to include two
12051 * cs-parser.jay: Update grammar to include anonymous methods.
12053 * anonymous.cs: new file.
12055 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12057 * class.cs (Field.Define): Add missing test for pointers and
12060 2003-05-27 Ravi Pratap <ravi@ximian.com>
12062 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12063 we use the stobj opcode.
12065 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12066 since it wasn't the correct fix.
12068 It still is puzzling that we are required to use stobj for IntPtr
12069 which seems to be a ValueType.
12071 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12073 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12074 during regular simple name resolution. Now, the trick is that
12075 instead of returning for processing the simplename, we do a
12076 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12077 contextual lookup type). If a match is found, return that, if
12078 not, return for further composition.
12080 This fixes long-standing 30485.
12082 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12083 using the address to initialize an object, do an Stobj instead of
12084 using the regular Stelem.
12086 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12087 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12088 Because if we are a BaseIndexerAccess that value will be true.
12091 * statement.cs (GotoCase.Resolve): Return after reporting an
12092 error, do not attempt to continue.
12094 * expression.cs (PointerArithmetic.Emit): If our operand is a
12095 long, convert our constants to match the operand before
12096 multiplying. Convert to I type before adding. Fixes 43670.
12098 2003-05-14 Ravi Pratap <ravi@ximian.com>
12100 * enum.cs (ImplicitConversionExists) : Rename to
12101 ImplicitEnumConversionExists to remove ambiguity.
12103 * ecore.cs (NullCast): New type of cast expression class which
12104 basically is very similar to EmptyCast with the difference being
12105 it still is a constant since it is used only to cast a null to
12107 (eg. (string) null)
12109 * convert.cs (ImplicitReferenceConversion): When casting a null
12110 literal, we return a NullCast.
12112 * literal.cs (NullLiteralTyped): Remove - I don't see why this
12113 should be around anymore.
12115 The renaming (reported was slightly wrong). Corrections:
12117 ConvertImplicitStandard -> ImplicitConversionStandard
12118 ConvertExplicitStandard -> ExplicitConversionStandard
12120 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12121 before passing them in !
12123 * convert.cs (ImplicitConversionStandard): When comparing for
12124 equal expr and target types, ensure that expr is not a
12127 In general, we must not be checking (expr_type ==
12128 target_type) in the top level conversion methods
12129 (ImplicitConversion, ExplicitConversion etc). This checking is
12130 done in the methods that they delegate to.
12132 2003-05-20 Miguel de Icaza <miguel@ximian.com>
12134 * convert.cs: Move Error_CannotConvertType,
12135 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12136 ImplicitNumericConversion, ImplicitConversionExists,
12137 ImplicitUserConversionExists, StandardConversionExists,
12138 FindMostEncompassedType, FindMostSpecificSource,
12139 FindMostSpecificTarget, ImplicitUserConversion,
12140 ExplicitUserConversion, GetConversionOperators,
12141 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12142 TryImplicitIntConversion, Error_CannotConvertImplicit,
12143 ConvertImplicitRequired, ConvertNumericExplicit,
12144 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12145 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12148 Perform the following renames:
12150 StandardConversionExists -> ImplicitStandardConversionExists
12151 ConvertImplicit -> ImplicitConversion
12152 ConvertImplicitStandard -> ImplicitStandardConversion
12153 TryImplicitIntConversion -> ImplicitIntConversion
12154 ConvertImplicitRequired -> ImplicitConversionRequired
12155 ConvertNumericExplicit -> ExplicitNumericConversion
12156 ConvertReferenceExplicit -> ExplicitReferenceConversion
12157 ConvertExplicit -> ExplicitConversion
12158 ConvertExplicitStandard -> ExplicitStandardConversion
12160 2003-05-19 Martin Baulig <martin@ximian.com>
12162 * statement.cs (TypeInfo.StructInfo): Made this type protected.
12163 (TypeInfo): Added support for structs having structs as fields.
12165 * ecore.cs (FieldExpr): Implement IVariable.
12166 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12167 VariableInfo for the field.
12169 2003-05-18 Martin Baulig <martin@ximian.com>
12171 * expression.cs (This.DoResolve): Report a CS0027 if we're
12172 emitting a field initializer.
12174 2003-05-18 Martin Baulig <martin@ximian.com>
12176 * expression.cs (This.ResolveBase): New public function.
12177 (This.DoResolve): Check for CS0188.
12179 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12182 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12183 `instance_expression' to null if we don't have any non-static
12186 2003-05-18 Martin Baulig <martin@ximian.com>
12188 Reworked the way how local variables and parameters are handled by
12189 the flow analysis code.
12191 * statement.cs (TypeInfo, VariableMap): New public classes.
12192 (VariableInfo): New public class. This is now responsible for
12193 checking whether a variable has been assigned. It is used for
12194 parameters and local variables.
12195 (Block.EmitMeta): Take the InternalParameters as argument; compute
12196 the layout of the flow vectors here.
12197 (Block.LocalMap, Block.ParameterMap): New public properties.
12198 (FlowBranching): The .ctor doesn't get the InternalParameters
12199 anymore since Block.EmitMeta() now computes the layout of the flow
12201 (MyStructInfo): This class is now known as `StructInfo' and nested
12202 in `TypeInfo'; we don't access this directly anymore.
12204 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12205 property and removed IsAssigned(), IsFieldAssigned(),
12206 SetAssigned() and SetFieldAssigned(); we now call them on the
12207 VariableInfo so we don't need to duplicate this code everywhere.
12209 * expression.cs (ParameterReference): Added `Block block' argument
12211 (LocalVariableReference, ParameterReference, This): The new
12212 VariableInfo class is now responsible for all the definite
12215 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12216 IsParameterAssigned, SetParameterAssigned): Removed.
12218 2003-05-18 Martin Baulig <martin@ximian.com>
12220 * typemanager.cs (InitCoreTypes): Try calling
12221 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12222 the 3-args-version. Corlib now also needs our `void_type'.
12223 (GetMethod): Added overloaded version which takes an optional
12224 `bool report_errors' to allow lookups of optional methods.
12226 2003-05-12 Martin Baulig <martin@ximian.com>
12228 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12229 only used for locals and not for parameters.
12231 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12233 * support.cs (InternalParameters.ParameterType): Return the
12234 ExternalType of the parameter.
12236 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12239 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12241 * class.cs (MethodData.Define): Do not set the `newslot' on
12242 interface members, if they are also flagged as "override".
12244 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12245 better code for ++i and i++. This only works for static fields
12246 and local variables.
12248 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12249 want to pull the DeclSpace out of the builder_to_declspace instead
12250 of the TypeBuilder (like in TypeContainer.FindMembers).
12252 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12253 instead of LookupTypeContainer. Fixes the crash on .NET for
12254 looking up interface members.
12256 * const.cs: Create our own emit context during the Definition
12257 stage, so that constants are evaluated in the proper context, when
12258 a recursive definition happens.
12260 2003-05-11 Martin Baulig <martin@ximian.com>
12262 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12263 new block for a switch section.
12264 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12265 the adding/lookup in the switch block. Fixes #39828.
12267 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12269 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12270 functionality: I needed to convert the data after I had performed
12271 the add/sub operation into the operands type size.
12273 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12274 pass the type for the box operation, otherwise the resulting
12275 object would have been of type object.
12277 (BoxedCast): Add constructor to specify the type to box as.
12279 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12281 * iterators.cs: I was reusing the `count' variable inadvertently,
12282 take steps to not allow this to happen.
12284 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12286 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12287 by creating an array at the point where the params starts and
12288 putting all those arguments there, then adjusting the size of the
12291 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12293 * expression.cs (New.AddressOf): Implement interface
12294 IMemoryLocation. This is used when the `new' operator is used in
12295 the context of an invocation to a method on a value type.
12297 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12300 * namespace.cs: Also check the using aliases here.
12302 * driver.cs: Move the test for using validity after the types have
12303 been entered, so we do a single pass that also includes the using
12306 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12307 in the regular case. CreateSiblingForFinally is doing extra
12310 * attribute.cs (GetAttributeArgumentExpression): Store the result
12311 on an out value, and use the return value to indicate failure
12312 instead of using null (which is a valid return for Constant.GetValue).
12314 * statement.cs: Perform the analysis flow for the increment
12315 portion after the statement, because this will be the real flow of
12316 execution. Fixes #42385
12318 * codegen.cs (EmitContext.EmitArgument,
12319 EmitContext.EmitStoreArgument): New helper functions when the
12320 RemapToProxy flag is set.
12322 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12325 Add support for remapping parameters.
12327 * iterators.cs: Propagate parameter values; Store parameter
12328 values in the proxy classes.
12330 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12332 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12333 need a proxy reference; I do not know what I was thinking
12335 * cs-parser.jay (constructor_initializer): catch another error,
12336 and display nice message.
12338 (field_declaration): catch void field declaration
12339 to flag a better error.
12341 * class.cs (MemberBase.CheckBase): Report an error instead of a
12342 warning if a new protected member is declared in a struct.
12343 (Field.Define): catch the error of readonly/volatile.
12345 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12347 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12348 volatile variable is taken
12350 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12352 * statement.cs (Fixed.Resolve): Report an error if we are not in
12355 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12357 * typemanager.cs: reuse the code that handles type clashes for
12358 delegates and enumerations.
12360 * class.cs (Report28): Always report.
12362 * expression.cs (EncodeAsAttribute): Allow nulls here.
12364 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12366 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12367 the functionality for testing whether an expression is valid for
12368 an attribute here. Also handle the case of arrays of elements
12371 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12372 encoding a linear array into an array of objects that are suitable
12373 to be passed to an CustomAttributeBuilder.
12375 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12377 * ecore.cs: (FieldExpr): Handle field remapping here.
12379 * iteratators.cs: Pass the instance variable (if the method is an
12380 instance method) to the constructors, so we can access the field
12381 variables on the class.
12383 TODO: Test this with structs. I think the THIS variable on
12384 structs might have to be a pointer, and not a refenrece
12386 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12388 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12389 local variables to fields in a proxy class.
12391 * iterators.cs (PopulateProxy): Rename our internal fields to
12393 Create a <THIS> field if we are an instance method, so we can
12394 reference our parent container variables.
12395 (MapVariable): Called back from the EmitContext code to enter a
12396 new variable to field mapping into the proxy class (we just create
12400 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12401 for using the remapped locals to fields.
12403 I placed the code here, because that gives the same semantics to
12404 local variables, and only changes the Emit code.
12406 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12407 statements inside iterators.
12408 (VariableInfo): Add a FieldBuilder for the cases when we are
12409 remapping local variables to fields in a proxy class
12411 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12412 current_block != null.
12414 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12415 not cope with strings, as it has been moved to the
12416 TableSwitchEmit. Fixed bug in switch generation.
12418 * expression.cs (New.DoResolve): Provide more context for the user
12419 when reporting an error.
12421 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12424 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12425 check the permissions for it. Note than in a type-resolution
12426 context the check was already present in DeclSpace.ResolveType,
12427 but was missing from the MemberAccess.
12429 (ArrayCreation.CheckIndices): warn if the user has
12430 more nested levels of expressions, but there are no more
12431 dimensions specified. Avoids crash on bug 41906.
12433 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12435 * statement.cs (Block): replace Implicit bool, for a generic
12437 New flag: `Unchecked'. This is used during the EmitMeta phase
12438 (which is out-of-line with the regular Resolve/Emit process for a
12439 statement, as this is done ahead of time, but still gets a chance
12440 to call constant resolve).
12442 (Block.Flags): new enum for adding a new flag.
12444 (Block.EmitMeta): track the state of unchecked.
12446 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12447 to enable constant resolution to work there as well.
12449 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12451 * typemanager.cs (ienumerable_type): Also look up
12452 System.Collections.IEnumerable.
12454 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12456 TODO: Test more than one conditional per method.
12458 * class.cs (Indexer.Define): Report the location where the user is
12459 referencing the unsupported feature.
12461 (MethodData): Overload the use of `conditionals' to
12462 minimize the creation of needless ArrayLists. This saves roughly
12463 212kb on my machine.
12465 (Method): Implement the new IIteratorContainer interface.
12466 (Method.SetYields): Implement the method by setting the ModFlags
12467 to contain METHOD_YIELDS.
12469 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12470 which just got set to null.
12472 * iterators.cs: New file.
12474 (Yield, YieldBreak): New statements.
12476 * statement.cs (Return.Resolve): Flag an error if we are used in
12477 an iterator method.
12479 * codegen.cs (InIterator): New flag set if the code is being
12480 compiled in an iterator method.
12482 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12483 internal modifier, and we just use it to avoid adding extra
12484 fields, as this is seldom used.
12486 * cs-parser.jay: Add yield_statement (yield and yield break).
12488 * driver.cs: New flag -v2 to turn on version 2 features.
12490 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12491 hashtable when v2 is enabled.
12493 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12495 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12496 there is already a namespace defined with this name.
12498 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12499 people upgraded their corlibs.
12501 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12502 always use fully qualified types, no need to use the compiler
12505 (TypeManager.IsNamespace): Use binarysearch.
12507 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12508 AddDelegate): I did not quite use the new IsValid API properly: I
12509 have to pass the short-name and the fullname. I was passing only
12510 the basename instead of the fullname sometimes.
12512 (TypeContainer.DefineType): call NamespaceClash.
12514 * interface.cs (Interface.DefineType): use NamespaceClash before
12517 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12520 * enum.cs: (Enum.DefineType): use NamespaceClash before
12523 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12524 speed increase. First, use the negative_hits cache when we get a
12525 negative. Second, add the type with its full original name
12526 instead of the new . and + encoded name (reflection uses + to
12527 separate type from a nested type). Use LookupTypeReflection
12528 directly which bypasses the type->name hashtable (that we already
12529 know does not contain the type.
12531 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12532 location/container type.
12534 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12536 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12538 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12540 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12541 method is being referenced in the method group from a static
12542 context, and report error 120 if so.
12544 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12547 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12548 is created, we create the A namespace).
12550 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12553 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12555 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12556 invocation to ModuleBuilder.GetType with the same values will
12557 return a new type instance, so we need to cache its return
12560 * expression.cs (Binary.ResolveOperator): Only allow the compare
12561 operators on enums if they are of the same type.
12563 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12564 types of ValueType on their own case. Before we were giving them
12565 the same treatment as objects.
12567 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12568 fullname. Short name is used to compare against container name.
12569 Fullname is used to check against defined namespace names.
12571 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12572 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12574 (Method.CheckBase): Call parent.
12575 (MemberBase.CheckBase): Check for protected members on sealed
12577 (PropertyBase.CheckBase): Call parent.
12578 (Field.Define): Call parent.
12580 * report.cs: Negative error codes are now mapped to 8000 - code,
12581 so that the display is render more nicely.
12583 * typemanager.cs: Do not use try/catch, instead report a regular
12586 (GetPointerType, GetReferenceType): These methods provide
12587 mechanisms to obtain the T* and T& from a T. We had the code
12588 previously scattered around the code base, and it also used
12589 TypeManager.LookupType that would go through plenty of caches.
12590 This one goes directly to the type source.
12592 In some places we did the Type.GetType followed by
12593 ModuleBuilder.GetType, but not in others, so this unifies the
12594 processing as well.
12596 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12597 statements now that we have namespace information.
12599 * typemanager.cs (IsNamespace): New method, returns whether the
12600 string presented is a namespace or not.
12602 (ComputeNamespaces): New public entry point, computes the list of
12603 available namespaces, using the GetNamespaces API call in Mono, or
12604 the slower version in MS.NET.
12606 Now before we start the semantic analysis phase, we have a
12607 complete list of namespaces including everything that the user has
12610 Deleted old code to cache namespaces in .nsc files.
12612 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12614 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12615 class/struct location definition Location for the implicit
12616 constructor location.
12618 (Operator.Define): Use the location of the operator for the
12619 implicit Method definition.
12621 (Constructor.Emit): use the constructor location for the implicit
12622 base initializer constructor.
12624 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12625 and the Expression class now contains two new methods:
12627 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12628 isolate type lookup from the rest of the resolution process.
12630 Since we use Expressions to hold type definitions due to the way
12631 we parse the input we have historically overloaded Resolve to
12632 perform the Type lookups if a special flag is passed. Now this is
12633 eliminated and two methods take their place.
12635 The differences in the two methods between xStep and xTerminal is
12636 that xStep is involved in our current lookup system that uses
12637 SimpleNames to compose a name, while xTerminal is used just to
12638 catch the case where the simplename lookup failed.
12640 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12642 * expression.cs (ResolveMemberAccess): Remove redundant code.
12643 TypeExpr expressions are always born fully resolved.
12645 * interface.cs (PopulateMethod): Do not lookup the types twice.
12646 We were doing it once during SemanticAnalysis and once during
12649 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12650 in local variable type definitions, were being returned as a
12651 SimpleName (we decomposed everything into a string), that is
12652 because primary_expression was being used instead of a type in the
12653 grammar (reduce/reduce conflicts).
12655 The part that was wrong is that we converted the expression into a
12656 string (an oversimplification in one hand, compounded with primary
12657 expressions doing string concatenation).
12663 Would return "A.B.C[]" as a SimpleName. This stopped things like
12664 using clauses from working on this particular context. And a type
12665 was being matched directly against "A.B.C[]".
12667 We now use the correct approach, and allow for ComposedCast to be
12668 part of the unary expression. So the "A.B.C []" become a composed
12669 cast of "A.B.C" (as a nested group of MemberAccess with a
12670 SimpleName at the end) plus the rank composition "[]".
12674 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12676 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12677 for the access level checking.
12679 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12680 `TypeContainer container', because I kept getting confused when I
12681 was debugging this code.
12683 * expression.cs (Indexers): Instead of tracking getters/setters,
12684 we now track them in parallel. We create one arraylist less, but
12685 most importantly it is possible now for the LValue code to find a
12686 matching get for a set.
12688 (IndexerAccess.DoResolveLValue): Update the code.
12689 GetIndexersForType has been modified already to extract all the
12690 indexers from a type. The code assumed it did not.
12692 Also make the code set the correct return type for the indexer.
12693 This was fixed a long time ago for properties, but was missing for
12694 indexers. It used to be void_type.
12696 (Binary.Emit): Test first for doubles instead of
12697 floats, as they are more common.
12699 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12700 when dealing with floats and the <=, >= operators. This fixes bug
12703 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12704 to load the array value by emitting a load on the foreach variable
12705 type. This was incorrect.
12707 We now emit the code to load an element using the the array
12708 variable type, and then we emit the conversion operator.
12712 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12714 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12716 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12718 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12719 test for protection before we test for signatures.
12721 (MethodSignature.ToString): implement.
12723 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12724 to the case where we reduced into a LongConstant.
12726 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12727 depend on whether the information is acurrate, because the
12728 Microsoft runtime will always claim that the array type is public,
12729 regardless of the real state.
12731 If the type is a pointer, another problem happens: the type is
12732 reported as non-public in Microsoft.
12734 In both cases we have to call CheckAccessLevel recursively with
12735 the underlying type as the argument to be tested.
12737 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12739 * assign.cs (Assign.Emit): If we are dealing with a compound
12740 assignment expression, we should use the code path that stores the
12741 intermediate result in a temporary value. This fixes #40903.
12743 *expression.cs (Indirection.ToString): Provide ToString method for
12746 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12748 * class.cs: Null out fields holding references to Block objects so
12749 they can be garbage collected.
12751 * expression.cs (OverloadResolve): Remove unused local.
12753 2003-04-07 Martin Baulig <martin@ximian.com>
12755 * codegen.cs (EmitContext.CurrentFile): New public field.
12756 (EmitContext.Mark): Use the CurrentFile to check whether the
12757 location is in the correct file.
12758 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12760 2003-04-07 Martin Baulig <martin@ximian.com>
12762 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12764 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12765 location. [FIXME: The location argument which gets passed to this
12766 method is sometimes wrong!]
12768 2003-04-07 Nick Drochak <ndrochak@gol.com>
12770 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12772 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12774 * expression.cs (Indirection.EmitAssign): We were using the
12775 temporary, but returning immediately instead of continuing the
12778 2003-04-06 Martin Baulig <martin@ximian.com>
12780 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12781 if it's a nested child, but also deriving from the outer class.
12784 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12785 nested child, but also deriving from the outer class. See
12787 (FilterWithClosure): We may access private members of the outer
12788 class if we're a nested child and deriving from the outer class.
12789 (RealMemberLookup): Only set `closure_private_ok' if the
12790 `original_bf' contained BindingFlags.NonPublic.
12792 2003-04-05 Martin Baulig <martin@ximian.com>
12794 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12796 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12798 * class.cs (Event.Define): Do not allow abstract events to have
12801 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12803 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12804 block in event declarations.
12806 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12807 value type, get its address.
12809 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12810 leaving a class on the stack instead of a boolean value (int
12811 0/1). Change the code so we compare against null, and then the
12812 result against zero.
12814 * class.cs (TypeContainer.GetClassBases): We were checking for the
12815 parent class being sealed too late.
12817 * expression.cs (Binary.Emit): For <= and >= when dealing with
12818 floating point values, use cgt.un and clt.un instead of cgt and
12821 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12823 * statement.cs: Apply the same optimization as MS: skip the
12824 GetEnumerator returning an IEnumerator, and use the one returning a
12825 CharEnumerator instead. This allows us to avoid the try-finally block
12828 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12830 * cs-parser.jay: Attributes cannot be applied to
12831 namespaces. Fixes #40473
12833 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12836 (Add*): check if the name is valid using the full name for constants,
12837 fields, properties and events.
12839 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12841 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12842 char constants to be part of the enumeration.
12844 * expression.cs (Conditional.DoResolve): Add support for operator
12845 true. Implements the missing functionality from 14.12
12847 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12848 operator true/false as required by the spec.
12850 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12851 implicit conversion to boolean.
12853 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12854 also one where the type implements `operator true'.
12856 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12857 get an expression that will invoke operator true based on an
12860 (GetConversionOperators): Removed the hack that called op_True
12863 (Expression.ResolveBoolean): Move this from Statement.
12865 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12867 * ecore.cs (FieldExpr): do not allow initialization of initonly
12868 fields on derived classes
12870 2003-03-13 Martin Baulig <martin@ximian.com>
12872 * statement.cs (Block.Emit): Call ig.BeginScope() and
12873 ig.EndScope() when compiling with debugging info; call
12874 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12876 2003-03-08 Miguel de Icaza <miguel@ximian.com>
12878 * expression.cs (Indexers): Do not construct immediately, allow
12879 for new members to be appended as we go. Fixes 38143
12881 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12883 * expression.cs: save/restore context when resolving an unchecked
12886 2003-03-05 Miguel de Icaza <miguel@ximian.com>
12888 * cfold.cs: Catch division by zero in modulus operator during
12891 2003-03-03 Miguel de Icaza <miguel@ximian.com>
12893 * interface.cs (Interface.DefineMembers): Avoid defining members
12896 2003-02-27 Miguel de Icaza <miguel@ximian.com>
12898 * driver.cs: handle the +/- options for -noconfig
12900 * statement.cs (Unckeched.Resolve): Also track the state of
12901 unchecked in the Resolve phase.
12903 2003-02-27 Martin Baulig <martin@ximian.com>
12905 * ecore.cs (Expression.MemberLookup): Don't create a
12906 MethodGroupExpr for something which is not a method. Fixes #38291.
12908 2003-02-25 Miguel de Icaza <miguel@ximian.com>
12910 * class.cs (MemberBase.CheckParameters): Also check that the type
12911 is unmanaged if it is a pointer.
12913 * expression.cs (SizeOf.Resolve): Add location information.
12915 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12916 a managed type is declared.
12918 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12919 parameter modifiers as well. Fixes bug 38606
12921 * class.cs: Very sad. Am backing out the speed up changes
12922 introduced by the ArrayList -> Array in the TypeContainer, as they
12923 were not actually that much faster, and introduced a bug (no error
12924 reports on duplicated methods).
12926 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12927 source first, this will guarantee that we have a valid expression
12928 before calling in lower levels functions that will require a
12929 resolved object. Then use this original_source in the
12930 target.ResolveLValue instead of the original source that was
12933 Another change. Use target.Resolve instead of LValueResolve.
12934 Although we are resolving for LValues, we will let the Assign code
12935 take care of that (it will be called again from Resolve). This
12936 basically allows code like this:
12938 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12939 class Y { void A (X x) { x [0] += o; }
12941 The problem was that the indexer was trying to resolve for
12942 set_Item (idx, object o) and never finding one. The real set_Item
12943 was set_Item (idx, X). By delaying the process we get the right
12948 2003-02-23 Martin Baulig <martin@ximian.com>
12950 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12951 while calling DoEmit ().
12953 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12954 source files; if you use the #line directive inside a method, the
12955 compiler stops emitting line numbers for the debugger until it
12956 reaches the end of the method or another #line directive which
12957 restores the original file.
12959 2003-02-23 Martin Baulig <martin@ximian.com>
12961 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12963 2003-02-23 Martin Baulig <martin@ximian.com>
12965 * statement.cs (Block.AddChildVariableNames): We need to call this
12966 recursively, not just for our immediate children.
12968 2003-02-23 Martin Baulig <martin@ximian.com>
12970 * class.cs (Event.Define): Always make the field private, like csc does.
12972 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12973 actually work, fixes bug #37521.
12975 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12977 * delegate.cs: When creating the various temporary "Parameters"
12978 classes, make sure that we call the ComputeAndDefineParameterTypes
12979 on those new parameters (just like we do with the formal ones), to
12980 allow them to be resolved in the context of the DeclSpace.
12982 This fixes the bug that Dick observed in Bugzilla #38530.
12984 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12986 * expression.cs (ResolveMemberAccess): When resolving a constant,
12987 do not attempt to pull a constant if the value was not able to
12988 generate a valid constant.
12990 * const.cs (LookupConstantValue): Do not report more errors than required.
12992 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12994 * expression.cs: fixes bug #38328.
12996 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12998 * class.cs: Changed all the various members that can be part of a
12999 class from being an ArrayList to be an Array of the right type.
13000 During the DefineType type_list, interface_list, delegate_list and
13001 enum_list are turned into types, interfaces, delegates and enums
13004 And during the member population, indexer_list, event_list,
13005 constant_list, field_list, instance_constructor_list, method_list,
13006 operator_list and property_list are turned into their real arrays.
13008 Although we could probably perform this operation earlier, for
13009 good error reporting we need to keep the lists and remove the
13010 lists for longer than required.
13012 This optimization was triggered by Paolo profiling the compiler
13013 speed on the output of `gen-sample-program.pl' perl script.
13015 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13016 not crash in methods like MemberLookupFailed that use this field.
13018 This problem arises when the compiler fails to resolve a type
13019 during interface type definition for example.
13021 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13023 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13024 inherit from System.Object, so we have to stop at null, not only
13025 when reaching System.Object.
13027 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13029 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13030 DeclaredOnly because the parent indexer might have had a different
13031 name, but did not loop until the top of the hierarchy was reached.
13033 The problem this one fixes is 35492: when a class implemented an
13034 indexer from an interface, we were getting the interface method
13035 (which was abstract) and we were flagging an error (can not invoke
13038 This also keeps bug 33089 functioning, and test-148 functioning.
13040 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13041 out if a method is special is to see if it is declared in a
13042 property or event, or whether it is one of the predefined operator
13043 names. This should fix correctly #36804.
13045 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13047 The goal here is to remove the dependency on EmptyCast.Peel ().
13048 Killing it completely.
13050 The problem is that currently in a number of places where
13051 constants are expected, we have to "probe" for an EmptyCast, and
13052 Peel, which is not the correct thing to do, as this will be
13053 repetitive and will likely lead to errors.
13055 The idea is to remove any EmptyCasts that are used in casts that
13056 can be reduced to constants, so we only have to cope with
13059 This bug hunt was triggered by Bug 37363 and the desire to remove
13060 the duplicate pattern where we were "peeling" emptycasts to check
13061 whether they were constants. Now constants will always be
13064 * ecore.cs: Use an enumconstant here instead of wrapping with
13067 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13068 throwing me off. By handling this we can get rid of a few hacks.
13070 * statement.cs (Switch): Removed Peel() code.
13072 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13074 * class.cs: Location information for error 508
13076 * expression.cs (New.DoResolve): Add a guard against double
13077 resolution of an expression.
13079 The New DoResolve might be called twice when initializing field
13080 expressions (see EmitFieldInitializers, the call to
13081 GetInitializerExpression will perform a resolve on the expression,
13082 and later the assign will trigger another resolution
13084 This leads to bugs (#37014)
13086 * delegate.cs: The signature for EndInvoke should contain any ref
13087 or out parameters as well. We were not doing this in the past.
13089 * class.cs (Field.Define): Do not overwrite the type definition
13090 inside the `volatile' group. Turns out that volatile enumerations
13091 were changing the type here to perform a validity test, which
13094 2003-02-12 Miguel de Icaza <miguel@ximian.com>
13096 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13097 and structs, we do not want to load the instance variable
13099 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13100 enum_type has to be handled like an object reference (implicit
13101 conversions exists from this to object), but the regular IsClass
13102 and IsValueType tests will never return true for this one.
13104 Also we use TypeManager.IsValueType instead of type.IsValueType,
13105 just for consistency with the rest of the code (this is only
13106 needed if we ever use the construct exposed by test-180.cs inside
13107 corlib, which we dont today).
13109 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
13111 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13114 2003-02-09 Martin Baulig <martin@ximian.com>
13116 * namespace.cs (Namespace..ctor): Added SourceFile argument.
13117 (Namespace.DefineNamespaces): New static public method; this is
13118 called when we're compiling with debugging to add all namespaces
13119 to the symbol file.
13121 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13122 pass it to the Namespace's .ctor.
13124 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13125 and MethodBase arguments; pass the namespace ID to the symwriter;
13126 pass the MethodBase instead of the token to the symwriter.
13127 (SymbolWriter.DefineNamespace): New method to add a namespace to
13130 2003-02-09 Martin Baulig <martin@ximian.com>
13132 * symbolwriter.cs: New file. This is a wrapper around
13133 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
13134 methods here in near future.
13136 2003-02-09 Martin Baulig <martin@ximian.com>
13138 * codegen.cs (EmitContext.Mark): Just pass the arguments to
13139 ILGenerator.MarkSequencePoint() which are actually used by the
13142 2003-02-09 Martin Baulig <martin@ximian.com>
13144 * location.cs (SourceFile): New public sealed class. This
13145 contains the name and an index which is used in the location's token.
13146 (Location): Reserve an appropriate number of bits in the token for
13147 the source file instead of walking over that list, this gives us a
13148 really huge performance improvement when compiling with debugging.
13150 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13151 `SourceFile' argument instead of a string.
13152 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13153 but don't parse/tokenize here, we need to generate the list of all
13154 source files before we do that.
13155 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13158 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13159 instead of a string.
13161 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13164 2003-02-09 Martin Baulig <martin@ximian.com>
13166 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13167 filename on `#line default'.
13169 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13171 * statement.cs: don't clear the pinned var when the fixed statement
13172 returns from the method (fixes bug#37752).
13174 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13176 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13179 2003-02-07 Martin Baulig <martin@ximian.com>
13181 * driver.cs: Removed the `--debug-args' command line argument.
13183 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13184 automatically by the AsssemblyBuilder.
13185 (CodeGen.InitializeSymbolWriter): We don't need to call any
13186 initialization function on the symbol writer anymore. This method
13187 doesn't take any arguments.
13189 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13191 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13192 from referenced assemblies as well.
13194 2003-02-02 Martin Baulig <martin@ximian.com>
13196 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13198 2003-02-02 Martin Baulig <martin@ximian.com>
13200 * class.cs (Constructor.Emit): Open the symbol writer before
13201 emitting the constructor initializer.
13202 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13203 single-stepping through constructor initializers.
13205 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13207 * class.cs: Handle error 549: do not allow virtual methods in
13210 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13212 * decl.cs: Check access levels when resolving types
13214 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13216 * statement.cs: Add parameters and locals set in catch blocks that might
13217 return to set vector
13219 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13221 * class.cs (Operator): Set the SpecialName flags for operators.
13223 * expression.cs (Invocation.DoResolve): Only block calls to
13224 accessors and operators on SpecialName methods.
13226 (Cast.TryReduce): Handle conversions from char constants.
13229 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13231 * statement.cs: small memory and time optimization in FlowBranching.
13233 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13235 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13236 problem that the last fix but in the other sid (Set).
13238 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13239 access when there is no indexer in the hierarchy.
13241 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13243 * class.cs: Combine some if statements.
13245 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13247 * driver.cs: fixed bug #37187.
13249 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13251 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13252 any indexer, it's needed to build a list with all the indexers in the
13253 hierarchy (AllGetters), else we have problems. Fixes #35653.
13255 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13257 * class.cs (MethodData.Define): It is wrong for an interface
13258 implementation to be static in both cases: explicit and implicit.
13259 We were only handling this in one case.
13261 Improve the if situation there to not have negations.
13263 * class.cs (Field.Define): Turns out that we do not need to check
13264 the unsafe bit on field definition, only on usage. Remove the test.
13266 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13268 * driver.cs: use assembly.Location instead of Codebase (the latest
13269 patch made mcs fail when using MS assemblies).
13271 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13273 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13274 get the path to *corlib.dll.
13276 2003-01-21 Nick Drochak <ndrochak@gol.com>
13280 * typemanager.cs: Remove compiler warnings
13282 2003-01-20 Duncan Mak <duncan@ximian.com>
13284 * AssemblyInfo.cs: Bump the version number to 0.19.
13286 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13288 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13290 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13292 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13294 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13296 * cs-parser.jay: Small fix: we were not comparing the constructor
13297 name correctly. Thanks to Zoltan for the initial pointer.
13299 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13301 * cs-tokenizer.cs: Set file name when specified with #line
13303 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13305 * cs-parser.jay: Only perform the constructor checks here if we
13306 are named like the class; This will help provider a better
13307 error. The constructor path is taken when a type definition is
13308 not found, but most likely the user forgot to add the type, so
13309 report that rather than the constructor error.
13311 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13313 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13316 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13318 * cs-parser.jay: Add cleanup call.
13320 2003-01-13 Duncan Mak <duncan@ximian.com>
13322 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13323 consistent with other methods.
13325 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13327 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13329 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13331 * attribute.cs: only set GuidAttr to true when we have a
13334 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13338 * typemanager.cs: fixes to allow mcs compile corlib with the new
13339 Type.IsSubclassOf fix.
13341 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13343 * expression.cs (LocalVariableReference.DoResolve): Classify a
13344 constant as a value, not as a variable. Also, set the type for
13347 * cs-parser.jay (fixed_statement): take a type instead of a
13348 pointer_type, so we can produce a better error message later.
13350 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13353 (For.DoEmit): Make inifinite loops have a
13354 non-conditional branch back.
13356 (Fixed.DoEmit): First populate the pinned variables, then emit the
13357 statement, then clear the variables. Before I was emitting the
13358 code once for each fixed piece.
13361 2003-01-08 Martin Baulig <martin@ximian.com>
13363 * statement.cs (FlowBranching.MergeChild): A break in a
13364 SWITCH_SECTION does not leave a loop. Fixes #36155.
13366 2003-01-08 Martin Baulig <martin@ximian.com>
13368 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13369 lives in the same number space than `param_map'. Fixes #36154.
13371 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13373 * cs-parser.jay (constructor_declaration): Set the
13374 Constructor.ModFlags before probing for it. This makes the
13375 compiler report 514, 515 and 132 (the code was there, but got
13378 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13379 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13380 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13382 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13384 * enum.cs: create the enum static fields using the enum type.
13386 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13388 * class.cs: don't try to create the ParamBuilder for the return
13389 type if it's not needed (and handle it breaking for the ms runtime
13392 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13394 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13396 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13398 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13399 the command. This showed up while compiling the JANET source
13400 code, which used \r as its only newline separator.
13402 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13404 * class.cs (Method.Define): If we are an operator (because it
13405 reuses our code), then set the SpecialName and HideBySig. #36128
13407 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13409 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13410 exception, report error 120 `object reference required'.
13412 * driver.cs: Add --pause option, used during to measure the size
13413 of the process as it goes with --timestamp.
13415 * expression.cs (Invocation.DoResolve): Do not allow methods with
13416 SpecialName to be invoked.
13418 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13420 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13421 number before adding it.
13423 2002-12-21 Ravi Pratap <ravi@ximian.com>
13425 * ecore.cs (StandardImplicitConversion): When in an unsafe
13426 context, we allow conversion between void * to any other pointer
13427 type. This fixes bug #35973.
13429 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13431 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13432 is not thrown when extensionless outputs are used
13434 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13436 * rootcontext.cs: fixed compilation of corlib.
13438 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13440 * attribute.cs (Attributes.Contains): Add new method.
13442 * class.cs (MethodCore.LabelParameters): if the parameter is an
13443 `out' parameter, check that no attribute `[In]' has been passed.
13445 * enum.cs: Handle the `value__' name in an enumeration.
13447 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13449 * decl.cs: Added special case to allow overrides on "protected
13452 2002-12-18 Ravi Pratap <ravi@ximian.com>
13454 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13455 since it makes much more sense.
13457 (Attributes.ctor): Don't require a Location parameter.
13459 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13461 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13462 since we already have that information per attribute.
13464 * everywhere : make appropriate changes.
13466 * class.cs (LabelParameters): Write the code which actually
13467 applies attributes to the return type. We can't do this on the MS
13468 .NET runtime so we flag a warning in the case an exception is
13471 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13473 * const.cs: Handle implicit null conversions here too.
13475 2002-12-17 Ravi Pratap <ravi@ximian.com>
13477 * class.cs (MethodCore.LabelParameters): Remove the extra
13478 Type [] parameter since it is completely unnecessary. Instead
13479 pass in the method's attributes so that we can extract
13480 the "return" attribute.
13482 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13484 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13485 of ignoring it and letting the compile continue.
13487 * typemanager.cs (ChangeType): use an extra argument to return an
13488 error condition instead of throwing an exception.
13490 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13492 * expression.cs (Unary.TryReduce): mimic the code for the regular
13493 code path. Perform an implicit cast in the cases where we can
13494 implicitly convert to one of the integral types, and then reduce
13495 based on that constant. This fixes bug #35483.
13497 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13499 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13501 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13503 * namespace.cs: fixed bug #35489.
13505 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13507 * class.cs: Remove some dead code.
13509 * cs-parser.jay: Estimate the number of methods needed
13510 (RootContext.MethodCount);
13512 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13513 numbers instead of StringBuilders.
13515 * support.cs (PtrHashtable): Add constructor with initial size;
13516 We can now reduce reallocations of the method table.
13518 2002-12-10 Ravi Pratap <ravi@ximian.com>
13520 * attribute.cs (ApplyAttributes): Keep track of the emitted
13521 attributes on a per-target basis. This fixes bug #35413.
13523 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13525 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13526 default to the Windows 1252 encoding.
13528 (UnixParseOption): Support version, thanks to Alp for the missing
13531 * AssemblyInfo.cs: Add nice assembly information.
13533 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13536 * cs-parser.jay: Allow a trailing comma before the close bracked
13537 in the attribute_section production.
13539 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13540 address of the instance was being taken, I will take this out,
13541 because we take the address of the object immediately here.
13543 2002-12-09 Ravi Pratap <ravi@ximian.com>
13545 * typemanager.cs (AreMultipleAllowed): Take care of the most
13546 obvious case where attribute type is not in the current assembly -
13549 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13551 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13552 definitions, instead of doing that afterwards.
13554 Also we use a nice little hack, depending on the constructor, we
13555 know if we are a "composed" name or a simple name. Hence, we
13556 avoid the IndexOf test, and we avoid
13558 * codegen.cs: Add code to assist in a bug reporter to track down
13559 the source of a compiler crash.
13561 2002-12-07 Ravi Pratap <ravi@ximian.com>
13563 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13564 types have been emitted for a given element and flag an error
13565 if something which does not have AllowMultiple set is used more
13568 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13569 attribute types and their corresponding AllowMultiple properties
13571 (AreMultipleAllowed): Check the property for a given type.
13573 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13574 property in the case we have a TypeContainer.
13576 (Attributes.AddAttribute): Detect duplicates and just skip on
13577 adding them. This trivial fix catches a pretty gross error in our
13578 attribute emission - global attributes were being emitted twice!
13580 Bugzilla bug #33187 is now fixed.
13582 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13584 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13585 instead of pp_and).
13587 * expression.cs (Binary.ResolveOperator): I can only use the
13588 Concat (string, string, string) and Concat (string, string,
13589 string, string) if the child is actually a concatenation of
13592 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13594 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13595 context where we need a 2-character lookahead.
13597 * pending.cs (PendingImplementation): Rework so we can keep track
13598 of interface types all the time, and flag those which were
13599 implemented by parents as optional.
13601 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13603 * expression.cs (Binary.ResolveOperator): Use
13604 String.Concat(string,string,string) or
13605 String.Concat(string,string,string,string) when possible.
13607 * typemanager: More helper methods.
13610 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13612 * pending.cs: remove the bogus return from GetMissingInterfaces()
13613 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13615 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13617 * namespace.cs: avoid duplicated 'using xxx' being added to
13618 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13619 when we get more than one 'using' statement for the same namespace.
13620 Report a CS0105 warning for it.
13622 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13624 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13625 of calling getChar/putback, uses internal knowledge of it.
13627 (xtoken): Reorder tokenizer so most common patterns are checked
13628 first. This reduces the compilation time in another 5% (from 8.11s
13629 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13631 The parsing time is 22% of the compilation in mcs, and from that
13632 64% is spent on the tokenization process.
13634 I tried using a binary search for keywords, but this is slower
13635 than the hashtable. Another option would be to do a couple of
13638 * Not use a StringBuilder, instead use an array of chars,
13639 with a set value. Notice that this way we could catch
13640 the 645 error without having to do it *afterwards*.
13642 * We could write a hand-parser to avoid the hashtable
13643 compares altogether.
13645 The identifier consumption process takes 37% of the tokenization
13646 time. Another 15% is spent on is_number. 56% of the time spent
13647 on is_number is spent on Int64.Parse:
13649 * We could probably choose based on the string length to
13650 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13653 Another 3% is spend on wrapping `xtoken' in the `token' function.
13655 Handle 0xa0 as whitespace (#34752)
13657 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13659 * typemanager.cs (IsCLRType): New routine to tell whether a type
13660 is one of the builtin types.
13662 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13663 typecode in more places instead of doing pointer comparissions.
13664 We could leverage some knowledge about the way the typecodes are
13667 New code to cache namespaces in assemblies, it is currently not
13668 invoked, to be used soon.
13670 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13672 * expression.cs (Binary.ResolveOperator): specially handle
13673 strings, and do not perform user-defined operator overloading for
13676 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13678 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13679 internalcall as it is a pretty simple operation; Avoid whenever
13680 possible to call Char.IsLetter.
13682 (consume_identifier): Cut by half the number of
13683 hashtable calls by merging the is_keyword and GetKeyword behavior.
13685 Do not short-circuit, because if we do, we
13686 report errors (ie, #if false && true would produce an invalid
13690 2002-11-24 Martin Baulig <martin@ximian.com>
13692 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13693 check constant ranges and report a CS0221. Fixes #33186.
13695 2002-11-24 Martin Baulig <martin@ximian.com>
13697 * cs-parser.jay: Make this work for uninitialized variable
13698 declarations in the `for' initializer. Fixes #32416.
13700 2002-11-24 Martin Baulig <martin@ximian.com>
13702 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13703 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13705 2002-11-24 Martin Baulig <martin@ximian.com>
13707 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13708 argument; if true, we also check for user-defined conversions.
13709 This is only needed if both arguments are of a user-defined type.
13710 Fixes #30443, added test-175.cs.
13711 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13713 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13715 2002-11-24 Martin Baulig <martin@ximian.com>
13717 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13718 function to get the store opcode.
13719 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13720 only emit the Ldelema if the store opcode is Stobj. You must run
13721 both test-34 and test-167 to test this. Fixes #34529.
13723 2002-11-23 Martin Baulig <martin@ximian.com>
13725 * ecore.cs (Expression.MemberLookup): Added additional
13726 `qualifier_type' argument which is used when we're being called
13727 from MemberAccess.DoResolve() and null if we're called from a
13729 (Expression.MemberLookupFailed): New method to report errors; this
13730 does the CS1540 check and reports the correct error message.
13732 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13733 argument for the CS1540 check and redone the way how we're dealing
13734 with private members. See the comment in the source code for details.
13735 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13736 `closure_start_type' to `closure_qualifier_type' and check whether
13737 it's not null. It was not this filter being broken, it was just
13738 being called with the wrong arguments.
13740 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13741 and pass it the correct `qualifier_type'; this also does the error
13744 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13746 * expression.cs (Invocation.EmitParams): If the we are dealing
13747 with a non-built-in value type, load its address as well.
13749 (ArrayCreation): Use a a pretty constant instead
13750 of the hardcoded value 2. Use 6 instead of 2 for the number of
13751 static initializers.
13753 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13754 because they are not really value types, just glorified integers.
13756 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13758 * ecore.cs: Remove redundant code for enumerations, make them use
13759 the same code path as everything else, fixes the casting issue
13760 with enumerations in Windows.Forms.
13762 * attribute.cs: Do only cast to string if it is a string, the
13763 validation happens later.
13765 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13766 people upgrade their corlibs.
13768 * ecore.cs: Oops, enumerations were not following the entire code path
13770 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13772 * typemanager.cs (FilterWithClosure): Commented out the test for
13773 1540 in typemanager.cs, as it has problems when accessing
13774 protected methods from a parent class (see test-174.cs).
13776 * attribute.cs (Attribute.ValidateGuid): new method.
13777 (Attribute.Resolve): Use above.
13779 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13781 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13783 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13784 handling for enumerations, as we only needed the TypeContainer
13785 functionality to begin with (this is required for the fix below to
13786 work for enums that reference constants in a container class for
13789 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13791 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13792 a valid TypeBuilder to perform lookups on.o
13794 * class.cs (InheritableMemberSignatureCompare): Use true in the
13795 call to GetGetMethod and GetSetMethod, because we are comparing
13796 the signature, and we need to get the methods *even* if they are
13799 (PropertyBase.CheckBase): ditto.
13801 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13802 GotoCase.Resolve): Use Peel on EmpytCasts.
13804 * ecore.cs (EmptyCast): drop child, add Peel method.
13806 2002-11-17 Martin Baulig <martin@ximian.com>
13808 * ecore.cs (EmptyCast.Child): New public property.
13810 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13811 label resolved to an EmptyCast. Fixes #34162.
13812 (GotoCase.Resolve): Likewise.
13813 (Block.EmitMeta): Likewise.
13815 2002-11-17 Martin Baulig <martin@ximian.com>
13817 * expression.cs (Invocation.BetterConversion): Prefer int over
13818 uint; short over ushort; long over ulong for integer literals.
13819 Use ImplicitConversionExists instead of StandardConversionExists
13820 since we also need to check for user-defined implicit conversions.
13821 Fixes #34165. Added test-173.cs.
13823 2002-11-16 Martin Baulig <martin@ximian.com>
13825 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13826 with the `true' and `false' literals. Fixes #33151.
13828 2002-11-16 Martin Baulig <martin@ximian.com>
13830 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13831 October 22nd; don't do the cs1540 check for static members.
13833 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13834 now using our own filter here and doing the cs1540 check again.
13836 2002-11-16 Martin Baulig <martin@ximian.com>
13838 * support.cs (InternalParameters): Don't crash if we don't have
13839 any fixed parameters. Fixes #33532.
13841 2002-11-16 Martin Baulig <martin@ximian.com>
13843 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13844 when looking up static methods to make this work on Windows.
13847 2002-11-16 Martin Baulig <martin@ximian.com>
13849 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13850 a setter rather than using PropertyInfo.CanWrite.
13852 2002-11-15 Nick Drochak <ndrochak@gol.com>
13854 * class.cs: Allow acces to block member by subclasses. Fixes build
13857 2002-11-14 Martin Baulig <martin@ximian.com>
13859 * class.cs (Constructor.Emit): Added the extern/block check.
13862 2002-11-14 Martin Baulig <martin@ximian.com>
13864 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13865 iteration while looking for indexers, this is needed because the
13866 indexer may have a different name in our base classes. Fixed the
13867 error reporting (no indexers at all, not get accessor, no
13868 overloaded match). Fixes bug #33089.
13869 (IndexerAccess.DoResolveLValue): Likewise.
13871 2002-11-14 Martin Baulig <martin@ximian.com>
13873 * class.cs (PropertyBase.CheckBase): Make this work for multiple
13874 indexers. Fixes the first part of bug #33089.
13875 (MethodSignature.InheritableMemberSignatureCompare): Added support
13878 2002-11-13 Ravi Pratap <ravi@ximian.com>
13880 * attribute.cs (Attribute.Resolve): Catch the
13881 NullReferenceException and report it since it isn't supposed to
13884 2002-11-12 Miguel de Icaza <miguel@ximian.com>
13886 * expression.cs (Binary.EmitBranchable): Also handle the cases for
13887 LogicalOr and LogicalAnd that can benefit from recursively
13888 handling EmitBranchable. The code now should be nice for Paolo.
13890 2002-11-08 Miguel de Icaza <miguel@ximian.com>
13892 * typemanager.cs (LookupType): Added a negative-hit hashtable for
13893 the Type lookups, as we perform quite a number of lookups on
13894 non-Types. This can be removed once we can deterministically tell
13895 whether we have a type or a namespace in advance.
13897 But this might require special hacks from our corlib.
13901 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13902 and double which avoids a conversion from an integer to a double.
13904 * expression.cs: tiny optimization, avoid calling IsConstant,
13905 because it effectively performs the lookup twice.
13907 2002-11-06 Miguel de Icaza <miguel@ximian.com>
13909 But a bogus return here to keep the semantics of the old code
13910 until the Mono runtime is fixed.
13912 * pending.cs (GetMissingInterfaces): New method used to remove all
13913 the interfaces that are already implemented by our parent
13914 classes from the list of pending methods.
13916 * interface.cs: Add checks for calls after ResolveTypeExpr.
13918 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13920 * class.cs (Class.Emit): Report warning 67: event not used if the
13921 warning level is beyond 3.
13923 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13924 being a NullLiteral.
13926 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13929 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13930 path that might fail if a type can not be resolved.
13932 * expression.cs (Binary.Emit): Emit unsigned versions of the
13935 * driver.cs: use error 5.
13937 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13939 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13941 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13943 * cs-parser.jay (switch_section): A beautiful patch from Martin
13944 Baulig that fixed 33094.
13946 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13948 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13949 Check whether the base is abstract and report an error if so.
13951 * expression.cs (IndexerAccess.DoResolveLValue,
13952 IndexerAccess.DoResolve): ditto.
13954 (Invocation.DoResolve): ditto.
13956 (Invocation.FullMethodDesc): Improve the report string.
13958 * statement.cs (Block): Eliminate IsVariableDefined as it is
13959 basically just a wrapper for GetVariableInfo.
13961 * ecore.cs (SimpleName): Use new
13963 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13964 type, as we return the actual parameter ref/unref state on a
13967 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13969 * support.cs: Return proper flags REF/OUT fixing the previous
13972 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13973 not used to mean `ref' but `ref or out' in ParameterReference
13975 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13976 full type signature instead of calling TypeManger.CSharpName
13979 * support.cs (InternalParameters.ParameterDesc): Do not compare
13980 directly to the modflags, because REF/OUT will actually be bitsets
13983 * delegate.cs (VerifyMethod): Check also the modifiers.
13985 * cs-tokenizer.cs: Fix bug where floating point values with an
13986 exponent where a sign was missing was ignored.
13988 * driver.cs: Allow multiple assemblies to be specified in a single
13991 2002-10-28 Miguel de Icaza <miguel@ximian.com>
13993 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
13994 because identifiers after a parenthesis would end up in this kind
13995 of production, and we needed to desamiguate it for having casts
13998 (UserDefinedType *) xxx
14000 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14002 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14003 we should set on the Bindingflags.NonPublic, but not turn on
14004 private_ok. private_ok controls whether a Private member is
14005 returned (this is chekced on the filter routine), while the
14006 BindingFlags.NonPublic just controls whether private/protected
14007 will be allowed. This fixes the problem part of the problem of
14008 private properties being allowed to be used in derived classes.
14010 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14011 so we can call the children DoResolveLValue method (this will
14012 properly signal errors on lvalue assignments to base properties)
14014 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14015 getter are null, and we have a property info, we know that this
14016 happened because the lookup failed, so we report an error 122 for
14017 protection level violation.
14019 We also silently return if setter and getter are null in the
14020 resolve functions, this condition only happens if we have flagged
14021 the error before. This is the other half of the problem.
14023 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14024 not have accessibility information, that is why we were returning
14025 true in the filter function in typemanager.cs.
14027 To properly report 122 (property is inaccessible because of its
14028 protection level) correctly, we report this error in ResolveAccess
14029 by failing if both the setter and the getter are lacking (ie, the
14032 DoResolve and DoLResolve have been modified to check for both
14033 setter/getter being null and returning silently, the reason being
14034 that I did not want to put the knowledge about this error in upper
14037 int old = Report.Errors;
14038 x = new PropertyExpr (...);
14039 if (old != Report.Errors)
14044 So the property expr is returned, but it is invalid, so the error
14045 will be flagged during the resolve process.
14047 * class.cs: Remove InheritablePropertySignatureCompare from the
14048 class, as we no longer depend on the property signature to compute
14049 whether it is possible to implement a method or not.
14051 The reason is that calling PropertyInfo.GetGetMethod will return
14052 null (in .NET, in Mono it works, and we should change this), in
14053 cases where the Get Method does not exist in that particular
14058 class X { public virtual int A { get { return 1; } } }
14060 class Z : Y { public override int A { get { return 2; } } }
14062 Would fail in Z because the parent (Y) would not have the property
14063 defined. So we avoid this completely now (because the alternative
14064 fix was ugly and slow), and we now depend exclusively on the
14067 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14068 reference method, instead of using the property.
14070 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14071 routines are gone now.
14073 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14074 names, they were incorrectly named.
14076 * cs-tokenizer.cs: Return are more gentle token on failure.
14078 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14079 had an out-of-sync index variable, which caused it to remove from
14080 the list of pending methods the wrong method sometimes.
14082 2002-10-22 Miguel de Icaza <miguel@ximian.com>
14084 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14085 CanWrite, because those refer to this particular instance of the
14086 property, and do not take into account the fact that we can
14087 override single members of a property.
14089 Constructor requires an EmitContext. The resolution process does
14090 not happen here, but we need to compute the accessors before,
14091 because the resolution does not always happen for properties.
14093 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14094 subclass, before we did not update this flag, but we did update
14097 (GetAccessors): Drop this routine, as it did not work in the
14098 presence of partially overwritten set/get methods.
14100 Notice that this broke the cs1540 detection, but that will require
14103 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14107 * driver.cs: issue a warning instead of an error if we don't support
14108 debugging for the platform. Also ignore a couple of errors that may
14109 arise when trying to write the symbols. Undo my previous patch.
14111 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14113 * driver.cs: ignore /debug switch except for Unix platforms.
14115 2002-10-23 Nick Drochak <ndrochak@gol.com>
14117 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14119 2002-10-21 Miguel de Icaza <miguel@ximian.com>
14121 * driver.cs: Do not make mcs-debug conditional, so we do not break
14122 builds that use it.
14124 * statement.cs (UsageVector.MergeChildren): I would like Martin to
14125 review this patch. But basically after all the children variables
14126 have been merged, the value of "Breaks" was not being set to
14127 new_breaks for Switch blocks. I think that it should be set after
14128 it has executed. Currently I set this to the value of new_breaks,
14129 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14130 conservative, but I do not understand this code very well.
14132 I did not break anything in the build, so that is good ;-)
14134 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14136 2002-10-20 Mark Crichton <crichton@gimp.org>
14138 * cfold.cs: Fixed compile blocker. Really fixed it this time.
14140 2002-10-20 Nick Drochak <ndrochak@gol.com>
14142 * cfold.cs: Fixed compile blocker.
14144 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14146 * driver.cs: I was chekcing the key, not the file.
14148 2002-10-19 Ravi Pratap <ravi@ximian.com>
14150 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14151 message that we were generating - we just need to silently return
14154 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14156 * class.cs (Event.Define): Change my previous commit, as this
14157 breaks the debugger. This is a temporary hack, as it seems like
14158 the compiler is generating events incorrectly to begin with.
14160 * expression.cs (Binary.ResolveOperator): Added support for
14161 "U operator - (E x, E y)"
14163 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14166 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14167 init-only variables, but this path did not take into account that
14168 there might be also instance readonly variables. Correct this
14171 This fixes bug 32253
14173 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14176 * driver.cs: Change the extension for modules to `netmodule'
14178 * cs-parser.jay: Improved slightly the location tracking for
14179 the debugger symbols.
14181 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14182 modifiers that were specified instead of the hardcoded value
14183 (FamAndAssem). This was basically ignoring the static modifier,
14184 and others. Fixes 32429.
14186 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14187 fixed a bug in the process (32476)
14189 * expression.cs (ArrayAccess.EmitAssign): Patch from
14190 hwang_rob@yahoo.ca that fixes bug 31834.3
14192 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14194 * driver.cs: Make the module extension .netmodule.
14196 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14198 * driver.cs: Report an error if the resource file is not found
14199 instead of crashing.
14201 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14202 false, like Emit does.
14204 2002-10-16 Nick Drochak <ndrochak@gol.com>
14206 * typemanager.cs: Remove unused private member. Also reported mcs
14207 bug to report this as a warning like csc.
14209 2002-10-15 Martin Baulig <martin@gnome.org>
14211 * statement.cs (Statement.Emit): Made this a virtual method; emits
14212 the line number info and calls DoEmit().
14213 (Statement.DoEmit): New protected abstract method, formerly knows
14214 as Statement.Emit().
14216 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14218 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14220 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14221 have fixed a remaining problem: not every AddXXXX was adding a
14222 fully qualified name.
14224 Now everyone registers a fully qualified name in the DeclSpace as
14225 being defined instead of the partial name.
14227 Downsides: we are slower than we need to be due to the excess
14228 copies and the names being registered this way.
14230 The reason for this is that we currently depend (on the corlib
14231 bootstrap for instance) that types are fully qualified, because
14232 we dump all the types in the namespace, and we should really have
14233 types inserted into the proper namespace, so we can only store the
14234 basenames in the defined_names array.
14236 2002-10-10 Martin Baulig <martin@gnome.org>
14238 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14239 from bug #31834, see the bug report for a testcase which is
14242 2002-10-10 Martin Baulig <martin@gnome.org>
14244 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14245 flow analysis code for this.
14247 * statement.cs (Do, While, For): Tell the flow analysis code about
14249 (FlowBranching.UsageVector): Added support for infinite loops.
14250 (Block.Resolve): Moved the dead code elimination here and use flow
14253 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14255 * class.cs (Field.Define): Catch cycles on struct type
14258 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14259 fields if the fields are static. We only need to check instance
14262 * expression.cs (As.DoResolve): Test for reference type.
14264 * statement.cs (Using.ResolveExpression): Use
14265 ConvertImplicitRequired, not ConvertImplicit which reports an
14267 (Using.ResolveLocalVariableDecls): ditto.
14269 * expression.cs (Binary.ResolveOperator): Report errors in a few
14270 places where we had to.
14272 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14274 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14276 * expression.cs: Use StoreFromPtr instead of extracting the type
14277 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14279 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14280 an enumeration value to a System.Enum, but System.Enum is not a
14281 value type, but an class type, so we need to box.
14283 (Expression.ConvertExplicit): One codepath could return
14284 errors but not flag them. Fix this. Fixes #31853
14286 * parameter.cs (Resolve): Do not allow void as a parameter type.
14288 2002-10-06 Martin Baulig <martin@gnome.org>
14290 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14291 if it's a class type and not a struct. Fixes #31815.
14293 2002-10-06 Martin Baulig <martin@gnome.org>
14295 * statement.cs: Reworked the flow analysis code a bit to make it
14296 usable for dead code elimination.
14298 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14300 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14302 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14304 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14305 to fix the test 165, will investigate deeper.
14307 2002-10-04 Martin Baulig <martin@gnome.org>
14309 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14310 finally blocks actually work.
14311 (Try.Resolve): We don't need to create a sibling for `finally' if
14312 there is no finally block.
14314 2002-10-04 Martin Baulig <martin@gnome.org>
14316 * class.cs (Constructor.Define): The default accessibility for a
14317 non-default constructor is private, not public.
14319 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14321 * class.cs (Constructor): Make AllowedModifiers public, add
14324 * cs-parser.jay: Perform the modifiers test here, as the
14325 constructor for the Constructor class usually receives a zero
14326 because of the way we create it (first we create, later we
14327 customize, and we were never checking the modifiers).
14329 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14330 is a version of LookupTypeReflection that includes the type-name
14331 cache. This can be used as a fast path for functions that know
14332 the fully qualified name and are only calling into *.GetType() to
14333 obtain a composed type.
14335 This is also used by TypeManager.LookupType during its type
14338 (LookupType): We now also track the real type name, as sometimes
14339 we can get a quey for the real type name from things like
14340 ComposedCast. This fixes bug 31422.
14342 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14343 complete type fullname, it does not have to go through the type
14344 resolution system to obtain the composed version of the type (for
14345 obtaining arrays or pointers).
14347 (Conditional.Emit): Use the EmitBoolExpression to
14348 generate nicer code, as requested by Paolo.
14350 (ArrayCreation.CheckIndices): Use the patch from
14351 hwang_rob@yahoo.ca to validate the array initializers.
14353 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14355 * class.cs (ConstructorInitializer.Emit): simplify code by using
14356 Invocation.EmitCall, and at the same time, fix the bugs in calling
14357 parent constructors that took variable arguments.
14359 * ecore.cs (Expression.ConvertNumericExplicit,
14360 Expression.ImplicitNumericConversion): Remove the code that
14361 manually wrapped decimal (InternalTypeConstructor call is now gone
14364 * expression.cs (Cast.TryReduce): Also handle decimal types when
14365 trying to perform a constant fold on the type.
14367 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14369 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14370 that only turned off an error report, and did nothing else.
14372 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14374 * driver.cs: Handle and ignore /fullpaths
14376 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14378 * expression.cs (Binary.ResolveOperator): Catch the case where
14379 DoNumericPromotions returns true,
14381 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14383 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14385 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14388 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14390 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14391 conversion exists, but it is also required that the conversion be
14392 performed. This manifested in "(Type64Enum) 2".
14394 * class.cs (TypeManager.AddMethod): The fix is not to change
14395 AddEnum, because that one was using a fully qualified name (every
14396 DeclSpace derivative does), but to change the AddMethod routine
14397 that was using an un-namespaced name. This now correctly reports
14398 the duplicated name.
14400 Revert patch until I can properly fix it. The issue
14401 is that we have a shared Type space across all namespaces
14402 currently, which is wrong.
14404 Options include making the Namespace a DeclSpace, and merge
14405 current_namespace/current_container in the parser.
14407 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14409 * cs-parser.jay: Improve error reporting when we get a different
14410 kind of expression in local_variable_type and
14411 local_variable_pointer_type.
14413 Propagate this to avoid missleading errors being reported.
14415 * ecore.cs (ImplicitReferenceConversion): treat
14416 TypeManager.value_type as a target just like object_type. As
14421 Is valid, and needs to result in the int 1 being boxed before it
14422 is assigned to the value type v.
14424 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14425 to validate the enumeration name.
14427 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14428 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14429 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14431 * ecore.cs (TryImplicitIntConversion): When doing an
14432 implicit-enumeration-conversion, check if the type is 64-bits and
14433 perform a conversion before passing to EnumConstant.
14435 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14437 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14438 report ambiguous type references. Unlike the MS version, we
14439 report what the ambiguity is. Innovation at work ;-)
14441 (DeclSpace.FindType): Require a location argument to
14442 display when we display an ambiguous error.
14444 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14446 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14448 * expression.cs (EmitDynamicInitializers): Apply patch from
14449 hwang_rob@yahoo.ca that fixes the order in which we emit our
14452 2002-09-21 Martin Baulig <martin@gnome.org>
14454 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14455 delegate takes no arguments.
14457 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14459 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14462 * expression.cs: Extract the underlying type.
14464 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14466 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14468 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14470 * class.cs (TypeContainer.DefineType): We can not use the nice
14471 PackingSize with the size set to 1 DefineType method, because it
14472 will not allow us to define the interfaces that the struct
14475 This completes the fixing of bug 27287
14477 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14478 means also structs. This fixes part of the problem.
14479 (Expresion.ImplicitReferenceConversionExists): ditto.
14481 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14482 error if there were no errors reported during the type lookup
14483 process, to avoid duplicates or redundant errors. Without this
14484 you would get an ambiguous errors plus a type not found. We have
14485 beaten the user enough with the first error.
14487 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14490 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14491 during the resolution process, stop the lookup, this avoids
14492 repeated error reports (same error twice).
14494 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14496 * typemanager.cs (LookupType): Redo the type lookup code to match
14497 the needs of System.Reflection.
14499 The issue is that System.Reflection requires references to nested
14500 types to begin with a "+" sign instead of a dot. So toplevel
14501 types look like: "NameSpace.TopLevelClass", and nested ones look
14502 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14505 2002-09-19 Martin Baulig <martin@gnome.org>
14507 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14508 says that a method always returns or always throws an exception,
14509 don't report the CS0161.
14511 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14512 set `Returns = new_returns'.
14514 2002-09-19 Martin Baulig <martin@gnome.org>
14516 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14517 to an enum constant, check for a CS0176.
14519 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14521 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14522 for operators that must be in pairs and report errors.
14524 * ecore.cs (SimpleName.DoResolveType): During the initial type
14525 resolution process, when we define types recursively, we must
14526 check first for types in our current scope before we perform
14527 lookups in the enclosing scopes.
14529 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14531 (Invocation.VerifyArgumentsCompat): Call
14532 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14533 I thought we were supposed to always call this, but there are a
14534 few places in the code where we dont do it.
14536 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14538 * driver.cs: Add support in -linkres and -resource to specify the
14539 name of the identifier.
14541 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14543 * ecore.cs (StandardConversionExists): Sync with the conversion
14544 code: allow anything-* to void* conversions.
14546 (FindMostSpecificSource): Use an Expression argument
14547 instead of a Type, because we might be handed over a Literal which
14548 gets a few more implicit conversions that plain types do not. So
14549 this information was being lost.
14551 Also, we drop the temporary type-holder expression when not
14554 2002-09-17 Martin Baulig <martin@gnome.org>
14556 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14557 this is an explicit interface implementation.
14559 2002-09-17 Martin Baulig <martin@gnome.org>
14561 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14562 different `IndexerName' attributes.
14564 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14565 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14566 virtual CommonResolve().
14568 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14570 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14571 and convert that to the UnderlyingType.
14573 * statement.cs (Foreach.Resolve): Indexers are just like variables
14574 or PropertyAccesses.
14576 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14577 inside quoted strings, we were not doing this before.
14579 2002-09-16 Martin Baulig <martin@gnome.org>
14581 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14582 resolve it. This is needed for the definite assignment check of the
14583 instance expression, fixes bug #29846.
14584 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14586 2002-09-16 Nick Drochak <ndrochak@gol.com>
14588 * parameter.cs: Fix compile error. Cannot reference static member
14589 from an instance object. Is this an mcs bug?
14591 2002-09-14 Martin Baulig <martin@gnome.org>
14593 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14594 multiple times. Fixes bug #30295, added test-166.cs.
14596 2002-09-14 Martin Baulig <martin@gnome.org>
14598 * statement.cs (Block.Emit): Don't emit unreachable code.
14599 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14600 `break' statements.
14601 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14603 2002-09-14 Martin Baulig <martin@gnome.org>
14605 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14608 2002-09-14 Martin Baulig <martin@gnome.org>
14610 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14611 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14612 be false on the ms runtime.
14614 2002-09-13 Martin Baulig <martin@gnome.org>
14616 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14617 the CS0038 error message.
14619 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14621 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14622 constant inside, return it.
14624 2002-09-12 Martin Baulig <martin@gnome.org>
14626 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14627 implicit conversion can be done between enum types.
14629 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14630 check whether an implicit conversion to the current enum's UnderlyingType
14631 exists and report an error if not.
14633 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14634 without debugging support.
14636 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14637 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14639 2002-09-12 Martin Baulig <martin@gnome.org>
14641 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14643 * ecore.cs (IMemberExpr.DeclaringType): New property.
14644 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14645 nonstatic member of an outer type (CS0038).
14647 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14649 * driver.cs: Activate the using-error detector at warning level
14650 4 (at least for MS-compatible APIs).
14652 * namespace.cs (VerifyUsing): Small buglett fix.
14654 * pending.cs (PendingImplementation): pass the container pointer.
14656 * interface.cs (GetMethods): Allow for recursive definition. Long
14657 term, I would like to move every type to support recursive
14658 definitions, not the current ordering mechanism that we have right
14661 The situation is this: Attributes are handled before interfaces,
14662 so we can apply attributes to interfaces. But some attributes
14663 implement interfaces, we will now handle the simple cases
14664 (recursive definitions will just get an error).
14666 * parameter.cs: Only invalidate types at the end if we fail to
14669 2002-09-09 Martin Baulig <martin@gnome.org>
14671 * ecore.cs (PropertyExpr.Emit): Also check for
14672 TypeManager.system_int_array_get_length so this'll also work when
14673 compiling corlib. Fixes #30003.
14675 2002-09-09 Martin Baulig <martin@gnome.org>
14677 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14678 and throw an exception if we can't get the type's size. Fixed #30040,
14681 2002-09-09 Martin Baulig <martin@gnome.org>
14683 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14685 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14686 context. Fixes bug #30027.
14688 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14689 virtual functions. Fixes bug #30043, added test-164.cs.
14691 2002-09-08 Ravi Pratap <ravi@ximian.com>
14693 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14695 2002-09-08 Nick Drochak <ndrochak@gol.com>
14697 * driver.cs: Use an object to get the windows codepage since it's not a
14700 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14702 * statement.cs (For.Emit): for infinite loops (test == null)
14703 return whether there is a break inside, not always "true".
14705 * namespace.cs (UsingEntry): New struct to hold the name of the
14706 using definition, the location where it is defined, and whether it
14707 has been used in a successful type lookup.
14709 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14714 2002-09-06 Ravi Pratap <ravi@ximian.com>
14716 * attribute.cs : Fix incorrect code which relied on catching
14717 a NullReferenceException to detect a null being passed in
14718 where an object was expected.
14720 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14722 * statement.cs (Try): flag the catch variable as assigned
14724 * expression.cs (Cast): Simplified by using ResolveType instead of
14725 manually resolving.
14727 * statement.cs (Catch): Fix bug by using ResolveType.
14729 2002-09-06 Ravi Pratap <ravi@ximian.com>
14731 * expression.cs (BetterConversion): Special case for when we have
14732 a NullLiteral as the argument and we have to choose between string
14733 and object types - we choose string the way csc does.
14735 * attribute.cs (Attribute.Resolve): Catch the
14736 NullReferenceException and report error #182 since the Mono
14737 runtime no more has the bug and having this exception raised means
14738 we tried to select a constructor which takes an object and is
14741 2002-09-05 Ravi Pratap <ravi@ximian.com>
14743 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14744 message (1502, 1503) when we can't locate a method after overload
14745 resolution. This is much more informative and closes the bug
14748 * interface.cs (PopulateMethod): Return if there are no argument
14749 types. Fixes a NullReferenceException bug.
14751 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14752 expressions too. Previously we were checking only in one place for
14753 positional arguments leaving out named arguments.
14755 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14756 type to the enum type is not allowed. Remove code corresponding to
14759 (ConvertNumericExplicit): Allow explicit conversions from
14760 the underlying type to enum type. This precisely follows the spec
14761 and closes a bug filed by Gonzalo.
14763 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14766 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14768 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14770 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14771 it was important that we stored the right value after the
14772 reduction in `converted'.
14774 2002-09-04 Martin Baulig <martin@gnome.org>
14776 * location.cs (Location.SymbolDocument): Use full pathnames for the
14779 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14781 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14782 of the expression resolve mechanism, because that will catch the
14783 SimpleName error failures.
14785 (Conditional): If we can not resolve the
14786 expression, return, do not crash.
14788 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14791 (location): display token name instead of its number.
14793 2002-08-28 Martin Baulig <martin@gnome.org>
14795 * expression.cs (Binary.ResolveOperator): Don't silently return
14796 but return an error if an operator cannot be applied between two
14799 2002-08-28 Martin Baulig <martin@gnome.org>
14801 * class.cs (Constructor.Define): Set the permission attributes
14802 correctly instead of making all constructors public.
14804 2002-08-28 Martin Baulig <martin@gnome.org>
14806 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14807 for private members before reporting a CS0103; if we find anything,
14810 2002-08-28 Martin Baulig <martin@gnome.org>
14812 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14813 to check whether `closure_start_type == closure_invocation_type',
14814 we also need to check whether `m.DeclaringType == closure_invocation_type'
14815 before bypassing the permission checks. We might be accessing
14816 protected/private members from the base class.
14817 (TypeManager.RealMemberLookup): Only set private_ok if private
14818 members were requested via BindingFlags.NonPublic.
14820 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14822 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14823 MethodGroupExpr.IsExplicitImpl if appropriate.
14824 (Invocation.DoResolve): Don't report the CS0120 for explicit
14825 interface implementations.
14827 2002-08-27 Martin Baulig <martin@gnome.org>
14829 * expression.cs (Invocation.DoResolve): If this is a static
14830 method and we don't have an InstanceExpression, we must report
14833 2002-08-25 Martin Baulig <martin@gnome.org>
14835 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14836 `==' between a valuetype and an object.
14838 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14840 * ecore.cs (TypeExpr): Provide a ToString method.
14842 2002-08-24 Martin Baulig <martin@gnome.org>
14844 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14845 now called proggie.dbg and it's a binary file.
14847 2002-08-23 Martin Baulig <martin@gnome.org>
14849 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14851 2002-08-23 Martin Baulig <martin@gnome.org>
14853 * struct.cs (MyStructInfo.ctor): Make this work with empty
14854 structs; it's not allowed to use foreach() on null.
14856 2002-08-23 Martin Baulig <martin@gnome.org>
14858 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14859 writer the full pathname of the generated assembly.
14861 2002-08-23 Martin Baulig <martin@gnome.org>
14863 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14864 A `finally' block never returns or breaks; improved handling of
14867 2002-08-23 Martin Baulig <martin@gnome.org>
14869 * statement.cs (Throw.Resolve): Allow `throw null'.
14871 2002-08-23 Martin Baulig <martin@gnome.org>
14873 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14874 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14875 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
14876 MemberLookup would return a wrong event if this is an explicit
14877 interface implementation and the class has an event with the same
14880 2002-08-23 Martin Baulig <martin@gnome.org>
14882 * statement.cs (Block.AddChildVariableNames): New public method.
14883 (Block.AddChildVariableName): Likewise.
14884 (Block.IsVariableNameUsedInChildBlock): Likewise.
14885 (Block.AddVariable): Check whether a variable name has already
14886 been used in a child block.
14888 * cs-parser.jay (declare_local_variables): Mark all variable names
14889 from the current block as being used in a child block in the
14892 2002-08-23 Martin Baulig <martin@gnome.org>
14894 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14895 find the symbol writer.
14897 * driver.cs: csc also allows the arguments to /define being
14898 separated by commas, not only by semicolons.
14900 2002-08-23 Martin Baulig <martin@gnome.org>
14902 * interface.cs (Interface.GetMembers): Added static check for events.
14904 2002-08-15 Martin Baulig <martin@gnome.org>
14906 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14907 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14909 * ecore.cs (Expression.MemberLookup): Added documentation and explained
14910 why the MethodData.EmitDestructor() change was necessary.
14912 2002-08-20 Martin Baulig <martin@gnome.org>
14914 * class.cs (TypeContainer.FindMembers): Added static check for events.
14916 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14918 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14919 use Type.GetEvents(), not Type.FindMembers().
14921 2002-08-20 Martin Baulig <martin@gnome.org>
14923 * decl.cs (MemberCache): Added a special method cache which will
14924 be used for method-only searched. This ensures that a method
14925 search will return a MethodInfo with the correct ReflectedType for
14928 2002-08-20 Martin Baulig <martin@gnome.org>
14930 * decl.cs (DeclSpace.FindMembers): Made this public.
14932 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14934 * delegate.cs: fixed build on windows.
14935 [FIXME: Filed as bug #29150: MCS must report these errors.]
14937 2002-08-19 Ravi Pratap <ravi@ximian.com>
14939 * ecore.cs (StandardConversionExists): Return a false
14940 if we are trying to convert the void type to anything else
14941 since that is not allowed.
14943 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14944 we flag error 70 in the event an event is trying to be accessed
14945 directly from outside the declaring type.
14947 2002-08-20 Martin Baulig <martin@gnome.org>
14949 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14950 MemberCache from typemanager.cs to decl.cs.
14952 2002-08-19 Martin Baulig <martin@gnome.org>
14954 * class.cs (TypeContainer): Implement IMemberContainer.
14955 (TypeContainer.DefineMembers): Create the MemberCache.
14956 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14957 return public members if BindingFlags.Public was given, check
14958 whether members are static.
14960 2002-08-16 Martin Baulig <martin@gnome.org>
14962 * decl.cs (DeclSpace.Define): Splitted this in Define and
14963 DefineMembers. DefineMembers is called first and initializes the
14966 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14967 DefineMembers() on all our DeclSpaces.
14969 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14970 but call DefineMembers() on all nested interfaces. We call their
14971 Define() in our new Define() function.
14973 * interface.cs (Interface): Implement IMemberContainer.
14974 (Interface.Define): Moved all code except the attribute stuf to
14976 (Interface.DefineMembers): Initialize the member cache.
14978 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14979 need this anymore since we can use MemberCache.FindMembers directly.
14981 2002-08-19 Martin Baulig <martin@gnome.org>
14983 * typemanager.cs (MemberCache): When creating the cache for an
14984 interface type, add all inherited members.
14985 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14986 to `out bool used_cache' and documented it.
14987 (TypeManager.MemberLookup): If we already used the cache in the first
14988 iteration, we don't need to do the interfaces check.
14990 2002-08-19 Martin Baulig <martin@gnome.org>
14992 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
14993 here from IMemberFinder and don't implement this interface anymore.
14994 (DeclSpace.MemberCache): Moved here from IMemberFinder.
14996 * typemanager.cs (IMemberFinder): This interface is now only used by
14997 classes which actually support the member cache.
14998 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14999 since we only put DeclSpaces into this Hashtable.
15000 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15001 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15003 2002-08-16 Martin Baulig <martin@gnome.org>
15005 * typemanager.cs (ICachingMemberFinder): Removed.
15006 (IMemberFinder.MemberCache): New property.
15007 (TypeManager.FindMembers): Merged this with RealFindMembers().
15008 This function will never be called from TypeManager.MemberLookup()
15009 so we can't use the cache here, just the IMemberFinder.
15010 (TypeManager.MemberLookup_FindMembers): Check whether the
15011 IMemberFinder has a MemberCache and call the cache's FindMembers
15013 (MemberCache): Rewrote larger parts of this yet another time and
15014 cleaned it up a bit.
15016 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15018 * driver.cs (LoadArgs): Support quoting.
15020 (Usage): Show the CSC-like command line arguments.
15022 Improved a few error messages.
15024 2002-08-15 Martin Baulig <martin@gnome.org>
15026 * typemanager.cs (IMemberContainer.Type): New property.
15027 (IMemberContainer.IsInterface): New property.
15029 The following changes are conditional to BROKEN_RUNTIME, which is
15030 defined at the top of the file.
15032 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15033 class'es members, but add all members from TypeHandle.ObjectType
15034 if we're an interface.
15035 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15036 is the current type.
15037 (MemberCache.CacheEntry.Container): Removed this field.
15038 (TypeHandle.GetMembers): Include inherited members.
15040 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15042 * typemanager.cs: fixed compilation and added a comment on a field that
15045 2002-08-15 Martin Baulig <martin@gnome.org>
15047 * class.cs (ConstructorInitializer.Resolve): In the
15048 Expression.MemberLookup call, use the queried_type as
15051 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15052 declared' attribute, it's always true.
15053 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15054 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15055 temporary wrapper for FindMembers which tells MemberLookup whether
15056 members from the base classes are included in the return value.
15057 This will go away soon.
15058 (TypeManager.MemberLookup): Use this temporary hack here; once the
15059 new MemberCache is completed, we don't need to do the DeclaredOnly
15060 looping here anymore since the MemberCache will take care of this.
15061 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15062 (MemberCache): When creating the MemberCache for a class, get
15063 members from the current class and all its base classes.
15064 (MemberCache.CacheEntry.Container): New field. This is a
15065 temporary hack until the Mono runtime is fixed to distinguish
15066 between ReflectedType and DeclaringType. It allows us to use MCS
15067 with both the MS runtime and the unfixed Mono runtime without
15068 problems and without accecting performance.
15069 (MemberCache.SearchMembers): The DeclaredOnly looping from
15070 TypeManager.MemberLookup is now done here.
15072 2002-08-14 Martin Baulig <martin@gnome.org>
15074 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15075 Type.GetFields on dynamic types but get the fields from the
15076 corresponding TypeContainer.
15077 (MyStructInfo.GetStructInfo): Added check for enum types.
15079 * typemanager.cs (MemberList.IsSynchronized): Implemented.
15080 (MemberList.SyncRoot): Implemented.
15081 (TypeManager.FilterWithClosure): No need to check permissions if
15082 closure_start_type == closure_invocation_type, don't crash if
15083 closure_invocation_type is null.
15085 2002-08-13 Martin Baulig <martin@gnome.org>
15087 Rewrote TypeContainer.FindMembers to use a member cache. This
15088 gives us a speed increase of about 35% for the self-hosting MCS
15089 build and of about 15-20% for the class libs (both on GNU/Linux).
15091 * report.cs (Timer): New class to get enhanced profiling. This
15092 whole class is "TIMER" conditional since it remarkably slows down
15095 * class.cs (MemberList): New class. This is an IList wrapper
15096 which we're now using instead of passing MemberInfo[]'s around to
15097 avoid copying this array unnecessarily.
15098 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15099 (ICachingMemberFinder, IMemberContainer): New interface.
15100 (TypeManager.FilterWithClosure): If `criteria' is null, the name
15101 has already been checked, otherwise use it for the name comparision.
15102 (TypeManager.FindMembers): Renamed to RealMemberFinder and
15103 provided wrapper which tries to use ICachingMemberFinder.FindMembers
15104 if possible. Returns a MemberList, not a MemberInfo [].
15105 (TypeHandle): New class, implements IMemberContainer. We create
15106 one instance of this class per type, it contains a MemberCache
15107 which is used to do the member lookups.
15108 (MemberCache): New class. Each instance of this class contains
15109 all members of a type and a name-based hash table.
15110 (MemberCache.FindMembers): This is our new member lookup
15111 function. First, it looks up all members of the requested name in
15112 the hash table. Then, it walks this list and sorts out all
15113 applicable members and returns them.
15115 2002-08-13 Martin Baulig <martin@gnome.org>
15117 In addition to a nice code cleanup, this gives us a performance
15118 increase of about 1.4% on GNU/Linux - not much, but it's already
15119 half a second for the self-hosting MCS compilation.
15121 * typemanager.cs (IMemberFinder): New interface. It is used by
15122 TypeManager.FindMembers to call FindMembers on a TypeContainer,
15123 Enum, Delegate or Interface.
15124 (TypeManager.finder_to_member_finder): New PtrHashtable.
15125 (TypeManager.finder_to_container): Removed.
15126 (TypeManager.finder_to_delegate): Removed.
15127 (TypeManager.finder_to_interface): Removed.
15128 (TypeManager.finder_to_enum): Removed.
15130 * interface.cs (Interface): Implement IMemberFinder.
15132 * delegate.cs (Delegate): Implement IMemberFinder.
15134 * enum.cs (Enum): Implement IMemberFinder.
15136 * class.cs (TypeContainer): Implement IMemberFinder.
15138 2002-08-12 Martin Baulig <martin@gnome.org>
15140 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15142 2002-08-12 Martin Baulig <martin@gnome.org>
15144 * ecore.cs (ITypeExpression): New interface for expressions which
15146 (TypeExpression): Renamed to TypeLookupExpression.
15147 (Expression.DoResolve): If we're doing a types-only lookup, the
15148 expression must implement the ITypeExpression interface and we
15149 call DoResolveType() on it.
15150 (SimpleName): Implement the new ITypeExpression interface.
15151 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15152 hack, the situation that we're only looking up types can't happen
15153 anymore when this method is called. Moved the type lookup code to
15154 DoResolveType() and call it.
15155 (SimpleName.DoResolveType): This ITypeExpression interface method
15156 is now doing the types-only lookup.
15157 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15158 (ResolveFlags): Added MaskExprClass.
15160 * expression.cs (MemberAccess): Implement the ITypeExpression
15162 (MemberAccess.DoResolve): Added support for a types-only lookup
15163 when we're called via ITypeExpression.DoResolveType().
15164 (ComposedCast): Implement the ITypeExpression interface.
15166 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15167 Expression.Resolve() with ResolveFlags.Type instead.
15169 2002-08-12 Martin Baulig <martin@gnome.org>
15171 * interface.cs (Interface.Define): Apply attributes.
15173 * attribute.cs (Attribute.ApplyAttributes): Added support for
15174 interface attributes.
15176 2002-08-11 Martin Baulig <martin@gnome.org>
15178 * statement.cs (Block.Emit): Only check the "this" variable if we
15179 do not always throw an exception.
15181 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15182 whether the property has a set accessor.
15184 2002-08-11 Martin Baulig <martin@gnome.org>
15186 Added control flow analysis support for structs.
15188 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15189 with control flow analysis turned off.
15190 (IVariable): New interface.
15191 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15192 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15193 (FieldExpr.DoResolve): Resolve the instance expression with flow
15194 analysis turned off and do the definite assignment check after the
15195 resolving when we know what the expression will resolve to.
15197 * expression.cs (LocalVariableReference, ParameterReference):
15198 Implement the new IVariable interface, only call the flow analysis
15199 code if ec.DoFlowAnalysis is true.
15200 (This): Added constructor which takes a Block argument. Implement
15201 the new IVariable interface.
15202 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15203 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15204 This does the definite assignment checks for struct members.
15206 * class.cs (Constructor.Emit): If this is a non-static `struct'
15207 constructor which doesn't have any initializer, call
15208 Block.AddThisVariable() to tell the flow analysis code that all
15209 struct elements must be initialized before control returns from
15212 * statement.cs (MyStructInfo): New public class.
15213 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15214 argument to this indexer. If non-zero, check an individual struct
15215 member, not the whole struct.
15216 (FlowBranching.CheckOutParameters): Check struct members.
15217 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15218 overloaded versions of these methods which take an additional
15219 `int field_idx' argument to check struct members.
15220 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15221 overloaded versions of these methods which take an additional
15222 `string field_name' argument to check struct member.s
15223 (VariableInfo): Implement the IVariable interface.
15224 (VariableInfo.StructInfo): New public property. Returns the
15225 MyStructInfo instance of the variable if it's a struct or null.
15226 (Block.AddThisVariable): New public method. This is called from
15227 Constructor.Emit() for non-static `struct' constructor which do
15228 not have any initializer. It creates a special variable for the
15229 "this" instance variable which will be checked by the flow
15230 analysis code to ensure that all of the struct's fields are
15231 initialized before control returns from the constructor.
15232 (UsageVector): Added support for struct members. If a
15233 variable/parameter is a struct with N members, we reserve a slot
15234 in the usage vector for each member. A struct is considered fully
15235 initialized if either the struct itself (slot 0) or all its
15236 members are initialized.
15238 2002-08-08 Martin Baulig <martin@gnome.org>
15240 * driver.cs (Driver.MainDriver): Only report an error CS5001
15241 if there were no compilation errors.
15243 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15244 `UnsafeContext' property to determine whether the parent is in
15245 unsafe context rather than checking the parent's ModFlags:
15246 classes nested in an unsafe class are unsafe as well.
15248 2002-08-08 Martin Baulig <martin@gnome.org>
15250 * statement.cs (UsageVector.MergeChildren): Distinguish between
15251 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15252 we return. Added test17() and test18() to test-154.cs.
15254 2002-08-08 Martin Baulig <martin@gnome.org>
15256 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15257 Family access, make sure the invoking type isn't a subclass of the
15258 queried type (that'd be a CS1540).
15260 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15261 this method which takes an additional `Type invocation_type'.
15263 * expression.cs (BaseAccess.DoResolve): Use the base type as
15264 invocation and query type.
15265 (MemberAccess.DoResolve): If the lookup failed and we're about to
15266 report a CS0122, try a lookup with the ec.ContainerType - if this
15267 succeeds, we must report a CS1540.
15269 2002-08-08 Martin Baulig <martin@gnome.org>
15271 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15272 (MethodGroupExpr): Implement the IMemberExpr interface.
15274 * expression (MemberAccess.ResolveMemberAccess): No need to have
15275 any special code for MethodGroupExprs anymore, they're now
15278 2002-08-08 Martin Baulig <martin@gnome.org>
15280 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15281 Family, FamANDAssem and FamORAssem permissions.
15282 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15284 2002-08-08 Martin Baulig <martin@gnome.org>
15286 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15287 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15290 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15292 * driver.cs: implemented /resource option to embed managed resources.
15294 2002-08-07 Martin Baulig <martin@gnome.org>
15296 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15297 (FieldBase.HasFieldInitializer): New public property.
15298 (FieldBase.GetInitializerExpression): New public method. Resolves and
15299 returns the field initializer and makes sure it is only resolved once.
15300 (TypeContainer.EmitFieldInitializers): Call
15301 FieldBase.GetInitializerExpression to get the initializer, this ensures
15302 that it isn't resolved multiple times.
15304 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15305 the resolving process (SimpleName/MemberLookup) that we're currently
15306 emitting a field initializer (which must not access any instance members,
15307 this is an error CS0236).
15309 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15310 argument, if the `IsFieldInitializer' flag is set, we must report and
15311 error CS0236 and not an error CS0120.
15313 2002-08-07 Martin Baulig <martin@gnome.org>
15315 * ecore.cs (IMemberExpr): New public interface.
15316 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15317 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15318 if the expression is an IMemberExpr.
15320 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15321 to be null, implicitly default to `this' if we're non-static in
15322 this case. Simplified the code a lot by using the new IMemberExpr
15323 interface. Also fixed bug #28176 here.
15325 2002-08-06 Martin Baulig <martin@gnome.org>
15327 * cs-parser.jay (SimpleLookup): Removed. We need to create
15328 ParameterReferences during semantic analysis so that we can do a
15329 type-only search when resolving Cast, TypeOf and SizeOf.
15330 (block): Pass the `current_local_parameters' to the Block's
15333 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15334 argument to the constructor.
15335 (ConstructorInitializer.Resolve): Create a temporary implicit
15336 block with the parameters.
15338 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15339 references here if we aren't doing a type-only search.
15341 * statement.cs (Block): Added constructor which takes a
15342 `Parameters parameters' argument.
15343 (Block.Parameters): New public property.
15345 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15346 to `Parameters' and made it public readonly.
15348 2002-08-06 Martin Baulig <martin@gnome.org>
15350 * ecore.cs (Expression.Warning): Made this public as well.
15352 * report.cs (Report.Debug): Print the contents of collections.
15354 2002-08-06 Martin Baulig <martin@gnome.org>
15356 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15357 used to tell Resolve() which kinds of expressions it may return.
15358 (Expression.Resolve): Added overloaded version of this method which
15359 takes a `ResolveFlags flags' argument. This can be used to tell
15360 Resolve() which kinds of expressions it may return. Reports a
15362 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15363 ResolveFlags.SimpleName.
15364 (Expression.Error118): Added overloaded version of this method which
15365 takes a `ResolveFlags flags' argument. It uses the flags to determine
15366 which kinds of expressions are allowed.
15368 * expression.cs (Argument.ResolveMethodGroup): New public method.
15369 Resolves an argument, but allows a MethodGroup to be returned.
15370 This is used when invoking a delegate.
15372 * TODO: Updated a bit.
15374 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15376 Fixed compilation with csc.
15378 * ecore.cs: Expression.Error made public. Is this correct? Should
15379 Warning be made public too?
15381 * expression.cs: use ea.Location instead of ea.loc.
15382 [FIXME: Filed as bug #28607: MCS must report these errors.]
15384 2002-08-06 Martin Baulig <martin@gnome.org>
15386 * ecore.cs (Expression.loc): Moved the location here instead of
15387 duplicating it in all derived classes.
15388 (Expression.Location): New public property.
15389 (Expression.Error, Expression.Warning): Made them non-static and
15390 removed the location argument.
15391 (Expression.Warning): Added overloaded version which takes an
15392 `int level' argument.
15393 (Expression.Error118): Make this non-static and removed the
15394 expression and location arguments.
15395 (TypeExpr): Added location argument to the constructor.
15397 * expression.cs (StaticCallExpr): Added location argument to
15399 (Indirection, PointerArithmetic): Likewise.
15400 (CheckedExpr, UnCheckedExpr): Likewise.
15401 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15402 (StringPtr): Likewise.
15405 2002-08-05 Martin Baulig <martin@gnome.org>
15407 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15409 * assign.cs (Assign.DoResolve): Check whether the source
15410 expression is a value or variable.
15412 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15413 while resolving the corresponding blocks.
15415 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15416 an error, don't silently return null.
15418 * statement.cs (Block.AddVariable): Do the error reporting here
15419 and distinguish between CS0128 and CS0136.
15420 (Block.DoResolve): Report all unused labels (warning CS0164).
15421 (LabeledStatement): Pass the location to the constructor.
15422 (LabeledStatement.HasBeenReferenced): New property.
15423 (LabeledStatement.Resolve): Set it to true here.
15425 * statement.cs (Return.Emit): Return success even after reporting
15426 a type mismatch error (CS0126 or CS0127), this is what csc does and
15427 it avoids confusing the users with any consecutive errors.
15429 2002-08-05 Martin Baulig <martin@gnome.org>
15431 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15433 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15435 * expression.cs (MemberAccess.DoResolve): Silently return if an
15436 error has already been reported.
15438 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15439 error has already been reported.
15441 2002-08-05 Martin Baulig <martin@gnome.org>
15443 * statement.cs (UsageVector): Only initialize the `parameters'
15444 vector if we actually have any "out" parameters.
15446 2002-08-05 Martin Baulig <martin@gnome.org>
15448 * expression.cs (Binary.ResolveOperator): When combining delegates,
15449 they must have the same type.
15451 2002-08-05 Martin Baulig <martin@gnome.org>
15453 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15454 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15455 work with the ms runtime and we also don't need it: if we're a
15456 PropertyBuilder and not in the `indexer_arguments' hash, then we
15457 are a property and not an indexer.
15459 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15460 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15461 since the latter one doesn't work with the ms runtime.
15463 2002-08-03 Martin Baulig <martin@gnome.org>
15465 Fixed bugs #27998 and #22735.
15467 * class.cs (Method.IsOperator): New public field.
15468 (Method.CheckBase): Report CS0111 if there's already a method
15469 with the same parameters in the current class. Report CS0508 when
15470 attempting to change the return type of an inherited method.
15471 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15472 and it's not marked abstract or extern.
15473 (PropertyBase): New abstract base class for Property and Indexer.
15474 (PropertyBase.CheckBase): Moved here from Property and made it work
15476 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15477 the same so we can reuse it there.
15478 (Property, Indexer): Derive from PropertyBase.
15479 (MethodSignature.inheritable_property_signature_filter): New delegate
15480 to find properties and indexers.
15482 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15483 argument and improved error reporting.
15485 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15486 EmptyReadOnlyParameters and made it a property.
15488 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15489 version of this method which takes a `PropertyInfo indexer'.
15490 (TypeManager.RegisterIndexer): New method.
15492 * class.cs: Added myself as author of this file :-)
15494 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15496 * class.cs: fixed compilation on windoze.
15498 2002-08-03 Martin Baulig <martin@gnome.org>
15500 * interface.cs (Interface.GetInterfaceBases): Check whether all
15501 base interfaces are at least as accessible than the current one.
15503 * class.cs (TypeContainer.GetClassBases): Check whether base types
15504 are at least as accessible than the current type.
15505 (TypeContainer.AsAccessible): Implemented and made non-static.
15506 (MemberBase.CheckParameters): Report errors if the accessibility
15509 * delegate.cs (Delegate.Delegate): The default visibility is
15510 internal for top-level types and private for nested types.
15511 (Delegate.Define): Report errors if the accessibility checks fail.
15513 * enum.cs (Enum.Enum): The default visibility is internal for
15514 top-level types and private for nested types.
15515 (Enum.DefineType): Compute the correct visibility.
15517 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15518 function which takes a `bool is_toplevel' instead of a TypeContainer.
15520 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15523 2002-08-02 Martin Baulig <martin@gnome.org>
15525 * expression.cs (LocalVariableReferenc): Added constructor which
15526 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15527 (LocalVariableReference.IsReadOnly): New property.
15528 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15529 variable is readonly, use our own readonly flag to do this; you can
15530 use the new constructor to get a writable reference to a read-only
15533 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15534 reference to the local variable.
15536 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15538 * rootcontext.cs (ResolveCore): Also include System.Exception
15540 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15541 we reach an EmptyStatement.
15543 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15546 * expression.cs (Binary.ResolveOperator): Check error result in
15549 use brtrue/brfalse directly and avoid compares to null.
15551 2002-08-02 Martin Baulig <martin@gnome.org>
15553 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15554 Fixes bug #28407, added test-155.cs.
15556 2002-08-01 Martin Baulig <martin@gnome.org>
15558 * class.cs (Event.EmitDefaultMethod): Make this work with static
15559 events. Fixes #28311, added verify-3.cs.
15561 2002-08-01 Martin Baulig <martin@gnome.org>
15563 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15564 `is_disposable' fields.
15565 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15566 `hm.is_disposable' if we're using the collection pattern.
15567 (Foreach.EmitCollectionForeach): Use the correct type for the
15568 enumerator's local variable, only emit the try/finally block if
15569 necessary (fixes #27713).
15571 2002-08-01 Martin Baulig <martin@gnome.org>
15573 * ecore.cs (Expression.report118): Renamed to Error118 and made
15576 * statement.cs (Throw.Resolve): Check whether the expression is of
15577 the correct type (CS0118) and whether the type derives from
15578 System.Exception (CS0155).
15579 (Catch.Resolve): New method. Do the type lookup here and check
15580 whether it derives from System.Exception (CS0155).
15581 (Catch.CatchType, Catch.IsGeneral): New public properties.
15583 * typemanager.cs (TypeManager.exception_type): Added.
15585 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15587 * driver.cs: Updated About function.
15589 2002-07-31 Martin Baulig <martin@gnome.org>
15591 Implemented Control Flow Analysis.
15593 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15594 (EmitContext.CurrentBranching): Added.
15595 (EmitContext.StartFlowBranching): Added.
15596 (EmitContext.EndFlowBranching): Added.
15597 (EmitContext.KillFlowBranching): Added.
15598 (EmitContext.IsVariableAssigned): Added.
15599 (EmitContext.SetVariableAssigned): Added.
15600 (EmitContext.IsParameterAssigned): Added.
15601 (EmitContext.SetParameterAssigned): Added.
15602 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15603 Added control flow analysis stuff here.
15605 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15606 resolve the expression as lvalue.
15607 (LocalVariableReference.DoResolve): Check whether the variable has
15608 already been assigned.
15609 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15610 the parameter as assigned here.
15611 (ParameterReference.DoResolve): Check whether the parameter has already
15613 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15614 expression as lvalue.
15616 * statement.cs (FlowBranching): New class for the flow analysis code.
15617 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15618 (LabeledStatement.IsDefined): New public property.
15619 (LabeledStatement.AddUsageVector): New public method to tell flow
15620 analyis that the label may be reached via a forward jump.
15621 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15623 (VariableInfo.Number): New public field. This is used by flow analysis
15624 to number all locals of a block.
15625 (Block.CountVariables): New public property. This is the number of
15626 local variables in this block (including the locals from all parent
15628 (Block.EmitMeta): Number all the variables.
15630 * statement.cs: Added flow analysis support to all classes.
15632 2002-07-31 Martin Baulig <martin@gnome.org>
15634 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15635 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15636 then use this argument.
15638 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15640 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15641 use this to specify /define options.
15643 2002-07-29 Martin Baulig <martin@gnome.org>
15645 * statement.cs (Fixed): Moved all code that does variable lookups
15646 and resolvings from Emit to Resolve.
15648 * statement.cs (For): Moved all code that does variable lookups
15649 and resolvings from Emit to Resolve.
15651 * statement.cs (Using): Moved all code that does variable lookups
15652 and resolvings from Emit to Resolve.
15654 2002-07-29 Martin Baulig <martin@gnome.org>
15656 * attribute.cs (Attribute.Resolve): Explicitly catch a
15657 System.NullReferenceException when creating the
15658 CustromAttributeBuilder and report a different warning message.
15660 2002-07-29 Martin Baulig <martin@gnome.org>
15662 * support.cs (ParameterData.ParameterName): Added method to
15663 get the name of a parameter.
15665 * typemanager.cs (TypeManager.IsValueType): New public method.
15667 2002-07-29 Martin Baulig <martin@gnome.org>
15669 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15670 is a flag which specifies that it's either ref or out.
15671 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15672 the out parameter to `out Parameter.Modifier mod', also set the
15673 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15675 * support.cs (InternalParameters.ParameterModifier): Distinguish
15676 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15677 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15679 * expression.cs (Argument.GetParameterModifier): Distinguish
15680 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15681 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15683 2002-07-29 Martin Baulig <martin@gnome.org>
15685 * expression.cs (ParameterReference.ParameterReference): Added
15686 `Location loc' argument to the constructor.
15688 * cs-parser.jay: Pass location to ParameterReference.
15690 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15692 * statement.cs (Try): Initialize the location.
15694 * cs-parser.jay: pass location to Try.
15696 * expression.cs (Unary.Reduce): Change the prototype to return
15697 whether a constant fold could be performed or not. The result is
15698 returned in an out parameters. In the case of Indirection and
15699 AddressOf, we want to perform the full tests.
15701 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15703 * statement.cs (Statement.Emit): Flag dead code.
15705 2002-07-27 Andrew Birkett <andy@nobugs.org>
15707 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15709 2002-07-27 Martin Baulig <martin@gnome.org>
15711 * class.cs (MethodData.Define): Put back call to
15712 TypeManager.AddMethod(), accidentally commented this out.
15714 * report.cs (Debug): New public method to print debugging information,
15715 this is `[Conditional ("DEBUG")]'.
15717 2002-07-26 Martin Baulig <martin@gnome.org>
15719 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15720 (switch_statement): Push the current_block to the switch_stack and
15721 pop it again when we're done with the switch.
15722 (switch_section): The new block is a child of the current_block.
15723 Fixes bug #24007, added test-152.cs.
15725 2002-07-27 Martin Baulig <martin@gnome.org>
15727 * expression.cs (Invocation.EmitArguments): When calling a varargs
15728 function with only its fixed arguments, we need to pass an empty
15731 2002-07-27 Martin Baulig <martin@gnome.org>
15733 Mono 0.13 has been released.
15735 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15737 * driver.cs: Rename --resource to --linkres, because that is what
15738 we do currently, we dont support --resource yet.
15740 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15742 2002-07-25 Martin Baulig <martin@gnome.org>
15744 * class.cs (MethodData): New public class. This is a `method builder'
15745 class for a method or one accessor of a Property/Indexer/Event.
15746 (MethodData.GetMethodFlags): Moved here from MemberBase.
15747 (MethodData.ApplyAttributes): Likewise.
15748 (MethodData.ApplyObsoleteAttribute): Likewise.
15749 (MethodData.ApplyConditionalAttribute): Likewise.
15750 (MethodData.ApplyDllImportAttribute): Likewise.
15751 (MethodData.CheckAbstractAndExternal): Likewise.
15752 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15753 (MethodData.Emit): Formerly known as Method.Emit().
15754 (MemberBase): Moved everything which was specific to a single
15755 accessor/method to MethodData.
15756 (Method): Create a new MethodData and call Define() and Emit() on it.
15757 (Property, Indexer, Event): Create a new MethodData objects for each
15758 accessor and call Define() and Emit() on them.
15760 2002-07-25 Martin Baulig <martin@gnome.org>
15762 Made MethodCore derive from MemberBase to reuse the code from there.
15763 MemberBase now also checks for attributes.
15765 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15766 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15768 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15769 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15770 (MemberBase.ApplyAttributes): New virtual method; applies the
15771 attributes to a method or accessor.
15772 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15773 (MemberBase.ApplyConditionalAttribute): Likewise.
15774 (MemberBase.ApplyDllImportAttribute): Likewise.
15775 (MemberBase.CheckAbstractAndExternal): Likewise.
15776 (MethodCore.ParameterTypes): This is now a property instead of a
15777 method, it's initialized from DoDefineParameters().
15778 (MethodCore.ParameterInfo): Removed the set accessor.
15779 (MethodCore.DoDefineParameters): New protected virtual method to
15780 initialize ParameterTypes and ParameterInfo.
15781 (Method.GetReturnType): We can now simply return the MemberType.
15782 (Method.GetMethodFlags): Override the MemberBase version and add
15783 the conditional flags.
15784 (Method.CheckBase): Moved some code from Define() here, call
15785 DoDefineParameters() here.
15786 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15787 here to avoid some larger code duplication.
15788 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15789 ensure that abstract and external accessors don't declare a body.
15791 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15792 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15793 lookup in the attribute's parent classes, so we need to abort as soon
15794 as we found the first match.
15795 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15796 the attribute has no arguments.
15798 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15801 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15803 * cs-parser.jay: reverted previous patch.
15805 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15807 * cs-parser.jay: fixed bug #22119.
15809 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15811 * attribute.cs: fixed compilation. The error was:
15812 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15813 be assigned to before control leaves the current method."
15814 [FIXME: Filed as bug #28186: MCS must report this error.]
15816 2002-07-25 Martin Baulig <martin@gnome.org>
15818 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15819 method to pull the condition name ouf of a Conditional attribute.
15820 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15821 the obsolete message and error flag out of an Obsolete attribute.
15823 * class.cs (Method.GetMethodFlags): New public method to get the
15824 TypeManager.MethodFlags for this method.
15825 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15827 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15828 if we're overriding a virtual function, set the new private variable
15829 `parent_method'; call the new TypeManager.AddMethod().
15831 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15832 the MethodBuilder and the Method in a PtrHashtable.
15833 (TypeManager.builder_to_method): Added for this purpose.
15834 (TypeManager.MethodFlags): Added IsObsoleteError.
15835 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15836 Obsolete and Conditional arguments in MethodBuilders. If we discover
15837 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15838 the message from the attribute.
15840 2002-07-24 Martin Baulig <martin@gnome.org>
15842 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15843 preprocessor directives, ensure that the argument to #define/#undef is
15844 exactly one identifier and that it's actually an identifier.
15846 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15849 2002-07-24 Martin Baulig <martin@gnome.org>
15851 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15852 initialize it to TypeManager.object_type in the constructor.
15853 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15854 of the `hm.get_current' method if we're using the collection pattern.
15855 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15856 for the explicit conversion to make it work when we're using the collection
15857 pattern and the `Current' property has a different return type than `object'.
15860 2002-07-24 Martin Baulig <martin@gnome.org>
15862 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15863 does not match, but don't report any errors. This method is called in
15864 order for all methods in a MethodGroupExpr until a matching method is
15865 found, so we don't want to bail out if the first method doesn't match.
15866 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15867 matches, report the 123. Fixes #28070.
15869 2002-07-24 Martin Baulig <martin@gnome.org>
15871 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15872 TypeManager.TypeToCoreType() to the top of the method so the
15873 following equality checks will work. Fixes #28107.
15875 2002-07-24 Martin Baulig <martin@gnome.org>
15877 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15878 operand is of type uint, and the other operand is of type sbyte,
15879 short or int, the operands are converted to type long." -
15880 Actually do what this comment already told us. Fixes bug #28106,
15883 2002-07-24 Martin Baulig <martin@gnome.org>
15885 * class.cs (MethodBase): New abstract class. This is now a base
15886 class for Property, Indexer and Event to avoid some code duplication
15887 in their Define() and DefineMethods() methods.
15888 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15889 generic methods for Define() and DefineMethods().
15890 (FieldBase): Derive from MemberBase, not MemberCore.
15891 (Property): Derive from MemberBase, not MemberCore.
15892 (Property.DefineMethod): Moved all the code from this method to the
15893 new MethodBase.DefineAccessor(), just call it with appropriate
15895 (Property.Define): Call the new Property.DoDefine(), this does some
15896 sanity checks and we don't need to duplicate the code everywhere.
15897 (Event): Derive from MemberBase, not MemberCore.
15898 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15899 accessors, this will also make them work with interface events.
15900 (Indexer): Derive from MemberBase, not MemberCore.
15901 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15902 (Indexer.Define): Use the new MethodBase functions.
15904 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15905 argument to the constructor.
15906 (Interface.FindMembers): Added support for interface events.
15907 (Interface.PopluateEvent): Implemented.
15909 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
15911 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15913 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15914 but this is required to check for a method name being the same as
15915 the containing class.
15919 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15921 * interface.cs: initialize variable.
15923 2002-07-23 Martin Baulig <martin@gnome.org>
15925 Implemented the IndexerName attribute in interfaces.
15927 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15928 name if this is an explicit interface implementation.
15929 (Indexer.InterfaceIndexerName): New public variable. If we're
15930 implementing an interface indexer, this is the IndexerName in that
15931 interface. Otherwise, it's the IndexerName.
15932 (Indexer.DefineMethod): If we're implementing interface indexer,
15933 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15934 and Pending.ImplementIndexer methods.
15935 (Indexer.Define): Also define the PropertyBuilder if we're
15936 implementing an interface indexer and this is neither an explicit
15937 interface implementation nor do the IndexerName match the one in
15940 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15941 If a method is defined here, then we always need to create a proxy
15942 for it. This is used when implementing interface indexers.
15943 (Pending.IsInterfaceIndexer): New public method.
15944 (Pending.ImplementIndexer): New public method.
15945 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15946 This is used when implementing interface indexers to define a proxy
15948 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15949 define a proxy if necessary.
15951 * interface.cs (Interface.IndexerName): New public variable.
15952 (Interface.PopulateIndexer): Set the IndexerName.
15953 (Interface.DefineIndexers): New private method. Populate all the
15954 indexers and make sure their IndexerNames match.
15956 * typemanager.cs (IndexerPropertyName): Added support for interface
15959 2002-07-22 Martin Baulig <martin@gnome.org>
15961 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15962 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15963 ret if HasReturnLabel.
15964 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15967 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15968 and set the ec.LoopBeginTryCatchLevel.
15969 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15970 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15971 the current ec.TryCatchLevel, the branch goes out of an exception
15972 block. In this case, we need to use Leave and not Br.
15974 2002-07-22 Martin Baulig <martin@gnome.org>
15976 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15977 block unless the block does not always return or it is contained in
15978 another try { ... } catch { ... } block. Fixes bug #26506.
15979 Added verify-1.cs to the test suite.
15981 2002-07-22 Martin Baulig <martin@gnome.org>
15983 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15984 then we do not always return. Fixes bug #24985.
15986 2002-07-22 Martin Baulig <martin@gnome.org>
15988 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15989 lookup on a per-class level; ie. walk up the class hierarchy until we
15990 found at least one applicable method, then choose the best among them.
15991 Fixes bug #24463 and test-29.cs.
15993 2002-07-22 Martin Baulig <martin@gnome.org>
15995 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15996 return types of the methods. The return type is not part of the
15997 signature and we must not check it to make the `new' modifier work.
15998 Fixes bug #27999, also added test-147.cs.
15999 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16001 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16002 on the method's return type.
16004 2002-07-21 Martin Baulig <martin@gnome.org>
16006 * assign.cs: Make this work if the rightmost source is a constant and
16007 we need to do an implicit type conversion. Also adding a few more tests
16008 to test-38.cs which should have caught this.
16010 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16011 target in the makefile for this. The makefile.gnu is primarily intended
16012 for end-users who don't want to debug the compiler.
16014 2002-07-21 Martin Baulig <martin@gnome.org>
16016 * assign.cs: Improved the Assign class so it can now handle embedded
16017 assignments (X = Y = Z = something). As a side-effect this'll now also
16018 consume less local variables. test-38.cs now passes with MCS, added
16019 a few new test cases to that test.
16021 2002-07-20 Martin Baulig <martin@gnome.org>
16023 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16024 instructions. Fixes bug #27977, also added test-146.cs.
16026 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16028 * cs-tokenizer.cs: fixed getHex ().
16030 2002-07-19 Martin Baulig <martin@gnome.org>
16032 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16033 not Type.GetType() to lookup the array type. This is needed when
16034 we're constructing an array of a user-defined type.
16035 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16036 single-dimensional arrays, but also for single-dimensial arrays of
16039 2002-07-19 Martin Baulig <martin@gnome.org>
16041 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16042 this function is called, it's not allowed to share LocalBuilders
16043 among ILGenerators.
16045 2002-07-19 Martin Baulig <martin@gnome.org>
16047 * expression.cs (Argument.Resolve): Report an error 118 when trying
16048 to pass a type as argument.
16050 2002-07-18 Martin Baulig <martin@gnome.org>
16052 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16053 Conv_R_Un for the signed `long' type.
16055 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16057 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16058 `expr' for the temporary result, as that will fail if we do
16059 multiple resolves on the same expression.
16061 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16063 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16064 ec.TypeContainer for looking up aliases.
16066 * class.cs (TypeContainer): Remove LookupAlias from here.
16068 * decl.cs (DeclSpace); Move here.
16070 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16072 * class.cs (FindMembers): Only call filter if the constructor
16073 bulider is not null.
16075 Also handle delegates in `NestedTypes' now. Now we will perform
16076 type lookups using the standard resolution process. This also
16079 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16080 This uses Expressions (the limited kind that can be parsed by the
16081 tree) instead of strings.
16083 * expression.cs (ComposedCast.ToString): Implement, used to flag
16084 errors since now we have to render expressions.
16086 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
16089 * ecore.cs (SimpleName.ToString): ditto.
16091 * cs-parser.jay: Instead of using strings to assemble types, use
16092 Expressions to assemble the type (using SimpleName, ComposedCast,
16093 MemberAccess). This should fix the type lookups in declarations,
16094 because we were using a different code path for this.
16096 * statement.cs (Block.Resolve): Continue processing statements
16097 even when there is an error.
16099 2002-07-17 Miguel de Icaza <miguel@ximian.com>
16101 * class.cs (Event.Define): Also remove the `remove' method from
16102 the list of pending items.
16104 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16105 generate more compact code.
16107 2002-07-17 Martin Baulig <martin@gnome.org>
16109 * const.cs (Const.LookupConstantValue): Add support for constant
16110 `unchecked' and `checked' expressions.
16111 Also adding test case test-140.cs for this.
16113 2002-07-17 Martin Baulig <martin@gnome.org>
16115 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16116 check whether mi.ReturnType implements the IEnumerator interface; the
16117 `==' and the IsAssignableFrom() will fail in this situation.
16119 2002-07-16 Ravi Pratap <ravi@ximian.com>
16121 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
16124 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16126 * expression.cs: fixed bug #27811.
16128 2002-07-14 Miguel de Icaza <miguel@ximian.com>
16130 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16131 Molaro: when we are a ref, the value already contains a pointer
16132 value, do not take the address of it.
16134 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16135 * removed mb-parser.jay and mb-tokenizer.cs
16137 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16139 * expression.cs: check against the building corlib void type.
16141 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16143 * ecore.cs: fix for valuetype static readonly fields: when
16144 initializing them, we need their address, not the address of a copy.
16146 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16148 * typemanager.cs: register also enum_type in corlib.
16150 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16152 * class.cs: allow calling this (but not base) initializers in structs.
16154 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16156 * ecore.cs: make sure we compare against the building base types
16159 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16161 * typemanager.cs: fix TypeToCoreType() to handle void and object
16162 (corlib gets no more typerefs after this change).
16164 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16166 * expression.cs (ArrayCreation.EmitArrayArguments): use
16167 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16169 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16170 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16171 array indexes, the runtime actually forbids them.
16173 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16174 for array arguments here.
16176 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16177 instead of the default for ValueTypes.
16179 (New.DoEmit): Use IsValueType instead of
16180 IsSubclassOf (value_type)
16181 (New.DoResolve): ditto.
16182 (Invocation.EmitCall): ditto.
16184 * assign.cs (Assign): ditto.
16186 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16187 Statements *are* currently doing part of their resolution during
16190 Expressions do always resolve during resolve, but statements are
16191 only required to propagate resolution to their children.
16193 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16195 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16197 (LoadAssembly): Do not add the dll if it is already specified
16199 (MainDriver): Add the System directory to the link path at the end,
16200 after all the other -L arguments.
16202 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16203 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16204 ldelem.u1) and using the opposite for sbytes.
16206 This fixes Digger, and we can finally run it.
16208 * driver.cs (UnixParseOption): Move the option parsing here.
16209 (CSCParseOption): Implement CSC-like parsing of options.
16211 We now support both modes of operation, the old Unix way, and the
16212 new CSC-like way. This should help those who wanted to make cross
16213 platform makefiles.
16215 The only thing broken is that /r:, /reference: and /lib: are not
16216 implemented, because I want to make those have the same semantics
16217 as the CSC compiler has, and kill once and for all the confussion
16218 around this. Will be doing this tomorrow.
16220 * statement.cs (Unsafe.Resolve): The state is checked during
16221 resolve, not emit, so we have to set the flags for IsUnsfe here.
16223 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16225 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16226 not catch the Error_ObjectRefRequired in SimpleName (as it is
16227 possible to have a class/instance variable name that later gets
16228 deambiguated), we have to check this here.
16230 2002-07-10 Ravi Pratap <ravi@ximian.com>
16232 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16233 make static and put into Expression.
16235 (Event.Define): Register the private field of the event with the
16236 TypeManager so that GetFieldFromEvent can get at it.
16238 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16239 keep track of the private field associated with an event which
16242 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16245 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16247 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16249 * expression.cs (Binary.EmitBranchable): this routine emits the
16250 Binary expression in a branchable context. This basically means:
16251 we need to branch somewhere, not just get the value on the stack.
16253 This works together with Statement.EmitBoolExpression.
16255 * statement.cs (Statement.EmitBoolExpression): Use
16258 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16260 * statement.cs (For): Reduce the number of jumps in loops.
16262 (For): Implement loop inversion for the For statement.
16264 (Break): We can be breaking out of a Try/Catch controlled section
16265 (foreach might have an implicit try/catch clause), so we need to
16266 use Leave instead of Br.
16268 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16269 now). If the instace expression supports IMemoryLocation, we use
16270 the AddressOf method from the IMemoryLocation to extract the
16271 address instead of emitting the instance.
16273 This showed up with `This', as we were emitting the instance
16274 always (Emit) instead of the Address of This. Particularly
16275 interesting when This is a value type, as we dont want the Emit
16276 effect (which was to load the object).
16278 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16280 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16282 * statement.cs (Checked): Set the CheckedState during the resolve
16283 process too, as the ConvCast operations track the checked state on
16284 the resolve process, and not emit.
16286 * cs-parser.jay (namespace_member_declaration): Flag that we have
16287 found a declaration when we do. This is used to flag error 1529
16289 * driver.cs: Report ok when we display the help only.
16291 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16293 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16295 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16297 * cs-tokenizer.cs (define): We also have to track locally the
16298 defines. AllDefines is just used for the Conditional Attribute,
16299 but we also need the local defines for the current source code.
16301 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16303 * statement.cs (While, For, Do): These loops can exit through a
16304 Break statement, use this information to tell whether the
16305 statement is the last piece of code.
16307 (Break): Flag that we break.
16309 * codegen.cs (EmitContexts): New `Breaks' state variable.
16311 2002-07-03 Martin Baulig <martin@gnome.org>
16313 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16314 modifiers in method declarations in structs. Otherwise, you won't
16315 be able to override things like Object.Equals().
16317 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16319 * class.cs (Method, Property, Indexer): Do not allow the public
16320 modifier to be used in explicit interface implementations.
16322 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16323 override modifiers in method declarations in structs
16325 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16327 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16328 integer or real overflow, report an error
16330 2002-07-02 Martin Baulig <martin@gnome.org>
16332 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16333 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16334 to tell the runtime about our newly created System.Object and
16335 System.ValueType types.
16337 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16339 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16340 struct instead of Ldarg/Starg.
16342 2002-07-02 Martin Baulig <martin@gnome.org>
16344 * expression.cs (Indirection.Indirection): Call
16345 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16347 2002-07-02 Martin Baulig <martin@gnome.org>
16349 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16350 ValueType, call TypeManager.TypeToCoreType() on it.
16351 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16352 the OpCodes.Newarr argument.
16354 2002-07-02 Martin Baulig <martin@gnome.org>
16356 * expression.cs (Invocation.EmitCall): When compiling corlib,
16357 replace all calls to the system's System.Array type to calls to
16358 the newly created one.
16360 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16361 System.Array methods.
16362 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16363 from the system's System.Array type which must be replaced.
16365 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16367 * typemanager.cs: load unverifiable_code_ctor so we can build
16368 corlib using the correct type. Avoid using GetTypeCode() with
16370 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16371 TypeManager.object_type to allow building corlib.
16373 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16375 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16377 2002-07-01 Martin Baulig <martin@gnome.org>
16379 * class.cs: Make the last change actually work, we need to check
16380 whether `ifaces != null' to avoid a crash.
16382 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16384 * class.cs: when we build structs without fields that implement
16385 interfaces, we need to add the interfaces separately, since there is
16386 no API to both set the size and add the interfaces at type creation
16389 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16391 * expression.cs: the dimension arguments to the array constructors
16392 need to be converted if they are a long.
16394 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16396 * class.cs: don't emit ldarg.0 if there is no parent constructor
16397 (fixes showstopper for corlib).
16399 2002-06-29 Martin Baulig <martin@gnome.org>
16401 MCS now compiles corlib on GNU/Linux :-)
16403 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16404 ie. check for MethodImplOptions.InternalCall.
16406 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16407 and TypeManager.attribute_type are null, so we must explicitly check
16408 whether parent is not null to find out whether it's an attribute type.
16409 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16410 and SetBuilder, not only if the property is neither abstract nor external.
16411 This is necessary to set the MethodImplOptions on the accessor methods.
16412 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16413 SetBuilder, see Property.Emit().
16415 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16416 populate "System.Object", "System.ValueType" and "System.Attribute" since
16417 they've already been populated from BootCorlib_PopulateCoreTypes().
16419 2002-06-29 Martin Baulig <martin@gnome.org>
16421 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16422 is the NullLiteral, we also need to make sure that target_type is not
16425 2002-06-29 Martin Baulig <martin@gnome.org>
16427 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16428 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16429 before calling BootstrapCorlib_ResolveDelegate ().
16431 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16433 * statement.cs: fixed build-breaker. All tests passed ok.
16435 2002-06-27 Martin Baulig <martin@gnome.org>
16437 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16438 for System.Decimal when compiling corlib.
16440 2002-06-27 Martin Baulig <martin@gnome.org>
16442 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16443 switch blocks which contain nothing but a default clause.
16445 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16447 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16449 2002-06-27 Martin Baulig <martin@gnome.org>
16451 * ecore.cs (PropertyExpr.PropertyExpr): Call
16452 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16454 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16455 is already a TypeBuilder.
16457 2002-06-27 Martin Baulig <martin@gnome.org>
16459 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16460 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16461 the "from an array-type to System.Array" case. This makes it work
16462 when compiling corlib.
16464 2002-06-27 Martin Baulig <martin@gnome.org>
16466 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16467 non-static PropertyExpr, set its InstanceExpression. This makes
16468 the `ICollection.Count' property work in System/Array.cs.
16470 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16472 * driver.cs: Made error handling more consistent. Errors now
16473 tracked by Report class, so many methods which used to return int
16474 now return void. Main() now prints success/failure and
16475 errors/warnings message.
16477 Renamed '--probe' compiler argument to '--expect-error'. Removed
16478 the magic number return values (123 and 124). Now, if the
16479 expected error occurs, the compiler exits with success (exit value
16480 0). If the compilation completes without seeing that particular
16481 error, the compiler exits with failure (exit value 1). The
16482 makefile in mcs/errors has been changed to handle the new behaviour.
16484 * report.cs: Made 'expected error' number a property and renamed
16485 it from 'Probe' to 'ExpectedError'.
16487 * genericparser.cs: Removed error handling support, since it is
16488 now all done by Report class.
16490 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16491 class, so parse() no longer returns an int.
16493 * namespace.cs: Use Report.Error instead of GenericParser.error
16495 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16497 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16498 TypeContainer.AddOperator): At the front of the list put the
16499 explicit implementations, so they get resolved/defined first.
16501 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16503 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16504 interface type is implemented by this TypeContainer. Used during
16505 explicit interface implementation.
16507 (Property.Define, Indexer.Define, Method.Define): Validate that
16508 the given interface in the explicit implementation is one of the
16509 base classes for the containing type.
16511 Also if we are explicitly implementing an interface, but there is
16512 no match in the pending implementation table, report an error.
16514 (Property.Define): Only define the property if we are
16515 not explicitly implementing a property from an interface. Use the
16516 correct name also for those properties (the same CSC uses,
16517 although that is really not needed).
16519 (Property.Emit): Do not emit attributes for explicitly implemented
16520 properties, as there is no TypeBuilder.
16522 (Indexer.Emit): ditto.
16524 Hiding then means that we do not really *implement* a pending
16525 implementation, which makes code fail.
16527 2002-06-22 Martin Baulig <martin@gnome.org>
16529 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16530 the return value of Object.GetType(). [FIXME: we need to do this whenever
16531 we get a type back from the reflection library].
16533 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16535 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16537 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16539 * attribute.cs: Return null if we can not look up the type.
16541 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16542 the interface types found.
16544 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16545 interface types found.
16547 * typemanager.cs (GetInterfaces): Make this routine returns alll
16548 the interfaces and work around the lame differences between
16549 System.Type and System.Reflection.Emit.TypeBuilder in the results
16550 result for GetInterfaces.
16552 (ExpandInterfaces): Given an array of interface types, expand and
16553 eliminate repeated ocurrences of an interface. This expands in
16554 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16557 2002-06-21 Martin Baulig <martin@gnome.org>
16559 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16562 2002-06-21 Martin Baulig <martin@gnome.org>
16564 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16565 and called with one of the core types, return the corresponding typebuilder for
16568 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16571 2002-06-21 Martin Baulig <martin@gnome.org>
16573 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16574 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16575 (Expression.ConvertReferenceExplicit): Likewise.
16577 * expression.cs (ElementAccess.DoResolve): Likewise.
16578 (ElementAccess.DoResolveLValue): Likewise.
16580 2002-06-10 Martin Baulig <martin@gnome.org>
16582 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16583 add the "value" parameter to the parameter list.
16585 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16588 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16590 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16591 the argument to an int, uint, long or ulong, per the spec. Also
16592 catch negative constants in array creation.
16594 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16596 * class.cs: do not allow the same interface to appear twice in
16597 the definition list.
16599 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16601 * ecore.cs: don't use ldlen with System.Array.
16603 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16605 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16607 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16609 * modifiers.cs: produce correct field attributes for protected
16610 internal. Easy fix so miguel can work on ther harder stuff:-)
16612 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16614 * pending.cs: New file. Move the code from class.cs here.
16615 Support clearning the pending flag for all methods (when not doing
16616 explicit interface implementation).
16618 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16620 * rootcontext.cs: added a couple more types needed to bootstrap.
16622 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16624 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16625 constructor in the type, instead of any constructor in the type
16626 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16627 a bug in the Mono runtime when applying the params attribute).
16629 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16630 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16632 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16634 * expression.cs (Unary.ResolveOperator): Use TypeManager
16635 to resolve the type.
16637 2002-06-13 Ravi Pratap <ravi@ximian.com>
16639 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16642 * enum.cs (AddEnumMember): Add support to store the attributes associated
16643 with each member too.
16645 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16646 field builders too - this takes care of the enum member case.
16648 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16650 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16651 address-of operator on both value types and pointers.
16653 2002-06-10 Martin Baulig <martin@gnome.org>
16655 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16656 PropertyBuilder to the `property_builders' list.
16658 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16659 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16660 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16661 find any indexers which are inherited from an interface.
16663 2002-06-09 Martin Baulig <martin@gnome.org>
16665 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16666 the same type as the constant if necessary. There's also a test-130.cs
16669 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16671 * typemanager.cs (TypeManager.ChangeType): Previously known as
16672 Enum.ChangeEnumType().
16674 2002-06-09 Martin Baulig <martin@gnome.org>
16676 * expression.cs (Cast.TryReduce): Added support for consts.
16678 2002-06-08 Ravi Pratap <ravi@ximian.com>
16680 * class.cs (Accessor): Hold attributes information so we can pass
16683 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16684 Modify to pass in attributes attached to the methods.
16686 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16688 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16689 to handle the Accessor kind :-)
16691 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16693 2002-06-08 Martin Baulig <martin@gnome.org>
16695 * expression.cs (Unary.TryReduceNegative): Added support for
16698 2002-06-08 Martin Baulig <martin@gnome.org>
16700 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16701 name can't be found in the `defined_names' - the caller will do a
16702 MemberLookup in this case and thus find methods in System.Enum
16703 such as Enum.IsDefined().
16705 2002-06-08 Martin Baulig <martin@gnome.org>
16707 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16708 Convert.ChangeType() which works with TypeBuilder created types.
16709 (Enum.LookupEnumValue, Enum.Define): Use it here.
16711 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16712 `TypeBuilder.BaseType != null' check.
16713 (TypeContainer.FindMembers): Only lookup parent members if we
16714 actually have a parent.
16715 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16716 (ConstructorInitializer.Resolve): Likewise.
16718 * interface.cs (Interface.FindMembers): Added
16719 `TypeBuilder.BaseType != null' check.
16721 * rootcontext.cs (RootContext.ResolveCore): Added
16722 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16723 classes_second_stage.
16725 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16726 debug_type and trace_type when compiling with --nostdlib.
16728 2002-06-07 Martin Baulig <martin@gnome.org>
16730 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16731 (AddField): Set it to true when adding a non-static field.
16732 (DefineType): Use `have_nonstatic_fields' to find out whether we
16733 have non-static fields, not `Fields != null'.
16735 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16737 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16738 dereferencing a null on the static-field code path)
16740 2002-05-30 Martin Baulig <martin@gnome.org>
16742 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16743 to take command line arguments. Use reflection to call the new
16744 custom `Initialize' function on the symbol writer and pass it the
16745 command line arguments.
16747 * driver.cs (--debug-args): New command line argument to pass command
16748 line arguments to the symbol writer.
16750 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16752 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16753 the target type for indexers and properties. Thanks to Joe for
16756 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16758 * typemanager.cs (MethodFlags): returns the method flags
16759 (Obsolete/ShouldIgnore) that control warning emission and whether
16760 the invocation should be made, or ignored.
16762 * expression.cs (Invocation.Emit): Remove previous hack, we should
16763 not do this on matching a base type, we should do this based on an attribute
16765 Only emit calls to System.Diagnostics.Debug and
16766 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16767 on the command line.
16769 * rootcontext.cs: Global settings for tracing and debugging.
16771 * cs-tokenizer.cs (define): New utility function to track
16772 defines. Set the global settings for TRACE and DEBUG if found.
16774 2002-05-25 Ravi Pratap <ravi@ximian.com>
16776 * interface.cs (Populate*): Pass in the TypeContainer as well as
16777 the DeclSpace as parameters so that we can create EmitContexts and
16778 then use that to apply attributes etc.
16780 (PopulateMethod, PopulateEvent, PopulateProperty)
16781 (PopulateIndexer): Apply attributes everywhere.
16783 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16786 (ApplyAttributes): Update accordingly.
16788 We now apply interface attributes for all members too.
16790 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16792 * class.cs (Indexer.Define); Correctly check if we are explicit
16793 implementation (instead of checking the Name for a ".", we
16794 directly look up if the InterfaceType was specified).
16796 Delay the creation of the PropertyBuilder.
16798 Only create the PropertyBuilder if we are not an explicit
16799 interface implementation. This means that explicit interface
16800 implementation members do not participate in regular function
16801 lookups, and hence fixes another major ambiguity problem in
16802 overload resolution (that was the visible effect).
16804 (DefineMethod): Return whether we are doing an interface
16807 * typemanager.cs: Temporary hack until we get attributes in
16808 interfaces (Ravi is working on that) and we get IndexerName
16809 support in interfaces.
16811 * interface.cs: Register the indexers as properties.
16813 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16814 warning, I have verified that this is a bug in the .NET runtime
16815 (JavaScript suffers of the same problem).
16817 * typemanager.cs (MemberLookup): When looking up members for
16818 interfaces, the parent of an interface is the implicit
16819 System.Object (so we succeed in searches of Object methods in an
16820 interface method invocation. Example: IEnumerable x; x.ToString
16823 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16825 * class.cs (Event): Events should also register if they do
16826 implement the methods that an interface requires.
16828 * typemanager.cs (MemberLookup); use the new GetInterfaces
16831 (GetInterfaces): The code used to lookup interfaces for a type is
16832 used in more than one place, factor it here.
16834 * driver.cs: Track the errors at the bottom of the file, we kept
16837 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16838 instance if the method we are calling is static!
16840 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16842 * attribute.cs (ApplyAttributes): Make this function filter out
16843 the IndexerName attribute (as that attribute in reality is never
16844 applied) and return the string constant for the IndexerName
16847 * class.cs (TypeContainer.Emit): Validate that all the indexers
16848 have the same IndexerName attribute, and if so, set the
16849 DefaultName attribute on the class.
16851 * typemanager.cs: The return value might contain other stuff (not
16852 only methods). For instance, consider a method with an "Item"
16853 property and an Item method.
16855 * class.cs: If there is a problem with the parameter types,
16858 2002-05-24 Ravi Pratap <ravi@ximian.com>
16860 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16861 looks at user defined conversion after making a call to
16862 StandardConversionExists - we need this for overload resolution.
16864 * expression.cs : Update accordingly the various method calls.
16866 This fixes 2 bugs filed against implicit user defined conversions
16868 2002-05-22 Miguel de Icaza <miguel@ximian.com>
16870 * statement.cs: Track the result of the assignment.
16872 2002-05-21 Miguel de Icaza <miguel@ximian.com>
16874 * expression.cs (MemberAccess): Improved error reporting for
16875 inaccessible members.
16877 2002-05-22 Martin Baulig <martin@gnome.org>
16879 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
16880 itself with debugging support.
16882 2002-05-22 Martin Baulig <martin@gnome.org>
16884 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16885 Removed, this isn't needed anymore.
16887 2002-05-20 Martin Baulig <martin@gnome.org>
16889 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16890 be underlying type for an enum.
16892 2002-05-20 Miguel de Icaza <miguel@ximian.com>
16894 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16895 that splits out the loading of just the core types.
16897 * rootcontext.cs (ResolveCore): Split the struct resolution in
16898 two, so we can load the enumeration underlying types before any
16901 * expression.cs (Is): Bandaid until we fix properly Switch (see
16902 bug #24985 for details).
16904 * typemanager.cs (ImplementsInterface): The hashtable will contain
16905 a null if there are no interfaces implemented.
16907 2002-05-18 Miguel de Icaza <miguel@ximian.com>
16909 * cs-parser.jay (indexer_declarator): It is fine to have array
16912 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16914 * typemanager.cs: (RegisterBuilder): New function used to register
16915 TypeBuilders that implement interfaces. Since
16916 TypeBuilder.GetInterfaces (as usual) does not work with lame
16918 (AddUserType): register interfaces.
16920 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16921 dealing with TypeBuilder. Also, arrays are showing up as
16922 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16923 methods can not be invoked on them!
16925 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16926 (ImplicitReferenceConversionExists): Split out from
16927 StandardConversionExists.
16929 * expression.cs (As): We were only implementing one of the three
16930 cases for the as operator. We now implement them all.
16931 (Is): Implement the various other cases for Is as well.
16933 * typemanager.cs (CACHE): New define used to control if we want or
16934 not the FindMembers cache. Seems to have a negative impact on
16935 performance currently
16937 (MemberLookup): Nested types have full acess to
16938 enclosing type members
16940 Remove code that coped with instance/static returns for events, we
16941 now catch this in RealFindMembers.
16943 (RealFindMembers): only perform static lookup if the instance
16944 lookup did not return a type or an event.
16946 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16948 * assign.cs (CompoundAssign): We pass more semantic information
16949 now to Compound Assignments than we did before: now we have all
16950 the information at hand, and now we resolve the target *before* we
16951 do the expression expansion, which allows the "CacheValue" method
16952 to have the effect we intended (before, a [x] += 1 would generate
16953 two differen ArrayAccess expressions from the ElementAccess,
16954 during the resolution process).
16956 (CompoundAssign.DoResolve): Resolve target and original_source here.
16958 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16960 * expression.cs (ArrayAccess): dropped debugging information.
16962 * typemanager.cs: Small bug fix: I was always returning i_members,
16963 instead of one of i_members or s_members (depending on which had
16966 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16967 method is invoked before any code generation takes place, and it
16968 is a mechanism to inform that the expression will be invoked more
16969 than once, and that the method should use temporary values to
16970 avoid having side effects
16972 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16974 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16977 * expression.cs (Indirection, ArrayAccess): Add support for
16978 CacheTemporaries in these two bad boys.
16980 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16981 ldobj or ldind_ref.
16982 (StoreFromPtr): Handle stobj as well.
16984 * expression.cs (UnaryMutator): Share more code.
16986 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16987 down: I was not tracking the Filter function as well, which
16988 was affecting the results of the cache.
16990 2002-05-15 Miguel de Icaza <miguel@ximian.com>
16992 * attribute.cs: Remove the hack to handle the CharSet property on
16995 2002-05-14 Miguel de Icaza <miguel@ximian.com>
16997 * attribute.cs (DoResolve): More uglyness, we now only try to
16998 resolve the attribute partially, to extract the CharSet
16999 information (only if we are a StructLayout attribute). Otherwise
17001 (GetExtraTypeInfo): Add some code to conditionally kill in the
17002 future this. I am more and more convinced that the .NET
17003 framework has special code to handle the attribute setting on
17006 * expression.cs (IsParamsMethodApplicable): Revert my previous
17007 foreach change here, it was wrong.
17009 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17011 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17012 (pp_expr): do not abort on unknown input, just return.
17013 (eval): abort if there are pending chars.
17015 * attribute.cs (Attribute.Resolve): Positional parameters are
17016 optional. Deal with that case.
17018 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17019 the Ansi/Unicode/Auto information for the type.
17021 (TypeContainer.DefineType): instantiate the EmitContext here, as
17022 we will be using it during the type definition (to resolve
17023 attributes) and during the emit phase.
17025 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17026 to pull type information out of the attributes
17028 (Attribute.Resolve): track the constructor builder, and allow for
17029 multiple invocations (structs and classes will use this).
17031 * ecore.cs (MemberLookupFinal): new version with all the
17032 parameters customizable.
17034 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17035 constructors. Return if the result value is null (as the error
17036 would have been flagged already by MemberLookupFinal)
17038 Do not allow instances of abstract classes or interfaces to be
17041 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17042 We have to compare the assembly property here when dealing with
17043 FamANDAssem and Assembly access modifiers, because we might be
17044 creating an assembly from *modules* (that means that we are not
17045 getting TypeBuilders for types defined in other modules that are
17046 part of this assembly).
17048 (Method.Emit): If the method is marked abstract and has a body,
17051 (TypeContainer.DefineMembers): If both the defined member and the
17052 parent name match are methods, then do not emit any warnings: let
17053 the Method.Define routine take care of flagging warnings. But if
17054 there is a mismatch (method overrides something else, or method is
17055 overriwritten by something, then emit warning).
17057 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17058 set to null, this means `do not check for the return type on the
17061 (Method.Define): set the return type for the method signature to
17062 null, so that we get methods with the same name and parameters and
17063 different return types. This is used to flag warning 114 (you are
17064 hiding a method, and you probably want to use the new/override
17067 * typemanager.cs (MemberLookup): Implemented proper access
17068 control, closing a long standing set of bug reports. The problem
17069 was that the Framework only has two bits: Public and NonPublic,
17070 and NonPublic includes private and protected methods, but we need
17071 to enforce the FamANDAssem, FamOrAssem and Family.
17073 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17075 * statement.cs (GotoCase): Return true: Ammounts to giving up
17076 knowledge on whether we return or not, and letting the other case
17077 be responsible for it.
17079 2002-05-10 Miguel de Icaza <miguel@ximian.com>
17081 * driver.cs: Do not load directories for each file processed, only
17082 do it if there is a pattern.
17084 * ecore.cs: Report readonly assigns here as well, as we might have
17085 been resolved only by MemberAccess.
17087 (SimpleName.SimpleNameResolve): Also be useful for LValue
17088 resolution. We need this to propagate assign to local readonly variables
17090 * typemanager.cs: Use a ptrhashtable for the criteria, because we
17091 do not want to reuse potential criteria memory.
17093 * class.cs (MyEventBuilder): Set reflected_type;
17095 * ecore.cs (Constantify): Added support for constifying bools.
17097 (RootContext.LookupType): Added a cache for values looked up in
17098 the declaration space.
17100 * typemanager.cs (FindMembers): Now is a front-end to
17101 RealFindMembers, and provides a two-level hashtable-based cache to
17104 15% performance improvement: from 22.5 to 19.2 seconds.
17106 * expression.cs (IsParamsMethodApplicable): use foreach.
17107 (Invocation.DoResolve): ditto.
17108 (New.DoResolve): ditto.
17109 (ArrayCreation.DoResolve): ditto.
17111 * ecore.cs (FindMostEncompassingType): use foreach.
17113 * delegate.cs (NewDelegate.DoResolve): Use foreach
17115 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17116 (RemoveMethods): use foreach.
17118 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17119 nested foreach statements instead of for, and also break out of
17120 the inner loop once a match is found.
17122 (Invocation.OverloadResolve): Use foreach, simplify the code.
17124 2002-05-08 Miguel de Icaza <miguel@ximian.com>
17126 * cfold.cs (BinaryFold): During an enumeration evaluation context,
17127 we actually unwrap the expression to allow for extra information
17130 * expression.cs: Use Shr_Un on unsigned operations.
17132 2002-05-08 Ravi Pratap <ravi@ximian.com>
17134 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
17135 applicable operators was not being considered correctly. This closes
17136 the bug Miguel reported.
17138 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17140 * attribute.cs: check that the type derives from System.Attribute
17141 and report the correct error in that case (moved the duplicate code to
17142 its own method, too).
17144 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17146 * attribute.cs: lookup attribute type name as the spec says: first the
17147 bare attribute name and then name + "Attribute" (nant compiles with
17148 mcs after this fix).
17150 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17152 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17153 Because of the way we parse things, we should try to see if a
17154 UIntConstant can fit in an integer.
17156 2002-05-07 Ravi Pratap <ravi@ximian.com>
17158 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17159 when we are in an explicit context.
17161 (ConvertReferenceExplicit): When converting from Iface type S to Class
17162 T make sure the rules are implemented as an OR.
17164 * parameter.cs (ParameterType): Make it a property for now although the
17165 purpose really isn't anything immediate.
17167 * expression.cs (Is*Applicable): Do better checking on the parameter type
17168 of a ref/out parameter. The ones from the system assemblies are already
17169 marked with the correct type so we don't need to do any correction.
17171 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17172 the object type is standard too so include that.
17174 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17176 * ecore.cs (StandardConversionExists): Augment with missing code:
17177 deal with IntConstant, LongConstants and Enumerations.
17179 * assign.cs: Report the error, instead of failing silently
17181 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17182 typecontainer that they are declared, because the
17183 typecontainer/namespace will have the list of using clauses that
17184 need to be applied.
17186 Assembly Attributes were escaping the normal registration
17189 (EmitCode): Apply attributes within an EmitContext that represents
17190 the container they were declared on.
17192 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17194 2002-05-06 Ravi Pratap <ravi@ximian.com>
17196 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17197 Revamp completely - make much cleaner as we now operate only
17200 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17201 to implement the logic detailed in the spec more correctly.
17203 (UserDefinedConversion): Update accordingly.
17205 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17207 * statement.cs: Return flow analysis information up.
17209 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17212 (token): Do not consume an extra character before calling
17215 2002-05-06 Piers Haken <piersh@friskit.com>
17217 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17219 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17221 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17222 EmitContext during the instance constructor initializer
17223 resolution, to stop access to instance variables.
17225 This is mandated by the spec, last paragraph of the `constructor
17226 initializers' section.
17228 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17230 * cs-parser.jay, class.cs (Accessor): new class used to represent
17231 an accessor (get or set). In the past we used `null' to represent
17232 a missing accessor. But this is ambiguous because there was no
17233 way to tell in abstract indexers/properties if one of them was
17236 Now there is a way of addressing that.
17238 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17239 instead of FindMembers.
17241 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17242 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17244 * attribute.cs: Treat indexers and properties as the same in terms
17245 of applying attributes
17247 * ecore.cs (FindMostEncompassedType): Use statically initialized
17248 EmptyExpressions()s like we do elsewhere to avoid creating useless
17249 objects (and we take this out of the tight loop).
17251 (GetConversionOperators): Move the code to extract the actual
17252 operators to a separate routine to clean things up.
17254 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17256 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17257 events are always registered FieldBuilders.
17259 * class.cs (FieldBase): New class shared by Fields
17261 * delegate.cs: If we are a toplevel delegate, use our full name.
17262 If we are a nested delegate, then only use our tail name.
17264 2002-05-02 Ravi Pratap <ravi@ximian.com>
17266 * expression.cs (IsApplicable): Ensure that we add the "&" to
17267 ref/out types before comparing it with the type of the argument.
17269 (IsParamsMethodApplicable): Ditto.
17271 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17274 * delegate.cs : Handle the case when we have more than one applicable
17275 method. Flag an error only when we finish checking all.
17277 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17279 * expression.cs: Add support for boolean static initializers.
17281 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17283 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17285 * parameter.cs (ComputeParameterTypes,
17286 ComputeAndDefineParameterTypes): Better error handling: now we
17287 clear the `types' cache if we fail during any of the type lookups.
17288 We also return the status code correctly to our caller
17290 * delegate.cs: If we fail to define a delegate, abort the extra
17293 * expression.cs (Binary.ResolveOperator): for
17294 operator==(object,object) and operator !=(object, object) we also
17295 have to verify that there is an implicit conversion from one to
17298 (ArrayAccess.DoResolve): Array Access can operate on
17301 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17303 * assign.cs (CompoundAssign): A new class used as a "flag" that
17304 the assignment actually is happening as part of a compound
17305 assignment operator.
17307 During compound assignment, a few new rules exist to enable things
17314 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17315 to the type of x) if y is implicitly convertible to the type of x,
17316 and the operator is a builtin operator and the return type of the
17317 operator is explicitly convertible to the type of x.
17319 * rootcontext.cs: Reset warning level to 2. 4 catches various
17320 "interesting" features in mcs, we must clean this up at some
17321 point, but currently am trying to kill other bugs ;-)
17323 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17324 in container classes as well.
17326 * expression.cs (Binary.ResolveOperator): Handle string case
17327 before anything else (as operator overloading does emit an error
17328 before doing anything else).
17330 This code could go away when we move to a table driven model, but
17331 i could not come up with a good plan last night.
17333 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17335 * typemanager.cs (CSharpName): reimplementation using regex.
17336 * class.cs: added null check for fields in Emit
17337 * rootcontext.cs: set warninglevel to 4
17339 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17341 * typemanager.cs (CSharpName): reimplemented with Lupus
17344 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17346 * statement.cs (If): correclty implement Resolve, because we were
17347 not catching sem errors in there. The same process is needed
17349 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17352 (Statement.Warning_DeadCodeFound): Factorize code.
17353 (While): Report dead code here too.
17355 (Statement): Added Resolve virtual method to allow
17356 for resolution split from the emit code.
17358 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17360 * statement.cs (EmitBoolExpression): No longer try to resolve the
17362 (MakeBoolean): New utility function that resolve, implicitly
17363 converts to boolean and tags the expression.
17366 (If, Do): Implement dead code elimination.
17367 (While): Implement loop inversion
17369 (Do, While, For, If): Resolve the expression prior to calling our
17372 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17375 - added method Report28 (warning: program has more than one entry point)
17376 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17377 - modified method Method.Define, the part at the end of the method
17379 * rootcontext.cs: added static public Location EntryPointLocation;
17381 * ../errors/cs0028.cs : Add test case for the above warning.
17384 - modified method CSharpName to allow arrays of primitive type to
17385 be printed nicely (e.g. instead of System.Int32[][] it now prints
17387 - added method CSharpSignature: returns the signature of a method
17388 in string format to be used in reporting errors, warnings, etc.
17390 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17393 2002-04-26 Ravi Pratap <ravi@ximian.com>
17395 * delegate.cs (Define): Fix extremely silly bug where I was
17396 setting the type of the 'object' parameter of the BeginInvoke
17397 method to System.IAsyncResult instead of System.Object ;-)
17399 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17401 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17404 (Constructor.Emit): return if we fail to initialize the
17405 constructor. Another door closed!
17407 * expression.cs (New.DoResolve): Improve error message (from -6 to
17408 1501). Use DeclaredOnly lookup to find the exact constructor.
17410 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17411 loop. This is useful.
17413 * cs-parser.jay: Adjust the default parameters so that destructors
17414 have the proper signature.
17416 2002-04-26 Martin Baulig <martin@gnome.org>
17418 * driver.cs (LoadAssembly): If `assembly' contains any characters
17419 which are only valid in path names and not in assembly names
17420 (currently slash, backslash and point), use Assembly.LoadFrom ()
17421 instead of Assembly.Load () on the `assembly' (before iteration
17422 over the link_paths).
17424 2002-04-26 Martin Baulig <martin@gnome.org>
17426 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17428 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17430 * class.cs (Property): use the new typemanager.MemberLookup
17432 (TypeContainer.MemberLookup): Implement using the
17433 TypeManager.MemberLookup now.
17435 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17436 and return MemberInfos, so that these can be used without an
17437 EmitContext (what we had before).
17439 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17441 * expression.cs: Fix the case where the argument to params if the
17442 type of the params. I omitted handling this before. Fixed
17444 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17446 * driver.cs: Call BootCorlib_PopulateCoreType
17448 * class.cs (Property.CheckBase): Check for properties only, not
17451 * interface.cs: Temporary hack: try/catch around the
17452 CustomAttributeBuilder, because I am getting an exception that I
17455 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17456 types whose definitions are required to be there (attributes are
17457 defined before standard types).
17459 Compute definitions as we boot the various types, as they are used
17460 immediately (value_type class will need object_type, but if we do
17461 not initialize object_type, we will pass a null, which will let
17462 the runtime pick the System.Object from the existing corlib, which
17463 is not what we want).
17465 2002-04-22 Patrik Torstensson <totte@labs2.com>
17467 * cs-tokenizer.cs: fixed a number of trim() issues.
17469 2002-04-22 Ravi Pratap <ravi@ximian.com>
17471 * expression.cs (Argument.Type): Ensure that we return the correct
17472 type when we have out or ref parameters [in which case we
17475 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17477 * class.cs (Property, Indexer): Allow extern modifier in there.
17479 * typemanager.cs (InitBaseTypes): Initializes object_type and
17480 value_type, since those will be used early on during the bootstrap
17481 process to compile corlib.
17483 (InitCoreTypes): Move code from here to InitBaseTypes.
17485 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17487 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17488 single-dimension arrays as using the ldlen opcode.
17490 Daniel Lewis discovered this optimization.
17492 * typemanager.cs: Add signature for System.Array::get_Length
17494 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17496 * statement.cs: report the error when the foreach does not apply to an
17497 array nor a collection.
17499 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17501 * expression.cs: Add implicit conversions to the operator ~.
17503 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17505 * typemanager.cs: Locate the decimal constructor.
17507 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17509 * attribute.cs: use the new property of TypeOf.
17510 * expression.cs: added 'get' property around typearg.
17512 These changes fix a build breaker reported by NickD. Is this the
17513 correct way to fix? If not, please, revert my changes and make it
17516 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17518 * attribute.cs: Add support for typeof in attribute invocations.
17519 I am not sure that this is right though.
17521 2002-04-14 Duncan Mak <duncan@ximian.com>
17523 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17524 Binary.Operator.Division case.
17526 2002-04-13 Ravi Pratap <ravi@ximian.com>
17528 * class.cs (DefineType): Ensure that we do a proper check on
17529 attribute types and also register it with the TypeManager.
17531 (TypeContainer.Targets): The default for attribute types is
17532 AttributeTargets.All.
17534 * attribute.cs (ApplyAttributes): Registering the attribute type
17535 is done elsewhere, not when we discover we have a Usage attribute.
17537 2002-04-12 Ravi Pratap <ravi@ximian.com>
17539 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17540 and get rid of is_delegate parameter.
17542 * everywhere : update.
17544 2002-04-12 Ravi Pratap <ravi@ximian.com>
17546 * cs-parser.jay (compilation_unit): Revamp completely to use
17547 some new ideas that I got from Rhys' grammar to solve the problems
17548 with assembly level attributes.
17550 (outer_declaration): New grammar production.
17552 (attribute_sections): Add.
17554 (opt_attributes): Base on attribute_sections
17556 (namespace_declaration): Allow opt_attributes to tackle the case
17557 when we have assembly level attributes - we are clever in this
17560 * attribute.cs (ApplyAttributes): Do not worry about assembly
17561 attributes in the non-global context.
17563 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17564 instead of SetGlobalAttributes.
17566 * class.cs, rootcontext.cs : Ensure we define and generate
17567 attribute types before anything else.
17569 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17570 and flag the new error -20 for the case when the attribute type
17571 does not have valid targets specified. csc does not catch this.
17573 * ../errors/errors.txt : update for error # -20
17575 2002-04-11 Ravi Pratap <ravi@ximian.com>
17577 * support.cs (InternalParameters.ParameterModifier): Do some null
17578 checking and return sane values.
17580 * class.cs (Method.Define): If we are a PInvoke method, ensure
17581 that we are static and extern. Report error # 601
17583 * ../errors/cs0601.cs : Add test case for the above error.
17585 2002-04-07 Ravi Pratap <ravi@ximian.com>
17587 * rootcontext.cs (attribute_types): We need to keep type of
17588 all attribute types separately and emit code for them first.
17590 (RegisterAttribute) : Implement.
17592 * class.cs (DefineType): Check if the current Type is a custom
17593 attribute type and register it accordingly.
17595 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17596 adding the first attribute twice and rename to
17598 (SetGlobalAttributes): this.
17600 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17603 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17604 if we are processing global arguments. Hmm, I am unsure of this.
17606 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17608 * expression.cs: added static array of strings to avoid calling
17609 Enum.ToString () for Operator in Binary. Significant recover of
17612 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17614 * class.cs (FindMembers): Allow the Builders of the various
17615 members to be null. If they are skip them. This only happens
17616 during the PInvoke declaration.
17618 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17620 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17621 failure, so we do not keep going afterwards.
17623 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17624 wanted to pass `false' as the `is_delegate' argument. If this is
17625 the case, why not use delegate_type == null to mean `is_delegate =
17626 false' and anything else as is_delegate = true.
17628 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17630 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17631 code for the section, not the beginning of the tests.
17633 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17635 * cfold.cs: Handle operator + (Enum x, Underlying x)
17637 * expression.cs (Binary): same. Warn about errors where we have
17638 Enum/Enum in operator + as well.
17640 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17643 - added support for switch(bool)
17644 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17645 - add TableSwitchEmit() to handle table-based switch statements
17647 2002-04-05 Ravi Pratap <ravi@ximian.com>
17649 * expression.cs (Invocation.OverloadResolve): Factor out code which
17650 does parameter compatibility checking with arguments so that we can
17651 re-use the code even from Delegate.VerifyApplicability
17653 (VerifyArgumentsCompat): Move above code here.
17655 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17656 and instead make a call to the above method.
17658 2002-03-31 Ravi Pratap <ravi@ximian.com>
17660 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17661 We use it to keep track of classes which are attribute types.
17663 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17665 * delegate.cs (Delegate.Define): Correctly define the types in the
17666 presence of fixed and array parameters.
17668 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17671 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17672 include NonPublic after the first iteration.
17674 * class.cs (Indexer.CheckBase): Only check if both parents are
17677 * cs-parser.jay (accessor_body): If empty, set to null.
17679 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17680 same code path here to resolve constants names that we did have in
17681 MemberAccess.DoResolve. There is too much code duplicated here.
17683 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17685 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17687 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17690 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17691 tokens, numbers and strings.
17693 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17696 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17697 asyncronous parameters and the regular parameters.
17699 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17700 specify the target directory.
17702 * expression.cs: (This.DoResolve): Simplify
17703 (As.Emit): Optimize, do not generate IsInst if the expression is
17704 always of the given type.
17706 (Is.DoResolve): Bug fix, we were reporting both always/never for
17709 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17710 creating too many unnecessary arrays.
17712 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17714 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17715 fields instead of rolling our own initializer. Takes care of all
17716 implicit conversions, and drops unnecessary static checks/argument.
17718 2002-03-31 Dick Porter <dick@ximian.com>
17720 * driver.cs: use the GetDirectories() return values properly, and
17721 use "/" as path separator.
17723 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17725 * expression.cs (Unary): Optimize - - expr into expr.
17726 (Binary): Optimize a + (-b) into a -b.
17728 * codegen.cs (CodeGen): Made all methods static.
17730 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17734 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17735 TypeBuilder property.
17737 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17740 * tree.cs: Removed the various RecordXXXX, and replaced with a
17741 single RecordDecl. Removed all the accessor methods, and just
17742 left a single access point Type
17744 * enum.cs: Rename DefineEnum to DefineType.
17746 * decl.cs: New abstract method `DefineType' used to unify the
17747 Defines for Enumerations, Interfaces, TypeContainers and
17750 (FindType): Moved LookupInterfaceOrClass here. Moved the
17751 LookupBaseClasses method that used to live in class.cs and
17752 interface.cs here, and renamed to FindType.
17754 * delegate.cs: Implement DefineType. Take advantage of the
17755 refactored pattern for locating the parent builder without taking
17756 the parent_builder argument (which we know does not work if we are
17757 nested, and triggering a toplevel definition).
17759 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17761 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17762 accessibility of a member has changed during override and report
17765 * class.cs (Method.Define, Property.Define): Only complain on
17766 overrides if the method is private, any other accessibility is
17767 fine (and since we just checked the permission is the same, we are
17770 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17771 and elif are processed always. The other pre-processing
17772 directives are only processed if we are "taking" the path
17774 2002-03-29 Martin Baulig <martin@gnome.org>
17776 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17777 current location is not Null.
17779 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17780 a separate method so we can profile it.
17782 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17783 `span.Seconds' are just seconds, but no minutes or hours.
17784 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17786 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17788 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17789 Remove the gratuitous set of Final:
17791 // If an interface implementation, then we can set Final.
17792 if (((flags & MethodAttributes.Abstract) == 0) &&
17793 implementing.DeclaringType.IsInterface)
17794 flags |= MethodAttributes.Final;
17796 I do not know what I was smoking when I used that.
17799 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17800 step into fixing the name resolution issues for delegates and
17801 unifying the toplevel name resolution.
17803 2002-03-28 Martin Baulig <martin@gnome.org>
17805 * class.cs (Method.Emit): If we have a symbol writer, call its
17806 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17807 tell it about the current method.
17809 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17810 writer that we're going to emit the first byte of IL code for a new
17811 statement (a new source line).
17812 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17813 EmitContext.Mark() before emitting any code.
17815 * location.cs (SymbolDocument): Return null when we're Null.
17817 * statement.cs (Statement): Moved the `Location loc' variable here.
17818 (Statement.EmitBoolExpression): If we have a symbol writer, call
17819 ec.Mark() before emitting any code to tell it that we're at the
17820 beginning of a new statement.
17821 (StatementExpression): Added `Location' argument to the constructor.
17822 (Block): Added public readonly variable `StartLocation' and public
17823 variable `EndLocation'. The latter is to be set using SetEndLocation().
17824 (Block): Added constructor which takes a start and end location.
17825 (Block.SetEndLocation): New method. This sets the end location.
17826 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17827 local variables we create.
17828 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17829 each statement and do also mark the begin and end of the block.
17831 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17832 tell it the current lexer.Location, use Location.Null for the end of the
17834 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17835 current block, set its end location using SetEndLocation().
17836 (statement_expression): StatementExpression constructor now takes the
17837 lexer.Location as additional argument.
17838 (for_statement, declare_local_variables): Likewise.
17839 (declare_local_variables): When creating a new implicit block, use the
17840 new Block constructor and pass it the lexer.Location.
17842 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17844 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17845 members also on the parent interfaces recursively.
17847 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17849 * report.cs: Use new formats, since Gonzalo finished the missing
17852 * expression.cs (Binary.ResolveOperator): added missing operator|
17853 operator& and operator^ for bool/bool.
17855 * cs-parser.jay: CheckDef now takes a Location argument that is
17856 used to report errors more precisly (instead of reporting the end
17857 of a definition, we try to track something which is a lot closer
17858 to the source of the problem).
17860 * cs-tokenizer.cs: Track global token use, so we can properly flag
17861 the use of #define/#undef after the first token has been seen.
17863 Also, rename the reportXXXX to Error_DescriptiveName
17865 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17866 TypeContainer, so that Enum and Interface can use this too.
17868 * class.cs (TypeContainer.LookupInterfaceOrClass,
17869 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17870 `builder' argument. Typically this was used to pass the parent
17871 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17874 The problem is that a nested class could trigger the definition of
17875 a toplevel class, and the builder would be obviously wrong in that
17878 So we drop this argument, and we compute dynamically the
17879 TypeBuilder/ModuleBuilder (the correct information was available
17880 to us anyways from DeclSpace.Parent)
17882 * interface.cs (Interface.DefineInterface): Drop builder
17883 parameter cleanup like class.cs
17885 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
17888 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17891 (Try.Emit): Propagate the returns value from the statement.
17893 (Return.Emit): Even if we are leavning
17895 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17897 * modifiers.cs: Fix the computation of MethodAttributes flags.
17899 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17901 * driver.cs: allow compilation of files that start with '/'.
17902 Add a default case when checking the argument of --target.
17904 2002-03-25 Miguel de Icaza <miguel@ximian.com>
17906 * interface.cs: Implement the same search algorithm for types in
17907 the interface code.
17909 * delegate.cs: Do not allow multiple definition.
17911 * Recovered ChangeLog that got accidentally amputated
17913 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17915 * rootcontext.cs: Load manually enum to allow core classes to
17916 contain enumerations.
17918 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17919 Update to new static methods in TypeManager.
17921 * typemanager.cs (GetMethod, GetConstructor): Use our
17922 implementation of FindMembers to find the members, since during
17923 corlib compilation, the types are TypeBuilders and GetMethod and
17924 GetConstructor do not work.
17926 Make all methods in TypeManager static.
17928 (InitCodeHelpers): Split the functionality from
17929 the InitCodeTypes function.
17931 * driver.cs: Call InitCodeHelpers after we have populated the
17934 * cs-parser.jay (delegate_declaration): we did not used to compute
17935 the delegate name correctly for void delegates.
17937 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17939 * rootcontext.cs (RootContext): Init the interface_resolve_order
17940 and type_container_resolve_order always.
17942 (ResolveCore, BootstrapCorlib_ResolveClass,
17943 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17944 compiler when compiling with --nostdlib
17946 * class.cs (TypeContainer.DefineType): Check that our parent is
17947 not null. This test is most important when we are bootstraping
17950 * codegen.cs: Split out the symbol writing code.
17952 2002-03-25 Martin Baulig <martin@gnome.org>
17954 * driver.cs (-g): Made -g an alias for --debug.
17956 2002-03-24 Martin Baulig <martin@gnome.org>
17958 * codegen.cs (SymbolWriter): New public variable. Returns the
17959 current symbol writer.
17960 (CodeGen): Added `bool want_debugging_support' argument to the
17961 constructor. If true, tell the ModuleBuild that we want debugging
17962 support and ask it for the ISymbolWriter.
17963 (Save): If we have a symbol writer, call it's Close() method after
17964 saving the assembly.
17966 * driver.c (--debug): New command line argument to create a
17967 debugger information file.
17969 * location.cs (SymbolDocument): New public property. Returns an
17970 ISymbolDocumentWriter object for the current source file or null
17971 if we don't have a symbol writer.
17973 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17975 * driver.cs (LoadAssembly): Correctly return when all the paths
17976 have been tried and not before.
17978 * statement.cs (Switch.Emit): return the actual coverage for this
17979 statement (returns/not-returns)
17981 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17982 switch of the statement if we are the last switch section. That
17983 kills two problems: try/catch problems (we used to emit an empty
17984 nop at the end) and switch statements where all branches would
17987 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17989 * driver.cs: Add default assemblies (the equivalent to the
17990 Microsoft CSC.RSP file)
17992 * cs-tokenizer.cs: When updating `cols and setting it to zero,
17993 also update tokens_seen and set it to false.
17995 * driver.cs: Implement --recurse for Mike.
17997 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17998 correctly splitting out the paths.
18000 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18002 * interface.cs (Interface.PopulateProperty): Instead of using
18003 `parent' as the declaration space for the set parameters, use
18006 * support.cs (InternalParameters): InternalParameters constructor
18007 takes a DeclSpace instead of a TypeContainer.
18009 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18010 types are being initialized, load the address of it before calling
18013 (New): Provide a mechanism to disable the generation of local
18014 value type temporaries when the caller will be providing us with
18015 an address to store it.
18017 (ArrayCreation.EmitDynamicInitializers): Use it.
18019 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18021 * expression.cs (Invocation.EmitArguments): Only probe for array
18022 property if there is more than one argument. Sorry about that.
18024 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18025 empty param arrays.
18027 * class.cs (Method.LabelParameters): Fix incorrect code path that
18028 prevented the `ParamArrayAttribute' from being applied to the
18031 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18033 * support.cs (ReflectionParameters): Correctly compute whether the
18034 last argument is a params array. Fixes the problem with
18037 * typemanager.cs: Make the assemblies array always be non-null
18038 (empty, but non-null)
18040 * tree.cs (RecordDecl): New function that abstracts the recording
18041 of names. This reports error 101, and provides a pointer to the
18042 previous declaration. Fixes a crash in the compiler.
18044 * cs-parser.jay (constructor_declaration): Update to new grammar,
18045 and provide a constructor_body that can be empty.
18047 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18049 * driver.cs: Add support for --resources.
18051 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18052 Make all types for the various array helper methods be integer.
18054 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18055 CheckState to ConvCast.
18057 (ConvCast): Now it takes a `checked' state argument, to avoid
18058 depending on the emit context for the conversion, and just using
18059 the resolve time setting.
18061 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18062 instead of Invocation.EmitArguments. We do not emit the original
18063 arguments, instead we emit those which have been converted to
18064 unsigned int expressions.
18066 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18068 * codegen.cs: ditto.
18070 * expression.cs (LocalVariableReference): Drop the use of the
18071 Store function that depended on the variable index.
18073 * statement.cs (VariableInfo): Drop the `Idx' property from this
18074 class, as this is not taking into account the indexes for
18075 temporaries tat we generate during the execution, getting the
18078 * class.cs: First emit class initializers, then call the parent
18081 * expression.cs (Binary): Fix opcode emision.
18082 (UnaryMutator.EmitCode): Support checked code generation
18084 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18085 matches for events for both the Static and Instance scans,
18086 pointing to the same element. Fix that.
18088 2002-03-14 Miguel de Icaza <miguel@ximian.com>
18090 * rootcontext.cs (ResolveTree): Always set the
18091 interface_resolve_order, because nested interfaces will be calling
18094 * class.cs (GetInterfaceOrClass): Track the same resolution
18095 process used by TypeManager.LookupType. This fixes the nested
18096 type lookups in class declarations (separate path from
18099 (TypeContainer.DefineType): Also define nested interfaces.
18100 (TypeContainer.RegisterOrder): New public function used to
18101 register the order in which child interfaces need to be closed.
18103 Nested interfaces need to be closed after their parents have been
18106 * interface.cs (InterfaceAttr): Put all the logic for computing
18107 the interface attribute here.
18109 (DefineInterface): Register our interface order with the
18110 RootContext or with the TypeContainer depending on the case.
18112 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18114 * cs-parser.jay: rework foreach statement to work with the new
18115 changes to the policy on SimpleNames.
18117 * report.cs: support Stacktrace on warnings as well.
18119 * makefile: drop --unsafe and /unsafe from the compile.
18121 2002-03-13 Ravi Pratap <ravi@ximian.com>
18123 * ecore.cs (StandardConversionExists): Modify to take an Expression
18124 as the first parameter. Ensure we do null -> reference type conversion
18127 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18128 temporary Expression objects.
18130 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18132 * interface.cs: workaround bug in method overloading resolution
18133 (there is already a bugzilla bug for it).
18135 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18137 We could also solve this problem by having a separate path for
18138 performing type lookups, instead of DoResolve, we could have a
18139 ResolveType entry point, and only participating pieces of the
18140 production (simplename, deref, array) would implement this.
18142 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18143 signal SimpleName to only resolve type names and not attempt to
18144 resolve anything else.
18146 * expression.cs (Cast): Set the flag.
18148 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18150 * class.cs: Only report 108 if there is no `new' modifier.
18152 * cs-parser.jay: rework foreach statement to work with the new
18153 changes to the policy on SimpleNames.
18155 * report.cs: support Stacktrace on warnings as well.
18157 * makefile: drop --unsafe and /unsafe from the compile.
18159 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18161 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18162 lookups here, instead of doing that at parse time. This means
18163 that our grammar will not introduce `LocalVariableReferences' as
18164 expressions at this point. That solves the problem of code like
18168 static void Main ()
18172 This is only half the fix. The full fix requires parameters to
18173 also be handled in this way.
18175 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18176 makes the use more obvious of the DeclSpace. The
18177 ec.TypeContainer.TypeBuilder is now only used to pull the
18178 TypeBuilder for it.
18180 My theory is that I can get rid of the TypeBuilder completely from
18181 the EmitContext, and have typecasts where it is used (from
18182 DeclSpace to where it matters).
18184 The only pending problem is that the code that implements Aliases
18185 is on TypeContainer, and probably should go in DeclSpace.
18187 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18188 lookups here, instead of doing that at parse time. This means
18189 that our grammar will not introduce `LocalVariableReferences' as
18190 expressions at this point. That solves the problem of code like
18194 static void Main ()
18198 This is only half the fix. The full fix requires parameters to
18199 also be handled in this way.
18201 * class.cs (Property.DefineMethod): When implementing an interface
18202 method, set newslot, when implementing an abstract method, do not
18203 set the flag (before we tried never setting it, or always setting
18204 it, which is the difference).
18205 (Indexer.DefineMethod): same.
18206 (Method.DefineMethod): same.
18208 * ecore.cs: Only set the status used flag if we get back a Field.
18210 * attribute.cs: Temporary hack, so Paolo can keep working.
18212 2002-03-08 Ravi Pratap <ravi@ximian.com>
18214 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18215 the unmanaged type in the case we have a MarshalAs attribute.
18217 (Resolve): Handle the case when we are parsing the special MarshalAs
18218 attribute [we need to store the unmanaged type to use later]
18220 * typemanager.cs (marshal_as_attr_type): Built in type for the
18221 MarshalAs Attribute.
18223 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18224 on parameters and accordingly set the marshalling info.
18226 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18228 * class.cs: Optimizing slightly by removing redundant code after
18229 we switched to the `NoTypes' return value.
18230 (Property.DefineMethod): use NoTypes here too.
18232 This fixes the bug I introduced in my last batch of changes.
18234 2002-03-05 Ravi Pratap <ravi@ximian.com>
18236 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18238 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18239 Enums since those are types too.
18241 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18243 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18244 thanks to a call during the lookup process.
18246 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18248 * statement.cs (Foreach): Lots of work to accomodate a particular
18249 kind of foreach statement that I had not kept in mind. It is
18250 possible to have foreachs on classes that provide a GetEnumerator
18251 method that return objects that implement the "pattern" for using
18252 a foreach, there is no need to support GetEnumerator
18255 This is needed to compile nant.
18257 * decl.cs: Only report 114 if the member is not `Finalize' and if
18258 the warning level is at least 2.
18260 * class.cs: Moved the compare function from Method to
18263 (MethodSignature.InheritableMemberSignatureCompare): Add new
18264 filter function that is used to extract inheritable methods from a
18267 (Method.Define): Use the new `inheritable_method_signature_filter'
18270 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18273 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18275 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18277 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18279 * expression.cs: Pass location information to
18280 ConvertImplicitStandard.
18282 * class.cs: Added debugging code to track return values from
18285 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18287 * expression.cs (Is.DoResolve): If either side of the `is' is an
18288 interface, do not flag the warning.
18290 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18293 * report.cs: Allow for --fatal to be used with --probe.
18295 * typemanager.cs (NoTypes): Move the definition for the empty Type
18298 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18300 (TypeContainer.DefineProxy): New function used to proxy to parent
18301 implementations when implementing interfaces.
18302 (TypeContainer.ParentImplements): used to lookup if our parent
18303 implements a public function that is required by an interface.
18304 (TypeContainer.VerifyPendingMethods): Hook this up.
18306 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18307 `modules' and `assemblies' arraylists into arrays. We only grow
18308 these are the very early start up of the program, so this improves
18309 the speedof LookupType (nicely measured).
18311 * expression.cs (MakeByteBlob): Replaced unsafe code with
18312 BitConverter, as suggested by Paolo.
18314 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18315 folding of string concatenation, but if either side is a string,
18316 and the other is not, then return null, and let the runtime use
18317 the concatenation on the string plus the object (using
18318 `Object.ToString').
18320 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18322 Constant Folding has been implemented now.
18324 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18325 the error instead on types that are not supported in one's
18328 * constant.cs (Constant and all children): New set of functions to
18329 perform implict and explicit conversions.
18331 * ecore.cs (EnumConstant): Implement the new functions to perform
18332 conversion by proxying to the child expression.
18334 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18335 own separate setting that can not be turned off from the command
18336 line using --unchecked or --checked and is only controlled using
18337 the checked/unchecked statements and expressions. This setting is
18338 used by the constant folder to flag errors.
18340 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18341 ConstantCheckState as well.
18343 During Resolve, they also have to flag the state, because the
18344 constant folder runs completely in the Resolve phase.
18346 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18349 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18351 * cfold.cs: New file, this file contains the constant folder.
18353 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18354 argument to track whether we are using the resulting address to
18355 load or store a value and provide better error messages.
18357 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18358 new AddressOf arguments.
18360 * statement.cs (Foreach.EmitCollectionForeach): Update
18362 * expression.cs (Argument.Emit): Call AddressOf with proper
18363 arguments to track usage.
18365 (New.DoEmit): Call AddressOf with new arguments.
18367 (Unary.Emit): Adjust AddressOf call.
18369 2002-03-01 Ravi Pratap <ravi@ximian.com>
18371 * cs-parser.jay (member_access): Change the case for pre-defined types
18372 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18375 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18378 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18379 essentially like methods and apply attributes like MethodImplOptions to them too.
18381 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18384 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18385 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18388 * Update code everywhere accordingly.
18390 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18392 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18394 2002-02-28 Ravi Pratap <ravi@ximian.com>
18396 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18397 try performing lookups against those instead of jumping straight into using
18398 the 'using' clauses.
18400 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18402 (LookupType): Perform lookups in implicit parents too.
18404 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18405 sequence as RootContext.LookupType.
18407 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18408 the various cases of namespace lookups into this method.
18410 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18412 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18413 in positional arguments)
18415 * class.cs (Operator): Update the AllowedModifiers to contain
18418 * cs-parser.jay: Update operator declaration to allow for the
18419 operator body to be empty.
18421 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18424 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18426 * class.cs (Method.Emit): Label parameters.
18428 * driver.cs: Return 1 or 0 as the program exit code.
18430 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18432 * expression.cs: Special case the `null' object when trying to
18433 auto-compute the type, as anything can be explicitly converted to
18436 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18437 spotting this Paolo.
18439 (Expression.ImplicitNumericConversion): Perform comparissions of
18440 the type using the underlying type in the case of an enumeration
18441 rather than using the enumeration type for the compare.
18443 Cope with the underlying == type case, which is not possible to
18446 (Expression.ConvertNumericExplicit): Perform comparissions of
18447 the type using the underlying type in the case of an enumeration
18448 rather than using the enumeration type for the compare.
18450 * driver.cs: If the user does not supply an extension, assume .exe
18452 * cs-parser.jay (if_statement): Rewrote so that we can track the
18453 location for the if statement.
18455 * expression.cs (Binary.ConstantFold): Only concat strings when
18456 the operation is "+", not everything ;-)
18458 * statement.cs (Statement.EmitBoolExpression): Take a location
18460 (If, While, Do): Track location.
18462 * expression.cs (Binary.ResolveOperator): In the object + string
18463 case, I was missing a call to ConvertImplicit
18465 2002-02-25 Ravi Pratap <ravi@ximian.com>
18467 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18468 Location arguments. Ensure we use RootContext.LookupType to do our work
18469 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18471 * interface.cs (PopulateMethod): Handle the type of the parameter being
18474 * expression.cs (Invocation.BetterFunction): Handle the case when we
18475 have a params method with no fixed arguments and a call is made with no
18478 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18480 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18481 the verbatim-string-literal
18483 * support.cs (InternalParameters.ParameterModifier): handle null
18485 (InternalParameters.ParameterType): ditto.
18487 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18488 duplicating the name of the variable parameter.
18489 (GetParameterByName): Fix bug where we were not looking up array
18490 paramters if they were the only present (thanks Paolo!).
18491 (GetParameterInfo): We only have an empty set of types if both
18492 fixed and array are set to null.
18493 (GetParameterInfo-idx): Handle FixedParameter == null
18495 * cs-parser.jay: Handle the case where there is no catch
18496 statements (missing null test).
18498 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18500 * driver.cs (MainDriver): Be conservative on our command line
18503 Catch DirectoryNotFoundException when calling GetFiles.
18505 (SplitPathAndPattern): Used to split the input specification into
18506 a path and a pattern that we can feed to Directory.GetFiles.
18508 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18510 * statement.cs (Fixed): Implement the last case of the Fixed
18511 statement (string handling).
18513 * expression.cs (StringPtr): New class used to return a char * to
18514 a string; Used by the Fixed statement.
18516 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18518 * expression.cs (Binary.ResolveOperator): Remove redundant
18519 MemberLookup pn parent type.
18520 Optimize union call, we do not need a union if the types are the same.
18521 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18524 Specialize the use of MemberLookup everywhere, instead of using
18525 the default settings.
18527 (StackAlloc): Implement stackalloc keyword.
18529 * cs-parser.jay: Add rule to parse stackalloc.
18531 * driver.cs: Handle /h, /help, /?
18533 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18534 before we supported unsafe code.
18536 * makefile: add --unsafe to the self compilation of mcs.
18538 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18540 * expression.cs (PointerArithmetic): New class that is used to
18541 perform pointer arithmetic.
18542 (Binary.Resolve): Handle pointer arithmetic
18543 Handle pointer comparission.
18544 (ArrayPtr): Utility expression class that is used to take the
18545 address of an array.
18547 (ElementAccess): Implement array access for pointers
18549 * statement.cs (Fixed): Implement fixed statement for arrays, we
18550 are missing one more case before we are done.
18552 * expression.cs (Indirection): Implement EmitAssign and set the
18553 ExprClass to Variable. This allows pointer dereferences to be
18554 treated as variables, and to have values assigned to them.
18556 * ecore.cs (Expression.StoreFromPtr): New utility function to
18557 store values dereferencing.
18559 2002-02-20 Ravi Pratap <ravi@ximian.com>
18561 * expression.cs (Binary.ResolveOperator): Ensure that we are
18562 not trying to operate on a void type - this fixes the reported
18565 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18566 the parent implementation is sealed.
18568 * ../errors/cs0239.cs : Add.
18570 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18572 * typemanager.cs (unverifiable_code_type): Corresponds to
18573 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18574 which have unsafe code in them.
18576 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18579 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18581 * cs-tokenizer.cs: Add support for @"litreal strings"
18583 Make tokenizer accept pre-processor directives
18584 on any column (remove the old C-like limitation).
18586 * rootcontext.cs (EmitCode): Emit any global attributes.
18587 (AddGlobalAttributes): Used to keep track of assembly attributes.
18589 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18591 * cs-parser.jay: Add support for global attributes.
18593 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18595 * expression.cs (Indirection): New helper class. Unary will
18596 create Indirection classes to be able to implement the
18597 IMemoryLocation interface on it.
18599 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18601 * cs-parser.jay (fixed_statement): reference the right statement.
18603 * statement.cs (Fixed.Emit): Finish implementing the fixed
18604 statement for the &x case.
18606 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18608 * class.cs (Property.Define, Method.Define): Remove newslot when
18611 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18612 wrong. NewSlot should only be used if the `new' keyword is present.
18614 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18615 locating our system dir. Sorry about this.
18617 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18619 * driver.cs (GetSystemDir): Compute correctly the location of our
18620 system assemblies. I was using the compiler directory instead of
18621 the library directory.
18623 2002-02-13 Ravi Pratap <ravi@ximian.com>
18625 * expression.cs (BetterFunction): Put back in what Miguel commented out
18626 since it is the correct fix. The problem is elsewhere ;-)
18628 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18629 parameters of the parms method are themselves compatible or not !
18631 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18632 to check that a class implements an interface before saying that an implicit
18633 conversion was allowed. Use ImplementsInterface to do the checking.
18635 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18637 * class.cs (Method.Define): Track whether we are an explicit
18638 implementation or not. And only call DefineMethodOverride if we
18639 are an explicit implementation.
18641 (Property.DefineMethod): Ditto.
18643 2002-02-11 Ravi Pratap <ravi@ximian.com>
18645 * expression.cs (BetterFunction): Catch hideous bug which was
18646 preventing us from detecting ambiguous calls due to implicit casts i.e
18649 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18651 * support.cs (Pair): Remove un-needed method. I figured why I was
18652 getting the error in cs-parser.jay, the variable in a foreach loop
18653 is readonly, and the compiler does not really treat this as a variable.
18655 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18656 instead of EQUALS in grammar.
18658 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18660 * expression.cs (Unary.DoResolve): Check whether the argument is
18663 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18665 * support.cs: Api for Pair to set a value. Despite the fact that
18666 the variables are public the MS C# compiler refuses to compile
18667 code that accesses the field if the variable is part of a foreach
18670 * statement.cs (Fixed): Begin implementation of the fixed
18673 (Block.AddVariable): Return the VariableInfo on success and null
18674 on failure instead of true/false.
18676 * cs-parser.jay (foreach): Catch errors on variables already
18677 defined (we were ignoring this value before) and properly unwind
18678 the block hierarchy
18680 (fixed_statement): grammar for the fixed statement.
18682 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18684 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18685 pointer types to be incretemented.
18687 (SizeOf): Implement.
18689 * cs-parser.jay (pointer_member_access): Implement
18690 expr->IDENTIFIER production.
18692 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18693 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18696 (Unary): Implement indirection.
18698 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18699 use in non-unsafe context).
18701 (SimpleName.DoResolve): Check for pointers in field access on safe
18704 (Expression.LoadFromPtr): Factor the load-indirect code in this
18705 function. This was duplicated in UnboxCast and ParameterReference
18707 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18709 * expression.cs (ComposedCast): report an error if a pointer cast
18710 is used in a safe region.
18712 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18713 pointer type casts in unsafe context.
18715 * codegen.cs (EmitContext): Set up IsUnsafe.
18717 * cs-parser.jay (non_expression_type): Add productions for pointer
18720 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18721 code. We should not use force into static mode if the method is
18722 not virtual. Fixes bug in MIS
18724 * statement.cs (Do.Emit, While.Emit, For.Emit,
18725 Statement.EmitBoolExpression): Add support to Do and While to
18726 propagate infinite loop as `I do return' semantics.
18728 Improve the For case to also test for boolean constants.
18730 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18731 to the list of attributes we can add.
18733 Remove `EmitContext' argument.
18735 * class.cs (Method.Define): Apply parameter attributes.
18736 (Constructor.Define): Apply parameter attributes.
18737 (MethodCore.LabelParameters): Move here the core of labeling
18740 * support.cs (ReflectionParameters.ParameterModifier,
18741 InternalParameters.ParameterModifier): Use IsByRef on the type and
18742 only return the OUT bit for these parameters instead of in/out/ref
18745 This is because I miss-understood things. The ParameterInfo.IsIn
18746 and IsOut represent whether the parameter has the [In] and [Out]
18749 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18751 * ecore.cs (FieldExpr.Emit): Release temporaries.
18753 * assign.cs (LocalTemporary.Release): new function.
18755 * codegen.cs (EmitContext.GetTemporaryStorage,
18756 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18757 temporary storage. Now we can "put back" localbuilders when we
18760 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18762 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18763 need to make a copy of the variable to generate verifiable code.
18765 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18767 * driver.cs: Compute dynamically the system directory.
18769 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18770 Slower, but more generally useful. Used by the abstract
18771 registering implementation.
18773 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18774 the rules for the special rule on Type/instances. First check if
18775 we have the same name, and if so, try that special static path
18776 rather than the instance path.
18778 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18780 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18783 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18784 Enum, ValueType, Delegate or Array for non-corlib compiles.
18786 * cs-tokenizer.cs: Catch long identifiers (645)
18788 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18791 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18792 fix, we were returning too early, so we were not registering
18793 pending methods from abstract classes.
18795 Do not register pending methods if the class is abstract.
18797 * expression.cs (Conditional.DoResolve): Report circular implicit
18798 conversions when we neecd to compute it for conditional
18801 (Is.DoResolve): If the expression is always of the provided type,
18802 flag warning 183. If the expression can not ever be of the
18803 provided type flag warning 184.
18805 * class.cs: Catch 169 as well.
18807 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18810 2002-01-18 Nick Drochak <ndrochak@gol.com>
18812 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18814 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18816 * interface.cs: (PopulateMethod): Check for pointers being defined
18817 only if the unsafe context is active.
18818 (PopulateProperty): ditto.
18819 (PopulateIndexer): ditto.
18821 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18822 specified. If pointers are present, make sure that they are
18823 present in an unsafe context.
18824 (Constructor, Constructor.Define): ditto.
18825 (Field, Field.Define): ditto.
18826 (Property, Property.Define): ditto.
18827 (Event, Event.Define): ditto.
18829 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18830 hashtable if there are classes or structs defined.
18832 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18833 code, as the constant resolution moved.
18835 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18836 the metadata, so we can flag error 133.
18838 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18839 pointer is being declared in an unsafe context.
18841 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18843 * modifiers.cs (Modifiers.Check): Require a Location argument.
18844 Report error 227 for Unsafe use.
18846 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18848 * statement.cs (For.Emit): If the test is null, then report that
18849 we do `return', as we wont reach anything afterwards.
18851 (Switch.SwitchGoverningType): Track the expression that matched
18854 * driver.cs: Allow negative numbers as an error code to flag.
18856 * cs-parser.jay: Handle 1551.
18858 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18860 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18862 * cs-parser.jay: Report 1518 (type declaration can only contain
18863 class, struct, interface, enum or delegate)
18865 (switch_label): Report 1523 (keywords `case' or `default' must
18868 (opt_switch_sections): Report 1522 (empty switch)
18870 * driver.cs: Report 1515 (response file specified multiple times)
18871 Report 1516 (Source file specified multiple times).
18873 * expression.cs (Argument.Resolve): Signal 1510
18875 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18876 access not allowed in static code)
18878 2002-01-11 Ravi Pratap <ravi@ximian.com>
18880 * typemanager.cs (IsPointerType): Utility method which we are going
18883 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18884 the object type, so we take care of that.
18886 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18888 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18889 added to non-params parameters :-)
18891 * typemanager.cs (CSharpName): Include 'void' type too.
18893 (void_ptr_type): Include in the set of core types.
18895 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
18898 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
18901 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
18902 completely forgotten about it.
18904 2002-01-10 Ravi Pratap <ravi@ximian.com>
18906 * cs-parser.jay (pointer_type): Add. This begins our implementation
18907 of parsing rules for unsafe code.
18909 (unsafe_statement): Implement.
18911 (embedded_statement): Modify to include the above.
18913 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18915 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18916 if the current context is an unsafe one.
18918 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18919 are handled differently, we need separate rules for them.
18921 (local_variable_declaration): Update to use local_variable_pointer_type
18922 to allow variable declarations of unmanaged pointer types.
18924 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18925 in unsafe contexts.
18927 * ../errors/cs0214.cs : Add.
18929 2002-01-16 Nick Drochak <ndrochak@gol.com>
18931 * makefile: remove 'response' file when cleaning.
18933 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18935 * cs-parser.jay: Report 1524.
18937 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18939 * typemanager.cs (RegisterMethod): drop checking if we have
18940 registered this from here
18942 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18944 * class.cs (Method.EmitDestructor): Implement calling our base
18947 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18948 value of InFinally.
18950 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18951 this routine and will wrap the call in a try/catch block. Deal
18954 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18956 * ecore.cs (Expression.MemberLookup): instead of taking a
18957 parameter `same_type' that was used to tell whether we could
18958 access private members we compute our containing type from the
18961 (FieldExpr): Added partial support for volatile fields. This does
18962 not work for volatile fields exposed from assemblies, as I can not
18963 figure out how to extract the modreq from it.
18965 Updated all the source files to use this.
18967 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18968 because it is referenced by MemberLookup very often.
18970 2002-01-09 Ravi Pratap <ravi@ximian.com>
18972 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18973 TypeBuilder.GetCustomAttributes to retrieve what we need.
18975 Get rid of redundant default_member_attr_type as this is the same as
18976 default_member_type which already exists.
18978 * interface.cs, attribute.cs : Update accordingly.
18980 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18982 * typemanager.cs: Enable IndexerPropertyName again. It does not
18983 work for TYpeBuilders though. Ravi, can you please fix this?
18985 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18987 * expression.cs (Argument.Emit): Handle the case of ref objects
18988 being passed to ref functions;
18990 (ParameterReference.EmitLoad): Loads the content of the pointer
18991 without dereferencing.
18993 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18995 * cs-tokenizer.cs: Implemented the pre-processing expressions.
18997 2002-01-08 Ravi Pratap <ravi@ximian.com>
18999 * class.cs (Indexer.DefineMethod): Incorporate the interface
19000 type in the name of the method if we are doing explicit interface
19003 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19005 (BetterConversion): Fix extremely trivial bug where we were referring to
19006 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19009 * ../errors/bug16.cs : Add although we have fixed it.
19011 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19013 * expression.cs (BaseIndexer): Begin implementation.
19015 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19017 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19018 production directly to remove a shift/reduce, and implement
19019 explicit interface implementation.
19021 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19022 after a floating point suffix.
19024 * expression.cs (DoNumericPromotions): Improved the conversion for
19025 uint/uint. If we have a constant, we avoid doing a typecast to a
19028 * class.cs (Indexer): Implement explicit interface implementation
19031 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19033 * class.cs: make the default instance constructor public and hidebysig.
19035 2001-01-03 Ravi Pratap <ravi@ximian.com>
19037 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19038 so we can call it from elsewhere.
19040 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19041 we emit it internally if the class has a defined indexer; otherwise the user
19042 emits it by decorating the class definition with the DefaultMemberAttribute.
19044 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19045 attribute is not used on a type which defines an indexer.
19047 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19048 character when we skip whitespace.
19050 * ../errors/cs0646.cs : Add.
19052 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19054 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19057 * makefile: Add practical target `mcs3.exe' which builds the third
19058 generation compiler.
19060 * expression.cs (New): Fix structures constructor calling.
19062 * class.cs (Property, Method, Indexer): Emit Final flag on the
19063 method if we are an interface implementation and we are not
19066 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19067 whether this property is referencing a `base' method.
19069 * expression.cs (Invocation.EmitCall): take an extra argument:
19070 is_base, this is used to determine whether the `call' or
19071 `callvirt' opcode should be used.
19074 * delegate.cs: update EmitCall.
19076 * class.cs (Method.Define): Set NewSlot for the cases where we are
19077 not implementing an interface method.
19079 (Property.Define): ditto.
19081 2002-01-02 Miguel de Icaza <miguel@ximian.com>
19083 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19084 'r'. Allows mcs to parse itself fully.
19086 2002-01-02 Ravi Pratap <ravi@ximian.com>
19088 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19089 of the number of initializers that require the InitializeArray method.
19091 (CheckIndices): Store the Expression in all cases - not the plain value. Also
19092 update the above field where necessary.
19094 (MakeByteBlob): Update accordingly.
19096 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
19099 (EmitDynamicInitializers): Update in accordance with the new optimization.
19101 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19102 same OpCode applies.
19104 * cs-parser.jay : Fix some glaring errors I introduced.
19106 2002-01-01 Ravi Pratap <ravi@ximian.com>
19108 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19109 so that we can check for name clashes there too.
19111 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19112 for interface indexers.
19114 * interfaces.cs (Define): Emit the default member attribute.
19116 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19117 variable was being referred to while setting the value ;-)
19119 2002-01-01 Miguel de Icaza <miguel@ximian.com>
19121 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19122 byte-by-byte information when we know the data is zero.
19124 Make the block always a multiple of 4, because
19125 DefineInitializedData has a bug.
19127 * assign.cs: Fix, we should assign from the temporary, not from
19130 * expression.cs (MakeByteBlob): Fix my incorrect code.
19132 2001-12-31 Miguel de Icaza <miguel@ximian.com>
19134 * typemanager.cs (EnumToUnderlying): This function is used to get
19135 the underlying type from an enumeration, because it does not
19138 * constant.cs: Use the I4_S form for values between -128 and 127.
19140 * statement.cs (Block.LookupLabel): Looks up a label.
19141 (Block): Drop support for labeled blocks.
19143 (LabeledStatement): New kind of statement that represents a label
19146 (Goto): Finally implement this bad boy.
19148 * cs-parser.jay: Update to reflect new mechanism to implement
19151 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19153 * codegen.cs (EmitContext.This): a codegen property that keeps the
19154 a single instance of this instead of creating many different this
19157 * delegate.cs (Delegate.DoResolve): Update to use the property;
19159 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19161 * expression.cs (BaseAccess.DoResolve): Ditto.
19163 2001-12-29 Ravi Pratap <ravi@ximian.com>
19165 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19166 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19168 (InitCoreTypes): Update accordingly.
19170 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19171 so we can quickly store the state.
19173 (ApplyAttributes): Set the correct implementation flags
19174 for InternalCall methods.
19176 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19178 * expression.cs (EmitCall): if a method is not virtual, then do
19179 not use callvirt on it.
19181 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19182 user defined stuff) requires the use of stobj, which takes an
19183 address on the stack instead of an array and an index. So emit
19184 the Ldelema operation for it.
19186 (EmitStoreOpcode): Use stobj for valuetypes.
19188 (UnaryMutator.EmitCode): Use the right 1 value depending on
19189 whether we are dealing with int64/uint64, float or doubles.
19191 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19192 constructors that I implemented last night.
19194 (Constructor.IsDefault): Fix to work properly for static
19197 * cs-parser.jay (CheckDef): report method signature errors.
19198 Update error number 103 to be 132.
19200 * decl.cs: New AdditionResult enumeration value: MethodExists.
19201 Although we do this check for methods later on in the semantic
19202 analysis, catching repeated default constructors is so easy that
19203 we catch these here.
19205 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19208 (ParameterReference.EmitAssign, Emit): handle
19211 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19212 (ArrayAccess.EmitStoreOpcode): ditto.
19214 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19216 * expression.cs (MakeByteBlob): Complete all the missing types
19217 (uint, short, ushort, byte, sbyte)
19219 * class.cs: Only init instance field initializers on instance
19222 Rename `constructors' to instance_constructors.
19224 (TypeContainer.AddConstructor): Only add constructors to the list
19225 if it is not static.
19227 Make sure that we handle default_static_constructor independently
19228 everywhere where we handle instance_constructors
19230 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19232 * class.cs: Do not lookup or create a base initializer for a
19233 static constructor.
19235 (ConstructorInitializer.Resolve): use the proper type to lookup
19238 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19240 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19243 * decl.cs: CloseType is now an virtual method, the default
19244 implementation just closes this type.
19246 2001-12-28 Ravi Pratap <ravi@ximian.com>
19248 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19249 to PreserveSig by default. Also emit HideBySig on such methods.
19251 Basically, set the defaults to standard values.
19253 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19254 argument, if candidate is better, it can't be worse than the best !
19256 (Invocation): Re-write bits to differentiate between methods being
19257 applicable in their expanded form and their normal form - for params
19260 Get rid of use_standard everywhere as only standard conversions are allowed
19261 in overload resolution.
19263 More spec conformance.
19265 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19267 * driver.cs: Add --timestamp, to see where the compiler spends
19270 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19271 `this' in static code.
19273 (SimpleName.DoResolve): Implement in terms of a helper function
19274 that allows static-references to be passed upstream to
19277 (Expression.ResolveWithSimpleName): Resolve specially simple
19278 names when called by MemberAccess to implement the special
19281 (Expression.ImplicitReferenceConversion): Handle conversions from
19282 Null to reference types before others, as Null's type is
19285 * expression.cs (Invocation.EmitCall): Handle the special case of
19286 calling methods declared on a reference type from a ValueType
19287 (Base classes System.Object and System.Enum)
19289 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19290 the left hand side is a TypeExpr, not on every enumeration.
19292 (Binary.Resolve): If types are reference types, then do a cast to
19293 object on operators != and == of both arguments.
19295 * typemanager.cs (FindMembers): Extract instance and static
19296 members if requested.
19298 * interface.cs (PopulateProperty): Use void_type instead of null
19299 as the return type for the setter method.
19301 (PopulateIndexer): ditto.
19303 2001-12-27 Ravi Pratap <ravi@ximian.com>
19305 * support.cs (ReflectionParameters): Fix minor bug where we
19306 were examining the wrong parameter for the ParamArray attribute.
19308 Cope with requests for the type of the parameter at position
19309 greater than the params parameter's. We now return the element
19310 type of the params array as that makes more sense.
19312 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19313 accordingly as we no longer have to extract the element type
19316 (Invocation.OverloadResolve): Update.
19318 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19320 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19321 against IEnumerator, test whether the return value is a descendant
19322 of the IEnumerator interface.
19324 * class.cs (Indexer.Define): Use an auxiliary method to implement
19325 the other bits of the method definition. Begin support for
19326 explicit interface implementation.
19328 (Property.DefineMethod): Use TypeManager.void_type instead of null
19329 for an empty return value.
19331 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19333 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19334 dealing with a FieldExpr which is composed of a FieldBuilder, in
19335 the code path we did extract the constant, but we should have
19336 obtained the underlying value to be able to cast it (otherwise we
19337 end up in an infinite loop, this is what Ravi was running into).
19339 (ArrayCreation.UpdateIndices): Arrays might be empty.
19341 (MemberAccess.ResolveMemberAccess): Add support for section
19342 14.5.4.1 that deals with the special case of E.I when E is a type
19343 and something else, that I can be a reference to a static member.
19345 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19346 handle a particular array type to create byte blobs, it is just
19347 something we dont generate byteblobs for.
19349 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19352 * location.cs (Push): remove the key from the hashtable that we
19353 are about to add. This happens for empty files.
19355 * driver.cs: Dispose files after we have parsed them.
19357 (tokenize): new function that only runs the tokenizer on its
19358 input, for speed testing.
19360 2001-12-26 Ravi Pratap <ravi@ximian.com>
19362 * class.cs (Event.Define): Define the private field only if there
19363 are no accessors defined.
19365 * expression.cs (ResolveMemberAccess): If there is no associated
19366 field with the event, that means we have an event defined with its
19367 own accessors and we should flag error cs0070 since transforming
19368 ourselves into a field is not valid in that case.
19370 * ecore.cs (SimpleName.DoResolve): Same as above.
19372 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19373 and charset to sane values.
19375 2001-12-25 Ravi Pratap <ravi@ximian.com>
19377 * assign.cs (DoResolve): Perform check on events only if they
19378 are being accessed outside the declaring type.
19380 * cs-parser.jay (event_declarations): Update rules to correctly
19381 set the type of the implicit parameter etc.
19383 (add_accessor, remove_accessor): Set current local parameters.
19385 * expression.cs (Binary): For delegate addition and subtraction,
19386 cast the return value from the method into the appropriate delegate
19389 2001-12-24 Ravi Pratap <ravi@ximian.com>
19391 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19392 of these as the workaround is unnecessary.
19394 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19395 delegate data - none of that is needed at all.
19397 Re-write bits to extract the instance expression and the delegate method
19400 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19403 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19404 of attaching attributes instead of duplicating code everywhere.
19406 * everywhere : Update code to do attribute emission using the above method.
19408 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19410 * expression.cs (IsParamsMethodApplicable): if there are not
19411 parameters, return immediately.
19413 * ecore.cs: The 0 literal can be implicity converted to an enum
19416 (SimpleName.DoResolve): First lookup the type, then lookup the
19419 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19420 want to get its address. If the InstanceExpression is not
19421 addressable, store the result in a temporary variable, then get
19424 * codegen.cs: Only display 219 errors on warning level or above.
19426 * expression.cs (ArrayAccess): Make it implement the
19427 IMemoryLocation interface.
19429 (Binary.DoResolve): handle the operator == (object a, object b)
19430 and operator != (object a, object b) without incurring into a
19431 BoxedCast (because 5 != o should never be performed).
19433 Handle binary enumerator operators.
19435 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19436 value type, otherwise use Ldelem_ref.
19438 Use precomputed names;
19440 (AddressOf): Implement address of
19442 * cs-parser.jay (labeled_statement): Fix recursive block
19443 addition by reworking the production.
19445 * expression.cs (New.DoEmit): New has a special case:
19447 If we are dealing with a ValueType, we have a few
19448 situations to deal with:
19450 * The target of New is a ValueType variable, that is
19451 easy, we just pass this as the variable reference
19453 * The target of New is being passed as an argument,
19454 to a boxing operation or a function that takes a
19457 In this case, we need to create a temporary variable
19458 that is the argument of New.
19461 2001-12-23 Ravi Pratap <ravi@ximian.com>
19463 * rootcontext.cs (LookupType): Check that current_type is not null before
19464 going about looking at nested types.
19466 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19467 not implement the IAssignMethod interface any more.
19469 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19470 where we tranform them into FieldExprs if they are being resolved from within
19471 the declaring type.
19473 * ecore.cs (SimpleName.DoResolve): Do the same here.
19475 * assign.cs (DoResolve, Emit): Clean up code considerably.
19477 * ../errors/bug10.cs : Add.
19479 * ../errors/cs0070.cs : Add.
19481 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19483 * assign.cs : Get rid of EventIsLocal everywhere.
19485 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19487 * ecore.cs (ConvertIntLiteral): finished the implementation.
19489 * statement.cs (SwitchLabel): Convert the value we are using as a
19490 key before looking up the table.
19492 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19494 * codegen.cs (EmitTopBlock): Require a Location argument now.
19496 * cs-parser.jay (constructor_declarator): We need to setup
19497 current_local_parameters before we parse the
19498 opt_constructor_initializer, to allow the variables to be bound
19499 to the constructor arguments.
19501 * rootcontext.cs (LookupType): First lookup nested classes in our
19502 class and our parents before we go looking outside our class.
19504 * expression.cs (ConstantFold): Extract/debox the values at the
19507 * rootcontext.cs (EmitCode): Resolve the constants first before we
19508 resolve the types. This is not really needed, but it helps debugging.
19510 * statement.cs: report location.
19512 * cs-parser.jay: pass location to throw statement.
19514 * driver.cs: Small bug fix.
19516 * report.cs: Updated format to be 4-zero filled digits.
19518 2001-12-22 Ravi Pratap <ravi@ximian.com>
19520 * expression.cs (CheckIndices): Fix minor bug where the wrong
19521 variable was being referred to ;-)
19523 (DoEmit): Do not call EmitStaticInitializers when the
19524 underlying type is System.Object.
19526 2001-12-21 Ravi Pratap <ravi@ximian.com>
19528 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19529 and do the usual workaround for SRE.
19531 * class.cs (MyEventBuilder.EventType): New member to get at the type
19532 of the event, quickly.
19534 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19536 * assign.cs (Assign.DoResolve): Handle the case when the target
19537 is an EventExpr and perform the necessary checks.
19539 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19542 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19544 (EventExpr): Set the type in the constructor itself since we
19545 are meant to be born fully resolved.
19547 (EventExpr.Define): Revert code I wrote earlier.
19549 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19550 instance expression is null. The instance expression is a This in that case
19551 or a null, depending on whether it is a static method or not.
19553 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19554 refers to more than one method.
19556 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19557 and accordingly flag errors.
19559 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19561 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19563 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19565 * location.cs (ToString): Provide useful rutine.
19567 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19569 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19570 objects, return the actual integral boxed.
19572 * statement.cs (SwitchLabel): define an ILLabel for each
19575 (Switch.CheckSwitch): If the value is a Literal, extract
19576 the underlying literal.
19578 Also in the unused hashtable we had, add the SwitchLabel so we can
19579 quickly look this value up.
19581 * constant.cs: Implement a bunch of new constants. Rewrite
19582 Literal based on this. Made changes everywhere to adapt to this.
19584 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19585 dereferencing array only once, and also copes with enumrations.
19587 bytes are two bytes wide, not one.
19589 (Cast): Perform constant conversions.
19591 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19592 wrappers to the literals here.
19594 * expression.cs (DoNumericPromotions): long literals can converted
19595 to ulong implicity (this is taken care of elsewhere, but I was
19596 missing this spot).
19598 * ecore.cs (Expression.Literalize): Make the return type Literal,
19599 to improve type checking.
19601 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19603 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19605 * literal.cs: Revert code from ravi that checked the bounds. The
19606 bounds are sane by the definition of the type itself.
19608 * typemanager.cs: Fix implementation of ImplementsInterface. We
19609 need to actually look up in our parent hierarchy for interfaces
19612 * const.cs: Use the underlying type for enumerations
19614 * delegate.cs: Compute the basename for the delegate creation,
19615 that should fix the delegate test case, and restore the correct
19616 Type Lookup semantics in rootcontext
19618 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19619 referencing a nested type with the Reflection API is using the "+"
19622 * cs-parser.jay: Do not require EOF token at the end.
19624 2001-12-20 Ravi Pratap <ravi@ximian.com>
19626 * rootcontext.cs (LookupType): Concatenate type names with
19627 a '.' instead of a '+' The test suite passes again.
19629 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19630 field of the enumeration.
19632 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19633 the case when the member is an EventExpr.
19635 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19636 static has an associated instance expression.
19638 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19640 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19642 * class.cs (Event.Define): Register event and perform appropriate checks
19645 We define the Add and Remove methods even if the use provides none because
19646 in that case, we provide default implementations ourselves.
19648 Define a private field of the type of the event. This is done by the CSC compiler
19649 and we should be doing it too ;-)
19651 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19652 More methods we use in code we generate.
19654 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19657 (InitCoreTypes): Update accordingly for the above.
19659 * class.cs (Event.Emit): Generate code for default accessors that we provide
19661 (EmitDefaultMethod): Do the job in the above.
19663 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19666 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19668 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19669 builders even if we were missing one.
19671 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19672 pass the Basename as our class name instead of the Name. The
19673 basename will be correctly composed for us.
19675 * parameter.cs (Paramters): Now takes a Location argument.
19677 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19678 make all the code call directly LookupType in RootContext and take
19679 this chance to pass the Location information everywhere.
19681 * Everywhere: pass Location information.
19683 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19685 * class.cs (Constructor.Define): Updated way of detecting the
19686 length of the parameters.
19688 (TypeContainer.DefineType): Use basename as the type name for
19691 (TypeContainer.Define): Do not recursively define types here, as
19692 definition is taken care in order by the RootContext.
19694 * tree.cs: Keep track of namespaces in a per-file basis.
19696 * parameter.cs (Parameter.ComputeSignature): Update to use
19699 (Parameters.GetSignature): ditto.
19701 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19702 instead of a TypeContainer.
19704 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19705 resolve names. Because we need to be resolve in our context, not
19708 * driver.cs: Implement response files.
19710 * class.cs (TypeContainer.DefineType): If we are defined, do not
19711 redefine ourselves.
19713 (Event.Emit): Emit the code for add/remove handlers.
19714 (Event.Define): Save the MethodBuilders for add/remove.
19716 * typemanager.cs: Use pair here too.
19718 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19719 DictionaryEntry requires the first argument to be non-null.
19721 (enum_declaration): Compute full name for registering the
19724 (delegate_declaration): Instead of using
19725 formal_parameter_list, use opt_formal_parameter_list as the list
19728 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19729 (EventParsing): New property that controls whether `add' and
19730 `remove' are returned as tokens or identifiers (for events);
19732 2001-12-19 Ravi Pratap <ravi@ximian.com>
19734 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19735 use MyEventBuilder only and let it wrap the real builder for us.
19737 (MyEventBuilder): Revamp constructor etc.
19739 Implement all operations that we perform on EventBuilder in precisely the same
19742 (FindMembers): Update to use the EventBuilder member.
19744 (Event.Emit): Update accordingly.
19746 2001-12-18 Ravi Pratap <ravi@ximian.com>
19748 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19749 by calling the appropriate methods.
19751 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19754 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19756 2001-12-17 Ravi Pratap <ravi@ximian.com>
19758 * delegate.cs (Delegate.Populate): Check that the return type
19759 and various parameters types are indeed accessible.
19761 * class.cs (Constructor.Define): Same here.
19763 (Field.Define): Ditto.
19765 (Event.Define): Ditto.
19767 (Operator.Define): Check that the underlying Method defined itself
19768 correctly - so it's MethodBuilder should not be null.
19770 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19771 expression happens to be null.
19773 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19774 members but as of now we don't seem to be able to do anything really useful with it.
19776 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19777 not the EventBuilder.
19779 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19781 * cs-tokenizer.cs: Add support for defines.
19782 Add support for #if, #elif, #else, #endif
19784 (eval_var): evaluates a variable.
19785 (eval): stubbed for evaluating functions.
19787 * cs-parser.jay: Pass the defines information
19789 * driver.cs: Add --define command line option.
19791 * decl.cs: Move MemberCore here.
19793 Make it the base class for DeclSpace. This allows us to catch and
19794 report 108 and 109 for everything now.
19796 * class.cs (TypeContainer.Define): Extract all the members
19797 before populating and emit the warning 108 (new keyword required
19798 to override) instead of having each member implement this.
19800 (MemberCore.Define): New abstract method, we will be using this in
19801 the warning reporting engine in Populate.
19803 (Operator.Define): Adjust to new MemberCore protocol.
19805 * const.cs (Const): This does not derive from Expression, it is a
19806 temporary object we use to create fields, it is a MemberCore.
19808 * class.cs (Method.Define): Allow the entry point to be in a
19811 * driver.cs: Rewrite the argument handler to clean it up a bit.
19813 * rootcontext.cs: Made it just an auxiliary namespace feature by
19814 making everything static.
19816 * driver.cs: Adapt code to use RootContext type name instead of
19819 * delegate.cs: Remove RootContext argument.
19821 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19824 * class.cs (Event.Define): The lookup can fail.
19826 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19828 * expression.cs: Resolve the this instance before invoking the code.
19830 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19832 * cs-parser.jay: Add a production in element_access that allows
19833 the thing to become a "type" reference. This way we can parse
19834 things like "(string [])" as a type.
19836 Note that this still does not handle the more complex rules of
19840 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19842 * ecore.cs: (CopyNewMethods): new utility function used to
19843 assemble the list of methods from running FindMembers.
19845 (MemberLookup): Rework FindMembers so that
19847 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19849 * class.cs (TypeContainer): Remove Delegates who fail to be
19852 * delegate.cs (Populate): Verify that we dont get null return
19853 values. TODO: Check for AsAccessible.
19855 * cs-parser.jay: Use basename to emit error 574 (destructor should
19856 have the same name as container class), not the full name.
19858 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19859 possible representation.
19861 Also implements integer type suffixes U and L.
19863 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19865 * expression.cs (ArrayCreation.DoResolve): We need to do the
19866 argument resolution *always*.
19868 * decl.cs: Make this hold the namespace. Hold the root context as
19870 (LookupType): Move here.
19872 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19874 * location.cs (Row, Name): Fixed the code, it was always returning
19875 references to the first file.
19877 * interface.cs: Register properties defined through interfaces.
19879 * driver.cs: Add support for globbing on the command line
19881 * class.cs (Field): Make it derive from MemberCore as well.
19884 2001-12-15 Ravi Pratap <ravi@ximian.com>
19886 * class.cs (Event::Define): Check that the type of the event is a delegate
19887 type else flag error #66.
19889 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19892 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19893 values of EntryPoint, CharSet etc etc.
19895 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19897 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19898 be null and we should ignore this. I am not sure if this is really clean. Apparently,
19899 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19900 which needs this to do its work.
19902 * ../errors/cs0066.cs : Add.
19904 2001-12-14 Miguel de Icaza <miguel@ximian.com>
19906 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19909 * class.cs: (MethodSignature.MethodSignature): Removed hack that
19910 clears out the parameters field.
19911 (MemberSignatureCompare): Cleanup
19913 (MemberCore): New base class used to share code between MethodCore
19916 (RegisterRequiredImplementations) BindingFlags.Public requires
19917 either BindingFlags.Instace or Static. Use instance here.
19919 (Property): Refactored code to cope better with the full spec.
19921 * parameter.cs (GetParameterInfo): Return an empty array instead
19924 * class.cs (Property): Abstract or extern properties have no bodies.
19926 * parameter.cs (GetParameterInfo): return a zero-sized array.
19928 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19929 method modifier validation to the typecontainer so we can reuse
19930 this on properties.
19932 (MethodCore.ParameterTypes): return an empty sized array of types.
19934 (Property.Define): Test property modifier validity.
19936 Add tests for sealed/override too.
19938 (Method.Emit): abstract or extern methods have no bodies.
19940 2001-12-14 Ravi Pratap <ravi@ximian.com>
19942 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19945 (Method::Define, ::Emit): Modify accordingly.
19947 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19949 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19951 * makefile: Pass in /unsafe.
19953 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19955 * class.cs (MakeKey): Kill routine.
19957 * class.cs (TypeContainer.Define): Correctly define explicit
19958 method implementations (they require the full interface name plus
19961 * typemanager.cs: Deply the PtrHashtable here and stop using the
19962 lame keys. Things work so much better.
19964 This of course broke everyone who depended on `RegisterMethod' to
19965 do the `test for existance' test. This has to be done elsewhere.
19967 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19968 the object stupid Equals method (because, that like fails all over
19969 the place). We still do not use it.
19971 * class.cs (TypeContainer.SetRequiredInterface,
19972 TypeContainer.RequireMethods): Killed these two routines and moved
19973 all the functionality to RegisterRequiredImplementations.
19975 (TypeContainer.RegisterRequiredImplementations): This routine now
19976 registers all the implementations required in an array for the
19977 interfaces and abstract methods. We use an array of structures
19978 which can be computed ahead of time to reduce memory usage and we
19979 also assume that lookups are cheap as most classes will not
19980 implement too many interfaces.
19982 We also avoid creating too many MethodSignatures.
19984 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19985 clear the "pending" bit if we find that there are problems with
19988 (TypeContainer.VerifyPendingMethods): Update to report errors of
19989 methods that look like implementations but are not.
19991 (TypeContainer.Define): Add support for explicit interface method
19994 2001-12-12 Miguel de Icaza <miguel@ximian.com>
19996 * typemanager.cs: Keep track of the parameters here instead of
19997 being a feature of the TypeContainer.
19999 * class.cs: Drop the registration of parameters here, as
20000 InterfaceMethods are also interface declarations.
20002 * delegate.cs: Register methods with the TypeManager not only with
20003 the TypeContainer. This code was buggy.
20005 * interface.cs: Full registation here.
20007 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20009 * expression.cs: Remove reducer for binary expressions, it can not
20012 * const.cs: Put here the code that used to go into constant.cs
20014 * constant.cs: Put here the code for constants, this is a new base
20015 class for Literals.
20017 * literal.cs: Make Literal derive from Constant.
20019 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20021 * statement.cs (Return.Emit): Report error 157 if the user
20022 attempts to return from a finally block.
20024 (Return.Emit): Instead of emitting a return, jump to the end of
20027 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20028 LocalBuilder to store the result of the function. ReturnLabel is
20029 the target where we jump.
20032 2001-12-09 Radek Doulik <rodo@ximian.com>
20034 * cs-parser.jay: remember alias in current namespace
20036 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20039 * class.cs (LookupAlias): lookup alias in my_namespace
20041 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20043 (LookupAlias): lookup alias in this and if needed in parent
20046 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20050 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20051 making things static. I need this to avoid passing the
20052 TypeContainer when calling ParameterType.
20054 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20055 that did string manipulation to compute the type and then call
20056 GetType. Use Parameter.ParameterType instead.
20058 * cs-tokenizer.cs: Consume the suffix for floating values.
20060 * expression.cs (ParameterReference): figure out whether this is a
20061 reference parameter or not. Kill an extra variable by computing
20062 the arg_idx during emission.
20064 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20065 function that returns whether a parameter is an out/ref value or not.
20067 (Parameter.ParameterType): The type of the parameter (base,
20068 without ref/out applied).
20070 (Parameter.Resolve): Perform resolution here.
20071 (Parameter.ExternalType): The full type (with ref/out applied).
20073 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20074 support for expressions on the using statement.
20076 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20078 * statement.cs (Using.EmitLocalVariableDecls): Split the
20079 localvariable handling of the using statement.
20081 (Block.EmitMeta): Keep track of variable count across blocks. We
20082 were reusing slots on separate branches of blocks.
20084 (Try.Emit): Emit the general code block, we were not emitting it.
20086 Check the type of the declaration to be an IDisposable or
20087 something that can be implicity converted to it.
20089 Emit conversions if required.
20091 * ecore.cs (EmptyExpression): New utility class.
20092 (Expression.ImplicitConversionExists): New utility function.
20094 2001-12-06 Miguel de Icaza <miguel@ximian.com>
20096 * statement.cs (Using): Implement.
20098 * expression.cs (LocalVariableReference): Support read only variables.
20100 * statement.cs: Remove the explicit emit for the Leave opcode.
20101 (VariableInfo): Add a readonly field.
20103 2001-12-05 Miguel de Icaza <miguel@ximian.com>
20105 * ecore.cs (ConvCast): new class used to encapsulate the various
20106 explicit integer conversions that works in both checked and
20107 unchecked contexts.
20109 (Expression.ConvertNumericExplicit): Use new ConvCast class to
20110 properly generate the overflow opcodes.
20112 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20114 * statement.cs: The correct type for the EmptyExpression is the
20115 element_type, not the variable type. Ravi pointed this out.
20117 2001-12-04 Ravi Pratap <ravi@ximian.com>
20119 * class.cs (Method::Define): Handle PInvoke methods specially
20120 by using DefinePInvokeMethod instead of the usual one.
20122 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20123 above to do the task of extracting information and defining the method.
20125 2001-12-04 Ravi Pratap <ravi@ximian.com>
20127 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20128 of the condition for string type.
20130 (Emit): Move that here.
20132 (ArrayCreation::CheckIndices): Keep string literals in their expression
20135 (EmitDynamicInitializers): Handle strings appropriately.
20137 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20139 * codegen.cs (EmitContext): Replace multiple variables with a
20140 single pointer to the current Switch statement.
20142 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20145 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20149 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20152 (Foreach.Emit): Foreach on arrays was not setting
20153 up the loop variables (for break/continue).
20155 (GotoCase): Semi-implented.
20157 2001-12-03 Ravi Pratap <ravi@ximian.com>
20159 * attribute.cs (CheckAttribute): Handle system attributes by using
20160 Attribute.GetAttributes to examine information we need.
20162 (GetValidPlaces): Same here.
20164 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20166 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20168 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20170 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20172 (Method::Emit): Handle the case when we are a PInvoke method.
20174 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20176 * expression.cs: Use ResolveWithSimpleName on compound names.
20178 2001-12-02 Ravi Pratap <ravi@ximian.com>
20180 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20181 before trying to reduce it.
20183 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20185 * constant.cs (LookupConstantValue): Implement.
20187 (EmitConstant): Use the above in emitting the constant.
20189 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20190 that are user-defined by doing a LookupConstantValue on them.
20192 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20195 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20197 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20199 (BaseAccess.DoResolve): Implement.
20201 (MemberAccess.DoResolve): Split this routine into a
20202 ResolveMemberAccess routine that can be used independently
20204 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20206 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20207 As that share bits of the implementation. Is returns a boolean,
20208 while As returns the Type that is being probed.
20210 2001-12-01 Ravi Pratap <ravi@ximian.com>
20212 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20213 instead of a Literal - much easier.
20215 (EnumInTransit): Remove - utterly useless :-)
20217 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20219 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20221 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20222 chain when we have no associated expression.
20224 2001-11-30 Ravi Pratap <ravi@ximian.com>
20226 * constant.cs (Define): Use Location while reporting the errror.
20228 Also emit a warning when 'new' is used and there is no inherited
20231 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20234 (LookupEnumValue): Implement to lookup an enum member's value and define it
20237 (Populate): Re-write accordingly to use the above routine.
20239 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20241 * expression.cs (This): Fix prototype for DoResolveLValue to
20242 override the base class DoResolveLValue.
20244 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20247 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20248 (we need to load the address of the field here). This fixes
20251 (FieldExpr.DoResolveLValue): Call the DoResolve
20252 function to initialize the Instance expression.
20254 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20255 correctly the GetEnumerator operation on a value type.
20257 * cs-parser.jay: Add more simple parsing error catches.
20259 * statement.cs (Switch): Add support for string switches.
20260 Handle null specially.
20262 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20264 2001-11-28 Ravi Pratap <ravi@ximian.com>
20266 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20268 (declare_local_constant): New helper function.
20270 * statement.cs (AddConstant): Keep a separate record of constants
20272 (IsConstant): Implement to determine if a variable is a constant.
20274 (GetConstantExpression): Implement.
20276 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20278 * statement.cs (IsVariableDefined): Re-write.
20280 2001-11-27 Ravi Pratap <ravi@ximian.com>
20282 * class.cs (TypeContainer::FindMembers): Look for constants
20283 in the case when we are looking for MemberTypes.Field
20285 * expression.cs (MemberAccess::DoResolve): Check that in the
20286 case we are a FieldExpr and a Literal, we are not being accessed
20287 by an instance reference.
20289 * cs-parser.jay (local_constant_declaration): Implement.
20291 (declaration_statement): Implement for constant declarations.
20293 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20295 * statement.cs (Switch): Catch double defaults.
20297 (Switch): More work on the switch() statement
20298 implementation. It works for integral values now, need to finish
20302 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20304 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20305 integer literals into other integer literals. To be used by
20308 2001-11-24 Ravi Pratap <ravi@ximian.com>
20310 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20313 (EmitDynamicInitializers): Cope with the above since we extract data
20314 directly from ArrayData now.
20316 (ExpectInitializers): Keep track of whether initializers are mandatory
20319 (Bounds): Make it a hashtable to prevent the same dimension being
20320 recorded for every element in that dimension.
20322 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20325 Also fix bug which was causing the indices to be emitted in the reverse
20328 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20330 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20331 unfinished. They do not work, because the underlying code is
20334 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20336 * cs-parser.jay: Remove bogus fixme.
20338 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20339 on Switch statement.
20341 2001-11-23 Ravi Pratap <ravi@ximian.com>
20343 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20346 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20347 parameter. Apparently, any expression is allowed.
20349 (ValidateInitializers): Update accordingly.
20351 (CheckIndices): Fix some tricky bugs thanks to recursion.
20353 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20354 I was being completely brain-dead.
20356 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20357 and re-write acordingly.
20359 (DelegateInvocation): Re-write accordingly.
20361 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20363 (MakeByteBlob): Handle types more correctly.
20365 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20366 initialization from expressions but it is incomplete because I am a complete
20369 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20371 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20372 on If. Basically, we have to return `true' (ie, we do return to
20373 our caller) only if both branches of the if return.
20375 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20376 short-circuit operators, handle them as short circuit operators.
20378 (Cast.DoResolve): Resolve type.
20379 (Cast.Cast): Take an expression as the target type.
20381 * cs-parser.jay (cast_expression): Remove old hack that only
20382 allowed a limited set of types to be handled. Now we take a
20383 unary_expression and we resolve to a type during semantic
20386 Use the grammar productions from Rhys to handle casts (this is
20387 not complete like Rhys syntax yet, we fail to handle that corner
20388 case that C# has regarding (-x), but we will get there.
20390 2001-11-22 Ravi Pratap <ravi@ximian.com>
20392 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20393 field which is an array type.
20395 * cs-parser.jay (declare_local_variables): Support array initialization too.
20397 * typemanager.cs (MakeKey): Implement.
20399 (everywhere): Use the above appropriately.
20401 * cs-parser.jay (for_statement): Update for array initialization while
20402 declaring variables.
20404 * ecore.cs : The error message was correct, it's the variable's names that
20405 were misleading ;-) Make the code more readable.
20407 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20408 the correct type etc.
20410 (ConvertExplicit): Handle Enum types by examining the underlying type.
20412 2001-11-21 Ravi Pratap <ravi@ximian.com>
20414 * parameter.cs (GetCallingConvention): Always return
20415 CallingConventions.Standard for now.
20417 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20419 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20420 and `r' after calling DoNumericPromotions.
20422 * ecore.cs: Fix error message (the types were in the wrong order).
20424 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20425 BindingFlags.Instance as well
20427 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20428 implicit int literal conversion in an empty cast so that we
20429 propagate the right type upstream.
20431 (UnboxCast): new class used to unbox value types.
20432 (Expression.ConvertExplicit): Add explicit type conversions done
20435 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20436 the target type before applying the implicit LongLiterals to ULong
20439 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20441 * cs-parser.jay (for_statement): Reworked the way For works: now
20442 we declare manually any variables that are introduced in
20443 for_initializer to solve the problem of having out-of-band code
20444 emition (that is what got for broken).
20446 (declaration_statement): Perform the actual variable declaration
20447 that used to be done in local_variable_declaration here.
20449 (local_variable_declaration): Do not declare anything, just pass
20450 the information on a DictionaryEntry
20452 2001-11-20 Ravi Pratap <ravi@ximian.com>
20454 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20455 re-write of the logic to now make it recursive.
20457 (UpdateIndices): Re-write accordingly.
20459 Store element data in a separate ArrayData list in the above methods.
20461 (MakeByteBlob): Implement to dump the array data into a byte array.
20463 2001-11-19 Ravi Pratap <ravi@ximian.com>
20465 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20468 * constant.cs (Define): Implement.
20470 (EmitConstant): Re-write fully.
20472 Pass in location info.
20474 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20477 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20478 DictionaryEntry since we need location info too.
20480 (constant_declaration): Update accordingly.
20482 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20483 code into another method : UpdateIndices.
20485 2001-11-18 Ravi Pratap <ravi@ximian.com>
20487 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20488 some type checking etc.
20490 2001-11-17 Ravi Pratap <ravi@ximian.com>
20492 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20493 bits to provide dimension info if the user skips doing that.
20495 Update second constructor to store the rank correctly.
20497 2001-11-16 Ravi Pratap <ravi@ximian.com>
20499 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20500 and try to implement.
20502 * ../errors/cs0150.cs : Add.
20504 * ../errors/cs0178.cs : Add.
20506 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20508 * statement.cs: Implement foreach on multi-dimensional arrays.
20510 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20511 name of the params argument.
20513 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20514 initializing the array.
20516 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20517 we can use this elsewhere.
20519 * statement.cs: Finish implementation of foreach for single
20522 * cs-parser.jay: Use an out-of-band stack to pass information
20523 around, I wonder why I need this.
20525 foreach_block: Make the new foreach_block the current_block.
20527 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20528 function used to return a static Parameters structure. Used for
20529 empty parameters, as those are created very frequently.
20531 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20533 2001-11-15 Ravi Pratap <ravi@ximian.com>
20535 * interface.cs : Default modifier is private, not public. The
20536 make verify test passes again.
20538 2001-11-15 Ravi Pratap <ravi@ximian.com>
20540 * support.cs (ReflectionParameters): Fix logic to determine
20541 whether the last parameter is a params one. Test 9 passes again.
20543 * delegate.cs (Populate): Register the builders we define with
20544 RegisterParameterForBuilder. Test 19 passes again.
20546 * cs-parser.jay (property_declaration): Reference $6 instead
20547 of $$ to get at the location.
20549 (indexer_declaration): Similar stuff.
20551 (attribute): Ditto.
20553 * class.cs (Property): Register parameters for the Get and Set methods
20554 if they exist. Test 23 passes again.
20556 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20557 call to EmitArguments as we are sure there aren't any params arguments.
20558 Test 32 passes again.
20560 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20561 IndexOutOfRangeException.
20563 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20564 Test 33 now passes again.
20566 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20568 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20569 broke a bunch of things. Will have to come up with a better way
20570 of tracking locations.
20572 * statement.cs: Implemented foreach for single dimension arrays.
20574 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20576 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20577 an error. This removes the lookup from the critical path.
20579 * cs-parser.jay: Removed use of temporary_loc, which is completely
20582 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20584 * support.cs (ReflectionParameters.ParameterModifier): Report
20585 whether the argument is a PARAMS argument or not.
20587 * class.cs: Set the attribute `ParamArrayAttribute' on the
20588 parameter argument.
20590 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20591 and cons_param_array_attribute (ConstructorInfo for
20592 ParamArrayAttribute).,
20594 * codegen.cs: Emit the return using the `Return' statement, that
20595 way we can report the error correctly for missing return values.
20597 * class.cs (Method.Emit): Clean up.
20599 * expression.cs (Argument.Resolve): Take another argument: the
20600 location where this argument is used. Notice that this is not
20601 part of the "Argument" class as to reduce the size of the
20602 structure (we know the approximate location anyways).
20604 Test if the argument is a variable-reference, if not, then
20605 complain with a 206.
20607 (Argument.Emit): Emit addresses of variables.
20609 (Argument.FullDesc): Simplify.
20611 (Invocation.DoResolve): Update for Argument.Resolve.
20613 (ElementAccess.DoResolve): ditto.
20615 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20616 method should be virtual, as this method is always virtual.
20618 (NewDelegate.DoResolve): Update for Argument.Resolve.
20620 * class.cs (ConstructorInitializer.DoResolve): ditto.
20622 * attribute.cs (Attribute.Resolve): ditto.
20624 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20626 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20628 * expression.cs (ParameterReference): Drop IStackStorage and implement
20629 IAssignMethod instead.
20631 (LocalVariableReference): ditto.
20633 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20634 IAssignMethod instead.
20636 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20638 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20639 enumerations that are used in heavily used structures derive from
20640 byte in a laughable and pathetic attempt to reduce memory usage.
20641 This is the kind of pre-optimzations that you should not do at
20642 home without adult supervision.
20644 * expression.cs (UnaryMutator): New class, used to handle ++ and
20645 -- separatedly from the other unary operators. Cleans up the
20646 code, and kills the ExpressionStatement dependency in Unary.
20648 (Unary): Removed `method' and `Arguments' from this class, making
20649 it smaller, and moving it all to SimpleCall, so I can reuse this
20650 code in other locations and avoid creating a lot of transient data
20651 strucutres when not required.
20653 * cs-parser.jay: Adjust for new changes.
20655 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20657 * enum.cs (Enum.Populate): If there is a failure during
20660 * cs-parser.jay (opt_enum_base): we used to catch type errors
20661 here, but this is really incorrect. The type error should be
20662 catched during semantic analysis.
20664 2001-12-11 Ravi Pratap <ravi@ximian.com>
20666 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20667 current_local_parameters as expected since I, in my stupidity, had forgotten
20670 * attribute.cs (GetValidPlaces): Fix stupid bug.
20672 * class.cs (Method::Emit): Perform check on applicability of attributes.
20674 (Constructor::Emit): Ditto.
20676 (Field::Emit): Ditto.
20678 (Field.Location): Store location information.
20680 (Property, Event, Indexer, Operator): Ditto.
20682 * cs-parser.jay (field_declaration): Pass in location for each field.
20684 * ../errors/cs0592.cs : Add.
20686 2001-11-12 Ravi Pratap <ravi@ximian.com>
20688 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20690 (InitCoreTypes): Update accordingly.
20692 (RegisterAttrType, LookupAttr): Implement.
20694 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20695 info about the same.
20697 (Resolve): Update to populate the above as necessary.
20699 (Error592): Helper.
20701 (GetValidPlaces): Helper to the above.
20703 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20705 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20707 2001-11-12 Ravi Pratap <ravi@ximian.com>
20709 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20711 * ../errors/cs0617.cs : Add.
20713 2001-11-11 Ravi Pratap <ravi@ximian.com>
20715 * enum.cs (Emit): Rename to Populate to be more consistent with what
20716 we expect it to do and when exactly it is called.
20718 * class.cs, rootcontext.cs : Update accordingly.
20720 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20721 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20723 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20725 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20726 of a fieldinfo using the above, when dealing with a FieldBuilder.
20728 2001-11-10 Ravi Pratap <ravi@ximian.com>
20730 * ../errors/cs0031.cs : Add.
20732 * ../errors/cs1008.cs : Add.
20734 * ../errrors/cs0543.cs : Add.
20736 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20739 (FindMembers): Implement.
20741 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20742 enums and delegates too.
20744 (enum_types): Rename to builder_to_enum.
20746 (delegate_types): Rename to builder_to_delegate.
20748 * delegate.cs (FindMembers): Implement.
20750 2001-11-09 Ravi Pratap <ravi@ximian.com>
20752 * typemanager.cs (IsEnumType): Implement.
20754 * enum.cs (Emit): Re-write parts to account for the underlying type
20755 better and perform checking etc.
20757 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20758 of the underlying type.
20760 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20763 * enum.cs (error31): Helper to report error #31.
20765 * cs-parser.jay (enum_declaration): Store location of each member too.
20767 * enum.cs (member_to_location): New hashtable.
20769 (AddEnumMember): Update location hashtable.
20771 (Emit): Use the location of each member while reporting errors.
20773 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20775 * cs-parser.jay: A for_initializer if is a
20776 local_variable_declaration really ammount to have an implicit
20777 block with the variable declaration and no initializer for for.
20779 * statement.cs (For.Emit): Cope with null initializers.
20781 This fixes the infinite loop on for initializers.
20783 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20785 * enum.cs: More cleanup.
20787 * ecore.cs: Remove dead code.
20789 * class.cs (Property.Emit): More simplification.
20790 (Event.Emit): ditto.
20792 Reworked to have less levels of indentation.
20794 2001-11-08 Ravi Pratap <ravi@ximian.com>
20796 * class.cs (Property): Emit attributes.
20806 * enum.cs (Emit): Ditto.
20808 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20811 * class.cs (Field, Event, etc.): Move attribute generation into the
20812 Emit method everywhere.
20814 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20815 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20816 as we had no way of defining nested enums !
20818 * rootcontext.cs : Adjust code accordingly.
20820 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20822 2001-11-07 Ravi Pratap <ravi@ximian.com>
20824 * expression.cs (EvalConstantExpression): Move into ecore.cs
20826 * enum.cs (Enum): Rename some members and make them public and readonly
20827 according to our convention.
20829 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20832 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20834 (Enum::Emit): Write a simple version for now which doesn't try to compute
20835 expressions. I shall modify this to be more robust in just a while.
20837 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20839 (TypeContainer::CloseType): Create the Enum types too.
20841 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20843 * expression.cs (EvalConstantExpression): Get rid of completely.
20845 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20846 user-defined values and other cases.
20848 (IsValidEnumLiteral): Helper function.
20850 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20851 out there in the case we had a literal FieldExpr.
20853 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20855 (Literalize): Revamp a bit to take two arguments.
20857 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20859 2001-11-06 Ravi Pratap <ravi@ximian.com>
20861 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20863 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20865 (Resolve): Use the above to ensure we have proper initializers.
20867 2001-11-05 Ravi Pratap <ravi@ximian.com>
20869 * expression.cs (Expression::EvalConstantExpression): New method to
20870 evaluate constant expressions.
20872 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20874 2001-11-07 Miguel de Icaza <miguel@ximian.com>
20876 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20879 (Binary.ResolveOperator): Handle operator != (object a, object b)
20880 and operator == (object a, object b);
20882 (Binary.DoNumericPromotions): Indicate whether the numeric
20883 promotion was possible.
20885 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20888 Made the ArrayAccess implement interface IAssignMethod instead of
20889 IStackStore as the order in which arguments are passed reflects
20892 * assign.cs: Instead of using expr.ExprClass to select the way of
20893 assinging, probe for the IStackStore/IAssignMethod interfaces.
20895 * typemanager.cs: Load InitializeArray definition.
20897 * rootcontext.cs (RootContext.MakeStaticData): Used to define
20898 static data that can be used to initialize arrays.
20900 2001-11-05 Miguel de Icaza <miguel@ximian.com>
20902 * expression.cs: Handle operator== and operator!= for booleans.
20904 (Conditioal.Reduce): Implement reducer for the ?: operator.
20906 (Conditional.Resolve): Implement dead code elimination.
20908 (Binary.Resolve): Catch string literals and return a new
20909 concatenated string.
20911 (Unary.Reduce): Implement reduction of unary expressions.
20913 * ecore.cs: Split out the expression core handling here.
20915 (Expression.Reduce): New method used to perform constant folding
20916 and CSE. This is needed to support constant-expressions.
20918 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20919 targets, and optimize for !x.
20921 2001-11-04 Ravi Pratap <ravi@ximian.com>
20923 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20924 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20925 set custom atttributes.
20927 * literal.cs (Literal::GetValue): New abstract method to return the actual
20928 value of the literal, cast as an object.
20930 (*Literal): Implement GetValue method.
20932 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20933 expressions to the arraylist but objects of type Argument.
20935 * class.cs (TypeContainer::Emit): Emit our attributes too.
20937 (Method::Emit, Constructor::Emit): Ditto.
20939 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20940 to be ignoring earlier.
20942 2001-11-03 Ravi Pratap <ravi@ximian.com>
20944 * attribute.cs (AttributeSection::Define): Implement to do the business
20945 of constructing a CustomAttributeBuilder.
20947 (Attribute): New trivial class. Increases readability of code.
20949 * cs-parser.jay : Update accordingly.
20951 (positional_argument_list, named_argument_list, named_argument): New rules
20953 (attribute_arguments): Use the above so that we are more correct.
20955 2001-11-02 Ravi Pratap <ravi@ximian.com>
20957 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20958 to perform all checks for a method with a params parameter.
20960 (Invocation::OverloadResolve): Update to use the above method and therefore
20961 cope correctly with params method invocations.
20963 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20966 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20967 constructors in our parent too because we can't afford to miss out on
20970 * attribute.cs (AttributeSection): New name for the class Attribute
20972 Other trivial changes to improve readability.
20974 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20975 use the new class names.
20977 2001-11-01 Ravi Pratap <ravi@ximian.com>
20979 * class.cs (Method::Define): Complete definition for params types too
20981 (Indexer::Define): Ditto.
20983 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20984 Cope everywhere with a request for info about the array parameter.
20986 2001-11-01 Ravi Pratap <ravi@ximian.com>
20988 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20990 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20991 local_variable_type to extract the string corresponding to the type.
20993 (local_variable_type): Fixup the action to use the new helper method.
20995 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
20998 * expression.cs : Clean out code which uses the above.
21000 2001-10-31 Ravi Pratap <ravi@ximian.com>
21002 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21003 and bale out if necessary by returning a false.
21005 (RegisterProperty): Ditto.
21007 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21008 and print out appropriate error messages.
21010 * interface.cs (everywhere): Ditto.
21012 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21013 location to constructor.
21015 * class.cs (Property, Event, Indexer): Update accordingly.
21017 * ../errors/cs111.cs : Added.
21019 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21020 of a method, as laid down by the spec.
21022 (Invocation::OverloadResolve): Use the above method.
21024 2001-10-31 Ravi Pratap <ravi@ximian.com>
21026 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21027 now take a TypeContainer and a Parameters object.
21029 (ParameterData): Modify return type of ParameterModifier method to be
21030 Parameter.Modifier and not a string.
21032 (ReflectionParameters, InternalParameters): Update accordingly.
21034 * expression.cs (Argument::GetParameterModifier): Same here.
21036 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21037 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21038 symbol in it at all so maybe this is only for now.
21040 2001-10-30 Ravi Pratap <ravi@ximian.com>
21042 * support.cs (InternalParameters): Constructor now takes an extra argument
21043 which is the actual Parameters class.
21045 (ParameterDesc): Update to provide info on ref/out modifiers.
21047 * class.cs (everywhere): Update call to InternalParameters to pass in
21048 the second argument too.
21050 * support.cs (ParameterData): Add ParameterModifier, which is a method
21051 to return the modifier info [ref/out etc]
21053 (InternalParameters, ReflectionParameters): Implement the above.
21055 * expression.cs (Argument::ParameterModifier): Similar function to return
21056 info about the argument's modifiers.
21058 (Invocation::OverloadResolve): Update to take into account matching modifiers
21061 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21062 a new SetFormalParameters object which we pass to InternalParameters.
21064 2001-10-30 Ravi Pratap <ravi@ximian.com>
21066 * expression.cs (NewArray): Merge into the ArrayCreation class.
21068 2001-10-29 Ravi Pratap <ravi@ximian.com>
21070 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21071 NewUserdefinedArray into one as there wasn't much of a use in having
21074 * expression.cs (Argument): Change field's name to ArgType from Type.
21076 (Type): New readonly property which returns the proper type, taking into
21077 account ref/out modifiers.
21079 (everywhere): Adjust code accordingly for the above.
21081 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21082 whether we are emitting for a ref or out parameter.
21084 * expression.cs (Argument::Emit): Use the above field to set the state.
21086 (LocalVariableReference::Emit): Update to honour the flag and emit the
21089 * parameter.cs (Attributes): Set the correct flags for ref parameters.
21091 * expression.cs (Argument::FullDesc): New function to provide a full desc.
21093 * support.cs (ParameterData): Add method ParameterDesc to the interface.
21095 (ReflectionParameters, InternalParameters): Implement the above method.
21097 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21100 (Invocation::FullMethodDesc): Ditto.
21102 2001-10-29 Miguel de Icaza <miguel@ximian.com>
21104 * cs-parser.jay: Add extra production for the second form of array
21107 * expression.cs (ArrayCreation): Update to reflect the above
21110 * Small changes to prepare for Array initialization.
21112 2001-10-28 Miguel de Icaza <miguel@ximian.com>
21114 * typemanager.cs (ImplementsInterface): interface might be null;
21115 Deal with this problem;
21117 Also, we do store negative hits on the cache (null values), so use
21118 this instead of calling t.GetInterfaces on the type everytime.
21120 2001-10-28 Ravi Pratap <ravi@ximian.com>
21122 * typemanager.cs (IsBuiltinType): New method to help determine the same.
21124 * expression.cs (New::DoResolve): Get rid of array creation code and instead
21125 split functionality out into different classes.
21127 (New::FormArrayType): Move into NewBuiltinArray.
21129 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21132 (NewBuiltinArray): New class to handle creation of built-in arrays.
21134 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21135 account creation of one-dimensional arrays.
21137 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21139 (NewUserdefinedArray::DoResolve): Implement.
21141 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21143 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21144 we maintain inside the TypeManager. This is necessary to perform lookups on the
21147 (LookupType): Update to perform GetType on the module builders too.
21149 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21151 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21153 2001-10-23 Ravi Pratap <ravi@ximian.com>
21155 * expression.cs (New::DoResolve): Implement guts of array creation.
21157 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21159 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21161 * expression.cs: Fix bug I introduced lsat night that broke
21164 (Expression.Resolve): Report a 246 error (can not resolve name)
21165 if we find a SimpleName in the stream.
21167 (Expression.ResolveLValue): Ditto.
21169 (Expression.ResolveWithSimpleName): This function is a variant of
21170 ResolveName, this one allows SimpleNames to be returned without a
21171 warning. The only consumer of SimpleNames is MemberAccess
21173 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21175 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21176 might arrive here. I have my doubts that this is correct.
21178 * statement.cs (Lock): Implement lock statement.
21180 * cs-parser.jay: Small fixes to support `lock' and `using'
21182 * cs-tokenizer.cs: Remove extra space
21184 * driver.cs: New flag --checked, allows to turn on integer math
21187 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21188 Threading.Monitor.Exit
21190 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21192 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21193 Expression Class to be IndexerAccess.
21195 Notice that Indexer::DoResolve sets the eclass to Value.
21197 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21199 * class.cs (TypeContainer::Emit): Emit code for indexers.
21201 * assign.cs (IAssignMethod): New interface implemented by Indexers
21202 and Properties for handling assignment.
21204 (Assign::Emit): Simplify and reuse code.
21206 * expression.cs (IndexerAccess, PropertyExpr): Implement
21207 IAssignMethod, clean up old code.
21209 2001-10-22 Ravi Pratap <ravi@ximian.com>
21211 * typemanager.cs (ImplementsInterface): New method to determine if a type
21212 implements a given interface. Provides a nice cache too.
21214 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21217 (ConvertReferenceExplicit): Ditto.
21219 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21220 various methods, with correct names etc.
21222 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21223 Operator.UnaryNegation.
21225 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21226 we have a unary plus or minus operator.
21228 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21231 * everywhere : update accordingly.
21233 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21236 * class.cs (Method::Define): For the case where we are implementing a method
21237 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21238 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21240 2001-10-21 Ravi Pratap <ravi@ximian.com>
21242 * interface.cs (FindMembers): Implement to work around S.R.E
21245 * typemanager.cs (IsInterfaceType): Implement.
21247 (FindMembers): Update to handle interface types too.
21249 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21250 use IsAssignableFrom as that is not correct - it doesn't work.
21252 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21253 and accordingly override EmitStatement.
21255 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21256 using the correct logic :-)
21258 2001-10-19 Ravi Pratap <ravi@ximian.com>
21260 * ../errors/cs-11.cs : Add to demonstrate error -11
21262 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21264 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21265 then pass this as a hint to ResolveLValue.
21267 * expression.cs (FieldExpr): Add Location information
21269 (FieldExpr::LValueResolve): Report assignment to readonly
21272 (Expression::ExprClassFromMemberInfo): Pass location information.
21274 (Expression::ResolveLValue): Add new method that resolves an
21277 (Expression::DoResolveLValue): Default invocation calls
21280 (Indexers): New class used to keep track of indexers in a given
21283 (IStackStore): Renamed from LValue, as it did not really describe
21284 what this did. Also ResolveLValue is gone from this interface and
21285 now is part of Expression.
21287 (ElementAccess): Depending on the element access type
21289 * typemanager.cs: Add `indexer_name_type' as a Core type
21290 (System.Runtime.CompilerServices.IndexerNameAttribute)
21292 * statement.cs (Goto): Take a location.
21294 2001-10-18 Ravi Pratap <ravi@ximian.com>
21296 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21297 if two delegates are compatible.
21299 (NewDelegate::DoResolve): Update to take care of the case when
21300 we instantiate a delegate from another delegate.
21302 * typemanager.cs (FindMembers): Don't even try to look up members
21303 of Delegate types for now.
21305 2001-10-18 Ravi Pratap <ravi@ximian.com>
21307 * delegate.cs (NewDelegate): New class to take care of delegate
21310 * expression.cs (New): Split the delegate related code out into
21311 the NewDelegate class.
21313 * delegate.cs (DelegateInvocation): New class to handle delegate
21316 * expression.cs (Invocation): Split out delegate related code into
21317 the DelegateInvocation class.
21319 2001-10-17 Ravi Pratap <ravi@ximian.com>
21321 * expression.cs (New::DoResolve): Implement delegate creation fully
21322 and according to the spec.
21324 (New::DoEmit): Update to handle delegates differently.
21326 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21327 because of which we were printing out arguments in reverse order !
21329 * delegate.cs (VerifyMethod): Implement to check if the given method
21330 matches the delegate.
21332 (FullDelegateDesc): Implement.
21334 (VerifyApplicability): Implement.
21336 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21337 delegate invocations too.
21339 (Invocation::Emit): Ditto.
21341 * ../errors/cs1593.cs : Added.
21343 * ../errors/cs1594.cs : Added.
21345 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21347 2001-10-16 Ravi Pratap <ravi@ximian.com>
21349 * typemanager.cs (intptr_type): Core type for System.IntPtr
21351 (InitCoreTypes): Update for the same.
21353 (iasyncresult_type, asynccallback_type): Ditto.
21355 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21358 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21361 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21362 the builders for the 4 members of a delegate type :-)
21364 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21367 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21369 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21371 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21373 * statement.cs (Break::Emit): Implement.
21374 (Continue::Emit): Implement.
21376 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21377 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21378 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21379 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21382 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21383 properties that track the label for the current loop (begin of the
21384 loop and end of the loop).
21386 2001-10-15 Ravi Pratap <ravi@ximian.com>
21388 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21389 use of emitting anything at all.
21391 * class.cs, rootcontext.cs : Get rid of calls to the same.
21393 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21395 (Populate): Define the constructor correctly and set the implementation
21398 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21401 (AddDelegateType): Implement.
21403 (IsDelegateType): Implement helper method.
21405 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21407 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21408 and accordingly handle it.
21410 * delegate.cs (Populate): Take TypeContainer argument.
21411 Implement bits to define the Invoke method. However, I still haven't figured out
21412 how to take care of the native int bit :-(
21414 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21415 Qualify the name of the delegate, not its return type !
21417 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21420 (StandardConversionExists): Checking for array types turns out to be recursive.
21422 (ConvertReferenceExplicit): Implement array conversion.
21424 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21426 2001-10-12 Ravi Pratap <ravi@ximian.com>
21428 * cs-parser.jay (delegate_declaration): Store the fully qualified
21429 name as it is a type declaration.
21431 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21434 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21435 as TypeContainer::DefineType.
21437 (Populate): Method in which all the definition of the various methods (Invoke)
21440 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21443 (CloseDelegate): Finally creates the delegate.
21445 * class.cs (TypeContainer::DefineType): Update to define delegates.
21446 (Populate, Emit and CloseType): Do the same thing here too.
21448 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21449 delegates in all these operations.
21451 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21453 * expression.cs: LocalTemporary: a new expression used to
21454 reference a temporary that has been created.
21456 * assign.cs: Handle PropertyAccess back here, so that we can
21457 provide the proper semantic access to properties.
21459 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21460 a few more explicit conversions.
21462 * modifiers.cs: `NEW' modifier maps to HideBySig.
21464 * expression.cs (PropertyExpr): Make this into an
21465 ExpressionStatement, and support the EmitStatement code path.
21467 Perform get/set error checking, clean up the interface.
21469 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21470 them into toplevel access objects.
21472 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21474 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21477 * typemanager.cs: Keep track here of our PropertyBuilders again to
21478 work around lameness in SRE.
21480 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21482 * expression.cs (LValue::LValueResolve): New method in the
21483 interface, used to perform a second resolution pass for LValues.
21485 (This::DoResolve): Catch the use of this in static methods.
21487 (This::LValueResolve): Implement.
21489 (This::Store): Remove warning, assigning to `this' in structures
21492 (Invocation::Emit): Deal with invocation of
21493 methods on value types. We need to pass the address to structure
21494 methods rather than the object itself. (The equivalent code to
21495 emit "this" for structures leaves the entire structure on the
21496 stack instead of a pointer to it).
21498 (ParameterReference::DoResolve): Compute the real index for the
21499 argument based on whether the method takes or not a `this' pointer
21500 (ie, the method is static).
21502 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21503 value types returned from functions when we need to invoke a
21504 method on the sturcture.
21507 2001-10-11 Ravi Pratap <ravi@ximian.com>
21509 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21510 defining the type in the Modulebuilder or Typebuilder. This is to take
21511 care of nested types which need to be defined on the TypeBuilder using
21512 DefineNestedMethod.
21514 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21515 methods in RootContext, only ported to be part of TypeContainer.
21517 (TypeContainer::GetInterfaceOrClass): Ditto.
21519 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21521 * interface.cs (Interface::DefineInterface): New method. Does exactly
21522 what RootContext.CreateInterface did earlier, only it takes care of nested types
21525 (Interface::GetInterfaces): Move from RootContext here and port.
21527 (Interface::GetInterfaceByName): Same here.
21529 * rootcontext.cs (ResolveTree): Re-write.
21531 (PopulateTypes): Re-write.
21533 * class.cs (TypeContainer::Populate): Populate nested types too.
21534 (TypeContainer::Emit): Emit nested members too.
21536 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21537 instead just use the name argument passed in as it is already fully
21540 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21541 to TypeContainer mapping to see if a type is user-defined.
21543 * class.cs (TypeContainer::CloseType): Implement.
21545 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21546 the default constructor.
21548 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21551 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21553 * interface.cs (CloseType): Create the type here.
21555 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21558 Remove all the methods which are now in TypeContainer.
21560 2001-10-10 Ravi Pratap <ravi@ximian.com>
21562 * delegate.cs (Define): Re-write bits to define the delegate
21565 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21567 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21569 * expression.cs (ImplicitReferenceConversion): handle null as well
21570 as a source to convert to any reference type.
21572 * statement.cs (Return): Perform any implicit conversions to
21573 expected return type.
21575 Validate use of return statement.
21577 * codegen.cs (EmitContext): Pass the expected return type here.
21579 * class.cs (Method, Constructor, Property): Pass expected return
21580 type to EmitContext.
21582 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21584 * expression.cs: Make DoResolve take an EmitContext instead of a
21587 Replaced `l' and `location' for `loc', for consistency.
21589 (Error, Warning): Remove unneeded Tc argument.
21591 * assign.cs, literal.cs, constant.cs: Update to new calling
21594 * codegen.cs: EmitContext now contains a flag indicating whether
21595 code is being generated in a static method or not.
21597 * cs-parser.jay: DecomposeQI, new function that replaces the old
21598 QualifiedIdentifier. Now we always decompose the assembled
21599 strings from qualified_identifier productions into a group of
21602 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21604 * rootcontext.cs: Deal with field-less struct types correctly now
21605 by passing the size option to Define Type.
21607 * class.cs: Removed hack that created one static field.
21609 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21611 * statement.cs: Moved most of the code generation here.
21613 2001-10-09 Ravi Pratap <ravi@ximian.com>
21615 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21618 (ElementAccess): Remove useless bits for now - keep checks as the spec
21621 2001-10-08 Ravi Pratap <ravi@ximian.com>
21623 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21624 and start performing checks according to the spec.
21626 2001-10-07 Ravi Pratap <ravi@ximian.com>
21628 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21629 rank_specifiers instead.
21631 (rank_specifiers): Change the order in which the rank specifiers are stored
21633 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21635 * expression.cs (ElementAccess): Implement the LValue interface too.
21637 2001-10-06 Ravi Pratap <ravi@ximian.com>
21639 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21640 except that user defined conversions are not included.
21642 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21643 perform the conversion of the return type, if necessary.
21645 (New::DoResolve): Check whether we are creating an array or an object
21646 and accordingly do the needful.
21648 (New::Emit): Same here.
21650 (New::DoResolve): Implement guts of array creation.
21652 (New::FormLookupType): Helper function.
21654 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21656 * codegen.cs: Removed most of the code generation here, and move the
21657 corresponding code generation bits to the statement classes.
21659 Added support for try/catch/finalize and throw.
21661 * cs-parser.jay: Added support for try/catch/finalize.
21663 * class.cs: Catch static methods having the flags override,
21664 virtual or abstract.
21666 * expression.cs (UserCast): This user cast was not really doing
21667 what it was supposed to do. Which is to be born in fully resolved
21668 state. Parts of the resolution were being performed at Emit time!
21672 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21674 * expression.cs: Implicity convert the result from UserCast.
21676 2001-10-05 Ravi Pratap <ravi@ximian.com>
21678 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21679 prevented it from working correctly.
21681 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21682 merely ConvertImplicit.
21684 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21686 * typemanager.cs: Make the LookupTypeContainer function static,
21687 and not per-instance.
21689 * class.cs: Make static FindMembers (the one that takes a Type
21692 * codegen.cs: Add EmitForeach here.
21694 * cs-parser.jay: Make foreach a toplevel object instead of the
21695 inline expansion, as we need to perform semantic analysis on it.
21697 2001-10-05 Ravi Pratap <ravi@ximian.com>
21699 * expression.cs (Expression::ImplicitUserConversion): Rename to
21700 UserDefinedConversion.
21702 (Expression::UserDefinedConversion): Take an extra argument specifying
21703 whether we look for explicit user conversions too.
21705 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21707 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21709 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21710 with the appropriate arguments.
21712 * cs-parser.jay (cast_expression): Record location too.
21714 * expression.cs (Cast): Record location info.
21716 (Expression::ConvertExplicit): Take location argument.
21718 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21719 to determine if we are doing explicit conversions.
21721 (UserCast::Emit): Update accordingly.
21723 (Expression::ConvertExplicit): Report an error if everything fails.
21725 * ../errors/cs0030.cs : Add.
21727 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21729 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21730 virtual and newslot bits.
21732 * class.cs (TypeContainer::RegisterRequiredImplementations):
21733 Record methods we need.
21735 (TypeContainer::MakeKey): Helper function to make keys for
21736 MethodBases, since the Methodbase key is useless.
21738 (TypeContainer::Populate): Call RegisterRequiredImplementations
21739 before defining the methods.
21741 Create a mapping for method_builders_to_methods ahead of time
21742 instead of inside a tight loop.
21744 (::RequireMethods): Accept an object as the data to set into the
21745 hashtable so we can report interface vs abstract method mismatch.
21747 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21749 * report.cs: Make all of it static.
21751 * rootcontext.cs: Drop object_type and value_type computations, as
21752 we have those in the TypeManager anyways.
21754 Drop report instance variable too, now it is a global.
21756 * driver.cs: Use try/catch on command line handling.
21758 Add --probe option to debug the error reporting system with a test
21761 * report.cs: Add support for exiting program when a probe
21762 condition is reached.
21764 2001-10-03 Ravi Pratap <ravi@ximian.com>
21766 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21767 we do a forcible conversion regardless of type, to check if
21768 ForceConversion returns a null.
21770 (Binary::error19): Use location to report error.
21772 (Unary::error23): Use location here too.
21774 * ../errors/cs0019.cs : Check in.
21776 * ../errors/cs0023.cs : Check in.
21778 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21779 case of a non-null MethodInfo object with a length of 0 !
21781 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21782 an applicable member - according to the spec :-)
21783 Also fix logic to find members in base types.
21785 (Unary::ResolveOperator): Same here.
21787 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21788 as I was getting thoroughly confused between this and error19 :-)
21790 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21791 (::FindMostEncompassedType): Implement.
21792 (::FindMostEncompassingType): Implement.
21793 (::StandardConversionExists): Implement.
21795 (UserImplicitCast): Re-vamp. We now need info about most specific
21796 source and target types so that we can do the necessary conversions.
21798 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21799 mathematical union with no duplicates.
21801 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21803 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21804 in order from base classes to child classes, so that we can in
21805 child classes look up in our parent for method names and
21806 attributes (required for handling abstract, virtual, new, override
21807 constructs: we need to instrospect our base class, and if we dont
21808 populate the classes in order, the introspection might be
21809 incorrect. For example, a method could query its parent before
21810 the parent has any methods and would determine that the parent has
21811 no abstract methods (while it could have had them)).
21813 (RootContext::CreateType): Record the order in which we define the
21816 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21818 * class.cs (TypeContainer::Populate): Also method definitions can
21819 fail now, keep track of this.
21821 (TypeContainer::FindMembers): Implement support for
21822 DeclaredOnly/noDeclaredOnly flag.
21824 (Constructor::Emit) Return the ConstructorBuilder.
21826 (Method::Emit) Return the MethodBuilder.
21827 Check for abstract or virtual methods to be public.
21829 * rootcontext.cs (RootContext::CreateType): Register all the
21830 abstract methods required for the class to be complete and the
21831 interface methods that must be implemented.
21833 * cs-parser.jay: Report error 501 (method requires body if it is
21834 not marked abstract or extern).
21836 * expression.cs (TypeOf::Emit): Implement.
21838 * typemanager.cs: runtime_handle_type, new global type.
21840 * class.cs (Property::Emit): Generate code for properties.
21842 2001-10-02 Ravi Pratap <ravi@ximian.com>
21844 * expression.cs (Unary::ResolveOperator): Find operators on base type
21845 too - we now conform exactly to the spec.
21847 (Binary::ResolveOperator): Same here.
21849 * class.cs (Operator::Define): Fix minor quirk in the tests.
21851 * ../errors/cs0215.cs : Added.
21853 * ../errors/cs0556.cs : Added.
21855 * ../errors/cs0555.cs : Added.
21857 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21859 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21860 single integer which is really efficient
21862 2001-10-01 Ravi Pratap <ravi@ximian.com>
21864 * expression.cs (Expression::ImplicitUserConversion): Use location
21865 even in the case when we are examining True operators.
21867 * class.cs (Operator::Define): Perform extensive checks to conform
21868 with the rules for operator overloading in the spec.
21870 * expression.cs (Expression::ImplicitReferenceConversion): Implement
21871 some of the other conversions mentioned in the spec.
21873 * typemanager.cs (array_type): New static member for the System.Array built-in
21876 (cloneable_interface): For System.ICloneable interface.
21878 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21879 we start resolving the tree and populating types.
21881 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21883 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21885 * expression.cs (Expression::ExprClassFromMemberInfo,
21886 Expression::Literalize): Create literal expressions from
21887 FieldInfos which are literals.
21889 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21890 type casts, because they were wrong. The test suite in tests
21893 (ImplicitNumericConversion): ushort to ulong requires a widening
21896 Int32 constant to long requires widening cast as well.
21898 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21899 for integers because the type on the stack is not i4.
21901 2001-09-30 Miguel de Icaza <miguel@ximian.com>
21903 * expression.cs (report118): require location argument.
21905 * parameter.cs: Do not dereference potential null value.
21907 * class.cs: Catch methods that lack the `new' keyword when
21908 overriding a name. Report warnings when `new' is used without
21909 anything being there to override.
21911 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21913 * class.cs: Only add constructor to hashtable if it is non-null
21914 (as now constructors can fail on define).
21916 (TypeManager, Class, Struct): Take location arguments.
21918 Catch field instance initialization in structs as errors.
21920 accepting_filter: a new filter for FindMembers that is static so
21921 that we dont create an instance per invocation.
21923 (Constructor::Define): Catch errors where a struct constructor is
21926 * cs-parser.jay: Pass location information for various new
21929 * delegate.cs (Delegate): take a location argument.
21931 * driver.cs: Do not call EmitCode if there were problesm in the
21932 Definition of the types, as many Builders wont be there.
21934 * decl.cs (Decl::Decl): Require a location argument.
21936 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21937 into integers, and find the most appropiate integer for it.
21939 * literal.cs: Implement ULongLiteral.
21941 * rootcontext.cs: Provide better information about the location of
21942 failure when CreateType fails.
21944 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21946 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21949 * expression.cs (Binary::CheckShiftArguments): Add missing type
21951 (Binary::ResolveOperator): Add type to the logical and and logical
21952 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21955 (Binary::DoNumericPromotions): In the case where either argument
21956 is ulong (and most signed types combined with ulong cause an
21957 error) perform implicit integer constant conversions as well.
21959 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21961 * expression.cs (UserImplicitCast): Method should always be
21963 (Invocation::BetterConversion): Simplified test for IntLiteral.
21965 (Expression::ImplicitNumericConversion): Split this routine out.
21966 Put the code that performs implicit constant integer conversions
21969 (Expression::Resolve): Become a wrapper around DoResolve so we can
21970 check eclass and type being set after resolve.
21972 (Invocation::Badness): Remove this dead function
21974 (Binary::ResolveOperator): Do not compute the expensive argumnets
21975 unless we have a union for it.
21977 (Probe::Emit): Is needs to do an isinst and then
21978 compare against null.
21980 (::CanConvert): Added Location argument. If the Location argument
21981 is null (Location.Null), then we do not report errors. This is
21982 used by the `probe' mechanism of the Explicit conversion. We do
21983 not want to generate an error for something that the user
21984 explicitly requested to be casted. But the pipeline for an
21985 explicit cast first tests for potential implicit casts.
21987 So for now, if the Location is null, it means `Probe only' to
21988 avoid adding another argument. Might have to revise this
21991 (ClassCast): New class used to type cast objects into arbitrary
21992 classes (used in Explicit Reference Conversions).
21994 Implement `as' as well.
21996 Reverted all the patches from Ravi below: they were broken:
21998 * The use of `level' as a mechanism to stop recursive
21999 invocations is wrong. That was there just to catch the
22000 bug with a strack trace but not as a way of addressing
22003 To fix the problem we have to *understand* what is going
22004 on and the interactions and come up with a plan, not
22005 just get things going.
22007 * The use of the type conversion cache that I proposed
22008 last night had an open topic: How does this work across
22009 protection domains. A user defined conversion might not
22010 be public in the location where we are applying the
22011 conversion, a different conversion might be selected
22012 (ie, private A->B (better) but public B->A (worse),
22013 inside A, A->B applies, but outside it, B->A will
22016 * On top of that (ie, even if the above is solved),
22017 conversions in a cache need to be abstract. Ie, `To
22018 convert from an Int to a Short use an OpcodeCast', not
22019 `To convert from an Int to a Short use the OpcodeCast on
22020 the variable 5' (which is what this patch was doing).
22022 2001-09-28 Ravi Pratap <ravi@ximian.com>
22024 * expression.cs (Invocation::ConversionExists): Re-write to use
22025 the conversion cache
22027 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22028 cache all conversions done, not just user-defined ones.
22030 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22031 to determine if a conversion exists instead of acutually trying to
22032 perform the conversion. It's faster too.
22034 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22035 and only then attempt the implicit conversion.
22037 2001-09-28 Ravi Pratap <ravi@ximian.com>
22039 * expression.cs (ConvertImplicit): Use a cache for conversions
22040 already found. Check level of recursion and bail out if necessary.
22042 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22044 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22045 Export standard methods that we expect for string operations.
22047 * statement.cs (Block::UsageWarning): Track usage of variables and
22048 report the errors for not used variables.
22050 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22053 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22055 * codegen.cs: remove unnneded code
22057 * expression.cs: Removed BuiltinTypeAccess class
22059 Fix the order in which implicit conversions are
22062 The previous fixed dropped support for boxed conversions (adding a
22063 test to the test suite now)
22065 (UserImplicitCast::CanConvert): Remove test for source being null,
22066 that code is broken. We should not feed a null to begin with, if
22067 we do, then we should track the bug where the problem originates
22068 and not try to cover it up here.
22070 Return a resolved expression of type UserImplicitCast on success
22071 rather than true/false. Ravi: this is what I was talking about,
22072 the pattern is to use a static method as a "constructor" for
22075 Also, do not create arguments until the very last minute,
22076 otherwise we always create the arguments even for lookups that
22077 will never be performed.
22079 (UserImplicitCast::Resolve): Eliminate, objects of type
22080 UserImplicitCast are born in a fully resolved state.
22082 * typemanager.cs (InitCoreTypes): Init also value_type
22083 (System.ValueType).
22085 * expression.cs (Cast::Resolve): First resolve the child expression.
22087 (LValue): Add new method AddressOf to be used by
22090 Change the argument of Store to take an EmitContext instead of an
22091 ILGenerator, because things like FieldExpr need to be able to call
22092 their children expression to generate the instance code.
22094 (Expression::Error, Expression::Warning): Sugar functions for
22097 (Expression::MemberLookup): Accept a TypeContainer instead of a
22098 Report as the first argument.
22100 (Expression::ResolvePrimary): Killed. I still want to improve
22101 this as currently the code is just not right.
22103 (Expression::ResolveMemberAccess): Simplify, but it is still
22106 (Unary::Resolve): Catch errors in AddressOf operators.
22108 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22109 index to a byte for the short-version, or the compiler will choose
22110 the wrong Emit call, which generates the wrong data.
22112 (ParameterReference::Emit, ::Store): same.
22114 (FieldExpr::AddressOf): Implement.
22116 * typemanager.cs: TypeManager: made public variable instead of
22119 * driver.cs: document --fatal.
22121 * report.cs (ErrorMessage, WarningMessage): new names for the old
22122 Error and Warning classes.
22124 * cs-parser.jay (member_access): Turn built-in access to types
22125 into a normal simplename
22127 2001-09-27 Ravi Pratap <ravi@ximian.com>
22129 * expression.cs (Invocation::BetterConversion): Fix to cope
22130 with q being null, since this was introducing a bug.
22132 * expression.cs (ConvertImplicit): Do built-in conversions first.
22134 2001-09-27 Ravi Pratap <ravi@ximian.com>
22136 * expression.cs (UserImplicitCast::Resolve): Fix bug.
22138 2001-09-27 Ravi Pratap <ravi@ximian.com>
22140 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22141 I had introduced long ago (what's new ?).
22143 * expression.cs (UserImplicitCast::CanConvert): Static method to do
22144 the work of all the checking.
22145 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22146 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22148 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22149 that is the right way.
22151 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22152 overloading resolution. Use everywhere instead of cutting and pasting code.
22154 (Binary::ResolveOperator): Use MakeUnionSet.
22156 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22157 we have to convert to bool types. Not complete yet.
22159 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22161 * typemanager.cs (TypeManager::CSharpName): support ushort.
22163 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22164 to provide an expression that performsn an implicit constant int
22165 conversion (section 6.1.6).
22166 (Expression::ConvertImplicitRequired): Reworked to include
22167 implicit constant expression conversions.
22169 (Expression::ConvertNumericExplicit): Finished.
22171 (Invocation::Emit): If InstanceExpression is null, then it means
22172 that we perform a call on this.
22174 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22176 * expression.cs (Unary::Emit): Remove some dead code.
22177 (Probe): Implement Resolve and Emit for `is'.
22178 (Expression::ConvertImplicitRequired): Attempt to do constant
22179 expression conversions here. Maybe should be moved to
22180 ConvertImplicit, but I am not sure.
22181 (Expression::ImplicitLongConstantConversionPossible,
22182 Expression::ImplicitIntConstantConversionPossible): New functions
22183 that tell whether is it possible to apply an implicit constant
22184 expression conversion.
22186 (ConvertNumericExplicit): Started work on explicit numeric
22189 * cs-parser.jay: Update operator constants.
22191 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22192 (Parameters::GetSignature): Hook up VerifyArgs here.
22193 (Parameters::VerifyArgs): Verifies that no two arguments have the
22196 * class.cs (Operator): Update the operator names to reflect the
22197 ones that the spec expects (as we are just stringizing the
22200 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22201 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22202 previous usage did only work for our methods.
22203 (Expression::ConvertImplicit): Handle decimal implicit numeric
22204 conversions as well.
22205 (Expression::InternalTypeConstructor): Used to invoke constructors
22206 on internal types for default promotions.
22208 (Unary::Emit): Implement special handling for the pre/post
22209 increment/decrement for overloaded operators, as they need to have
22210 the same semantics as the other operators.
22212 (Binary::ResolveOperator): ditto.
22213 (Invocation::ConversionExists): ditto.
22214 (UserImplicitCast::Resolve): ditto.
22216 2001-09-26 Ravi Pratap <ravi@ximian.com>
22218 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22219 operator, return after emitting body. Regression tests pass again !
22221 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22222 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22223 (Invocation::OverloadResolve): Ditto.
22224 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22226 * everywhere : update calls to the above methods accordingly.
22228 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22230 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22232 * expression.cs (ExpressionStatement): New base class used for
22233 expressions that can appear in statements, so that we can provide
22234 an alternate path to generate expression that do not leave a value
22237 (Expression::Emit, and all the derivatives): We no longer return
22238 whether a value is left on the stack or not. Every expression
22239 after being emitted leaves a single value on the stack.
22241 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22242 facilties of ExpressionStatement if possible.
22244 * cs-parser.jay: Update statement_expression.
22246 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22248 * driver.cs: Change the wording of message
22250 2001-09-25 Ravi Pratap <ravi@ximian.com>
22252 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22253 the type of the expression to the return type of the method if
22254 we have an overloaded operator match ! The regression tests pass again !
22255 (Unary::ResolveOperator): Ditto.
22257 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22258 to find "op_Implicit", not "implicit" ;-)
22259 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22260 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22262 * everywhere : Correct calls to the above accordingly.
22264 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22265 (ConvertImplicit): Do user-defined conversion if it exists.
22267 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22269 * assign.cs: track location.
22270 (Resolve): Use implicit conversions on assignment.
22272 * literal.cs: Oops. Not good, Emit of short access values should
22273 pass (Bytes) or the wrong argument will be selected.
22275 * expression.cs (Unary::Emit): Emit code for -expr.
22277 (Unary::ResolveOperator): Handle `Substract' for non-constants
22278 (substract from zero from the non-constants).
22279 Deal with Doubles as well.
22281 (Expression::ConvertImplicitRequired): New routine that reports an
22282 error if no implicit conversion exists.
22284 (Invocation::OverloadResolve): Store the converted implicit
22285 expressions if we make them
22287 2001-09-24 Ravi Pratap <ravi@ximian.com>
22289 * class.cs (ConstructorInitializer): Take a Location argument.
22290 (ConstructorBaseInitializer): Same here.
22291 (ConstructorThisInitializer): Same here.
22293 * cs-parser.jay : Update all calls accordingly.
22295 * expression.cs (Unary, Binary, New): Take location argument.
22296 Update accordingly everywhere.
22298 * cs-parser.jay : Update all calls to the above to take a location
22301 * class.cs : Ditto.
22303 2001-09-24 Ravi Pratap <ravi@ximian.com>
22305 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22306 (Invocation::BetterConversion): Same here
22307 (Invocation::ConversionExists): Ditto.
22309 (Invocation::ConversionExists): Implement.
22311 2001-09-22 Ravi Pratap <ravi@ximian.com>
22313 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22314 Also take an additional TypeContainer argument.
22316 * All over : Pass in TypeContainer as argument to OverloadResolve.
22318 * typemanager.cs (CSharpName): Update to check for the string type and return
22321 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22324 2001-09-21 Ravi Pratap <ravi@ximian.com>
22326 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22327 (Invocation::BetterFunction): Implement.
22328 (Invocation::BetterConversion): Implement.
22329 (Invocation::ConversionExists): Skeleton, no implementation yet.
22331 Okay, things work fine !
22333 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22335 * typemanager.cs: declare and load enum_type, delegate_type and
22338 * expression.cs (Expression::Emit): Now emit returns a value that
22339 tells whether a value is left on the stack or not. This strategy
22340 might be reveted tomorrow with a mechanism that would address
22341 multiple assignments.
22342 (Expression::report118): Utility routine to report mismatches on
22345 (Unary::Report23): Report impossible type/operator combination
22348 (Unary::IsIncrementableNumber): Whether the type can be
22349 incremented or decremented with add.
22350 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22352 (Unary::ResolveOperator): Implement ++, !, ~,
22354 (Invocation::Emit): Deal with new Emit convetion.
22356 * All Expression derivatives: Updated their Emit method to return
22357 whether they leave values on the stack or not.
22359 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22360 stack for expressions that are statements.
22362 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22364 * expression.cs (LValue): New interface. Must be implemented by
22366 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22369 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22370 interface for generating code, simplifies the code.
22372 2001-09-20 Ravi Pratap <ravi@ximian.com>
22374 * expression.cs (everywhere): Comment out return statements in ::Resolve
22375 methods to avoid the warnings.
22377 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22379 * driver.cs (parse): Report error 2001 if we can not open the
22382 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22385 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22388 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22389 otherwise nested blocks end up with the same index.
22391 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22393 * expression.cs: Instead of having FIXMEs in the Resolve
22394 functions, throw exceptions so it is obvious that we are facing a
22397 * cs-parser.jay (invocation_expression): Pass Location information.
22399 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22400 Use a basename for those routines because .NET does not like paths
22403 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22406 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22408 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22409 are loading the correct data types (throws an exception if not).
22410 (TypeManager::InitCoreTypes): Use CoreLookupType
22412 * expression.cs (Unary::ResolveOperator): return the child
22413 expression for expressions which are just +expr.
22414 (Unary::ResolveOperator): Return negative literals for -LITERAL
22415 expressions (otherwise they are Unary {Literal}).
22416 (Invocation::Badness): Take into account `Implicit constant
22417 expression conversions'.
22419 * literal.cs (LongLiteral): Implement long literal class.
22420 (IntLiteral): export the `Value' of the intliteral.
22422 2001-09-19 Ravi Pratap <ravi@ximian.com>
22424 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22426 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22427 instead of 'Operator'
22429 * expression.cs (Binary::ResolveOperator): Update accordingly.
22430 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22433 * cs-parser.jay (unary_expression): Update to use the new names.
22435 * gen-treedump.cs (GetUnary): Same here.
22437 * expression.cs (Unary::Resolve): Implement.
22438 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22439 operators are found instead of making noise ;-)
22440 (Unary::ResolveOperator): New method to do precisely the same thing which
22441 Binary::ResolveOperator does for Binary expressions.
22442 (Unary.method, .Arguments): Add.
22443 (Unary::OperName): Implement.
22444 (Unary::ForceConversion): Copy and Paste !
22446 * class.cs (Operator::Define): Fix a small bug for the case when we have
22449 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22450 for the inbuilt operators. Only overloading works for now ;-)
22452 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22454 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22455 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22457 * expression.cs (This::Emit): Implement.
22458 (This::Resolve): Implement.
22459 (TypeOf:Resolve): Implement.
22460 (Expression::ResolveSimpleName): Add an implicit this to instance
22462 (MemberAccess::Resolve): Deal with Parameters and Fields.
22463 Bind instance variable to Field expressions.
22464 (FieldExpr::Instance): New field used to track the expression that
22465 represents the object instance.
22466 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22468 (FieldExpr::Emit): Implement.
22470 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22471 the last instruction contains a return opcode to avoid generating
22472 the last `ret' instruction (this generates correct code, and it is
22473 nice to pass the peverify output).
22475 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22476 initializer for static and instance variables.
22477 (Constructor::Emit): Allow initializer to be null in the case of
22478 static constructors. Only emit initializer for instance
22481 (TypeContainer::FindMembers): Return a null array if there are no
22484 Also fix the code for the MemberTypes.Method branch, as it was not
22485 scanning that for operators (or tried to access null variables before).
22487 * assign.cs (Assign::Emit): Handle instance and static fields.
22491 * driver.cs: Stop compilation if there are parse errors.
22493 * cs-parser.jay (constructor_declaration): Provide default base
22494 initializer for non-static constructors.
22495 (constructor_declarator): Do not provide a default base
22496 initializers if none was specified.
22497 Catch the fact that constructors should not have parameters.
22499 * class.cs: Do not emit parent class initializers for static
22500 constructors, that should be flagged as an error.
22502 2001-09-18 Ravi Pratap <ravi@ximian.com>
22504 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22505 Move back code into TypeContainer::Populate.
22507 2001-09-18 Ravi Pratap <ravi@ximian.com>
22509 * class.cs (TypeContainer::AddConstructor): Fix the check to
22510 compare against Name, not Basename.
22511 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22513 * cs-parser.jay : Update accordingly.
22515 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22516 for methods, don't forget to look into the operators too.
22517 (RegisterMethodBuilder): Helper method to take care of this for
22518 methods, constructors and operators.
22519 (Operator::Define): Completely revamp.
22520 (Operator.OperatorMethod, MethodName): New fields.
22521 (TypeContainer::Populate): Move the registering of builders into
22522 RegisterMethodBuilder.
22523 (Operator::Emit): Re-write.
22525 * expression.cs (Binary::Emit): Comment out code path to emit method
22526 invocation stuff for the case when we have a user defined operator. I am
22527 just not able to get it right !
22529 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22531 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22534 (Expression::MemberLookup): Provide a version that allows to
22535 specify the MemberTypes and BindingFlags.
22537 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22538 so it was not fetching variable information from outer blocks.
22540 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22541 Beforefieldinit as it was buggy.
22543 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22544 that Ravi put here.
22546 * class.cs (Constructor::Emit): Only emit if block is not null.
22547 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22548 deal with this by semantically definining it as if the user had
22551 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22552 constructors as we now "emit" them at a higher level.
22554 (TypeContainer::DefineDefaultConstructor): Used to define the
22555 default constructors if none was provided.
22557 (ConstructorInitializer): Add methods Resolve and Emit.
22559 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22561 2001-09-17 Ravi Pratap <ravi@ximian.com>
22563 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22564 the default constructor builder with our hashtable for methodbuilders
22567 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22568 and argument_count is 0 in which case we have a match.
22569 (Binary::ResolveOperator): More null checking and miscellaneous coding
22572 2001-09-17 Ravi Pratap <ravi@ximian.com>
22574 * rootcontext.cs (IsNameSpace): Compare against null.
22576 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22578 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22579 and Unary::Operator.
22581 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22584 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22585 we have overloaded operators.
22586 (Binary::ResolveOperator): Implement the part which does the operator overload
22589 * class.cs (Operator::Emit): Implement.
22590 (TypeContainer::Emit): Emit the operators we have too.
22592 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22593 the case when we have a user-defined operator.
22595 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22597 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22599 2001-09-16 Ravi Pratap <ravi@ximian.com>
22601 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22602 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22603 (Constructor::Emit): Implement.
22604 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22605 if we have no work to do.
22606 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22609 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22610 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22612 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22615 2001-09-15 Ravi Pratap <ravi@ximian.com>
22617 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22619 (Tree::RecordNamespace): Method to do what the name says ;-)
22620 (Tree::Namespaces): Property to get at the namespaces hashtable.
22622 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22625 * rootcontext.cs (IsNamespace): Fixed it :-)
22627 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22629 * class.cs (TypeContainer::FindMembers): Add support for
22631 (MethodCore): New class that encapsulates both the shared aspects
22632 of a Constructor and a Method.
22633 (Method, Constructor): Factored pieces into MethodCore.
22635 * driver.cs: Added --fatal which makes errors throw exceptions.
22636 Load System assembly as well as part of the standard library.
22638 * report.cs: Allow throwing exceptions on errors for debugging.
22640 * modifiers.cs: Do not use `parent', instead use the real type
22641 container to evaluate permission settings.
22643 * class.cs: Put Ravi's patch back in. He is right, and we will
22644 have to cope with the
22646 2001-09-14 Ravi Pratap <ravi@ximian.com>
22648 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22649 FamORAssem, not FamANDAssem.
22651 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22653 * driver.cs: Added --parse option that only parses its input files
22656 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22657 incorrect. IsTopLevel is not used to tell whether an object is
22658 root_types or not (that can be achieved by testing this ==
22659 root_types). But to see if this is a top-level *class* (not
22660 necessarly our "toplevel" container).
22662 2001-09-14 Ravi Pratap <ravi@ximian.com>
22664 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22665 parent instead of a direct call to GetType.
22667 2001-09-14 Ravi Pratap <ravi@ximian.com>
22669 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22670 Modifiers.TypeAttr. This should just be a call to that method.
22672 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22673 object so that we can determine if we are top-level or not.
22675 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22678 * enum.cs (Enum::Define): Ditto.
22680 * modifiers.cs (FieldAttr): Re-write.
22682 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22683 (TypeContainer::HaveStaticConstructor): New property to provide access
22684 to precisely that info.
22686 * modifiers.cs (MethodAttr): Re-write.
22687 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22689 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22690 of top-level types as claimed.
22692 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22694 * expression.cs (MemberLookup): Fruitless attempt to lookup
22695 constructors. Maybe I need to emit default constructors? That
22696 might be it (currently .NET emits this for me automatically).
22697 (Invocation::OverloadResolve): Cope with Arguments == null.
22698 (Invocation::EmitArguments): new function, shared by the new
22699 constructor and us.
22700 (Invocation::Emit): Handle static and instance methods. Emit
22701 proper call instruction for virtual or non-virtual invocations.
22702 (New::Emit): Implement.
22703 (New::Resolve): Implement.
22704 (MemberAccess:Resolve): Implement.
22705 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22706 to track instances.
22707 (FieldExpr::Resolve): Set type.
22709 * support.cs: Handle empty arguments.
22711 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22712 SimpleLookup): Auxiliary routines to help parse a qualifier
22715 Update qualifier_identifier rule.
22717 * codegen.cs: Removed debugging messages.
22719 * class.cs: Make this a global thing, this acts just as a "key" to
22720 objects that we might have around.
22722 (Populate): Only initialize method_builders_to_methods once.
22724 * expression.cs (PropertyExpr): Initialize type from the
22727 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22728 Resolve pattern. Attempt to implicitly convert value to boolean.
22731 * expression.cs: Set the type for the int32/int32 argument case.
22732 (Binary::ResolveOperator): Set the return type to boolean for
22733 comparission operators
22735 * typemanager.cs: Remove debugging print code.
22737 (Invocation::Resolve): resolve type.
22739 * class.cs: Allocate a MemberInfo of the correct size, as the code
22740 elsewhere depends on the test to reflect the correct contents.
22742 (Method::) Keep track of parameters, due to System.Reflection holes
22744 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22747 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22748 of the exact size and return that.
22750 (Class::LookupMethodByBuilder): New function that maps
22751 MethodBuilders to its methods. Required to locate the information
22752 on methods because System.Reflection bit us again.
22754 * support.cs: New file, contains an interface ParameterData and
22755 two implementations: ReflectionParameters and InternalParameters
22756 used to access Parameter information. We will need to grow this
22759 * expression.cs (Invocation::GetParameterData): implement a cache
22760 and a wrapper around the ParameterData creation for methods.
22761 (Invocation::OverloadResolve): Use new code.
22763 2001-09-13 Ravi Pratap <ravi@ximian.com>
22765 * class.cs (TypeContainer::EmitField): Remove and move into
22766 (Field::Define): here and modify accordingly.
22767 (Field.FieldBuilder): New member.
22768 (TypeContainer::Populate): Update accordingly.
22769 (TypeContainer::FindMembers): Implement.
22771 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22773 * statement.cs: (VariableInfo::VariableType): New field to be
22774 initialized with the full type once it is resolved.
22776 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22778 * parameter.cs (GetParameterInfo): Use a type cache to compute
22779 things only once, and to reuse this information
22781 * expression.cs (LocalVariableReference::Emit): Implement.
22782 (OpcodeCast::Emit): fix.
22784 (ParameterReference::Resolve): Implement.
22785 (ParameterReference::Emit): Implement.
22787 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22788 that are expressions need to stay as Expressions.
22790 * typemanager.cs (CSharpName): Returns the C# name of a type if
22793 * expression.cs (Expression::ConvertImplicit): New function that
22794 implements implicit type conversions.
22796 (Expression::ImplicitReferenceConversion): Implements implicit
22797 reference conversions.
22799 (EmptyCast): New type for transparent casts.
22801 (OpcodeCast): New type for casts of types that are performed with
22802 a sequence of bytecodes.
22804 (BoxedCast): New type used for casting value types into reference
22805 types. Emits a box opcode.
22807 (Binary::DoNumericPromotions): Implements numeric promotions of
22808 and computation of the Binary::Type.
22810 (Binary::EmitBranchable): Optimization.
22812 (Binary::Emit): Implement code emission for expressions.
22814 * typemanager.cs (TypeManager): Added two new core types: sbyte
22817 2001-09-12 Ravi Pratap <ravi@ximian.com>
22819 * class.cs (TypeContainer::FindMembers): Method which does exactly
22820 what Type.FindMembers does, only we don't have to use reflection. No
22821 implementation yet.
22823 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22824 typecontainer objects as we need to get at them.
22825 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22827 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22828 typecontainer object.
22830 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22831 of just a Report object.
22833 2001-09-11 Ravi Pratap <ravi@ximian.com>
22835 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22837 (TypeContainer::Populate): Now define the delegates of the type too.
22838 (TypeContainer.Delegates): Property to access the list of delegates defined
22841 * delegates.cs (Delegate::Define): Implement partially.
22843 * modifiers.cs (TypeAttr): Handle more flags.
22845 2001-09-11 Ravi Pratap <ravi@ximian.com>
22847 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22849 (Operator::Define): Re-write logic to get types by using the LookupType method
22850 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22851 (Indexer::Define): Ditto.
22852 (Event::Define): Ditto.
22853 (Property::Define): Ditto.
22855 2001-09-10 Ravi Pratap <ravi@ximian.com>
22857 * class.cs (TypeContainer::Populate): Now define operators too.
22858 (TypeContainer.Operators): New property to access the list of operators
22860 (Operator.OperatorMethodBuilder): New member to hold the method builder
22861 for the operator we are defining.
22862 (Operator::Define): Implement.
22864 2001-09-10 Ravi Pratap <ravi@ximian.com>
22866 * class.cs (Event::Define): Make the prefixes of the accessor methods
22867 addOn_ and removeOn_
22869 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22870 of the location being passed in too. Ideally, this should go later since all
22871 error reporting should be done through the Report object.
22873 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22874 (Populate): Iterate thru the indexers we have and define them too.
22875 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22876 for the get and set accessors.
22877 (Indexer::Define): Implement.
22879 2001-09-09 Miguel de Icaza <miguel@ximian.com>
22881 * expression.cs (Binary::Resolve): Beginning of it. I scratched
22882 my previous implementation, did not work.
22884 * typemanager.cs: Add a couple of missing types (the longs).
22886 * literal.cs: Use TypeManager.bool_type instead of getting it.
22888 * expression.cs (EventExpr): New kind of expressions.
22889 (Expressio::ExprClassFromMemberInfo): finish
22891 2001-09-08 Miguel de Icaza <miguel@ximian.com>
22893 * assign.cs: Emit stores to static fields differently.
22895 2001-09-08 Ravi Pratap <ravi@ximian.com>
22897 * Merge in changes and adjust code to tackle conflicts. Backed out my
22898 code in Assign::Resolve ;-)
22900 2001-09-08 Ravi Pratap <ravi@ximian.com>
22902 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22903 instead Report.Error and also pass in the location.
22904 (CSharpParser::Lexer): New readonly property to return the reference
22905 to the Tokenizer object.
22906 (declare_local_variables): Use Report.Error with location instead of plain
22910 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22911 (Operator.CheckBinaryOperator): Ditto.
22913 * cs-parser.jay (operator_declarator): Update accordingly.
22915 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22916 (CheckBinaryOperator): Same here.
22918 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22919 on the name without any prefixes of namespace names etc. This is because we
22920 already might have something already fully qualified like
22921 'System.Console.WriteLine'
22923 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22925 2001-09-07 Ravi Pratap <ravi@ximian.com>
22927 * cs-tokenizer.cs (location): Return a string which also contains
22930 * expression.cs (ElementAccess): New class for expressions of the
22931 type 'element access.'
22932 (BaseAccess): New class for expressions of the type 'base access.'
22933 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22936 * cs-parser.jay (element_access): Implement action.
22937 (base_access): Implement actions.
22938 (checked_expression, unchecked_expression): Implement.
22940 * cs-parser.jay (local_variable_type): Correct and implement.
22941 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22943 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22945 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22946 name and the specifiers.
22948 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22950 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22951 making them all public ;-)
22953 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22956 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22958 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22960 (FieldExpr, PropertyExprs): New resolved expressions.
22961 (SimpleName::MemberStaticCheck): Perform static checks for access
22962 to non-static fields on static methods. Maybe this should be
22963 generalized for MemberAccesses.
22964 (SimpleName::ResolveSimpleName): More work on simple name
22967 * cs-parser.jay (primary_expression/qualified_identifier): track
22968 the parameter index.
22970 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22971 (EmitContext::EmitBoolExpression): Chain to expression generation
22972 instead of temporary hack.
22973 (::EmitStatementExpression): Put generic expression code generation.
22975 * assign.cs (Assign::Emit): Implement variable assignments to
22976 local variables, parameters and fields.
22978 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22980 * statement.cs (Block::GetVariableInfo): New method, returns the
22981 VariableInfo for a variable name in a block.
22982 (Block::GetVariableType): Implement in terms of GetVariableInfo
22984 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22985 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22987 2001-09-06 Ravi Pratap <ravi@ximian.com>
22989 * cs-parser.jay (operator_declaration): Continue on my quest : update
22990 to take attributes argument.
22991 (event_declaration): Ditto.
22992 (enum_declaration): Ditto.
22993 (indexer_declaration): Ditto.
22995 * class.cs (Operator::Operator): Update constructor accordingly.
22996 (Event::Event): Ditto.
22998 * delegate.cs (Delegate::Delegate): Same here.
23000 * enum.cs (Enum::Enum): Same here.
23002 2001-09-05 Ravi Pratap <ravi@ximian.com>
23004 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23006 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23008 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23009 being passed around as an arraylist.
23010 (Attributes::AddAttribute): Method to add attribute sections.
23012 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23013 (struct_declaration): Update accordingly.
23014 (constant_declaration): Update.
23015 (field_declaration): Update.
23016 (method_header): Update.
23017 (fixed_parameter): Update.
23018 (parameter_array): Ditto.
23019 (property_declaration): Ditto.
23020 (destructor_declaration): Ditto.
23022 * class.cs (Struct::Struct): Update constructors accordingly.
23023 (Class::Class): Ditto.
23024 (Field::Field): Ditto.
23025 (Method::Method): Ditto.
23026 (Property::Property): Ditto.
23027 (TypeContainer::OptAttribute): update property's return type.
23029 * interface.cs (Interface.opt_attributes): New member.
23030 (Interface::Interface): Update to take the extra Attributes argument.
23032 * parameter.cs (Parameter::Parameter): Ditto.
23034 * constant.cs (Constant::Constant): Ditto.
23036 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23037 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23038 the attributes as a parameter.
23039 (InterfaceProperty): Update constructor call.
23040 (InterfaceEvent): Ditto.
23041 (InterfaceMethod): Ditto.
23042 (InterfaceIndexer): Ditto.
23044 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23045 pass the attributes too.
23046 (interface_event_declaration): Ditto.
23047 (interface_property_declaration): Ditto.
23048 (interface_method_declaration): Ditto.
23049 (interface_declaration): Ditto.
23051 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23053 * class.cs (Method::Define): Track the "static Main" definition to
23054 create an entry point.
23056 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23057 EntryPoint if we find it.
23059 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23060 (EmitContext::ig): Make this variable public.
23062 * driver.cs: Make the default output file be the first file name
23063 with the .exe extension.
23065 Detect empty compilations
23067 Handle various kinds of output targets. Handle --target and
23068 rename -t to --dumper.
23070 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23071 methods inherited from Expression return now an Expression. This
23072 will is used during the tree rewriting as we resolve them during
23075 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23076 the spec. Missing entirely is the information about
23077 accessability of elements of it.
23079 (Expression::ExprClassFromMemberInfo): New constructor for
23080 Expressions that creates a fully initialized Expression based on
23081 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23084 (Invocation::Resolve): Begin implementing resolution of invocations.
23086 * literal.cs (StringLiteral): Implement Emit.
23088 2001-09-05 Ravi Pratap <ravi@ximian.com>
23090 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23093 2001-09-04 Ravi Pratap <ravi@ximian.com>
23095 * cs-parser.jay (attribute_arguments): Implement actions.
23096 (attribute): Fix bug in production. Implement action.
23097 (attribute_list): Implement.
23098 (attribute_target): Implement.
23099 (attribute_target_specifier, opt_target_specifier): Implement
23100 (CheckAttributeTarget): New method to check if the attribute target
23102 (attribute_section): Implement.
23103 (opt_attributes): Implement.
23105 * attribute.cs : New file to handle attributes.
23106 (Attribute): Class to hold attribute info.
23108 * cs-parser.jay (opt_attribute_target_specifier): Remove production
23109 (attribute_section): Modify production to use 2 different rules to
23110 achieve the same thing. 1 s/r conflict down !
23111 Clean out commented, useless, non-reducing dimension_separator rules.
23113 * class.cs (TypeContainer.attributes): New member to hold list
23114 of attributes for a type.
23115 (Struct::Struct): Modify to take one more argument, the attribute list.
23116 (Class::Class): Ditto.
23117 (Field::Field): Ditto.
23118 (Method::Method): Ditto.
23119 (Property::Property): Ditto.
23121 * cs-parser.jay (struct_declaration): Update constructor call to
23122 pass in the attributes too.
23123 (class_declaration): Ditto.
23124 (constant_declaration): Ditto.
23125 (field_declaration): Ditto.
23126 (method_header): Ditto.
23127 (fixed_parameter): Ditto.
23128 (parameter_array): Ditto.
23129 (property_declaration): Ditto.
23131 * constant.cs (Constant::Constant): Update constructor similarly.
23132 Use System.Collections.
23134 * parameter.cs (Parameter::Parameter): Update as above.
23136 2001-09-02 Ravi Pratap <ravi@ximian.com>
23138 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23139 (TypeContainer.delegates): New member to hold list of delegates.
23141 * cs-parser.jay (delegate_declaration): Implement the action correctly
23142 this time as I seem to be on crack ;-)
23144 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23146 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23147 tell whether an identifier represents a namespace.
23149 * expression.cs (NamespaceExpr): A namespace expression, used only
23150 temporarly during expression resolution.
23151 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23152 utility functions to resolve names on expressions.
23154 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23156 * codegen.cs: Add hook for StatementExpressions.
23158 * class.cs: Fix inverted test for static flag in methods.
23160 2001-09-02 Ravi Pratap <ravi@ximian.com>
23162 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23163 to make it coincide with MS' number.
23164 (Operator::CheckBinaryOperator): Ditto.
23166 * ../errors/errors.txt : Remove error numbers added earlier.
23168 * ../errors/cs1019.cs : Test case for error # 1019
23170 * ../errros/cs1020.cs : Test case for error # 1020
23172 * cs-parser.jay : Clean out commented cruft.
23173 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23174 used anywhere - non-reducing rule.
23175 (namespace_declarations): Non-reducing rule - comment out.
23177 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23178 with TypeContainer::AddEnum.
23180 * delegate.cs : New file for delegate handling classes.
23181 (Delegate): Class for declaring delegates.
23183 * makefile : Update.
23185 * cs-parser.jay (delegate_declaration): Implement.
23187 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23189 * class.cs (Event::Define): Implement.
23190 (Event.EventBuilder): New member.
23192 * class.cs (TypeContainer::Populate): Update to define all enums and events
23194 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23195 readonly fields for all these cases ?
23197 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23199 * class.cs (Property): Revamp to use the convention of making fields readonly.
23200 Accordingly modify code elsewhere.
23202 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23203 the Define method of the Property class.
23205 * class.cs : Clean up applied patch and update references to variables etc. Fix
23207 (TypeContainer::Populate): Update to define all the properties we have. Also
23208 define all enumerations.
23210 * enum.cs (Define): Implement.
23212 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23214 * cs-parser.jay (overloadable_operator): The semantic value is an
23215 enum of the Operator class.
23216 (operator_declarator): Implement actions.
23217 (operator_declaration): Implement.
23219 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23220 validity of definitions.
23221 (Operator::CheckBinaryOperator): Static method to check for binary operators
23222 (TypeContainer::AddOperator): New method to add an operator to a type.
23224 * cs-parser.jay (indexer_declaration): Added line to actually call the
23225 AddIndexer method so it gets added ;-)
23227 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23228 already taken care of by the MS compiler ?
23230 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23232 * class.cs (Operator): New class for operator declarations.
23233 (Operator::OpType): Enum for the various operators.
23235 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23237 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23238 ostensibly handle this in semantic analysis.
23240 * cs-parser.jay (general_catch_clause): Comment out
23241 (specific_catch_clauses, specific_catch_clause): Ditto.
23242 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23243 (catch_args, opt_catch_args): New productions.
23244 (catch_clause): Rewrite to use the new productions above
23245 (catch_clauses): Modify accordingly.
23246 (opt_catch_clauses): New production to use in try_statement
23247 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23248 and re-write the code in the actions to extract the specific and
23249 general catch clauses by being a little smart ;-)
23251 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23252 Hooray, try and catch statements parse fine !
23254 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23256 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23257 string from the hashtable of variables.
23259 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23260 I end up making that mistake ;-)
23261 (catch_clauses): Fixed gross error which made Key and Value of the
23262 DictionaryEntry the same : $1 !!
23264 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23266 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23268 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23269 when the add and remove accessors are specified.
23271 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23273 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23274 information about indexer_declarator.
23275 (indexer_declarator): Implement actions.
23276 (parsing_indexer): New local boolean used to keep track of whether
23277 we are parsing indexers or properties. This is necessary because
23278 implicit_parameters come into picture even for the get accessor in the
23279 case of an indexer.
23280 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23282 * class.cs (Indexer): New class for indexer declarations.
23283 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23284 (TypeContainer::indexers): New member to hold list of indexers for the
23287 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23289 * cs-parser.jay (add_accessor_declaration): Implement action.
23290 (remove_accessor_declaration): Implement action.
23291 (event_accessors_declaration): Implement
23292 (variable_declarators): swap statements for first rule - trivial.
23294 * class.cs (Event): New class to hold information about event
23296 (TypeContainer::AddEvent): New method to add an event to a type
23297 (TypeContainer::events): New member to hold list of events.
23299 * cs-parser.jay (event_declaration): Implement actions.
23301 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23303 * cs-parser.jay (dim_separators): Implement. Make it a string
23304 concatenating all the commas together, just as they appear.
23305 (opt_dim_separators): Modify accordingly
23306 (rank_specifiers): Update accordingly. Basically do the same
23307 thing - instead, collect the brackets here.
23308 (opt_rank_sepcifiers): Modify accordingly.
23309 (array_type): Modify to actually return the complete type string
23310 instead of ignoring the rank_specifiers.
23311 (expression_list): Implement to collect the expressions
23312 (variable_initializer): Implement. We make it a list of expressions
23313 essentially so that we can handle the array_initializer case neatly too.
23314 (variable_initializer_list): Implement.
23315 (array_initializer): Make it a list of variable_initializers
23316 (opt_array_initializer): Modify accordingly.
23318 * expression.cs (New::NType): Add enumeration to help us
23319 keep track of whether we have an object/delegate creation
23320 or an array creation.
23321 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23322 members to hold data about array creation.
23323 (New:New): Modify to update NewType
23324 (New:New): New Overloaded contructor for the array creation
23327 * cs-parser.jay (array_creation_expression): Implement to call
23328 the overloaded New constructor.
23330 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23332 * class.cs (TypeContainer::Constructors): Return member
23333 constructors instead of returning null.
23335 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23337 * typemanager.cs (InitCoreTypes): Initialize the various core
23338 types after we have populated the type manager with the user
23339 defined types (this distinction will be important later while
23340 compiling corlib.dll)
23342 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23343 on Expression Classification. Now all expressions have a method
23344 `Resolve' and a method `Emit'.
23346 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23347 generation from working. Also add some temporary debugging
23350 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23352 * codegen.cs: Lots of code generation pieces. This is only the
23353 beginning, will continue tomorrow with more touches of polish. We
23354 handle the fundamentals of if, while, do, for, return. Others are
23355 trickier and I need to start working on invocations soon.
23357 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23360 * codegen.cs (EmitContext): New struct, used during code
23361 emission to keep a context. Most of the code generation will be
23364 * cs-parser.jay: Add embedded blocks to the list of statements of
23365 this block. So code generation proceeds in a top down fashion.
23367 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23369 * statement.cs: Add support for multiple child blocks.
23371 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23373 * codegen.cs (EmitCode): New function, will emit the code for a
23374 Block of code given a TypeContainer and its ILGenerator.
23376 * statement.cs (Block): Standard public readonly optimization.
23377 (Block::Block constructors): Link children.
23378 (Block::Child): Child Linker.
23379 (Block::EmitVariables): Emits IL variable declarations.
23381 * class.cs: Drop support for MethodGroups here, delay until
23383 (Method::): Applied the same simplification that I did before, and
23384 move from Properties to public readonly fields.
23385 (Method::ParameterTypes): Returns the parameter types for the
23386 function, and implements a cache that will be useful later when I
23387 do error checking and the semantic analysis on the methods is
23389 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23390 and made a method, optional argument tells whether this is a class
23391 or a structure to apply the `has-this' bit.
23392 (Method::GetCallingConvention): Implement, returns the calling
23394 (Method::Define): Defines the type, a second pass is performed
23395 later to populate the methods.
23397 (Constructor::ParameterTypes): implement a cache similar to the
23398 one on Method::ParameterTypes, useful later when we do semantic
23401 (TypeContainer::EmitMethod): New method. Emits methods.
23403 * expression.cs: Removed MethodGroup class from here.
23405 * parameter.cs (Parameters::GetCallingConvention): new method.
23407 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23409 * class.cs (TypeContainer::Populate): Drop RootContext from the
23412 (Constructor::CallingConvention): Returns the calling convention.
23413 (Constructor::ParameterTypes): Returns the constructor parameter
23416 (TypeContainer::AddConstructor): Keep track of default constructor
23417 and the default static constructor.
23419 (Constructor::) Another class that starts using `public readonly'
23420 instead of properties.
23422 (Constructor::IsDefault): Whether this is a default constructor.
23424 (Field::) use readonly public fields instead of properties also.
23426 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23427 track of static constructors; If none is used, turn on
23428 BeforeFieldInit in the TypeAttributes.
23430 * cs-parser.jay (opt_argument_list): now the return can be null
23431 for the cases where there are no arguments.
23433 (constructor_declarator): If there is no implicit `base' or
23434 `this', then invoke the default parent constructor.
23436 * modifiers.cs (MethodAttr): New static function maps a set of
23437 modifiers flags into a MethodAttributes enum
23438 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23439 MethodAttr, TypeAttr to represent the various mappings where the
23440 modifiers are used.
23441 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23443 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23445 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23448 * interface.cs (PopulateIndexer): Implemented the code generator
23449 for interface indexers.
23451 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23453 * interface.cs (InterfaceMemberBase): Now we track the new status
23456 (PopulateProperty): Implement property population. Woohoo! Got
23457 Methods and Properties going today.
23459 Removed all the properties for interfaces, and replaced them with
23460 `public readonly' fields.
23462 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23464 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23465 initialize their hashtables/arraylists only when they are needed
23466 instead of doing this always.
23468 * parameter.cs: Handle refs and out parameters.
23470 * cs-parser.jay: Use an ArrayList to construct the arguments
23471 instead of the ParameterCollection, and then cast that to a
23474 * parameter.cs: Drop the use of ParameterCollection and use
23475 instead arrays of Parameters.
23477 (GetParameterInfo): Use the Type, not the Name when resolving
23480 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23482 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23483 and instead use public readonly fields.
23485 * class.cs: Put back walking code for type containers.
23487 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23489 * class.cs (MakeConstant): Code to define constants.
23491 * rootcontext.cs (LookupType): New function. Used to locate types
23494 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23496 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23497 this System.Reflection code is. Kudos to Microsoft
23499 * typemanager.cs: Implement a type cache and avoid loading all
23500 types at boot time. Wrap in LookupType the internals. This made
23501 the compiler so much faster. Wow. I rule!
23503 * driver.cs: Make sure we always load mscorlib first (for
23504 debugging purposes, nothing really important).
23506 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23507 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23509 * rootcontext.cs: Lookup types on their namespace; Lookup types
23510 on namespaces that have been imported using the `using' keyword.
23512 * class.cs (TypeContainer::TypeAttr): Virtualize.
23513 (Class::TypeAttr): Return attributes suitable for this bad boy.
23514 (Struct::TypeAttr): ditto.
23515 Handle nested classes.
23516 (TypeContainer::) Remove all the type visiting code, it is now
23517 replaced with the rootcontext.cs code
23519 * rootcontext.cs (GetClassBases): Added support for structs.
23521 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23523 * interface.cs, statement.cs, class.cs, parameter.cs,
23524 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23525 Drop use of TypeRefs, and use strings instead.
23527 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23531 * class.cs (Struct::Struct): set the SEALED flags after
23532 checking the modifiers.
23533 (TypeContainer::TypeAttr): new property, returns the
23534 TypeAttributes for a class.
23536 * cs-parser.jay (type_list): Oops, list production was creating a
23537 new list of base types.
23539 * rootcontext.cs (StdLib): New property.
23540 (GetInterfaceTypeByName): returns an interface by type name, and
23541 encapsulates error handling here.
23542 (GetInterfaces): simplified.
23543 (ResolveTree): Encapsulated all the tree resolution here.
23544 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23547 * driver.cs: Add support for --nostdlib, to avoid loading the
23548 default assemblies.
23549 (Main): Do not put tree resolution here.
23551 * rootcontext.cs: Beginning of the class resolution.
23553 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23555 * rootcontext.cs: Provide better error reporting.
23557 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23559 * rootcontext.cs (CreateInterface): Handle the case where there
23560 are no parent interfaces.
23562 (CloseTypes): Routine to flush types at the end.
23563 (CreateInterface): Track types.
23564 (GetInterfaces): Returns an array of Types from the list of
23565 defined interfaces.
23567 * typemanager.c (AddUserType): Mechanism to track user types (puts
23568 the type on the global type hash, and allows us to close it at the
23571 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23573 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23574 RecordInterface instead.
23576 * cs-parser.jay: Updated to reflect changes above.
23578 * decl.cs (Definition): Keep track of the TypeBuilder type that
23579 represents this type here. Not sure we will use it in the long
23580 run, but wont hurt for now.
23582 * driver.cs: Smaller changes to accomodate the new code.
23584 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23587 * rootcontext.cs (CreateInterface): New method, used to create
23588 the System.TypeBuilder type for interfaces.
23589 (ResolveInterfaces): new entry point to resolve the interface
23591 (CodeGen): Property, used to keep track of the code generator.
23593 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23595 * cs-parser.jay: Add a second production for delegate_declaration
23598 (enum_body): Put an opt_comma here instead of putting it on
23599 enum_body or enum_member_declarations so we can handle trailing
23600 commas on enumeration members. Gets rid of a shift/reduce.
23602 (type_list): Need a COMMA in the middle.
23604 (indexer_declaration): Tell tokenizer to recognize get/set
23606 * Remove old targets.
23608 * Re-add the parser target.
23610 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23612 * cs-parser.jay: Add precendence rules for a number of operators
23613 ot reduce the number of shift/reduce conflicts in the grammar.
23615 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23617 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23620 Get rid of old crufty code.
23622 * rootcontext.cs: Use this to keep track of the parsed
23623 representation and the defined types available to the program.
23625 * gen-treedump.cs: adjust for new convention.
23627 * type.cs: Split out the type manager, and the assembly builder
23630 * typemanager.cs: the type manager will live here now.
23632 * cil-codegen.cs: And the code generator here.
23634 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23636 * makefile: Fixed up for easy making.
23638 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23640 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23643 (unary_expression): Expand pre_increment_expression and
23644 post_decrement_expression to reduce a shift/reduce.
23646 2001-07-11 Simon Cozens
23648 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23650 Improve allow_keyword_as_indent name.
23652 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23654 * Adjustments for Beta2.
23656 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23658 * decl.cs: Added `Define' abstract method.
23659 (InTransit): new property, used to catch recursive definitions.
23661 * interface.cs: Implement `Define'.
23663 * modifiers.cs: Map Modifiers.constants to
23664 System.Reflection.TypeAttribute flags.
23666 * class.cs: Keep track of types and user-defined types.
23667 (BuilderInit): New method for creating an assembly
23668 (ResolveType): New function to launch the resolution process, only
23669 used by interfaces for now.
23671 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23672 that are inserted into the name space.
23674 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23676 * ARGH. I have screwed up my tree so many times due to the use of
23677 rsync rather than using CVS. Going to fix this at once.
23679 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23682 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23684 * Experiment successful: Use System.Type rather that our own
23687 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23689 * cs-parser.jay: Removed nsAliases from here.
23691 Use new namespaces, handle `using XXX;'
23693 * namespace.cs: Reimplemented namespace handling, use a recursive
23694 definition of the class. Now we can keep track of using clauses
23695 and catch invalid using clauses.
23697 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23699 * gen-treedump.cs: Adapted for all the renaming.
23701 * expression.cs (Expression): this class now has a Type property
23702 which returns an expression Type.
23704 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23705 `Type', as this has a different meaning now in the base
23707 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23709 * interface.cs, class.cs: Removed from all the sources the
23710 references to signature computation, as we can not do method
23711 signature computation during the parsing time, as we are not
23712 trying to solve at that point distinguishing:
23716 void a (NS.Blah x) {}
23719 Which depending on the context might be valid or not, as we do not
23720 know if Blah is the same thing as NS.Blah at that point.
23722 * Redid everything so the code uses TypeRefs now instead of
23723 Types. TypeRefs are just temporary type placeholders, that need
23724 to be resolved. They initially have a pointer to a string and the
23725 current scope in which they are used. This is used later by the
23726 compiler to resolve the reference to an actual Type.
23728 * DeclSpace is no longer a CIR.Type, and neither are
23729 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23730 are all DeclSpaces, but no Types.
23732 * type.cs (TypeRefManager): This implements the TypeRef manager,
23733 which keeps track of all the types that need to be resolved after
23734 the parsing has finished.
23736 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23738 * ARGH. We are going to have to store `foreach' as a class rather
23739 than resolving it, as we need to verify error 1579 after name
23740 resolution. *OR* we could keep a flag that says `This request to
23741 IEnumerator comes from a foreach statement' which we can then use
23742 to generate the error.
23744 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23746 * class.cs (TypeContainer.AddMethod): we now add methods to the
23747 MethodGroup instead of the method hashtable.
23749 * expression.cs: Add MethodGroup abstraction, which gets us one
23750 step closer to the specification in the way we handle method
23753 * cs-parser.jay (primary_expression): qualified_identifier now
23754 tried to match up an identifier to a local variable reference or
23755 to a parameter reference.
23757 current_local_parameters is now a parser global variable that
23758 points to the current parameters for the block, used during name
23761 (property_declaration): Now creates an implicit `value' argument to
23764 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23766 * parameter.cs: Do not use `param' arguments as part of the
23767 signature, per the spec.
23769 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23771 * decl.cs: Base class for classes, structs and interfaces. This
23772 is the "Declaration Space"
23774 * cs-parser.jay: Use CheckDef for checking declaration errors
23775 instead of having one on each function.
23777 * class.cs: Factor out some code for handling error handling in
23778 accordance to the "Declarations" section in the "Basic Concepts"
23779 chapter in the ECMA C# spec.
23781 * interface.cs: Make all interface member classes derive from
23782 InterfaceMemberBase.
23784 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23786 * Many things: all interfaces are parsed and generated in
23787 gen-treedump. Support for member variables, constructors,
23788 destructors, properties, constants is there.
23790 Beginning of the IL backend, but very little done, just there for
23793 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23795 * cs-parser.jay: Fix labeled statement.
23797 * cs-tokenizer.cs (escape): Escape " and ' always.
23798 ref_line, ref_name: keep track of the line/filename as instructed
23799 by #line by the compiler.
23802 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23804 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23805 to match the values in System.CodeDOM.
23807 Divid renamed to Divide.
23809 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23811 (Statements.set): remove.
23813 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23816 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23817 falseStatements always have valid values.
23819 * cs-parser.jay: Use System.CodeDOM now.