1 2006-09-08 Marek Safar <marek.safar@seznam.cz>
3 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
6 2006-09-07 Martin Baulig <martin@ximian.com>
9 (MainDriver): Revert r62663 from Marek; see #70506 for details.
11 2006-08-29 Miguel de Icaza <miguel@novell.com>
13 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
15 2006-08-17 Miguel de Icaza <miguel@novell.com>
17 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
18 #52019 and #79064, the use of the \uXXXX sequence in source code
19 to represent unicode characters.
21 2006-08-15 Marek Safar <marek.safar@seznam.cz>
23 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
25 * class.cs, ecore.cs, statement.cs: Merged to one error message.
27 2006-08-13 Miguel de Icaza <miguel@novell.com>
29 * assign.cs: Catch attempts to assign to a method groups in += and
32 2006-08-13 Marek Safar <marek.safar@seznam.cz>
35 * cs-parser.jay: Don't destroy current array type by typeof of array's.
37 2006-08-12 Marek Safar <marek.safar@seznam.cz>
39 * class.cs (Method.Define): Issue a warning when generic method looks like
41 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
44 2006-08-09 Marek Safar <marek.safar@seznam.cz>
46 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
48 * decl.cs (MemberCache.FindMembers): When container is interface we need to
49 search all base interfaces as a member can be ambiguous.
50 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
51 Constructor member type filter.
52 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
53 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
54 reporting for returned memberinfos.
56 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
57 version to work on all runtimes.
58 (TypeManager.RealMemberLookup): Removed members filtering.
60 2006-08-08 Raja R Harinath <rharinath@novell.com>
62 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
63 (PropertyExpr.EmitAssign): Likewise.
64 * expression.cs (Indirection.EmitAssign): Likewise.
65 (LocalVariableReference.EmitAssign): Likewise.
66 (ParameterReference.EmitAssign): Likewise.
67 (Invocation.EmitArguments): Likewise.
68 (ArrayAccess.EmitAssign): Likewise.
69 (IndexerAccess.EmitAssign): Likewise.
70 (This.EmitAssign): Likewise.
71 (ConditionalLogicalOperator.Emit): Likewise.
74 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
75 instead of ArrayList. If the hashtable has a LocalBuilder, don't
76 leave it in after returning it.
77 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
79 2006-08-06 Marek Safar <marek.safar@seznam.cz>
81 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
84 2006-08-03 Raja R Harinath <rharinath@novell.com>
86 Fix cs0146-3.cs and cs0146-4.cs.
87 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
88 enclosing types don't depend on the current type.
90 2006-08-02 Raja R Harinath <rharinath@novell.com>
93 * class.cs (TypeContainer.DoDefineMembers): Use
94 FindBaseMemberWithSameName on Parent, since we're interested in
95 whether we hide inherited members or not.
96 (FindBaseMemberWithSameName): Make slightly more robust.
98 Fix the non-generic testcase from #77396
99 * decl.cs (DeclSpace.DeclContainer): Remove override.
101 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
102 declspaces for doppelgangers too.
103 (UsingEntry): Implement IResolveContext.
104 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
105 'this' as the resolve context.
106 (LocalAliasEntry): Likewise.
108 Implement parts of #77403
109 * roottypes.cs (RootDeclSpace): New. Used to represent the
110 toplevel declaration space. Each namespace declaration introduces
111 a "partial" root declaretion space.
112 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
113 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
114 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
115 from 'current_namespace.SlaveDeclSpace'.
116 (namespace_declaration): Likewise.
117 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
118 check. It can't happen now.
119 * decl.cs (DeclSpace.LookupType): Likewise.
120 * driver.cs (MainDriver): Sanity check.
122 2006-08-01 Raja R Harinath <rharinath@novell.com>
124 * decl.cs (DeclSpace.FindNestedType): Remove.
125 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
126 LookupTypeContainer to get the container of the nested type.
127 * class.cs (TypeContainer.FindNestedType): Make non-override.
129 2006-07-31 Raja R Harinath <rharinath@novell.com>
131 * decl.cs (DeclSpace.PartialContainer): Move field from ...
132 * class.cs (TypeContainer.PartialContainer): ... here.
133 (TypeContainer.AddBasesForPart): New helper.
134 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
136 * cs-parser.jay (current_class): Convert to DeclSpace.
137 (struct_declaration, interface_declaration, class_declaration):
138 Use AddBasesForPart instead of .Bases directly.
139 * const.cs, iterators.cs: Update to changes.
141 2006-07-28 Raja R Harinath <rharinath@novell.com>
143 * class.cs (TypeContainer.AddMemberType): Rename from
145 (TypeContainer.AddMember): Rename from AddToMemberContainer.
146 (AddTypeContainer): New. Combine AddClassOrStruct and
148 (AddPartial): Update. Add 'is_partial' argument.
149 * roottypes.cs: Update to changes.
150 * cs-parser.jay (push_current_class): New helper for handling
151 current_container and current_class.
152 (struct_declaration, interface_declaration, class_declaration):
155 2006-07-26 Raja R Harinath <rharinath@novell.com>
157 * roottypes.cs: Rename from tree.cs.
159 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
160 * tree.cs (Tree, ITreeDump): Remove types.
161 * rootcontext.cs (tree, Tree): Remove fields.
162 (root, ToplevelTypes): New.
163 * *.cs: Update to rename.
165 * tree.cs (Tree.RecordDecl): Remove.
166 (RootTypes.AddToTypeContainer): Record the toplevel type in its
168 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
170 2006-07-23 Raja R Harinath <harinath@gmail.com>
172 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
173 DoFlowAnalysis and OmitStructFlowAnalysis here.
174 (ec.With): Rename from WithUnsafe and generalize.
175 (ec.WithCheckState): Remove. All users can be handled by 'With'.
176 (ec.WithFlowAnalyis): New.
177 * ecore.cs, expression.cs, statement.cs: Update.
179 2006-07-22 Raja R Harinath <harinath@gmail.com>
181 * statement.cs (Block.ResolveMeta): Simplify slightly.
183 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
184 multiple boolean fields. Convert InUnsafe, constant_check_state,
185 check_state to flags.
186 (CheckState, ConstantCheckState): Update.
187 (InUnsafe): New read-only property.
188 (FlagsHandle): Rename from CheckStateHandle and convert to handle
190 (WithUnsafe): New helper similar to WithCheckState.
191 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
192 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
194 2006-07-21 Raja R Harinath <rharinath@novell.com>
196 Make comparisons use the same IL irrespective of whether they're
197 in a 'checked' or 'unchecked' context: one of the issues in #78899
198 * codegen.cs (EmitContext.CheckState): Make read-only property.
199 (EmitContext.ConstantCheckState): Likewise.
200 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
201 helper that implement a save/restore stack for CheckState
202 values. This is the only way to change check-state.
203 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
204 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
205 (CheckedExpr.EmitBranchable): New forwarding method.
206 (UnCheckedExpr): Likewise.
207 * statement.cs (Block.ResolveMeta): Use WithCheckState.
208 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
209 (Checked.Resolve, checked.DoEmit): Likewise.
211 2006-07-20 Miguel de Icaza <miguel@novell.com>
213 * anonymous.cs: Cache the resolved anonymous delegate, and return
214 this so that the ResolveTopBlock is only triggered once, not
217 Currently we trigger ResolvetopBlock twice due to a first pass of
218 argument check compatibility, and a second pass that does the
221 2006-07-15 Marek Safar <marek.safar@seznam.cz>
223 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
225 * rootcontext.cs (Reset): Add helper_classes.
227 2006-07-15 Marek Safar <marek.safar@seznam.cz>
230 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
233 2006-07-13 Miguel de Icaza <miguel@novell.com>
235 * statement.cs (Lock): Handle expressions of type
236 TypeManager.null_type specially. Fixes #78770
238 2006-07-08 Marek Safar <marek.safar@seznam.cz>
240 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
243 2006-07-08 Marek Safar <marek.safar@seznam.cz>
245 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
246 for accessors as well.
247 * ecore.cs (EventExpr): Add AccessorTable.
249 2006-07-01 Marek Safar <marek.safar@seznam.cz>
252 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
253 for CS0122 where appropriate.
254 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
256 (Filter): Assembly can be null in the case of top level attributes.
258 2006-06-25 Marek Safar <marek.safar@seznam.cz>
262 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
263 is done at global level.
265 2006-06-24 Marek Safar <marek.safar@seznam.cz>
267 A fix for #77002, Implemented TypeForwarder support.
269 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
270 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
271 * typemanager.cs (): Add type_forwarder_attr_type.
273 2006-06-24 Marek Safar <marek.safar@seznam.cz>
275 * report.cs: Add CS0469 warning.
277 2006-06-21 Martin Baulig <martin@ximian.com>
279 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
280 the `try'-block, so we also report CS0016 etc. there.
282 2006-06-21 Martin Baulig <martin@ximian.com>
285 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
287 2006-06-21 Martin Baulig <martin@ximian.com>
289 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
290 also report CS1686 for parameters.
292 2006-06-21 Martin Baulig <martin@ximian.com>
294 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
295 instead of an error if the value is not implicitly convertible to
296 the switch types; fixes #77964.
298 2006-06-21 Raja R Harinath <rharinath@novell.com>
301 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
302 FieldBuilder is null.
305 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
306 'left' and 'right' before error-checking.
308 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
310 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
312 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
313 (FieldExpr.DoResolve): likewise.
314 (PropertyExpr.InstanceResolve): likewise.
315 (EventExpr.InstanceResolve): likewise.
317 2006-06-04 Marek Safar <marek.safar@seznam.cz>
319 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
320 attribute applicable tests for attribute argument.
322 2006-06-02 Raja R Harinath <rharinath@novell.com>
325 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
326 (Binary.OverloadResolve_PredefinedIntegral): New.
327 (Binary.OverloadResolve_PredefinedFloating): New.
328 (Binary.OverloadResolve_PredefinedString): New.
329 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
330 Follow the standard more closely, and treat numeric promotions in
331 terms of overload resolution.
332 (Binary.CheckShiftArguments): Simplify.
334 2006-06-01 Raja R Harinath <rharinath@novell.com>
336 * flowanalysis.cs (MyBitVector): Simplify representation.
337 (MyBitVector.Clone): Avoid allocating BitArray.
338 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
339 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
340 (*): Update. Change all references to MyBitVector.And and
341 MyBitVector.Or to &= and |=.
343 2006-05-29 Raja R Harinath <rharinath@novell.com>
346 * cs-parser.jay (formal_parameter_list): Extend the pattern below
347 to param arguments too.
349 2006-05-26 Miguel de Icaza <miguel@novell.com>
351 * cs-parser.jay: Catch another parsing form for arglist being
352 followed by other arguments. Fixes #78313.
354 2006-05-24 Raja R Harinath <rharinath@novell.com>
356 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
357 checking of out parameters to ...
358 (FlowBranchingToplevel.Merge): ... here.
359 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
360 set, propagate the origin upward, and only complain if there was
362 (FlowBranchingException.AddContinueOrigin): Likewise.
363 (FlowBranchingException.AddReturnOrigin): Likewise.
364 (FlowBranchingException.AddGotoOrigin): Likewise.
366 2006-05-23 Raja R Harinath <rharinath@novell.com>
368 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
369 unreachable, skip it.
370 (FlowBranchingException.Merge): Always propagate jumps, even if
371 the finally block renders subsequent code unreachable.
373 2006-05-18 Raja R Harinath <rharinath@novell.com>
376 * statement.cs (Goto.Resolve): Move responsibility for resolving
377 'goto' to FlowBranching.AddGotoOrigin.
378 (Goto.SetResolvedTarget): New. Callback to set the
379 LabeledStatement that's the target of the goto.
380 (Goto.DoEmit): Use Leave instead of Br when crossing an
381 unwind-protect boundary.
382 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
383 LookupLabel and adjust to new semantics.
384 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
385 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
386 Goto.SetResolvedTarget to update target.
387 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
388 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
389 AddBreakOrigin & co. Delay propagation until ...
390 (FlowBranchingException.Merge): ... this.
392 * statement.cs (Block.Resolve): Always depend on flow-branching to
393 determine unreachability. Kill workaround that originally emitted
394 only one statement after an "unreachable" label (see infloop in
397 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
398 This is still "wrong", but anything better would probably need a
399 multi-pass algorithm.
400 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
401 usage vector. Force current usage vector to be reachable, to
402 optimistically signify backward jumps.
403 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
405 (FlowBranchingLabeled.Merge): New. If no backward jump was
406 detected, return the original salted-away usage vector instead,
407 updated with appropriate changes. Print unreachable warning if
409 * statement.cs (Block.Resolve): Don't print unreachable warning on
412 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
414 * driver.cs: Pass filename without path to AssemblyBuilder's
415 AddResourceFile. Fixes bug #78407.
417 2006-05-17 Raja R Harinath <rharinath@novell.com>
419 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
420 * flowanalysis.cs (FlowBranchingLabeled): ... here.
421 (FlowBranching.MergeChild): Overwrite
422 reachability information from Labeled branchings too.
424 2006-05-16 Raja R Harinath <rharinath@novell.com>
426 * statement.cs (Goto.Resolve): Merge jump origins here ...
427 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
429 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
430 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
431 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
432 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
434 * statement.cs (Goto.Resolve): ... not here.
435 (Goto.Emit): Remove CS1632 check.
437 2006-05-14 Marek Safar <marek.safar@seznam.cz>
439 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
442 2006-05-11 Raja R Harinath <rharinath@novell.com>
444 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
445 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
446 (FlowBranchingException.Label): Likewise.
448 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
450 (MyBitVector.Or): Use it to avoid losing information (Count).
451 (FlowBranching.MergeOrigins): Likewise.
453 * flowanalysis.cs (UsageVector.IsDirty): Remove.
454 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
455 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
456 (UsageVector.ToString): Simplify.
457 (UsageVector.MergeSiblings): Move here from ...
458 (FlowBranching.Merge): ... here.
459 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
462 2006-05-10 Raja R Harinath <rharinath@novell.com>
464 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
465 null bitvector is treated as all-true.
467 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
468 (MyBitVector): Rationalize invariants. 'vector != null' implies
469 that we have our own copy of the bitvector. Otherwise,
470 'InheritsFrom == null' implies all inherited bits are true.
472 2006-05-09 Marek Safar <marek.safar@seznam.cz>
474 * statement.cs (LocalInfo): Add IsConstant.
475 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
476 local variable for constants.
478 2006-05-09 Raja R Harinath <rharinath@novell.com>
480 * flowanalysis.cs (MyBitVector.Empty): New.
481 (MyBitVector): Don't allow InheritedFrom to be null.
482 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
483 (UsageVector, FlowBranching): Update to changes.
485 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
486 recursion. The 'Parent == null' condition isn't sufficient for
488 (FlowBranching.AddBreakOrigin): Likewise.
489 (FlowBranching.AddContinueOrigin): Likewise.
490 (FlowBranching.AddReturnOrigin): Likewise.
491 (FlowBranching.StealFinallyClauses): Likewise.
492 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
493 (FlowBranching.CheckOutParameters): Likewise.
494 (FlowBranchingToplevel): Terminate all the above recursions here.
495 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
496 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
498 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
500 (FlowBranchingToplevel): New. Empty for now.
501 (FlowBranching.MergeTopBlock): Update.
502 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
503 branching for the anonymous delegate.
504 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
506 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
507 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
508 information at the start of the merge. Reorganize.
510 2006-05-07 Marek Safar <marek.safar@seznam.cz>
512 * class.cs (MethodData.Define): Method cannot implement interface accessor.
514 2006-05-07 Marek Safar <marek.safar@seznam.cz>
516 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
517 to newly introduced ctor.
519 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
520 message to one place.
521 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
524 2006-05-07 Marek Safar <marek.safar@seznam.cz>
526 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
528 * ecore.cs (Expression.ResolveAsConstant): Updated.
530 * statement.cs (ResolveMeta): Updated.
532 2006-05-06 Marek Safar <marek.safar@seznam.cz>
534 * cs-parser.jay: __arglist cannot be used in initializer.
536 2006-05-06 Marek Safar <marek.safar@seznam.cz>
539 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
542 2006-05-05 Raja R Harinath <rharinath@novell.com>
544 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
545 (LabeledStatement): Add 'name' parameter.
546 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
547 (Block.AddLabel): Update to changes.
548 * cs-parser.jay (labeled_statement): Likewise.
550 * flowanalysis.cs (BranchingType.Labeled): New.
551 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
552 (FlowBranchingLabeled): New. Does nothing for now, but will
553 eventually handle 'goto' flows.
554 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
555 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
556 that's terminated ...
557 (Block.Resolve): ... here.
559 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
560 (UsageVector.MergeFinallyOrigins): Likewise.
561 (FlowBranching.InTryOrCatch): Likewise.
562 (FlowBranching.AddFinallyVector): Likewise.
563 (FlowBranchingException): Update to changes.
566 * statement.cs (Return.Resolve): Move error checking to ...
567 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
568 (FlowBranchingException): Handle return origins like break and
570 (FlowBranching.UsageVector.CheckOutParameters): Remove.
572 2006-05-04 Marek Safar <marek.safar@seznam.cz>
575 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
578 2006-05-04 Marek Safar <marek.safar@seznam.cz>
581 * class.cs (MethodData.Define): Do public accessor check only when method
582 implements an interface.
584 2006-05-04 Raja R Harinath <rharinath@novell.com>
586 Remove special handling of 'break'
587 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
588 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
589 (UsageVector.Break): Remove.
590 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
592 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
594 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
595 UsageVector.Breaks (). Don't set NeedsReturnLabel.
597 2006-05-03 Marek Safar <marek.safar@seznam.cz>
600 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
601 be the interface member.
603 2006-05-03 Marek Safar <marek.safar@seznam.cz>
606 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
607 for emitting small (int) values.
609 2006-05-03 Raja R Harinath <rharinath@novell.com>
612 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
613 control-flow passes through the 'finally' after merging-in all the
614 control-flows from 'try' and the 'catch' clauses.
616 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
617 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
618 always true at the only non-recursive entry point.
619 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
620 FlowBranchingBreakable.
621 (FlowBranchingLoop): Remove.
622 * statement.cs (Return.DoResolve): Update to changes.
625 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
626 (FlowBranching.CreateBranching): Handle it: create a
627 FlowBranchingContinuable.
628 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
629 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
630 except that it handles the 'continue' command.
631 (FlowBranching.UsageVector.MergeOrigins): Rename from
633 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
634 except that it overrides AddContinueOrigin.
635 (FlowBranchingException): Override AddContinueOrigin, similar to
637 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
638 Create a new branching around the embedded statement.
639 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
640 control flow after the embedded statement.
641 (Continue.Resolve): Move all error checking to AddContinueOrigin.
643 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
644 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
645 FlowBranchingBreakable.
646 (FlowBranchingSwitch): Remove.
649 * statement.cs (Break.Resolve): Simplify. Move responsibility for
650 error reporting to ...
651 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
652 Rename from 'AddBreakVector'. Add new location argument. Return
653 a bool indicating whether the 'break' crosses an unwind-protect.
654 (FlowBranchingException.AddBreakOrigin): Add.
655 (FlowBranchingException.Merge): Propagate 'break's to surrounding
656 flowbranching after updating with the effects of the 'finally'
658 (FlowBranchingBreakable): New common base class for
659 FlowBranchingLoop and FlowBranchingSwitch.
661 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
663 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
665 2006-05-02 Raja R Harinath <rharinath@novell.com>
667 * statement.cs (Do.Resolve): If the loop is infinite, set the
669 (While.Resolve, For.Resolve): Set a barrier after the embedded
670 statement. There's no direct control flow that goes from the end
671 of the embedded statement to the end of the loop.
672 * flowanalysis.cs (FlowBranching.Infinite): Remove.
673 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
674 above ensure that the reachability is correctly computed.
676 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
677 (UsageVector.MergeBreakOrigins): If the current path is
678 unreachable, treat it as if all parameters/locals are initialized.
679 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
680 infinite loops before merging-in break origins.
682 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
683 (Reachability.Reachable): Split part into ...
684 (Reachability.Unreachable): ... this. Simplify.
685 (Reachability.IsUnreachable): Use 'Unreachable' instead.
687 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
688 (Reachability.SetThrowsSometimes): Likewise.
689 (FlowBranchingBlock.MergeTopBlock): Don't compare against
690 TriState.Always, use corresponding property.
691 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
692 (Block.Resolve): Likewise. Remove some redundant checks.
694 2006-05-02 Raja R Harinath <harinath@gmail.com>
696 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
697 (Reachability.Meet): Don't bother checking AlwaysThrows --
698 barrier is always set.
699 (FlowBranchingBlock.Merge): Likewise.
701 2006-05-01 Raja R Harinath <harinath@gmail.com>
703 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
704 checks for unreachable.
706 2006-05-01 Marek Safar <marek.safar@seznam.cz>
709 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
711 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
712 whether field is really assigned.
714 2006-04-30 Raja R Harinath <harinath@gmail.com>
716 * flowanalysis.cs (Reachability): Make 4-argument constructor
718 (Reachability.Meet): Rename from 'And'. Remove static variant.
719 (Reachability.Always): Rename from the highly misleading
720 'Reachability.Never'.
721 (FlowBranching.Merge): Update to changes. Mark an impossible
722 situation with a 'throw'.
723 (*): Update to changes.
725 2006-04-29 Raja R Harinath <harinath@gmail.com>
727 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
729 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
730 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
731 (*): Update to changes.
732 * statement.cs: Update to changes.
734 2006-04-28 Marek Safar <marek.safar@seznam.cz>
737 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
739 2006-04-28 Raja R Harinath <harinath@gmail.com>
741 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
744 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
745 argument to two arguments: an usage-vector and a bool. Move call
746 to FlowBranching.Merge () ...
747 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
749 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
750 handling of loop and switch reachability to ...
751 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
753 2006-04-27 Raja R Harinath <harinath@gmail.com>
755 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
756 handling to FlowBranchingLoop.InLoop.
757 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
759 2006-04-26 Marek Safar <marek.safar@seznam.cz>
762 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
763 anonymous method is allowed from AnonymousContainer here.
765 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
767 2006-04-24 Raja R Harinath <rharinath@novell.com>
770 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
772 2006-04-23 Marek Safar <marek.safar@seznam.cz>
775 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
776 (DoubleConstant.Reduce): Ditto.
778 2006-04-23 Raja R Harinath <rharinath@novell.com>
780 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
781 Remove 'lvalue_right_side' argument. Move parts to ...
782 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
783 (LocalVariable.DoResolveLValue): ... these.
785 2006-04-21 Raja R Harinath <rharinath@novell.com>
788 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
789 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
790 (LocalVariableReference.DoResolveBase): Use it to implement new
792 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
793 (Argument.Resolve): Simplify. Move CS1510 check ...
794 * ecore.cs (Expression.ResolveLValue): ... here.
795 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
796 (PropertyExpr.DoResolveLValue): Likewise.
797 (FieldExpr.Report_AssignToReadonly): Likewise.
798 (FieldExpr.DoResolve): Add 'out_access' argument. Use
799 LValueMemberAccess or LValueMemberOutAccess on instance depending
801 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
802 DoResolve as appropriate.
804 2006-04-20 Raja R Harinath <rharinath@novell.com>
807 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
808 implicit conversions on 'out' and 'ref' arguments.
810 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
811 improve clarity. Remove dead code.
814 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
815 (Catch.Resolve): Resolve VarBlock if it exists.
817 2006-04-19 Miguel de Icaza <miguel@novell.com>
819 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
820 twice, this was some residual code, the enumerator was emitted
821 properly in the two branche of if later.
823 2006-04-19 Raja R Harinath <rharinath@novell.com>
825 * expression.cs (Cast.ResolveLValue): Remove. The result of a
826 cast is never an lvalue.
827 (Cast.DoResolve, Cast.ResolveRest): Combine.
828 (Argument.Emit): Simplify slightly. Move 'Expr is
829 IMemoryLocation' check ...
830 (Argument.Resolve): ... here.
831 (Argument.Error_LValueRequired): Remove. Inline into only user.
833 Simplifications. Fix cs0191-2.cs
834 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
835 CS1649 and CS1651 to ...
836 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
837 the actual selection of the error code and message to a lookup
838 table. Add a dummy return value to simplify callsites.
839 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
840 readonly fields of other instances of the same type. Move CS0197
842 * expression.cs (Argument.Resolve): ... here. Simplify code.
843 Ensure that ec.InRefOutArgumentResolving is only set during LValue
844 resolution of an out or ref argument. The code simplification
845 above uses this invariant.
847 2006-04-18 Raja R Harinath <rharinath@novell.com>
849 Possibly fix #77752. Fix cs1690-[4-7].cs.
850 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
851 CheckMarshallByRefAccess. Drop parameter.
852 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
854 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
856 * report.cs (AllWarnings): Add CS1690.
857 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
859 (LocalVariableReference.DoResolveBase): Update.
861 2006-04-09 Marek Safar <marek.safar@seznam.cz>
863 * class.cs (MethodOrOperator): Moved common parts from method class.
864 detect obsolete attributes.
865 (Method.Define): Simplified as it reuses code from base.
866 (Constructor.ValidAttributeTargets): Fixed issue found during
868 (Destructor.ValidAttributeTargets): Fixed issue found during
870 (Operator): Finished refactoring set off by #78020. Operator class is now
871 ordinary method class.
873 * anonymous.cs: Updated.
875 * decl.cs (DeclSpace): Add IsGeneric
877 2006-04-09 Marek Safar <marek.safar@seznam.cz>
879 * class.cs (Constructor.Emit): Don't emit the attributes twice.
881 2006-04-09 Marek Safar <marek.safar@seznam.cz>
883 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
884 detect obsolete attributes.
885 (Method.CreateEmitContext): Moved to MethodOrOperator.
887 2006-04-09 Marek Safar <marek.safar@seznam.cz>
890 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
891 customized exception to make crash detection easier.
892 (MethodOrOperator): Started to work on new base class for methods and
894 (Method): Derives from MethodOrOperator.
895 (Constructor.Emit): Emits its own attributes.
896 (AbstractPropertyEventMethod.Emit): Ditto.
897 (Operator): Derives from MethodOrOperator, will refactor fully in extra
899 (Operator.Emit): It's temporary more tricky than should be.
901 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
903 * report.cs (InternalErrorException): Add ctor with inner exception.
905 2006-04-08 Marek Safar <marek.safar@seznam.cz>
908 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
911 2006-04-07 Marek Safar <marek.safar@seznam.cz>
914 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
917 2006-04-06 Marek Safar <marek.safar@seznam.cz>
919 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
920 attribute is present and Guid not.
921 (Interface.ApplyAttributeBuilder): Ditto.
923 * attribute.cs: Add error message.
925 2006-04-06 Marek Safar <marek.safar@seznam.cz>
929 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
930 sources (it's composite) so hold them in extra array as they are used in
931 Emit phase only. It worked in the previous versions by mistake.
932 (Attribute.Emit): Emit attribute for more owners when exist.
934 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
935 it has now different behaviour.
937 2006-04-04 Marek Safar <marek.safar@seznam.cz>
939 * constant.cs (Constant.IsDefaultInitializer): New method.
943 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
944 re-initialize default values. It saves KBs almost for every assembly.
945 Thanks Zoltan for the idea.
946 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
947 (ArrayCreation.DoResolve): Resolve only once.
948 (ArrayCreation.Emit): Emit static initializer only when it is faster.
949 (ArrayCreation.GetAttributableValue): Cope with optimized values.
951 2006-04-03 Zoltan Varga <vargaz@gmail.com>
953 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
956 2006-04-01 Marek Safar <marek.safar@seznam.cz>
958 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
959 in an embedded statement too.
961 2006-04-01 Raja R Harinath <rharinath@novell.com>
964 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
966 2006-04-01 Marek Safar <marek.safar@seznam.cz>
970 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
973 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
975 2006-03-31 Marek Safar <marek.safar@seznam.cz>
977 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
980 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
981 LocalTemporary change.
983 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
985 (ClassOrStruct.DefineFieldInitializers): Implemented static field
986 initializers optimization.
987 (ClassOrStruct.TypeAttr): Moved from modifiers.
988 (Constructor.CheckBase): Don't crash when static ctor has parameters.
989 (FieldBase.ResolveInitializer): Resolves initializer.
990 (FieldBase.HasDefaultInitializer): New property.
992 * cs-parser.jay: Removed message.
994 * expression.cs (CompilerGeneratedThis): New specialization.
996 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
998 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1000 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1002 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1004 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1005 be now EnumConstants only.
1007 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1009 * attribute.cs, driver.cs: Reset more caches.
1011 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1013 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1015 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1017 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1018 for easier reuse. Updated all overrides.
1019 (IntegralConstant): New base class for all integral constants.
1020 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1021 of the constant range, report custom error.
1022 (UIntConstant.Reduce): Fixed uint conversion.
1024 * ecore.cs, literal.cs: Reduce updates.
1026 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1030 * class.cs (Constructor.Define): Removed extra if for default ctors.
1031 A patch from Atsushi Enomoto.
1033 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1035 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1036 GetAttributableValue.
1038 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1041 * convert.cs (ImplicitConversionRequired): Error message moved to
1044 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1045 automatic implicit conversion of an output value.
1046 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1048 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1050 (TypeOf.GetAttributableValue): Add extra handling for object type.
1052 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1053 special error message.
1055 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1057 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1059 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1060 compatible with MS runtime.
1062 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1064 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1065 attribute arguments here.
1067 * class.cs (Indexer.Define): The check was moved to attribute class.
1069 2006-03-22 Marek Safar <marek.safar@seznam.cz>
1071 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1072 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1075 2006-03-22 Raja R Harinath <rharinath@novell.com>
1077 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1078 mcs to keep code differences small.
1079 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1080 * typemanager.cs (parameter_default_value_attribute_type): New.
1081 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1084 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1086 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1088 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1090 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1092 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1095 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1097 * doc-bootstrap.cs : fix build.
1099 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1101 * expression.cs (StringConcat.Append): Issue a warning when empty string
1104 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1106 * assign.cs (CompoundAssign.ResolveSource): Removed.
1108 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1111 * class.cs (TypeContainer.FindMethods): Removed.
1112 (TypeContainer.CheckMemberUsage): Made static.
1114 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1116 * constant.cs (CheckRange): Removed unused type argument.
1117 (CheckUnsigned): Removed unused type argument.
1119 * cs-parser.jay: Updated after MemberAccess clean up.
1120 Uses Length for empty string test.
1122 * cs-tokenizer.cs: Uses Length for empty string test.
1123 (IsCastToken): Made static.
1124 (is_hex): Made static.
1125 (real_type_suffix): Made static.
1127 * decl.cs (SetupCache): Made static.
1128 (OnGenerateDocComment): Removed unused ds argument.
1130 * delegate.cs (VerifyDelegate): Removed unused argument.
1132 * doc.cs: Uses Length for empty string test.
1134 * driver.cs: Uses Length for empty string test.
1136 * enum.cs (IsValidEnumType): Made static
1138 * expression.cs (EnumLiftUp): Removed unused argument.
1139 (ResolveMethodGroup): Ditto.
1140 (BetterConversion): Ditto.
1141 (GetVarargsTypes): Ditto.
1142 (UpdateIndices): Ditto.
1143 (ValidateInitializers): Ditto.
1144 (MemberAccess.ctor): Ditto.
1145 (GetIndexersForType): Ditto.
1147 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1149 * iterators.cs: Updated after MemberAccess clean up.
1151 * location.cs: Uses Length for empty string test.
1153 * namespace.cs: Uses Length for empty string test.
1155 * report.cs (CheckWarningCode): Made static.
1157 * statement.cs (LabeledStatement): Removed unused argument.
1159 * typemanager.cs (FilterNone): Removed.
1161 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1163 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1166 * class.cs: Updated.
1168 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1170 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1172 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1176 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1177 reporting, it's more tricky than I thought.
1179 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1183 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1185 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1186 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1187 Add more error reporting; Fixed issue with params.
1189 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1191 * cs-parser.jay: AnonymousMethod requires host container.
1193 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1195 2006-03-18 Raja R Harinath <harinath@gmail.com>
1197 * class.cs: Change 'TypeContainer ds' constructor argument to
1198 'DeclSpace parent'. Some classes were missed below due to
1199 different naming convention.
1201 * class.cs (MemberCore.Parent): Delete. This makes the
1202 ParentContainer changes below enforceable by the compiler.
1204 Treat pointers to enclosing declaration space as 'DeclSpace', not
1206 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1207 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1209 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1211 (Block.AddThisVariable): Likewise.
1212 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1213 (AbstractPropertyEventMethod.Emit): Likewise.
1214 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1215 (GetMethod.Define, SetMethod.Define): Likewise.
1216 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1217 (DelegateMethod.EmitMethod): Likewise.
1219 Fix regression test-partial-13.cs.
1220 Rationalize use of PartialContainer. Ensure that the partial
1221 class semantics can be tied to type-correctness, i.e., any
1222 violation will cause a compile error.
1223 * class.cs, const.cs: Access all fields that belong to class
1224 TypeContainer via ParentContainer. Arguments of EmitContexts and
1225 Resolve()-like functions still use 'Parent'.
1227 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1228 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1229 (PropertyMethod.CheckModifiers): Remove unused argument.
1230 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1233 2006-03-17 Raja R Harinath <harinath@gmail.com>
1235 Make semantics of PartialContainer simpler.
1236 * decl.cs (DeclSpace.IsPartial): Remove.
1237 * class.cs (TypeContainer.IsPartial): Likewise.
1238 (TypeContainer..ctor): Set PartialContainer to point to self.
1239 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1240 (TypeContainer.FindNestedType): Likewise.
1241 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1243 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1245 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1247 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1249 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1252 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1254 * class.cs (Operator.Define): An error for base conversion was not
1257 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1259 * iterator.cs : yield break is allowed in try statement which has
1260 catch clauses. Fixed bug #77767.
1262 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1264 A fix for #77593, #77574.
1266 * class.cs (MethodCore.CheckBase): Another if for operator.
1268 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1270 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1273 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1274 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1277 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1280 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1281 Updated after another emitcontext usage was clean up. It should help us to
1282 synchronize with gmcs easier.
1284 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1288 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1289 (Event.Define): ditto
1290 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1292 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1293 Removed redundant code and set NewSlot for Invoke method too.
1295 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1296 (Parameters.MergeGenerated): New method. Use this method when you merge
1297 compiler generated argument with user arguments.
1299 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1301 * attribute.cs (ResolveAsTypeTerminal): Removed.
1303 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1304 specialization for predefined types; 30% speed up.
1305 Finally placed obsolete check to right place.
1306 (Expression.ResolveType): Removed.
1308 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1309 Updated after ResolveType was removed.
1311 * expression.cs (Cast.ctor): Check void cast.
1312 (Binary.ResolveAsTypeTerminal): Is never type.
1313 (Conditional.ResolveAsTypeTerminal): Is never type.
1315 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1317 2006-03-01 Raja R Harinath <rharinath@novell.com>
1320 * expression.cs (ParameterReference.DoResolveBase): Change return
1322 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1326 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1329 * typemanager.cs (GetFullNameSignature): Don't nullref on
1330 protected accessors.
1332 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1334 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1335 these two separated members to simplify the code.
1336 (Attribute.Resolve): Refactored to use new fields and methods.
1337 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1338 implemented obsolete attribute checking.
1339 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1340 implemented obsolete checking again. It look line never ending quest ;-)
1341 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1343 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1345 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1347 *class.cs (Property.Define): Add RegisterProperty call.
1349 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1350 argument groups (only 2).
1352 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1353 encoding expression to arguments.
1354 (Expression.ExprClassToResolveFlags): Just turned to property.
1356 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1357 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1358 optimized as well as implemented support for zero-length attributes.
1360 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1361 Add caching of PropertyInfo's.
1363 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1365 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1366 error multiple times.
1368 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1370 New partial class implementation.
1371 A fix for #77027, #77029, #77403
1373 * attribute.cs (Attributable): Made attributes protected.
1375 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1376 the replacements of ClassPart and PartialContainer.
1377 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1378 (TypeContainer.AddInterface): Ditto.
1379 (TypeContainer.AddPartial): The main method for partial classes. It checks
1380 for errors and merges ModFlags and attributes. At the end class is added to
1382 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1384 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1385 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1386 from the rest of partial classes.
1387 (TypeContainer.GetClassBases): Simplified.
1388 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1390 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1391 (TypeContainer.HasExplicitLayout): Uses Flags now.
1392 (PartialContainer): Removed.
1393 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1394 (StaticClass): Was merged with Class.
1395 (Class.GetClassBases): class and static class bases are verified here.
1396 (Class.TypeAttr): Added static attributes when class is static.
1397 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1398 (MemberBase): In some cases we need to call parent container for partial
1399 class. It should be eliminated but it's not easy now.
1401 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1403 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1404 partial classed to accumulate class comments.
1405 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1407 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1409 * driver.cs (MainDriver): Tree.GetDecl was removed.
1411 * modifiers.cs (Modifiers): Add partial modifier.
1413 * tree.cs (Tree.decl): Removed.
1414 (RootTypes): Started to use this class more often for root types
1417 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1421 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1422 external interface does not have an attribute.
1424 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1426 Another prerequisites for new partial classs implementation.
1428 * attribute.cs (Attribute.Equal): Implemented.
1429 (Attribute.Emit): Changed as attributes can be applied more than twice.
1430 (Attributes.Emit): Check for duplicate attributes here.
1432 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1433 as a parameter, clean-up.
1435 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1439 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1440 contains obsolete attribute check which can in some cases look for base
1441 type of current class which is not initialized yet.
1442 (TypeContainer.BaseType): Replacement of ptype.
1444 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1446 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1448 First of prerequisites for new partial classs implemention.
1450 * attribute.cs (Attributable): Extended by ResolveContext;
1451 Attributes finally have correct context for resolving in all cases.
1452 (AttachTo): Attribute owner is assigned here.
1454 * codegen.cs (IResolveContext): Introduce new interface to hold
1455 all information needed in resolving phase.
1456 (EmitContext): Implements IResolveContext; more clean-up needed here.
1458 * decl.cs (MemberCore): Implemented IResolveContext.
1460 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1461 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1462 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1463 Refactored to use new IResolveContext instead of EmitContext; cleanup
1465 2006-02-06 Miguel de Icaza <miguel@novell.com>
1467 * codegen.cs (EmitScopeInitFromBlock): check here the
1468 capture_context, there is no need to make two calls to the
1471 * anonymous.cs: Add some debugging messages that might help me
1472 track other instances of this problem in the future (the
1473 regression of test 467).
1475 * cs-parser.jay: track the variable block, as we need to initalize
1476 any captured variables declared in this block for the "catch"
1477 portion of the "Try" statement.
1479 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1480 scope initialization for captured variables.
1482 Also, move the emit for the variables after the block location has
1485 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1487 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1489 2006-02-02 Miguel de Icaza <miguel@novell.com>
1491 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1492 commit yesterday, the initialization for the roots is necessary.
1493 What is not necessary is the scope activation.
1495 2006-02-02 Raja R Harinath <rharinath@novell.com>
1497 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1498 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1500 (Argument.Resolve): Remove CS0206 checks.
1502 2006-02-01 Miguel de Icaza <miguel@novell.com>
1504 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1505 scopes for all the roots, the scopes will now be emitted when the
1506 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1508 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1509 code. This reduces a lot of existing cruft.
1511 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1512 that the ScopeInfo is generated as we enter the scope, not at the
1513 time of use, which is what we used to do before.
1515 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1516 every time a Block is about to be emitted if we have a
1519 2006-02-01 Raja R Harinath <rharinath@novell.com>
1521 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1523 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1525 * typemanager.cs (cons_param_array_attribute): Make private.
1526 (Reset): Set it to null.
1527 (InitCoreHelpers): Don't initialize it.
1528 (ConsParamArrayAttribute): New. Initialize it as needed.
1529 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1531 2006-01-31 Miguel de Icaza <miguel@novell.com>
1533 * expression.cs: There might be errors reported during the
1534 selection of applicable methods. If there are errors, do not
1535 continue execution as it will lead the compiler to crash.
1537 2006-01-30 Miguel de Icaza <miguel@novell.com>
1539 * expression.cs: Member access is not allowed on anonymous
1540 methods. Fixes #77402.
1542 2006-01-30 Raja R Harinath <rharinath@novell.com>
1545 * cs-parser.jay (VariableDeclaration): Don't set
1546 current_array_type to null.
1547 (field_declaration, event_declaration, declaration_statement):
1548 Set it to null here.
1550 2006-01-28 Raja R Harinath <harinath@gmail.com>
1552 * typemanager.cs (GenericParameterPosition): New.
1555 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1557 * doc.cs : To process "include" elements, first we should create
1558 another list than XmlNodeList, because it could result in node
1559 removal, which could result in that the XmlNodeList gives up
1562 (Also made code identical to gmcs again.)
1564 2006-01-25 Miguel de Icaza <miguel@novell.com>
1566 * ecore.cs: Introduce an error report that we were not catching
1567 before, if not silent, we must report the error. Gonzalo ran into
1570 2006-01-23 Miguel de Icaza <miguel@novell.com>
1572 A fix for bug: #76957
1574 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1575 ComputeMethodHost before creating the method, this is a new
1578 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1579 that this method references (RegisterScope). The actual scope
1580 where the method is hosted is computed with the ComputeMethodHost
1581 before we create the method.
1583 Moved the Deepest routine here.
1585 (AnonymousContainer.ComputeMethodHost): New routine used to
1586 compute the proper ScopeInfo that will host the anonymous method.
1588 (ScopeInfo): Deal with multiple roots. The problem was that we
1589 did not have a unique root where all ScopeInfos could be hanged
1590 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1593 Remove AdjustMethodScope which is now computed at the end. Remove
1594 LinkScope which did a partial link, instead link all ScopeInfos
1595 before code generation from the new "LinkScopes" routine.
1597 Simplify all the Add* routines as they no longer need to maintain
1598 the tree, they just need to record that they are using variables
1601 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1602 routines to produce the forest of ScopeInfo trees.
1604 * class.cs (TypeContainer.AppendMethod): This is just like
1605 AddMethod, but ensures that an interface implementation method
1606 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1607 methods, but at the end.
1609 We use this functionality to ensure that the generated MoveNext
1610 method in the iterator class is resolved/emitted before the
1611 enumerator methods created.
1613 This is required because the MoveNext method computes the right
1614 ScopeInfo for the method. And the other methods will eventually
1615 need to resolve and fetch information computed from the anonymous
1618 2006-01-21 Raja R Harinath <harinath@gmail.com>
1619 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1622 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1624 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1625 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1627 2006-01-18 Raja R Harinath <rharinath@novell.com>
1629 Fix #76656, cs0231-2.cs.
1630 * cs-parser.jay (formal_parameter_list): Make error case catch
1632 (parenthesized_expression_0): Add CS1026 check.
1633 (invocation_expression): Remove unused { $$ = lexer.Location }.
1635 2006-01-17 Raja R Harinath <rharinath@novell.com>
1638 * cs-parser.jay (statement_expression): Don't list out the
1639 individual statement-expressions. Convert syntax error into
1642 2006-01-16 Raja R Harinath <rharinath@novell.com>
1645 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1646 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1647 CheckIntermediateModification.
1648 (FieldExpr.DoResolve): Add new two-argument version that
1649 allows us to resolve the InstanceExpression as an lvalue.
1650 The one-argument variant is now just a wrapper.
1651 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1652 Resolve the lhs as an lvalue if the it has a value type.
1653 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1654 from Assign.DoResolve.
1655 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1656 resolved as an lvalue.
1657 (PropertyExpr.DoResolve): Update.
1658 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1659 has a value type. Move CS1612 check here from
1660 CheckIntermediateModification.
1661 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1662 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1663 'right_side' of a ResolveLValue on an 'out' argument.
1664 (EmptyExpression.LValueMemberAccess): New. Used as the
1665 'right_side' of a propagated ResolveLValue on a value type.
1666 (LocalVariableReference.DoResolveBase): Recognize
1667 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1669 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1670 EmptyExpression.Null.
1672 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1674 * typemanager.cs : added IsGenericParameter(). In mcs it always
1676 * doc.cs : for generic parameters, use GenericParameterPosition,
1679 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1681 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1683 2006-01-12 Miguel de Icaza <miguel@novell.com>
1685 This fixes the problem where we used ldfld instead of ldflda to
1686 load the "THIS" pointer on captured parameters, when THIS is a
1687 value type. See bug #77205.
1689 * iterators.cs (CapturedThisReference.Emit): Pass false to
1690 EmitThis (we do not need the address).
1692 * codegen.cs (EmitThis): it needs to know whether we need the
1693 address of `this' or not. This is used by value types.
1695 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1696 every other call passes false.
1698 2006-01-12 Raja R Harinath <rharinath@novell.com>
1701 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1703 * expression.cs (Invocation.OverloadResolve): Update.
1704 (Invocation.DoResolve): Avoid double resolution of invocation.
1706 2006-01-11 Raja R Harinath <rharinath@novell.com>
1709 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1710 unary negation of floating point types as 0-expr; negation cannot
1711 overflow in floating point types.
1714 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1715 on operands of 'void' type.
1718 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1719 and ExclusiveOr for boolean constants too.
1721 2006-01-09 Raja R Harinath <rharinath@novell.com>
1724 * expression.cs (Invocation.OverloadResolve): Replace reflected
1725 override methods with their base virtual methods, rather than
1727 * typemanager.cs (TypeManager.GetOverride): New.
1729 2006-01-05 Jb Evain <jbevain@gmail.com>
1731 * class.cs (Property.Define, Indexer.Define): do not tag the
1732 properties as SpecialName | RTSpecialName.
1734 2006-01-04 Miguel de Icaza <miguel@novell.com>
1736 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1737 doing a low-level comparission of parameter types. It was lacking
1738 a check for __argslist.
1740 2005-12-30 Miguel de Icaza <miguel@novell.com>
1742 * expression.cs (ParameterReference.DoResolveBase): Allow
1743 reference parameters if they are local to this block.
1745 This allows the ref and out parameters of a delegate to be used in
1746 an anonymous method, for example:
1748 delegate void set (out int x);
1750 set s = delegate (out int x){
1754 This is used by functionality introduced late in the C# language.
1756 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1757 method that take ref and out parameters.
1759 Fixes #77119 which was a late change in the spec.
1761 2005-12-23 Miguel de Icaza <miguel@novell.com>
1763 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1764 parent if its the same scope. Fixes #77060.
1766 2005-12-21 Miguel de Icaza <miguel@novell.com>
1768 * driver.cs: Report the case of no source files and no -out:
1771 2005-12-20 Raja R Harinath <rharinath@novell.com>
1774 * expression.cs (ComposedCast.GetSignatureForError): Define.
1776 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1780 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1781 ListDictionary, to contain the ExternAliasEntry entries (in
1782 addition to the NamespaceEntry.aliases hashtable). This field is
1783 shared between the original entry and its doppelganger (bodyless
1785 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1786 extern_aliases field.
1787 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1788 lookup in extern_aliases.
1790 2005-12-16 Raja R Harinath <rharinath@novell.com>
1793 * class.cs (TypeContainer.Mark_HasEquals): New.
1794 (TypeContainer.Mark_HasGetHashCode): New.
1795 (ClassPart): Override them.
1796 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1799 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1800 'parent' argument to the base constructor.
1802 Remove all mention of TypeContainer from decl.cs.
1803 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1804 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1805 (DeclSpace.DeclSpace): Likewise.
1806 (DeclSpace.DefineMembers): Remove unused argument.
1807 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1808 debugging check -- we don't care if the debug code throws an
1809 InvalidCastException instead of an InternalErrorException.
1810 * class.cs (TypeContainer.DefineMembers): Update to changes.
1811 (TypeContainer.DoDefineMembers): Likewise.
1812 (TypeContainer.GetMethods): Likewise.
1813 (PropertyMember.Define): Likewise.
1814 (MemberBase.Parent): New property that forwards to
1815 MemberCore.Parent, but ensures that we get a TypeContainer.
1816 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1817 (RootContext.PopulateTypes): Likewise. Remove special case code
1818 for !RootContext.StdLib: DefineMembers is idempotent.
1820 2005-12-14 Miguel de Icaza <miguel@novell.com>
1822 * convert.cs (ExplicitConversionCore): Check the return value from
1823 ExplicitConversionCore which can return null on failure. Fixes #76914
1825 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1827 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1829 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1831 * doc.cs : The search for referenced namespace was insufficient to
1832 get global one as it used to do. Fixed bug #76965.
1834 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1836 * doc.cs : check name in cref in the last phase that whether it is
1839 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1841 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1844 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1846 * doc.cs : so it turned out that we cannot skip override check for
1847 interface members. Fixed bug #76954.
1849 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1851 * cs-tokenizer.cs : fixed bug #75984:
1852 - #warning and #error should not be handled when the source line
1854 - #line is not checked strictly when the source line is disabled.
1855 - #define and #undef is on the other hand checked strictly at any
1858 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1860 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1863 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1865 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1867 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1869 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1870 (FieldBase.Initializer): Initializer is now optional.
1871 (EventField.Define): Only event field can have initializer.
1873 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1875 * const.cs (Const): Reuse initializer.
1877 * cs-parser.jay: Updated after FieldBase changes.
1878 Added current_array_type to simplify array initializers.
1880 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1882 * expression.cs, iterators.cs: Updated.
1884 * namespace.cs (NamespaceEntry): Made UsingFound private.
1886 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1888 * parameterCollection.cs: Obsolete, removed.
1889 * parser.cs: Obsolete, removed.
1891 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1894 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1896 * enum.cs (Enum.Define): Set obsolete context here.
1898 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1901 - FindDocumentedMember() now expects 1) paramList as null
1902 when "we don't have to check the number of parameters" and
1903 2) Type.EmptyTypes when "there is no arguments".
1904 - Introduced FoundMember struct to hold the exact type which was
1905 used to find the documented member (the above change broke
1906 test-xml-044; it might be better just to use DeclaringType than
1907 what MS does, like this change does, but it depends on usage.)
1909 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1911 * doc.cs : documented member might be from DeclaringType for nested
1912 types. Fixed bug #76782.
1914 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1916 * anonymous.cs: Have the param code handle leaving copies on the
1917 stack etc. Allows anonymous params to take part in the assignment
1918 code (++, +=, etc). Fixes bug #76550
1920 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1921 it down to the anon code.
1923 * iterators.cs: Use dummy var here
1925 * codegen.cs: Handle new vars
1927 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1930 * class.cs (MethodData.Define): Set proper Obsolete context.
1932 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1934 (FieldExpr.DoResolve): Ditto.
1936 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1939 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1940 parent is not obsolete.
1942 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1944 * doc.cs : (FindDocumentedMember) find parameterless members first
1945 and get CS0419 in the early stage. Fixed first case of bug #76727.
1947 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1950 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1951 no error was reported.
1953 *expression.cs (Binary.DoResolve): left can be null.
1955 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1958 * class.cs (MethodData.Emit): Parameters should be labeled first.
1960 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1963 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1965 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1967 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1969 * class.cs (MethodCore): Parameter clean up.
1970 (IMethodData): Added ParameterInfo.
1971 (MethodData): Parameter clean up.
1972 (Indexer.Define): Parameter clean up.
1984 * typemanager.cs: Parameter clean up.
1986 * delegate.cs (Define): Get rid of duplicated code.
1988 * expression.cs (ParameterReference): Removed useless parameters
1990 (Invocation): Ditto.
1992 * parameter.cs (ParamsParameter): New class, params specialization.
1993 (ArglistParameter): Attemp to separate arglist.
1994 (Parameter): Refactored to be reusable and faster.
1995 (Parameter.Modifier): Made understandable.
1996 (Parameters): Changed to be used as a class for `this' assembly
1997 parameters. Refactored to use new specialized classes.
1999 * support.cs (ParameterData): Added Types property.
2000 (InternalParameters): Deleted.
2002 2005-08-20 Martin Baulig <martin@ximian.com>
2004 Merging this patch from GMCS to fix #75867.
2006 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2007 scope if we don't already have it.
2009 2005-11-17 Martin Baulig <martin@ximian.com>
2012 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2013 inherit the scope from our parent. Fixes #76653.
2015 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2017 * doc.cs : the previous patch does not actually fix the bug.
2018 PropertyInfo override check is now implemented and really fixed it.
2019 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2021 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2023 * doc.cs : apply "override filter" also to properties.
2026 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2028 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2029 no need to check overrides. For classes, omit those results from
2030 interfaces since they must exist in the class. Fixed bug #76726.
2032 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2034 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2035 with different parameters. Fixed the second problem in #76685.
2037 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2039 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2040 get expected 'protected' access in CheckValidFamilyAccess()).
2043 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2045 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2046 Fixed bug #76705. CS1569 was incorrectly commented out.
2048 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2050 * doc.cs : use Invocation.IsOverride() to do real override check.
2051 * expression.cs : made Invocation.IsOverride() internal.
2053 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2055 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2056 TypeBuilder.FindMembers() and filter overriden base members out.
2059 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2061 * doc.cs : ref/out parameters are represented as '@' (instead of
2062 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2064 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2066 * doc.cs : when there was no '.' in cref to methods in doc comment,
2067 then parameters were missing in the output. Fixed bug #76691.
2069 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2071 * driver.cs : don't output docs when there is an error.
2074 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2077 Now it should detect indexers. Fixed primary concern in bug #76685.
2078 Fixed CS0419 message to not show the identical member signature in
2081 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2083 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2084 instead of Type.FindMembers() since it does not handle events.
2087 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2089 * codegen.cs: Fixed typo (speficied -> specified).
2091 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2094 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2096 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2098 * attribute.cs: Changed error message.
2100 * cs-tokenizer.cs: One more check.
2102 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2104 * statement.cs (Block.Resolve): Ignore empty statement.
2106 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2108 * report.cs: Made error/warning methods more strict to avoid
2111 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2112 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2113 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2114 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2116 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2118 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2119 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2121 * class.cs (TypeContainer.IsComImport): New property.
2122 (Constructor.Define): Create proper ctor for ComImport types.
2124 * expression.cs (New.CheckComImport): Fixed.
2126 2005-11-07 Miguel de Icaza <miguel@novell.com>
2128 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2129 that a parameter has been captured does not mean that we do not
2130 have to do the rest of the processing. This fixes the second part
2131 of #76592. If there was another anonymous method capturing
2132 values in the past, the Scope would never be set for the second
2133 method that captured the same parameter.
2135 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2136 properly manipulate the stack. Second part of fix for #76592.
2138 * expression.cs (New): Add support for invoking "new" on
2139 interfaces that have been flagged with the ComImport attribute and
2140 the CoClass. Fixes #76637
2142 * statement.cs (Try.DoEmit): When a variable is captured, do not
2143 try to emit the vi.LocalBuilder variable as it has been captured.
2144 Create a temporary variable and store the results on the
2145 FieldBuilder. Fixes #76642
2147 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2149 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2151 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2153 * expression.cs (Binary.DoResolve): Added && optimalization.
2155 * typemanager.cs (AddUserType): Removed useless argument.
2157 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2159 * statement.cs (Block.variables): Uses ListDictionary.
2161 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2164 * class.cs (PartialContainer.EmitType): Customized to emit
2165 security attributes.
2166 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2167 for partial classes.
2169 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2172 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2173 access has to be fixed.
2175 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2177 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2180 * ecore.cs (NullCast.Reduce): Implemented.
2182 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2185 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2187 (Foreach.Resolve): Catch null properly.
2189 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2191 * cs-tokenizer.cs: Warning text fix.
2193 * driver.cs: AllWarningNumbers exposed on public interface.
2195 * report.cs (): Reviewed warning numbers.
2196 (IsValidWarning): Use binary search.
2198 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2200 * driver.cs: Implemeted resource visibility.
2201 (Resources): New class for code sharing between /res: and
2204 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2207 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2210 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2213 * ecore.cs (NullCast): Child is contant only.
2215 * literal.cs (NullLiteral.Reduce): null can be converted to any
2218 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2220 * driver.cs: Use Encoding.Default as default code page instead
2223 2005-10-27 Raja R Harinath <rharinath@novell.com>
2226 * expression.cs (Invocation.Error_InvalidArguments): Handle
2227 __arglist parameters.
2228 (Invocation.VerifyArgumentsCompat): Likewise.
2229 * support.cs (ReflectionParameters.GetSignatureForError): Print
2230 __arglist parameters.
2231 (InternalParamters.GetSignatureForError): Likewise.
2232 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2234 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2236 * attribute.cs (GetPropertyValue): Made public.
2238 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2240 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2242 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2245 * driver.cs: Reflect method name change.
2247 * statement.cs (Try.Resolve): Warn when try has both general
2250 * typemanager.cs: runtime_compatibility_attr_type new predefined
2253 2005-10-26 Raja R Harinath <harinath@gmail.com>
2256 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2257 treat it as an empty parameter list.
2259 2005-10-26 Raja R Harinath <rharinath@novell.com>
2262 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2263 ResolveAsTypeStep silent.
2264 * statement.cs (Block.AddConstant): Mark block as used.
2265 (Block.ResolveMeta): Avoid piling on error messages
2266 if a constant initializer resolution fails.
2268 2005-10-25 Raja R Harinath <rharinath@novell.com>
2270 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2272 (NamespaceEntry.VerifyAllUsing): New.
2273 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2274 behaviour. Delegates actual resolution of alias to ...
2275 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2276 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2278 * driver.cs (Driver.MainDriver): Update.
2280 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2281 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2283 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2285 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2286 RootNamespace.DefineNamespacesForAll.
2288 2005-10-24 Raja R Harinath <harinath@gmail.com>
2290 * typemanager.cs (assemblies, external_aliases, modules)
2291 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2292 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2293 overhead. Move resposibility ...
2294 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2295 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2297 2005-10-23 Raja R Harinath <harinath@gmail.com>
2299 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2300 cached_namespaces. Improve usage.
2301 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2302 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2303 Move from GlobalRootNamespace and simplify.
2304 (RootNamespace.Global): Make instance variable.
2305 (RootNamespace.RootNamespace): Add "alias name" parameter.
2306 (GlobalRootNamespace): Simplify drastically.
2307 (Namespace.Lookup): Don't use GetNamespace.
2308 * typemanager.cs (GetRootNamespace): Rename from
2309 ComputeNamespaceForAlias.
2310 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2312 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2314 * anonymous.cs (AnonymousContainer): Don't crash when container
2317 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2319 * expression.cs (Binary.DoResolve): Warn when comparing same
2322 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2325 * expression.cs (Binary.DoResolve): It looks like there are no
2326 convetsion rules in enum context.
2328 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2330 Add support for extern alias qualifiers.
2331 * typemanager.cs: Move some LookupTypeReflection code
2332 to namespace.cs, to have cleaner code. Added some methods
2333 to help us keep track of the extern aliased references.
2334 * driver.cs: Add suport for extern alias assemblies on command
2335 line and check for their warnings/errors. Also keep track of the
2336 extern aliased assemblies.
2337 * namespace.cs: Move the global functionality of Namespace
2338 to GlobalRootNamespace/RootNamespace. Now the global namespace
2339 is GlobalRootNamespace.Globa. Also the code moved from
2340 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2341 Finally added LocalAliasEntry (AliasEntry before) and
2342 ExternAliasEntry, to handle alias statements.
2343 * cs-parser.jay: Add support in the grammar for extern alias
2345 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2346 Update callings to Namespace (now in GlobalRootNamespace).
2348 2005-10-18 Raja R Harinath <rharinath@novell.com>
2351 * class.cs (TypeContainer.DefineType): Move updating of
2352 topological sort earlier in the code.
2353 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2355 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2358 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2360 * constant.cs (Constant.TryReduce): Moved from Cast class.
2361 (Reduce): Made little bit more OO and fixed missing conversions.
2363 * ecore.cs (Reduce): Implemented.
2364 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2366 * literal.cs (Reduce): Implemented.
2368 * class.cs: Reverted Miguel's wrong commit.
2370 2005-10-14 Miguel de Icaza <miguel@novell.com>
2372 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2374 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2376 * cs-parser.jay, expression.cs : CS0214 was missing error location
2377 for constants. Fixed bug #76404.
2379 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2382 * convert.cs (ExplicitConversionCore): Fixed object->enum
2385 2005-10-10 Raja R Harinath <rharinath@novell.com>
2387 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2389 (PropertyExpr.EmitCall): Likewise.
2390 * expression.cs (Invocation.EmitArguments): Handle case where
2392 (Invocation.EmitCall): Avoid allocating temporary variable if
2393 there are no arguments.
2395 2005-10-07 Raja R Harinath <rharinath@novell.com>
2398 * convert.cs (ImplicitConversionStandard): Move conversion of
2399 void* to arbitrary pointer types ...
2400 (ExplicitConversionStandard): .. here.
2401 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2402 error to always print typenames.
2404 2005-10-07 Raja R Harinath <rharinath@novell.com>
2406 * convert.cs (GetConversionOperator): Rename from
2407 GetConversionOperators. Move operator selection code from ...
2408 (UserDefinedConversion): ... here.
2410 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2412 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2415 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2417 * assign.cs (Assign.DoResolve): Error method changed.
2419 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2421 * const.cs (ResolveValue): Reset in_transit immediately.
2423 * constant.cs: Error method changed.
2425 * convert.cs: Removed useless location parameter.
2426 (ExplicitNumericConversion): Don't do double enum check.
2427 (ExplicitConversionCore): Renamed from ExplicitConversion.
2428 (ExplicitUnsafe): Extracted from ExplicitConversion.
2429 (ExplicitConversion): Uses for error reporting.
2431 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2433 (ResolveBoolean): Uses common error method.
2434 (CastToDecimal): Get rid of ec.
2435 (CastFromDecimal): Optimized.
2436 (ConvCast): Get rid of ec.
2438 * enum.cs (ResolveValue): Reset in_transit immediately.
2439 (Emit): Return after first error.
2441 * expression.cs: Convert changes.
2443 * literal.cs: Error method changed.
2445 * statement.cs: Error method changed.
2447 2005-10-03 Raja R Harinath <rharinath@novell.com>
2449 * support.cs (SeekableStreamReader.Position): Don't error out when
2450 the requested position is just beyond the end of the current
2453 2005-09-28 Raja R Harinath <rharinath@novell.com>
2455 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2456 try to keep in sync with the byte count of the underlying Stream.
2457 However, this limits us to a window size of 2048 characters: i.e.,
2458 the maximum lookahead of our lexer/parser can be 2048 characters.
2460 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2463 * driver.cs: Fix compilation files with full root path.
2465 2005-09-25 Miguel de Icaza <miguel@novell.com>
2467 * report.cs (SymbolRelatedToPreviousError): Format the output so
2468 it does not use an open parenthesis that is never closed.
2470 * driver.cs: Follow coding guidelines
2472 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2475 * const.cs (Const.ResolveValue): Check for assigning non-null
2476 value to reference type.
2478 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2480 * anonymous.cs: Implemented ExprClassName.
2482 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2485 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2488 * class.cs (StaticClass.DefineContainerMembers): Report protected
2491 * codegen.cs: if(ed) PRODUCTION.
2493 * convert.cs (Error_CannotImplicitConversion): Better error
2496 * cs-parser.jay: More error checks.
2498 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2500 * driver.cs (CSCParseOption): Enabled wrong option check.
2502 * ecore.cs (Expression.ExprClassName): Turned to property.
2503 (MemberExpr.CheckIntermediateModification): For checking boxed
2504 value types modification.
2506 * statement.cs (Fixed.Resolve): Expression type must be
2507 convertible to fixed type.
2508 (CollectionForeach.GetEnumeratorFilter,TryType):
2509 Small refactoring for easier error checking.
2511 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2513 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2516 * class.cs (GeneratedBaseInitializer): New class for customization
2517 compiler generated initializers.
2518 (MemberBase.DoDefine): Check Obsolete attribute here.
2519 (FieldMember.DoDefine): Ditto.
2521 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2524 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2525 (MemberCore.GetObsoleteAttribute): Removed argument.
2526 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2527 (MemberCore.CheckObsoleteType): New helper.
2531 * statement.cs: Updates after MemberCore changes.
2533 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2534 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2536 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2537 obsolete attribute for compiler construct.
2538 (As.DoResolve): Cache result.
2540 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2542 2005-09-26 Raja R Harinath <rharinath@novell.com>
2545 * expression.cs (This.VerifyFixed): In a value type T, the type of
2546 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2547 value type R, 'this' is treated as a value parameter.
2549 2005-09-22 Miguel de Icaza <miguel@novell.com>
2551 * statement.cs (Lock): Use the TemporaryVariable class instead of
2552 manually using local variables as those do not work when variables
2555 * ecore.cs: Moved the TemporaryVariable class from being a nested
2556 class inside Foreach to be a public class that can be employed in
2559 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2561 * cs-parser.jay: interface_accessors replaced by
2562 accessor_declarations.
2564 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2567 * statement.cs (GotoCase.Resolve): Convert null constant to
2569 (SwitchLabel.ResolveAndReduce): Ditto.
2570 (SwitchLabel.NullStringCase): Custom null stamp.
2571 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2573 typemanager.cs (CSharpSignature): Don't skip first argument
2576 2005-09-18 Miguel de Icaza <miguel@novell.com>
2578 * driver.cs: Set InEmacs based on the environment variable EMACS.
2580 * location.cs (InEmacs): in this mode, do not report column
2581 location as it confuses Emacs.
2583 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2585 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2586 expression.cs, iterators.cs, literal.cs: Store constants and
2589 * class.cs (MemberBase.ShortName): Pass location.
2591 * cs-parser.jay: Some location fixes.
2593 * ecore.cs (Expression.Location): Made virtual.
2595 2005-09-05 Miguel de Icaza <miguel@novell.com>
2597 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2598 if the underlying types are the same, otherwise we need to produce
2599 code that will do the proper cast.
2601 This was exposed by Marek's constant rewrite which produced
2602 invalid code for the call site:
2605 void Method (X v) {}
2609 This fixes test-49.cs
2611 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2613 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2614 Type/Object should be allowed as well. Fixed bug #75968.
2616 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2618 * expression.cs : (Binary.DoResolve): when one is enum constant and
2619 another is constant 0, then return enum one *as enum type*.
2622 2005-09-02 Raja R Harinath <rharinath@novell.com>
2624 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2628 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2629 flow-branching for LocalVariableReferences in case we were invoked
2630 from a MemberAccess.
2631 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2633 (LocalVariableReference.DoResolveBase): ... this.
2634 (MemberAccess.Resolve): Do the check that was disabled during
2637 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2640 (PartialContainer.Create): check abstract/sealed/static strictly
2641 but abstract/sealed can exist only at one side. Fixed bug #75883.
2643 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2646 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2647 specified, don't default to UnmanagedType.I4.
2649 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2651 * expression.cs : conditional operator should check possibly
2652 incorrect assign expression. Fixed bug #75946.
2654 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2656 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2657 Reverting the change. gmcs is much complex than mcs on this matter.
2659 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2661 * cs-tokenizer.cs : To read another token ahead of the actual
2662 consumption, use new SavedToken and cache token instead of moving
2663 back the stream with SeekableStreamReader (it seemed problematic).
2665 driver.cs : Thus use StreamReader directly.
2666 * support.cs : Thus removed SeekableStreamReader.
2668 2005-08-30 Raja R Harinath <rharinath@novell.com>
2671 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2672 (ScopeInfo.EmitScopeType): Use it to construct field names from
2673 names of captured locals.
2676 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2677 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2678 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2679 (ExplicitConversion): Remove enum cases already handled by
2680 implicit conversion. Move implicit conversion check to the beginning.
2681 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2682 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2683 Don't treat System.Enum as a struct.
2685 2005-08-30 Jb Evain <jbevain@gmail.com>
2687 * attribute.cs: handles as expression in parameters.
2689 2005-08-30 Raja R Harinath <rharinath@novell.com>
2692 * class.cs (TypeContainer.VerifyClsName): Don't use a
2693 PartialContainer when verifying CLS compliance.
2694 (AbstractPropertyEventMethod): Set Parent here, ...
2695 (PropertyMethod): ... not here.
2697 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2699 * attribute.cs : escaped attribute name should not be allowed to be
2700 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2702 2005-08-29 Raja R Harinath <rharinath@novell.com>
2705 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2706 when converting a long constant to unsigned long.
2707 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2708 detect where IsApplicable and VerifyArgumentsCompat disagree.
2710 2005-08-29 Raja R Harinath <rharinath@novell.com>
2711 and Carlos Alberto Cortez <carlos@unixmexico.org>
2714 * class.cs (TypeContainer.CanElideInitializer): New helper.
2715 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2716 can safely emitting the initializer of a field.
2718 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2720 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2721 allowed inside a switch (without loop). Fixed bug #75433.
2723 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2725 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2726 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2728 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2730 * driver.cs : kinda reverting the default encoding changes (not exact
2731 revert since I noticed that "codepage:reset" might not work fine).
2733 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2735 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2736 Location. Now getter and setter store location correctly.
2737 (errors/cs0111-12.cs now reports the expected location.)
2739 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2741 * driver.cs : Use default encoding on the environment.
2742 Removed (now that) extra parameter for SeekableStreamReader.
2743 * support.cs : (SeekableStreamReader) third .ctor() argument for
2744 StreamReader is not required (always true). preamble size could
2745 be acquired in simpler and safe way.
2747 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2749 * cs-parser.jay: report CS0642 at warning level 3
2750 and report CS0642 for an if else statement also
2751 fixes bug #74745. Patch by John Luke (and a bit
2753 Removed extra CS0642 warning check for "while",
2755 * statement.cs: In Block.Resolve(), CS0642 check
2756 is reimplemented to check a sequence of an empty
2757 statement and a block.
2759 Both fix bug #66777.
2761 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2763 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2764 detection until I fix it.
2766 * cs-tokenizer.cs: Changed error message.
2768 * cs-parser.jay: Fixed 2 error locations.
2770 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2771 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2774 * enum.cs (GetSignatureForError): Fixed.
2776 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2780 * typemanager.cs (RegisterProperty): Removed.
2782 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2784 2005-08-24 Raja R Harinath <rharinath@novell.com>
2787 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2788 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2790 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2792 * expression.cs : tiny fix is required for not warning positive ulong.
2795 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2797 * expression.cs : add CS0652 check for constant and integral
2798 expression. Fixed bug #53974.
2800 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2802 * expression.cs : in DoNumericPromotions(), check if there is implicit
2803 conversion overload for string (to check CS0034). Fixed bug #52492.
2805 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2807 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2809 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2811 * ecore.cs : report location when it is *not* Null.
2813 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2819 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2820 correctly. Fixed bug #75721.
2822 2005-08-23 Raja R Harinath <rharinath@novell.com>
2824 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2825 loop that performs 'min (pos, char_count)'.
2828 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2829 converted value in Operator.OnesComplement.
2831 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2833 * anonymous.cs: If the anon method is pulled into a helper class,
2834 it needs to be `internal' not `private'. Fixes runtime behavior on
2837 2005-08-20 Martin Baulig <martin@ximian.com>
2839 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2840 scope if we don't already have it.
2842 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2843 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2846 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2849 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2852 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2854 The big constants rewrite
2855 Fix #75746, #75685 and more
2856 As a side effect saved 1MB for MWF ;-)
2858 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2859 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2860 enum based for corlib compilation.
2862 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2865 * class.cs (FixedField.Define): Use ResolveAsConstant.
2867 * const.cs (IConstant): Interface constants and enums.
2868 (Const.ResolveValue): New method for constant resolvning.
2869 (ExternalConstant): Constants from imported assemblies.
2871 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2872 conversion; like enums.
2873 (Constant.ToType): Converts this constant to different type.
2874 (Constant.Increment): Adds 1.
2876 * convert.cs (ImplicitConversionRequired): Simplified.
2878 * cs-parser.jay: Create EnumMember directly.
2880 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2882 * doc.cs (GenerateEnumDocComment): Removed.
2884 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2885 (ConvertIntLiteral): Removed.
2886 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2888 * enum.cs (EnumMember): Implement IConstant.
2889 (Enum.IsValidEnumConstant): Removed.
2890 (Enum.GetNextDefaultValue): Removed.
2891 (Enum.FindMembers): Updated.
2892 (Enum.GenerateDocComment): Iterate enum members.
2894 * expression.cs (Cast.TryReduce): Handle enums correctly.
2895 (New.Constantify): Made public.
2896 (MemberAccess.DoResolve): Removed contant specific if(s).
2898 * literal.cs (NullLiteral): Implement new abstract methods.
2900 * statement.cs (GotoCase.Resolve): Use new constant methods.
2901 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2903 * typemanager.cs (LookupEnum): Removed.
2904 (IsEnumType): Fixed to work with corlib.
2905 (RegisterConstant): Removed.
2906 (LookupConstant): Removed.
2907 (GetConstant): Changed to work with IConstant.
2909 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2911 * location.cs : Fixed overflown (>255) column number.
2913 2005-08-03 Raja R Harinath <rharinath@novell.com>
2915 First cut of the qualified-alias-member feature.
2916 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2918 * cs-parser.jay (DOUBLE_COLON): New token.
2919 (namespace_or_type_name): Add rule for recognizing
2920 qualified-alias-members.
2921 (primary_expression): Likewise.
2922 (element_access): Allow QualifiedAliasMember as a possible
2923 type-bearing expression.
2924 (local_variable_type, local_variable_pointer_type): Likewise.
2925 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2926 aliases in the current and enclosing namespace declarations.
2927 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2928 * decl.cs (MemberName.is_double_colon): New.
2929 (MemberName.MemberName): Add new constructor for alias-member.
2930 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2931 * expression.cs (QualifiedAliasMember): New expression type.
2933 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2935 * location.cs : it borked when no argument was specified.
2937 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2939 * location.cs : tiny ToString() format fix.
2941 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2943 * statement.cs : oops, it was missing.
2945 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2947 A set of fixes for precise line/column location.
2950 "token" field now holds a file/line "delta", a line number offset
2951 from the segment, and a column number. See also:
2952 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2953 December/009508.html
2954 Removed static IsNull. Use instance IsNull property instead.
2956 For some tokens it stores Location. For Identifier it stores
2957 LocatedToken which is a pair of string name and location.
2958 Column numbers are adjusted only at getChar().
2960 Use Location.ToString() for reporting (it now contains column).
2962 Largely modified to use LocatedToken instead of
2963 string (IDENTIFIER), and to acquire Location from some tokens.
2964 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2965 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2967 Now MemberName holds Location. DeclSpace.ctor() receives Location
2968 as a parameter. Removed extra parameters to all derived classes.
2969 Replaced Location.IsNull() with instance property.
2970 * assign.cs, expression.cs :
2971 Added .ctor() overload that omits Location.
2973 Added "nameEscaped" flag that indicates the identifier was escaped
2974 in the source file. This fixes bug #57047.
2976 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2978 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2979 New method, looking for lo-case imported cls type.
2981 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2984 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2986 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2988 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2990 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2992 Optimized to save 3.5 MB for SWF compilation.
2994 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2996 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2997 (PartialContainer.Create): Moved logic AddToContainer.
2998 (PartialContainer.MarkForDuplicationCheck): Shares name.
3000 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3003 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3005 (Namespace.GetSignatureForError): New method.
3007 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3008 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3010 2005-08-01 Raja R Harinath <rharinath@novell.com>
3013 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3014 member lookup rather than qualifier_type, since qualifier_type can
3017 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3019 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3022 2005-07-31 Miguel de Icaza <miguel@novell.com>
3024 * statement.cs: Copy the local exception into the exception
3025 captured local. Fixes 75674
3027 2005-07-31 Raja R Harinath <harinath@gmail.com>
3030 * expression.cs (Invocation.OverloadResolve): Don't report error
3031 CS1501 if error CS1502 has been reported.
3032 (New.DoResolve): Delegate CS1501 reporting to
3033 Invocation.OverloadResolve.
3036 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3037 invariant-meaning-in-block property in an enclosing block if
3040 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3042 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3043 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3044 (Switch.CheckSwitch): Just save 50kb for SWF.
3046 2005-07-27 Martin Baulig <martin@ximian.com>
3048 * anonymous.cs (CaptureContext.AddField): Added
3049 `AnonymousContainer am' argument; compute its toplevel scope if
3050 it's not already computed. Fixes #75649.
3052 2005-07-26 Raja R Harinath <rharinath@novell.com>
3055 * class.cs (Constructor.Emit): Reset block to null if the block
3058 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3060 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3062 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3064 * class.cs (MethodData.Define): Check whether accessor implementing
3065 interface is public.
3067 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3069 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3072 * namespace.cs (LookupType): Moved same type check to...
3074 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3077 2005-07-21 Raja R Harinath <rharinath@novell.com>
3079 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3080 already found a typebuilder.
3081 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3082 MemberNames, not strings.
3084 * const.cs (Error_ExpressionMustBeConst):
3085 Rename from Error_EpressionMustBeConst.
3086 * const.cs, class.cs, statement.cd: Update.
3088 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3092 * const.cs (Const.LookupConstantValue): Report missing contant expression
3094 (Error_EpressionMustBeConstant): Only one error method.
3096 * class.cs, statement.c: Updated.
3098 2005-07-20 Raja R Harinath <rharinath@novell.com>
3100 * statement.cs (Block.Flags): Add back HasVarargs.
3101 (Block.flags): Make protected.
3102 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3104 * typemanager.cs (types, typecontainers, user_types): Remove.
3105 (UserTypes, TypeContainers): Likewise.
3106 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3107 (CleanUp, Reset): Update.
3108 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3109 (GetNestedType): Use Type.GetNestedType.
3110 (CoreLookupType): Take two arguments, the namespace and the
3111 basename of the type. Update to use the Namespace.Lookup
3113 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3114 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3115 string concatenation and substring matches.
3116 * class.cs, enum.cs, delegate.cs: Update to changes.
3118 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3120 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3121 Expression and made virtual.
3123 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3124 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3126 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3128 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3131 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3134 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3137 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3138 AssemblyCultureAttribute is not used on executable.
3141 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3143 2005-07-16 Raja R Harinath <rharinath@novell.com>
3146 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3147 New. Reports CS0252/CS0253.
3148 Mostly taken from preliminary patch by Duncak Mak.
3149 (Binary.DoResolveOperator): Store results of operator lookup.
3150 Use them to detect if we need to warn about unintended reference
3153 2005-07-15 Raja R Harinath <rharinath@novell.com>
3156 * namespace.cs (Namespace.Lookup): Add back location parameter.
3157 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3158 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3160 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3161 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3162 (Namespace.LookupType): ... this.
3163 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3165 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3166 purported to handle pointers.
3167 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3170 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3172 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3175 2005-07-15 Raja R Harinath <rharinath@novell.com>
3177 * namespace.cs (Namespace.Lookup): Drop location parameter.
3178 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3179 (NamespaceEntry.Lookup): ... this.
3180 (NamespaceEntry.Error_AmbiguousTypeReference):
3181 Move here from DeclSpace.
3182 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3184 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3185 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3186 Move to NamespaceEntry.
3187 * delegate.cs, expression.cs: Update to changes.
3189 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3191 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3192 CheckAttributeType and refactored.
3193 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3194 ResolveAsTypeTerminal error handling.
3195 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3197 (GetSignatureForError): Print errors in same way.
3200 * codegen.cs: Reflect attribute GetSignatureForError change.
3203 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3205 * namespace.cs (UsingEntry): Refactored to make fields private.
3208 statement.cs: Error_UnexpectedKind has extra parameter.
3210 2005-07-14 Raja R Harinath <rharinath@novell.com>
3212 * ecore.cs (IAlias): Remove.
3213 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3214 that implement the interface.
3215 * namespace.cs (Namespace): Likewise.
3216 (Namespace.declspaces): Renamed from 'defined_names'.
3217 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3218 DeclSpace instead of an IAlias.
3219 * tree.cs (Tree.AddDecl): Update.
3221 2005-07-12 Raja R Harinath <rharinath@novell.com>
3223 * statement.cs (Block.Flags); Remove HasVarargs.
3224 (Block.HasVarargs): Move to ToplevelBlock.
3225 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3226 (Block.Variables): Make protected. Initialize variable hashtable
3228 (Block.AddVariable): Update.
3229 (Block.Resolve): Update to changes.
3230 (ToplevelBlock.HasVarargs): New boolean.
3231 (ToplevelBlock.ThisVariable): Move here from Block.
3232 (ToplevelBlock.AddThisVariable): Likewise.
3233 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3234 * expression.cs (This.ResolveBase): Update to changes.
3235 (ArglistAccess.DoResolve): Likewise.
3237 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3240 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3242 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3243 not used and not used & assigned.
3244 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3246 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3249 * expression.cs (Is.DoResolve): null is never provided type.
3251 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3254 * cs-parser.jay: Less strict event error rule to catch more errors.
3256 2005-07-08 Martin Baulig <martin@ximian.com>
3258 Fix test-iter-10.cs - distinguish whether we `yield' in a property
3259 gettter (allowed) or setter (not allowed).
3261 * class.cs (Accessor): Implement IIteratorContainer.
3262 (Accessor.Yields): New public field.
3263 (PropertyBase.PropertyMethod.Define): Handle iterators on a
3267 (get_accessor_declaration, set_accessor_declaration): Set the
3268 `yields' flag on the accessor, not the property.
3269 (property_declaration): Do the iterators check on a per-accessor
3270 basis and not for the whole property.
3272 2005-07-08 Martin Baulig <martin@ximian.com>
3274 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3275 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3277 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3280 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3281 (ExtractSecurityPermissionSet): Cope with self referencing security
3282 attributes properly.
3284 * driver.cs (SetOutputFile): Made public property OutputFile.
3286 2005-07-07 Raja R Harinath <rharinath@novell.com>
3289 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3290 has_nonstatic_fields. Make into a FieldBase pointer.
3291 (TypeContainer.AddField): Add CS0282 check.
3292 (TypeContainer.EmitType): Update.
3294 2005-07-06 Miguel de Icaza <miguel@novell.com>
3296 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3297 compare if they start with __.
3299 2005-07-06 Raja R Harinath <rharinath@novell.com>
3301 * statement.cs (Switch.SwitchGoverningType): Only look at
3302 UserCasts that don't need implicit standard conversions to one of
3303 the allowed switch types (Fixes test-322.cs).
3304 (LocalInfo.Resolve): Re-enable sanity-test.
3306 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3308 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3310 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3312 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3314 2005-07-06 Raja R Harinath <rharinath@novell.com>
3317 * ecore.cs (SimpleName.GetSignatureForError): Add.
3318 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3319 (MemberAccess.GetSignatureForError): Add.
3321 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3323 The big error and warning messages review.
3353 * typemanager.cs: Updated.
3355 * class.cs: (MethodCore.SetYields): Moved here to share.
3356 (PropertyMethod.Define): Moved iterator setup here.
3358 * iterators.cs: Add orig_method to have full access to parent
3361 2005-07-05 Raja R Harinath <rharinath@novell.com>
3363 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3364 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3365 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3366 variable of struct type.
3367 * expression.cs (Unary.ResolveOperator): Update to change.
3368 (Indirection.VerifyFixed): Likewise.
3369 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3370 (ParameterReference.VerifyFixed): Value parameters are fixed.
3371 (This.VerifyFixed): Treat 'this' as a value parameter.
3372 * statement.cs (LocalInfo.IsFixed): Remove.
3374 2005-07-01 Martin Baulig <martin@ximian.com>
3376 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3377 `ec.EmitThis ()' to get the correct scope.
3379 2005-07-01 Martin Baulig <martin@ximian.com>
3381 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3382 instance is a ParameterReference; fixes #75299.
3384 2005-07-01 Martin Baulig <martin@ximian.com>
3386 Reverted Marek's latest patch (r46725):
3387 - it contains structural changes which are neither mentioned in
3388 the ChangeLog nor explained anywhere; for example the additional
3389 argument of EmitContext's and Iterator's .ctor's and the
3390 TypeContainer.DefineMembers() change.
3391 - structural changes like this should go in in seperate patches
3392 and not be hidden in a huge patch which just seems to affect
3393 warnings and errors.
3394 a big and hard to understand patch.
3395 - it breaks iterators and causes regressions, for instance in
3398 2005-06-30 Raja R Harinath <rharinath@novell.com>
3401 * expression.cs (Indexers.map): Remove.
3402 (Indexers.Append): Filter out inaccessible setters and getters.
3403 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3406 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3408 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3409 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3410 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3411 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3413 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3416 * class.cs (FieldBase.GetInitializerExpression): One more field
3419 2005-06-28 Miguel de Icaza <miguel@novell.com>
3421 * pending.cs: Do not define a proxy if the base method is virtual,
3422 it will be picked up by the runtime (bug 75270).
3424 2005-06-08 Martin Baulig <martin@ximian.com>
3426 The big Iterators rewrite :-)
3428 * iterators.cs: Rewrite this to use the anonymous methods framework.
3430 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3431 before the TypeContainers; see 2test-21.cs.
3434 (TypeContainer.DefineType): Don't create a new EmitContext if we
3435 already have one (this only happens if we're an Iterator).
3436 (TypeContainer.Define): Also call Define() on all our iterators.
3437 (Method.CreateEmitContext): Added support for iterators.
3440 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3441 (AnonymousContainer.CreateMethodHost): Moved here from
3442 AnonymousMethod and made abstract.
3443 (AnonymousContainer.CreateScopeType): New abstract method.
3444 (AnonymousContainer.IsIterator): New public property.
3445 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3446 get the ScopeTypeBuilder rather than manually defining it here.
3447 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3450 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3451 before RootContext.DefineTypes().
3453 * codegen.cs (EmitContext.RemapToProxy): Removed.
3454 (EmitContext.CurrentAnonymousMethod): Changed type from
3455 AnonymousMethod -> AnonymousContainer.
3456 (EmitContext.ResolveTopBlock): Protect from being called twice.
3457 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3458 (EmitContext.EmitThis): Removed the iterators hacks; use the
3459 anonymous methods framework for that.
3462 (ToplevelBlock.Container): Make this a property, not a field.
3463 (ToplevelBlock.ReParent): New public method; move the
3464 ToplevelBlock into a new container.
3465 (Foreach.TemporaryVariable): Simplify.
3467 2005-06-05 Martin Baulig <martin@ximian.com>
3469 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3470 (Block.AddTemporaryVariable): New public method; creates a new
3471 `LocalInfo' for a temporary variable.
3472 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3474 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3475 non-iterator variables.
3477 2005-06-05 Martin Baulig <martin@ximian.com>
3479 * statement.cs (Foreach.TemporaryVariable): Create the
3480 LocalBuilder in the Emit phase and not in Resolve since in some
3481 situations, we don't have an ILGenerator during Resolve; see
3482 2test-19.cs for an example.
3484 2005-06-04 Martin Baulig <martin@ximian.com>
3486 **** Merged r45395 from GCS ****
3488 The big Foreach rewrite - Part II.
3490 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3491 with `PropertyInfo ienumerator_getcurrent'.
3493 * codegen.cs (VariableStorage): Removed.
3496 (Foreach): Derive from Statement, not ExceptionStatement.
3497 (Foreach.CollectionForeach): New nested class. Moved all the code
3498 dealing with collection foreach here.
3499 (Foreach.ForeachHelperMethods): Removed.
3500 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3502 2005-05-23 Martin Baulig <martin@ximian.com>
3504 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3505 don't need to. Fix #75014.
3507 2005-05-20 Martin Baulig <martin@ximian.com>
3509 Merged r44808 from GMCS.
3511 * class.cs (TypeContainer.CircularDepException): Removed.
3512 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3513 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3514 (CS0146) and interface (CS0529) dependencies here.
3516 2005-06-21 Raja R Harinath <rharinath@novell.com>
3518 * expression.cs (Invocation.EmitCall): Fix initialization
3519 'this_call' to reflect current behaviour. Fix indentation.
3521 * convert.cs (FindMostEncompassedType): Add two trivial special
3522 cases (number_of_types == 0 || number_of_types == 1).
3523 (FindMostEncompasingType): Likewise.
3525 2005-06-17 Raja R Harinath <rharinath@novell.com>
3527 Some cleanups preparing for the fix of #75283.
3528 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3530 (EventExpr.InstanceResolve): Likewise.
3531 (EventExpr.DoResolve): Remove redundant checks.
3533 2005-06-10 Duncan Mak <duncan@novell.com>
3535 * cs-tokenizer.cs (process_directives): New flag for controlling
3536 the processing of preprocessor directives.
3537 (x_token): After seeing a '#', return Token.NONE instead of going
3538 to handle_preprocessing_directive() when not processing
3539 directives. This avoids unnecessary processing during the token peek in
3544 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3545 the existing error reporting methods instead of Report.Error.
3547 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3548 after Raja's rewrite.
3550 2005-06-08 Miguel de Icaza <miguel@novell.com>
3552 * class.cs: Small fix.
3554 2005-06-08 Raja R Harinath <rharinath@novell.com>
3557 * class.cs (GetPartialBases): Fix return value check of
3560 2005-06-07 Raja R Harinath <rharinath@novell.com>
3562 Ensure that partial classes are registered in their enclosing
3563 namespace. Initial part of fix of #75160.
3564 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3565 Register declspace with namespace here, not in
3566 DeclSpace.RecordDecl.
3567 * cs-parser.jay: Pass namespace to RecordDecl.
3568 * class.cs (PartialContainer.Create): Likewise.
3569 (ClassPart.DefineType): New sanity-check. Throws an exception if
3571 * decl.cs (Declspace.RecordDecl): Remove.
3572 * namespace.cs (NamespaceEntry.DefineName): Remove.
3574 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3576 * rootcontext.cs: Reset TargetExt as well.
3578 2005-06-03 Raja R Harinath <rharinath@novell.com>
3580 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3583 2005-06-02 Raja R Harinath <rharinath@novell.com>
3585 Fix #75080, cs0119.cs.
3586 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3588 (Expression.Resolve): ... this. Use it. Remove bogus code
3589 allowing ExprClass.Type and ExprClass.Namespace for
3590 ResolveFlags.VariableOrValue.
3591 (Expression.Resolve) [1-argument variant]: Change default resolve
3592 flags based on language version.
3593 (Expression.Error_UnexpectedKind): Use a simple string array
3594 rather than an ArrayList.
3595 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3597 (TypeOfVoid.DoResolve): Likewise.
3598 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3599 flags argument -- it always has the same value.
3601 2005-05-31 Raja R Harinath <rharinath@novell.com>
3604 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3605 Use it in the error message.
3606 * assign.cs, expression.cs, statement.cs: Update.
3608 2005-05-30 Raja R Harinath <rharinath@novell.com>
3611 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3612 the "almostMatchedMember" case too.
3613 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3614 that failed the accessibility checks to 'almost_match'.
3616 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3618 * attribute.cs: Use internal MethodBuilder methods to set
3619 ExactSpelling and SetLastError on PInvoke methods, instead
3620 of passing them via charset. Fixes #75060.
3622 2005-05-27 Raja R Harinath <rharinath@novell.com>
3624 * parameter.cs (Parameter): Remove TODO comment.
3625 (Parameter.DefineParameter): Remove Location parameter.
3626 (Parameters.LabelParameters): Likewise.
3627 * class.cs (Constructor.Emit): Update to change.
3628 (MethodData.Emit): Likewise.
3629 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3630 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3632 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3635 Removed Parameters.Location and added Parameter.Location instead.
3636 Removed Location parameter from Emit() and GetSignature().
3643 Modified all related calls.
3645 2005-05-26 Raja R Harinath <rharinath@novell.com>
3647 Improve user-defined conversion handling.
3648 * convert.cs (GetConversionOperators): Rewrite. Return only the
3649 applicable operators.
3650 (AddConversionOperators): New. Helper for GetConversionOperators.
3651 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3652 there is only one most encompassed/encompassing type.
3653 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3654 "applicable operator" handling.
3655 (UserConversion): Move cache here from GetConversionOperators.
3656 Directly cache the chosen operator, rather than the whole
3658 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3659 case. Allow conversion of decimal to sbyte and byte too.
3660 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3661 New static methods. Used to avoid allocating EmptyExpressions in
3664 2005-05-24 Duncan Mak <duncan@novell.com>
3666 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3667 another class, used in Convert.ExplicitNumericConversion.
3668 (CastToDecimal): New class, similar to above, but casts to
3669 System.Decimal, used in Convert.ImplicitNumericConversion and also
3670 in explicit convesion from double/float to decimal.
3672 * convert.cs (ImplicitNumericConversion): Handle implicit
3673 conversions to System.Decimal.
3674 (ExplicitNumericConversion): handle explicit conversions to
3679 2005-05-20 Miguel de Icaza <miguel@novell.com>
3681 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3682 know the type at this stage, just break through. Fixes #75008
3684 2005-05-19 Martin Baulig <martin@ximian.com>
3687 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3688 to disable error reporting.
3690 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3691 here since we don't want to report an error; see the new test-336.cs.
3693 2005-05-19 Raja R Harinath <rharinath@novell.com>
3695 * statement.cs (ToplevelBlock.GetParameterReference)
3696 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3697 Move here from class Block.
3698 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3699 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3701 2005-05-18 Martin Baulig <martin@ximian.com>
3706 (FlowBranching.Reachability): Add non-static public And() and Or()
3708 (FlowBranchingSwitch): New class; do the `break_origins' thing
3709 like in FlowBranchingLoop.
3710 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3711 reachability, not just locals and parameters.
3712 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3713 switch; MergeBreakOrigins() now takes care of that.
3715 2005-05-18 Martin Baulig <martin@ximian.com>
3717 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3718 a loop and may leave it, reset the barrier; fixes #74974.
3720 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3722 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3725 * cs-parser.jay: Catch more lexical errors.
3727 * report.cs: Add one more Error method.
3730 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3732 2005-05-17 Martin Baulig <martin@ximian.com>
3734 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3737 2005-05-16 Raja R Harinath <rharinath@novell.com>
3739 Fix test-382.cs. Emit values of decimal constants.
3740 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3742 (TypeContainer.AddField): ... this.
3743 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3744 with initializers to include 'Const's.
3745 (ClassPart.RegisterFieldForInitialization): Forward to
3747 * const.cs (Const.Const): Pass initializer to base class.
3748 (Const.Define): In case of decimal constants, register them for
3749 initialization in a static constructor.
3751 2005-05-14 Martin Baulig <martin@ximian.com>
3753 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3754 do not call ResolveUnreachable() on unreachable statements in
3755 here, see the comment in the source code.
3757 2005-05-13 Raja R Harinath <rharinath@novell.com>
3760 * expression.cs (BinaryResolveOperator): If one of the operands of
3761 an equality comparison is 'null' and the other is a pointer type,
3762 convert the null to a NullPointer.
3763 * convert.cs (ImplicitReferenceConversion): If the expression is a
3764 NullLiteral and the target type is a pointer type, return a
3765 NullPointer instead.
3766 (ImplicitConversionStandard): Likewise.
3768 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3770 * cs-parser.jay: Set readonly context based on special constructs.
3772 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3773 readonly variable error handling.
3775 * rootcontext.cs (EmitCode): Don't verify members when error
3778 * statement.cs (LocalInfo): Add reaodnly context information.
3779 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3781 2005-05-13 Raja R Harinath <rharinath@novell.com>
3783 * statement.cs (Block.Resolve): Revert change below. Modify fix
3784 for #74041 to initialize 'resolved' to false only for explicit
3785 blocks. Fixes #74873.
3787 2005-05-12 Raja R Harinath <harinath@gmail.com>
3790 * typemanager.cs (unmanaged_enclosing_types): New.
3791 (IsUnmanagedType): Avoid infloops by using
3792 'unmanaged_enclosing_types' to talk with recursive invocations.
3794 2005-05-13 Martin Baulig <martin@ximian.com>
3796 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3797 instance variable, not a local. Fix #74873.
3798 (Block.ResolveUnreachable): Set it to true here.
3800 2005-05-11 Duncan Mak <duncan@novell.com>
3802 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3803 continuing to process for 'arg'.
3804 (handle_preprocessing_directive): Check the argument of the #endif
3805 directive and report error CS1025 if there are any trailing
3808 According to the C# spec, having even whitespace after the #endif
3809 directive is illegal; however, because we call arg.TrimEnd ()
3810 beforehand, we have the same behavior as csc, allowing whitespace
3811 after the directive.
3815 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3819 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3820 (Constructor.GetObsoleteAttribute): Implemented correctly.
3822 2005-05-10 Martin Baulig <martin@ximian.com>
3824 * support.cs (ReflectionParameters.ParameterModifier): Use
3825 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3826 and `ParameterAttributes.In'. Fixes #74884.
3828 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3830 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3832 * expression.cs (Argument.GetParameterModifier): Turned to property.
3833 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3835 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3838 2005-05-09 Raja R Harinath <rharinath@novell.com>
3841 * decl.cs (MemberCache.AddMethods): Register override methods,
3842 rather than non-override methods.
3843 * typemanager.cs (RegisterOverride): New.
3844 (IsOverride): Update.
3846 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3850 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3851 recursive declaration.
3853 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3855 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3857 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3859 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3861 2005-05-05 Raja R Harinath <rharinath@novell.com>
3864 * decl.cs (DeclSpace.FamilyAccessible):
3865 Use TypeManager.IsNestedFamilyAccessible.
3867 Fix reopened #64812.
3868 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3871 2005-05-04 Raja R Harinath <rharinath@novell.com>
3872 Abin Thomas <projectmonokochi@rediffmail.com>
3873 Anoob V E <projectmonokochi@rediffmail.com>
3874 Harilal P R <projectmonokochi@rediffmail.com>
3877 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3878 allow access to all static members.
3880 2005-05-04 Martin Baulig <martin@ximian.com>
3882 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3884 2005-05-04 Martin Baulig <martin@ximian.com>
3888 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3889 section at the end; make things work if `default' is not the last
3892 2005-05-04 Martin Baulig <martin@ximian.com>
3896 * statement.cs (Switch): Replaced the `got_default' field with a
3897 `default_section' one.
3898 (Switch.CheckSwitch): Set `default_section' here.
3899 (Switch.Resolve): If we're a constant switch and the constant is
3900 not found, use the default section.
3902 2005-05-03 Martin Baulig <martin@ximian.com>
3904 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3906 * statement.cs (Foreach.ArrayForeach): New nested class.
3907 (Foreach.TemporaryVariable): New nested class.
3908 (Foreach.EmitArrayForeach): Removed; this is now in the new
3911 2005-05-03 Raja R Harinath <rharinath@novell.com>
3913 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3915 (VerifyPendingMethods): Revert change below.
3917 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3918 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3919 that used to trigger warning -28. Remove warning -28.
3920 * expression.cs (Invocation.OverloadResolve): Use
3921 TypeManager.IsOverride to distinguish override methods.
3924 * pending.cs (VerifyPendingMethods): If a base type implements the
3925 requested interface, don't bother checking individual methods of
3926 the base type. As a side-effect, this prevents the creation of
3927 unnecessary proxies.
3929 2005-05-02 Martin Baulig <martin@ximian.com>
3933 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3934 Also `And' the locals if the old vector is null.
3935 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3936 null; in this case we basically reset all the variables.
3938 2005-05-02 Martin Baulig <martin@ximian.com>
3942 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3943 Added `FlowBranching branching' argument; always `and' the
3944 variables instead of `or'ing them unless we're an infinite loop.
3946 * statement.cs (While.Resolve): Create a new sibling unless we're
3949 2005-05-02 Martin Baulig <martin@ximian.com>
3953 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3954 arguments; use it instead of creating a new TopLevelBlock.
3955 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3956 our ConstructorInitializer.
3959 (TopLevelBlock.TopLevelBranching): New public property.
3960 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3961 and create our `TopLevelBranching'.
3963 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3964 anonymous method host, use `block.TopLevelBranching' rather than
3965 creating a new branching.
3967 2005-04-20 Miguel de Icaza <miguel@novell.com>
3969 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3970 a ScopeInfo, if any of the current children is a child of the new
3971 entry, move those children there.
3973 2005-04-30 Martin Baulig <martin@ximian.com>
3975 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3976 at the beginning of a SwitchSection. Fix #73335.
3978 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3981 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3983 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3984 (FieldExpr.DoResolve): Obsolete members are ignored for field
3987 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3989 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3990 of arrays detection.
3992 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3994 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3996 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3999 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4001 * cs-parser.jay: Use the prefered version of -unsafe in error
4004 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4006 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4009 2005-04-20 John Luke <john.luke@gmail.com>
4011 * driver.cs: fix typo in error message, --outout to --output
4013 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4015 * codegen.cs (InRefOutArgumentResolving): New field.
4017 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4018 fields outside contructor.
4020 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4022 2005-04-19 Miguel de Icaza <miguel@novell.com>
4024 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4025 parameter code was not completed ever, so it was not as up-to-date
4026 as local variables. Must finish it.
4028 The bug fix was to compare the Toplevel of the block, not the
4029 current block. Thanks for Ben for pointing this out.
4031 2005-04-19 Raja R Harinath <rharinath@novell.com>
4033 * decl.cs (AddMethods): Use the declaring type of the problem
4034 method to determine if we want to squash a warning.
4036 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4038 * attribute.cs: Removed debug output.
4040 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4042 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4045 2005-04-18 Raja R Harinath <rharinath@novell.com>
4048 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4049 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4050 all null comparisons against reference types.
4052 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4055 * class.cs (TypeContainer.CircularDepException) New nested
4057 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4058 (TypeContainer.DefineType): Removed error, reset InTransit before
4060 (Class.DefineType): Throw exception when is in Transit.
4061 Catch exception and report error.
4062 (Struct.DefineType): Throw exception when is in Transit.
4063 Catch exception and report error.
4064 (Interface.DefineType): Throw exception when is in Transit.
4065 Catch exception and report error.
4067 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4068 handle nested exception handlers.
4070 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4073 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4074 InFinally and InCatch storage.
4076 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4077 (Catch.Resolve): Set and Restore ec.InCatch.
4078 (Try.Resolve): Set and Restore ec.InFinally.
4079 (Try.HasCatch): True when try has catch.
4081 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4083 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4084 for the same event member, so exclude such cases from warning 419.
4087 2005-04-16 Miguel de Icaza <miguel@novell.com>
4089 * expression.cs (Binary.ResolveOperator): Apply patch from John
4090 Luke to fix bug 59864: operators &, | and ^ on enumerations
4091 require that the same enum type on both sides.
4093 * driver.cs: Add warnings to old flag usage, this is to assist
4094 people who produce Makefiles and hope that the Makefiles will be
4097 * class.cs (TypeContainer.EmitType): Moved the definition of the
4098 special $PRIVATE$ field from the resolve phase to the Emit phase.
4099 During resolve we do not know if we are a struct with
4100 HasExplicitLayout, we know this only after the attributes for the
4103 Set the FieldOffset to zero on the dummy field that we create for
4104 the class. Fixes 74590.
4106 2005-04-16 Raja R Harinath <rharinath@novell.com>
4109 * ecore.cs (PropertyExpr.resolved): New.
4110 (DoResolve): Use it to handle a case of double resolution here.
4111 Handle a case of identical-name-and-type-name.
4112 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4113 resolution by storing the results of expression resolution back
4114 into the "probes" array.
4116 2005-04-15 Raja R Harinath <rharinath@novell.com>
4118 Fix cs0208-7.cs and cs0208-8.cs.
4119 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4120 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4121 error reporting to point out the reason a struct is not unmanaged.
4123 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4125 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4126 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4128 2005-04-13 Raja R Harinath <rharinath@novell.com>
4131 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4132 IdenticalNameAndTypeName here.
4133 (EventExpr.InstanceResolve): Likewise.
4135 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4137 C# 2.0 DefaultCharSetAttribute implementation
4139 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4140 which allows us to set GlobalNamespace for every resolve.
4141 (Attribute.ResolveArguments): Cut from Resolve.
4142 (Attribute.GetCharSetValue): Returns CharSet named argument.
4143 (Attribute.DefinePInvokeMethod): Gets default charset from
4145 (GlobalAttribute.ResolveAsTypeStep): Override.
4146 (GlobalAttribute.ResolveArguments): Override.
4148 * class.cs (TypeAttr): Is protected.
4150 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4151 (ModuleClass.DefaultCharSetType): New memeber.
4152 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4154 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4155 charset from module.
4157 * delegate.cs (TypeAttr): Override.
4158 (Delegate.DefineType): Use this TypeAttr.
4160 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4161 at very early stage (before types are defined) to resolve model
4162 module attributes. It will probably not work with corlib but it
4165 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4166 charset from module.
4168 * typemanager.cs (default_charset_type): New type.
4170 2005-04-13 Raja R Harinath <rharinath@novell.com>
4172 * decl.cs (MemberCache.AddMethods): Don't warn if
4173 System.Object.Finalize has buggy MethodAttributes.
4175 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4178 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4180 * doc.cs : detect ambiguous reference to overloaded members.
4181 Fixed bug #71603. MS 1.1 csc does not detect it.
4183 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4185 * doc.cs : delegates must not be referenced with parameters.
4188 2005-04-12 Miguel de Icaza <miguel@novell.com>
4190 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4192 2005-04-10 Miguel de Icaza <miguel@novell.com>
4194 * driver.cs (MainDriver): Stop processing if the CLS stage found
4197 (CompilerCallableEntryPoint.InvokeCompiler): Always
4198 reset after execution; Take a TextWriter argument for the
4201 * report.cs: Use the error stream instead of hardcoding stderr.
4203 2005-04-09 Miguel de Icaza <miguel@novell.com>
4205 * class.cs: Reduce code paths to test, too small of an
4206 optimization to make it worth the extra testing. Always perform
4209 2005-04-08 Raja R Harinath <rharinath@novell.com>
4212 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4213 operators that had errors reported on them.
4215 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4217 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4219 (Attribute.Resolve): Add named argument type checking.
4221 * class.cs (FixedField.Define): Use IsPrimitiveType
4223 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4225 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4226 unsafe parameter types.
4228 * statement.cs (Using.ResolveExpression): Add better error description.
4230 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4232 2005-04-08 Raja R Harinath <rharinath@novell.com>
4235 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4236 AttributeUsageAttribute in the emitcontext of the attribute class,
4237 not in the emitcontext of the attributable entity it was attached to.
4238 * cs-parser.jay: Use 'current_class', not 'current_container',
4239 when creating a GlobalAttribute.
4241 2005-04-08 Alp Toker <alp@atoker.com>
4243 * pending.cs: The fix to #58413 failed to compile methods implementing
4244 interfaces with/without params modifiers and vice versa, even though
4245 params modifiers aren't part of the signature. Make the modifier check
4246 less strict as in csc.
4248 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4249 Anoob V E <projectmonokochi@rediffmail.com>
4250 Harilal P R <projectmonokochi@rediffmail.com>
4253 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4254 modifiers of pending methods.
4255 (PendingImplementation.PendingImplementation): Initialize it.
4256 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4257 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4258 with ParameterData. Add check for modifiers.
4259 * class.cs (MethodData.Define): Update to changes.
4261 2005-04-07 Raja R Harinath <rharinath@novell.com>
4263 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4265 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4267 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4270 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4273 * typemanager.cs: Registered RequiredAttributeAttribute.
4275 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4277 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4278 Warning CS0169 is back at level 3.
4279 (IMethodData.SetMemberIsUsed): New method.
4281 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4282 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4284 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4286 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4288 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4291 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4294 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4295 to avoid the problems with nested types.
4297 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4298 Anoob V.E <projectmonokochi@rediffmail.com>
4299 Harilal P.R <projectmonokochi@rediffmail.com>
4300 Raja R Harinath <rharinath@novell.com>
4303 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4305 * typemanager (GetConstructor): Make public.
4307 2005-04-05 John Luke <john.luke@gmail.com>
4308 Raja R Harinath <rharinath@novell.com>
4311 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4312 struct too. Return false quicker in a few cases.
4313 (VerifyUnManaged): Use it.
4315 2005-04-05 Raja R Harinath <rharinath@novell.com>
4318 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4319 not 'unreachable_seen'.
4321 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4323 * attribute.cs (Attribute.GetValue): Removed unused.
4325 * codegen.cs (CodeGen.TrimExt): Removed unused.
4327 * cs-parser.jay (output): Removed unused.
4329 * cs-tokenizer.cs (hex_digits): Removed unused.
4331 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4333 * expression.cs (Indirection.LoadExprValue): Removed unused.
4334 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4336 * iterators.cs (Iterator.param_types): Removed unused.
4338 * statement.cs (Goto.block): Removed unused.
4339 (ToplevelBlock.did): Removed unused.
4340 (Switch.ResolveConstantSwitch): Removed unused.
4342 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4344 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4347 2005-04-01 Raja R Harinath <rharinath@novell.com>
4349 Fix #74232 and cs0208-3.cs.
4350 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4351 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4352 unmanaged type. Don't use FieldBuilders when 't' is a
4353 TypeBuilder. Use ModFlags and MemberType fields.
4354 * class.cs (MemberBase.member_type): Rename from MemberType.
4355 (MemberBase.MemberType): New property. Determines member_type on
4357 (MemberBase.DoDefine): Don't initialize MemberType here.
4358 (FieldMember.Define): Likewise.
4360 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4363 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4364 Attributes are emitted there.
4366 2005-04-01 Raja R Harinath <rharinath@novell.com>
4368 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4369 keyword in 'partial enum' too.
4370 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4372 Report from Kamil Skalski <nazgul@omega.pl>.
4375 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4376 have partial containers too.
4378 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4379 in block' checks to Block.CheckInvariantMeaningInBlock.
4380 * statement.cs (Block.GetKnownVariableInfo): Make private.
4381 (Block.IsVariableUsedInChildBlock): Remove.
4382 (Block.IsVariableUsedInBlock): Likewise.
4383 (Block.CheckInvariantMeaningInBlock): New. Show location of
4384 conflicting declaration.
4385 (Block.AddVariable): Make error messages less long-winded and more
4386 specific. Show location of conflicting declaration.
4387 * parameter.cs (Parameters.Location): New readonly property.
4389 2005-03-31 Raja R Harinath <rharinath@novell.com>
4391 Clean up semantics of invoking ResolveMemberAccess.
4392 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4393 can have an instance, ensure that we pass in a non-TypeExpression
4394 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4395 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4396 argument. Update to changes and simplify.
4397 (FieldExpr.Emitinstance): Remove CS0120 check.
4398 (PropertyExpr.EmitInstance): Likewise.
4399 * expression.cs (Argument.Resolve): Likewise.
4400 (Invocation.DoResolve): Update to changes in semantics of
4403 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4406 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4409 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4411 2005-03-31 Raja R Harinath <rharinath@novell.com>
4413 Fix difference in behaviour with commandline invocation.
4414 * driver.cs (Driver.Reset): New.
4415 (CompilerCallableEntryPoint): Call it.
4417 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4418 variable" warnings if the boolean expression failed to resolve.
4420 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4422 * attribute.cs: Fix the union of several permissions when some of them
4423 are unrestricted (so the result isn't an unrestricted permission set).
4426 2005-03-30 Raja R Harinath <rharinath@novell.com>
4428 * ecore.cs (MemberExpr): New class. Convert from interface
4430 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4431 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4433 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4434 (MethodGroupExpr.IsExplicitImpl): Remove.
4435 (Expression.GetFieldFromEvent): Remove.
4436 (SimpleName.MemberStaticCheck): Remove.
4437 (SimpleName.DoSimpleNameResolve): Update to changes.
4438 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4439 (MemberAccess.IdenticalNameAndTypeName): Remove.
4440 (MemberAccess.error176): Move to MemberExpr.
4441 (MemberAccess.DoResolve): Update to changes.
4442 (BaseAccess.DoResolve): Likewise.
4444 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4446 C# 2.0 Conditional attribute class implementation
4448 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4449 Analyzes class whether it has attribute which has ConditionalAttribute
4450 and its condition is not defined.
4452 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4453 (Class.IsExcluded): New method. Search for at least one defined
4454 condition in ConditionalAttribute of attribute class.
4456 2005-03-30 Raja R Harinath <rharinath@novell.com>
4458 * ecore.cs (PropertyExpr): Derive from Expression, not
4459 ExpressionStatement.
4460 (PropertyExpr.EmitStatement): Remove.
4462 2005-03-29 Raja R Harinath <rharinath@novell.com>
4465 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4466 internal field "value__" of an enum be private. The examples for
4467 "value__" that I found on MSDN all used FieldAttributes.Private.
4469 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4470 Don't mention IL method attribute names.
4472 Fix #47991. Remove a TODO.
4473 * statement.cs (Block.Toplevel): Make into a field.
4474 (Block.Parameters): Move into ToplevelBlock.
4475 (Block.known_variables): Rename from child_variable_names.
4476 (Block.Block): Remove variants that take Parameters. Initialize
4477 'Toplevel' with the immediately surrounding toplevel block.
4478 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4479 LocalInfo parameter.
4480 (Block.GetKnownVariableInfo): New.
4481 (Block.IsVariableNameUsedInChildBlock): Update.
4482 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4483 the block, even though it may not be in scope.
4484 (Block.AddVariable): Remove Parameters parameter. Use
4485 Toplevel.Parameters instead.
4486 (Block.AddConstant): Remove Parameters parameter.
4487 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4488 (Block.IsParamaterReference): Likewise.
4489 (Block.IsLocalParameter): Likewise. Simplify a lot.
4490 (ToplevelBlock.Parameters): New. Moved from Block.
4491 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4492 initialize Parameters to a non-null value.
4493 * cs-parser.jay: Update to changes.
4494 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4495 simple names that mean different things in the same block. Use
4496 Block.IsVariableNameUsedInBlock.
4498 2005-03-28 Raja R Harinath <rharinath@novell.com>
4500 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4501 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4502 GetTypeHandle. It is possible for a reflected type to derive from
4503 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4504 System.Array during mscorlib compilation).
4505 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4506 contain a method_hash, don't create one either. Don't create a
4507 deep copy of the base cache's method_hash.
4508 (MemberCache.SetupCache): Rename back from DeepCopy.
4509 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4510 already initialized. If we see an override function, add its
4511 underlying base virtual function to the member_hash too.
4513 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4515 2005-03-26 Raja R Harinath <harinath@acm.org>
4518 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4519 fails to resolve, ensure that the LHS is still resolved as an
4522 2005-03-25 Raja R Harinath <harinath@acm.org>
4524 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4526 (Enum.current_ec): Remove.
4527 (Enum.LookupEnumValue): Remove EmitContext argument.
4528 Just uses the one created during DefineType.
4529 (Enum.FindMembers): Update.
4530 * expression.cs (MemberAccess.DoResolve): Update.
4532 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4534 * assign.cs (Assign.DoResolve): Check for CS1717 when
4535 source and target are same (uses Equals).
4537 * expression.cs (LocalVariableReference, ParameterReference,
4538 This): Implemented Equals, GetHashCode.
4540 * statement.cs (Block.GetParameterReference): Removed useless
4543 2005-03-22 Raja R Harinath <rharinath@novell.com>
4546 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4547 blocks before deciding whether the error is cs0136 or cs0128.
4549 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4550 (using_alias_directive, using_namespace_directive): Pass
4551 MemberName, not an expression to Namespace.UsingAlias and
4553 (MakeName): Use the MemberName of the namespace.
4554 * namespace.cs (Namespace.MemberName): New.
4555 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4556 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4558 * decl.cs (MemberName.Name): Make readonly.
4559 (MemberName.FromDotted): New "constructor".
4560 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4561 (MemberCore.Name): Compute from MemberName on demand.
4562 (MemberCore.SetMemberName): Provide a way to change the
4564 (MemberCore.AddToContainer): Don't take a fullname parameter.
4565 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4566 fully qualified name of the container to the member name.
4567 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4568 only if the type is a member of the root container.
4569 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4570 MemberName.Left rather than searching for an embedded ".".
4571 (PartialContainer.CreatePart): Update to changes in RootContext.
4572 (MemberBase.ShortName): Turn into a property. Use
4573 MemberCore.SetMemberName.
4574 (MemberBase.ExplicitInterfaceName): Remove.
4575 (MemberBase.UpdateMemberName): Remove.
4576 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4577 (PropertyBase.SetMemberName): New override.
4578 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4579 (Tree.GetDecl): New.
4580 (Tree.AllDecls): Rename from Decls.
4581 * attribute.cs, enum.cs, report.cs: Update to changes.
4582 * driver.cs (MainDriver): Use MemberName.FromDotted on
4583 RootContext.MainClass.
4585 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4587 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4590 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4592 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4594 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4595 property accessor modifiers.
4597 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4598 fixed buffer attribute (CS1716).
4599 (PropertyMethod.HasCustomAccessModifier): When property accessor
4600 has custom modifier.
4602 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4604 (PropertyExpr.DoResolveLValue): Add CS0272.
4606 2005-03-17 Miguel de Icaza <miguel@novell.com>
4608 * convert.cs: When converting to a pointer, use the proper Conv.U
4609 or Conv.I depending on the source data type.
4611 * cs-tokenizer.cs: Make the size for large decimal constants,
4614 2005-03-17 Martin Baulig <martin@ximian.com>
4616 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4617 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4619 2005-03-17 Martin Baulig <martin@ximian.com>
4621 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4622 to bool so we can return an error condition.
4623 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4626 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4628 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4631 2005-03-16 Raja R Harinath <rharinath@novell.com>
4633 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4634 Refactor to avoid traversing the list of assemblies, and to avoid
4635 string concatenation.
4636 * typemanager.cs (guid_attr_type): Remove.
4637 (negative_hits, pointers, references): Remove hashes.
4639 (GetConstructedType): New. Uses type_hash to handle constructed
4640 types (arrays, references, pointers).
4641 (GetReferenceType, GetPointerType): Use it.
4642 (GetNestedType): New. Uses type_hash to handle nested types of
4644 (LookupType, LookupTypeDirect): Remove.
4645 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4646 'types' hash and LookupTypeReflection directly.
4647 (params_string, params_object): Use GetConstructedType.
4648 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4650 (Namespace.Lookup): Use cached_types.
4651 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4652 provided by old TypeManager.LookupType.
4653 * rootcontext.cs (MakeFQN): Remove.
4654 * decl.cs (DeclSpace.MakeFQN): Likewise.
4655 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4656 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4657 TypeManager.GetConstructedType.
4658 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4660 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4662 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4665 * cs-parser.jay: Reports CS1527 for any namespace element.
4667 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4670 * expression.cs (ParameterReference.IsAssigned): Changed error to
4672 (Error_WrongNumArguments): Moved CS0245 detection here.
4674 * statement.cs (Return.Resolve): Add CS1622 report.
4676 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4678 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4680 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4682 * attribute.cs expression.cs: Get rid of some allocations.
4684 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4686 * doc.cs : just eliminate the latest change.
4688 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4690 * doc.cs : commented out the latest change. It breaks xml-030.cs
4692 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4694 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4695 fail. So invoke CreateType() in FindDocumentedType().
4697 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4699 * cs-tokenizer.cs : added IsKeyword().
4700 * doc.cs : Detect keyword incorrectly used as identifier.
4701 Allow identifiers prefixed by @.
4703 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4705 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4706 It caused exception in namespace resolving (again!).
4708 * class.cs (Class.ctor): Removed exit.
4709 (PropertyMethod.ctor): ditto.
4711 * codegen.cs (Codegen.Reset): Reset static data.
4712 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4714 * cs-tokenizer.cs (Cleanup): Removed.
4716 * driver.cs (GetSystemDir): Rewrote to one line command.
4717 It caused problem with unloaded dynamic modules.
4718 (UnixParseOption): Removed Exit.
4719 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4720 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4721 Now can be mcs used as library.
4723 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4726 * location.cs (Reset): Reset static data.
4728 * namespace.cs (Reset): Reset static data.
4730 * report.cs (Report.Reset): Reset static data.
4732 * rootcontext.cs (RootContext.Reset): Reset static data.
4734 * tree.cs (RootTypes.ctor): Use Location.Null
4736 * typemanager.cs (TypeManager.Reset): Reset static data.
4737 (CoreLookupType): Removed Exit.
4738 (TypeHandle.Reset): Reset static data.
4740 2005-03-10 Raja R Harinath <rharinath@novell.com>
4743 * typemanager.cs (ComputeNamespaces): Import namespaces from
4744 referenced modules too.
4746 2005-03-09 Raja R Harinath <rharinath@novell.com>
4748 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4751 2005-03-09 Raja R Harinath <rharinath@novell.com>
4753 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4754 enclosing DeclSpace. This ensures that a name-lookup populates
4755 more caches and there are fewer 'TypeExpression's. Carve out
4756 nested type lookup into ...
4757 (LookupNestedTypeInHierarchy): ... this.
4759 2005-03-09 Raja R Harinath <rharinath@novell.com>
4761 Clean up a few partial-class semantics.
4762 Fixes test-357.cs and cs1618-2.cs.
4763 * cs-parser.jay (struct_declaration): Use 'current_class' as
4764 parent of newly-created struct. Remove call to Register ().
4765 Use 'pop_current_class' to complete handing the current struct.
4766 (interface_declaration): Likewise.
4767 (class_declaration): Likewise.
4768 (enum_declaration): Use 'current_class' as parent of newly created
4770 (delegate_declaration): Likewise.
4771 (pop_current_class): New function. This is used to handle closing
4772 up the 'current_class' and 'current_container', and pointing them
4773 to the enclosing class/container.
4774 (CSharpParser): Initialize 'current_class' too.
4775 * decl.cs (MemberCore): Add check for invariant: a partial
4776 container is not a parsed entity, and thus does not enclose any
4778 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4779 (DeclSpace.BaseTypeExpr): Use it.
4780 (DeclSpace.LookupType): Add check for invariant.
4781 * class.cs (TypeContainer): Add check for invariant: a nested
4782 class should have the same NamespaceEntry as its enclosing class.
4783 (TypeContainer.EmitFieldInitializers): Make virtual.
4784 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4786 (TypeContainer.Register): Remove.
4787 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4788 null. Use TypeResolveEmitContext for resolving base types and
4789 interfaces. Move initialization of Parts.TypeBuilder here from
4791 (TypeContainer.DefineNestedTypes): ... here.
4792 (PartialContainer): Take a Namespace not a NamespaceEntry.
4793 (PartialContainer.Create): Don't use Register. Call the
4794 appropriate Add... function directly.
4795 (ClassPart): Take both the PartialContainer and the enclosing
4796 class as constructor arguments.
4797 (ClassPart.EmitFieldInitializers): Override.
4798 (ClassPart.PartFindNestedTypes): Remove.
4799 (FieldBase.GetInitializerExpression): Resolve the initializer
4800 expression in the emit context of the enclosing class.
4801 * tree.cs (RootTypes): Remove Register ().
4803 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4805 * cs-parser.jay: Removed CS0134.
4807 * driver.cs: Removed CS1901.
4809 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4810 for predefined types.
4812 2005-03-07 Duncan Mak <duncan@novell.com>
4814 * codegen.cs (Save): Catch UnauthorizedAccessException as
4815 well. Fixes bug #73454.
4817 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4819 * cs-tokenizer.cs (xtoken): Add CS1035.
4821 * class.cs (MethodData.Define): Add CS0683.
4822 (FieldMember.ctor): Add CS0681.
4824 2005-03-07 Raja R Harinath <rharinath@novell.com>
4826 * ecore.cs (SimpleName.DoResolve): Rename from
4827 SimpleName.DoResolveAllowStatic.
4828 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4829 Pass 'intermediate' flag to MemberStaticCheck.
4830 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4831 of "intermediate" lookups via MemberAccess.
4832 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4833 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4835 2005-03-07 Raja R Harinath <rharinath@novell.com>
4838 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4839 slipped in because of variable names that are identical to a
4840 builtin type's BCL equivalent ('string String;', 'int Int32;').
4841 (PropertyExpr.EmitInstance): Likewise.
4843 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4845 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4847 * report.cs (warning_ignore_table): Made public.
4849 2005-03-04 Raja R Harinath <rharinath@novell.com>
4852 * class.cs (MethodData.Emit): Pass 'container' to
4853 container.GetObsoleteAttribute instead of 'container.Parent'.
4855 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4857 * cs-parser.jay: Add 1534 error test.
4859 * iterators.cs (Yield.CheckContext): Add error 1629.
4860 (Iterator.ctor): Save unsafe modifier.
4861 (MoveNextMethod.DoEmit): Restore unsafe context.
4863 * namespace.cs (UsingAlias): Better error message.
4865 2005-03-03 Dan Winship <danw@novell.com>
4867 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4868 the warning message [#73219]
4870 2005-03-03 Raja R Harinath <rharinath@novell.com>
4872 Fix compile with MCS 1.0.0.0.
4873 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4874 w_restore to not depend on string constant folding.
4876 2005-03-03 Raja R Harinath <rharinath@novell.com>
4878 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4879 CS0246 check to users who passed 'silent = false'.
4880 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4882 (SimpleName.SimpleNameResolve): Update.
4883 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4884 (MemberAccess.IdenticalNameAndTypeName): Update.
4885 * doc.cs (FindDocumentedTypeNonArray): Update.
4887 2005-03-03 Raja R Harinath <rharinath@novell.com>
4889 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4890 * parameters.cs (ComputeAndDefineParameters): Remove.
4891 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4892 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4893 Use GetParameterInfo.
4895 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4897 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4899 2005-03-02 Raja R Harinath <rharinath@novell.com>
4901 Unify DeclSpace.LookupType and DeclSpace.FindType.
4902 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4903 is in charge of defining nested types on demand.
4904 (DeclSpace.LookupType): Use it when the current_type is a
4905 TypeBuilder. Use LookupTypeDirect for reflected types.
4906 (DeclSpace.FindType): Remove.
4907 (DeclSpace.LookupInterfaceOrClass): Likewise.
4908 (DeclSpace.DefineTypeAndParents): Likewise.
4909 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4910 DeclSpace.LookupType.
4911 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4912 * typemanager.cs (LookupType): Simplify.
4913 (AddUserType): Remove type from negative_hits.
4914 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4915 * class.cs (TypeContainer.FindMembers): Move handling of nested
4917 (TypeContainer.FindMembers_NestedTypes): ... here.
4918 (TypeContainer.FindNestedType): Implement override.
4919 (ClassPart.FindNestedType): Delegate to PartialContainer.
4920 (ClassPart.PartFindNestedType): Looks up the nested types of the
4923 2005-03-02 Martin Baulig <martin@ximian.com>
4925 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4926 static constructor in static classes.
4928 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4930 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4931 sizeParamIndex is not specified.
4933 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4936 * report.cs (WarningMessage.IsEnabled): Missing null check.
4938 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4940 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4941 in the fields and not in the properties.
4943 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4945 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4948 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4950 * attribute.cs: Small refactoring (improved robustness).
4951 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4952 (ValidateGuid): Removed.
4953 (Resolve): Removed referenced to above mentioned.
4954 (GetAttributeUsage): Made private and changed to work without
4956 (GetIndexerAttributeValue): Don't crash.
4957 (GetConditionalAttributeValue): Ditto.
4958 (GetClsCompliantAttributeValue): Ditto.
4959 (ExtractSecurityPermissionSet): All attributes exceptions are
4961 (GetPropertyValue): New helper.
4962 (GetMethodImplOptions): New method.
4963 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4964 some missing properties.
4966 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4967 (Method.ApplyAttributeBuilder): Updated.
4969 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4972 2005-02-28 Raja R Harinath <rharinath@novell.com>
4975 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4976 non-simple types (array, pointer, reference).
4978 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4980 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4982 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4984 (Method.CheckBase): Catch wrong destructor here.
4985 (MethodData.Define): Add errors 550, 668.
4987 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4989 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4991 * pending.cs (VerifyPendingMethods): Add error 551.
4993 * typemanager.cs (CSharpName): Next error report helper.
4995 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4997 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4998 attributes. Removed useless attribute double check.
4999 It saves almost 2MBs for corlib.
5001 2005-02-25 Raja R Harinath <rharinath@novell.com>
5004 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5005 called twice in case of error.
5007 2005-02-23 Chris Toshok <toshok@ximian.com>
5009 Fix compiler portions of #72827.
5010 * statement.cs (Block.Emit): call Begin/EndScope on the
5011 EmitContext instead of the ILGenerator.
5013 * codegen.cs (EmitContext.BeginScope): new method, call
5014 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5016 (EmitContext.BeginScope): same, but EndScope and CloseScope
5018 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5019 offset and call the superclass's OpenScope(int) with it.
5020 (SymbolWriter.CloseScope): get the current il
5021 offset and call superclass's CloseScope(int) with it.
5023 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5025 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5026 CS1677 for out and ref as well.
5028 * class.cs (Method.Define): Add error CS1599 detection.
5030 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5032 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5034 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5036 * support.cs.cs (ModifierDesc): New helper method.
5038 2005-02-23 Raja R Harinath <rharinath@novell.com>
5039 Abin Thomas <projectmonokochi@rediffmail.com>
5040 Anoob V E <projectmonokochi@rediffmail.com>
5041 Harilal P R <projectmonokochi@rediffmail.com>
5044 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5045 MemberLookup (used for error reporting) actually returns a result.
5046 Fix error report number (122, not 112).
5048 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5049 Anoob V E <projectmonokochi@rediffmail.com>
5050 Harilal P R <projectmonokochi@rediffmail.com>
5053 * pending.cs (PendingImplementation.GetAbstractMethods):
5054 Find NonPublic members too.
5056 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5058 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5061 * class.cs (MethodCore.CheckMethodAgainstBase):
5062 Add error 239 report.
5064 2005-02-21 Raja R Harinath <rharinath@novell.com>
5067 * expression.cs (Invocation.IsApplicable): Make public.
5068 (Invocation.IsParamsMethodApplicable): Likewise.
5069 * delegate.cs (Delegate.VerifyApplicability): Don't use
5070 Invocation.VerifyArgumentCompat for parameter applicability
5071 testing. Use Invocation.IsApplicable and
5072 Invocation.IsParamsMethodApplicable.
5074 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5076 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5078 * class.cs (Operator.Define): Add error 217 report.
5080 2005-02-21 Raja R Harinath <rharinath@novell.com>
5082 * namespace.cs (UsingEntry.Resolve): Undo change below.
5084 2005-02-21 Raja R Harinath <rharinath@novell.com>
5087 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5088 disable the error message when the extended MemberLookup also
5090 (Expression.MemberLookupFinal): Update.
5091 (SimpleName.DoSimpleNameResolve): Update.
5092 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5093 Don't use MemberLookupFinal.
5094 (New.DoResolve): Update.
5095 (BaseAccess.CommonResolve): Update.
5097 2005-02-21 Raja R Harinath <rharinath@novell.com>
5100 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5101 occured previously, don't resolve again.
5103 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5106 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5107 argument. Call ResolveAttributeUsage for unresolved.
5108 when types doesn't match ctor arguments.
5110 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5111 for nested attribute classes.
5112 (Class.attribute_usage): Removed.
5113 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5114 for attribute class.
5116 * ecore.cs (IsAttribute): Removed.
5118 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5120 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5122 (attribute_types): Removed.
5123 (EmitCode): Global attributes are emited as the latest.
5125 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5127 * class.cs (EmitFieldInitializers): Don't emit field initializer
5128 for default values when optimilization is on.
5130 * constant.cs (Constant.IsDefaultValue): New property.
5132 * driver.cs: Add /optimize handling.
5136 * literal.cs: Implement new IsDefaultValue property.
5138 * rootcontext.cs (Optimize): New field, holds /optimize option.
5140 2005-02-18 Raja R Harinath <rharinath@novell.com>
5142 Fix crasher in re-opened #72347.
5143 * namespace.cs (Namespace.Lookup): Return null if
5144 DeclSpace.DefineType returns null.
5147 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5149 2005-02-18 Raja R Harinath <rharinath@novell.com>
5151 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5152 now returns null if it cannot resolve to an lvalue.
5153 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5154 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5155 returned null. Remove check for SimpleName.
5156 (EventExpr.DoResolveLValue): New.
5157 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5158 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5160 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5162 (Unary.ResolveOperator): Move CS0211 check ...
5163 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5165 (Unary.DoResolveLValue): Simplify.
5166 (AddressOf.DoResolveLValue): New.
5167 (ArrayAccess.DoResolveLValue): New.
5169 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5171 * attribute.cs (Attribute.Resolve): Add arguments casting for
5172 when types doesn't match ctor arguments.
5174 2005-02-16 Raja R Harinath <rharinath@novell.com>
5176 Fix parts of #63202.
5177 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5178 lookup of operator in base type. Ensure that all checks happen
5179 when the operator resolves to an "op_..." method.
5181 2005-02-15 Raja R Harinath <rharinath@novell.com>
5184 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5185 'ignore_cs0104' parameter. Pass it to ...
5186 (NamespaceEntry.Lookup): ... this.
5187 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5188 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5189 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5190 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5191 Update. Request that cs0104 errors be ignored.
5192 (ComposedCast.ResolveAsTypeStep): Update.
5194 2005-02-14 Raja R Harinath <rharinath@novell.com>
5197 * expression.cs (Invocation.BetterFunction): Remove support for
5198 comparing virtual functions and their overrides.
5199 (Invocation.IsOverride): New.
5200 (Invocation.OverloadResolve): Don't consider 'override' functions
5201 during candidate selection. Store them in a lookaside list.
5202 If the selected method is a 'virtual' function, use the list to
5203 find any overrides that are closer to the LHS type.
5205 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5207 * expression.cs (New.DoResolve): Add complex core type reduction.
5208 (New.Constantify): Converts complex core type syntax like 'new int ()'
5211 2005-02-14 Raja R Harinath <rharinath@novell.com>
5213 * decl.cs (EntryType.EntryType): New constructor to create an
5214 updated copy of a cache entry.
5215 (MemberCache.AddMethods): Use it.
5216 (MemberCache.ClearDeclaredOnly): Remove.
5217 (MemberCache.MemberCache): Update.
5219 2005-02-11 Miguel de Icaza <miguel@novell.com>
5221 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5222 variable. This one is represents the actual low-level declaration
5223 of the method, as opposed to the semantic level `IsStatic'.
5225 An anonymous method which is hosted into a static method might be
5226 actually an instance method. IsStatic would reflect the
5227 container, while MethodIsStatic represents the actual code
5230 * expression.cs (ParameterReference): Use the new MethodIsStatic
5231 instead of IsStatic.
5233 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5234 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5235 set on the current EmitContext.
5237 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5238 resolve our casted expression as an LValue. This triggers the
5239 proper LValue processing that is later required by Assign.
5243 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5245 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5247 C# 2.0 Fixed buffer implementation
5249 * anonymous.cs: Update after RegisterHelperClass renaming.
5251 * attribute.cs (AttributeTester.fixed_buffer_cache):
5252 Cache of external fixed buffers.
5253 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5254 implementation if field is fixed buffer else null.
5257 (TypeContainer.AddField): Accept FieldMember instead of Field.
5258 (FieldBase.IsFieldClsCompliant): Extracted code from
5259 VerifyClsCompliance descendant customization.
5260 (FixedField): New class handles fixed buffer fields.
5261 (FixedFieldExternal): Keeps information about imported fixed
5263 (IFixedField): Make access to internal or external fixed buffer
5266 * cs-parser.jay: Add fixed buffer parsing.
5268 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5271 * expression.cs (Indirection): Extended implementation to accept
5273 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5274 (ElementAccess.MakePointerAccess): Get type as parameter.
5275 (DoResolve): Add fixed buffer field expression conversion.
5276 (DoResolveLValue): Ditto.
5277 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5278 (ArrayPtr): Derives from FixedBufferPtr.
5279 (ArrayPtr.Emit): Add extra emit for array elements.
5281 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5283 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5284 for compiler generated types.
5285 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5287 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5288 and consume less memory.
5289 (Fixed.Resolve): Add fixed buffer case.
5291 * typemanager.cs (compiler_generated_attr_ctor,
5292 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5293 (HasElementType): Add our own implementation to work on every
5296 2005-02-11 Miguel de Icaza <miguel@novell.com>
5298 * anonymous.cs (CaptureContext): Track whether `this' has been
5301 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5302 only captured `this' if it was implicitly done (instance
5303 methods/variables were used).
5305 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5306 `this' must be captured.
5308 2005-01-30 Miguel de Icaza <miguel@novell.com>
5310 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5311 is null it means that there has been no need to capture anything,
5312 so we just create a sibling.
5314 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5316 Just a partial fix. The other half is fairly elusive.
5318 2005-02-10 Raja R Harinath <rharinath@novell.com>
5320 Fix #52586, cs0121-4.cs.
5321 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5322 and return a hashtable.
5323 (MemberCache.ClearDeclaredOnly): New.
5324 (MemberCache.MemberCache): Update to change. Make a deep copy of
5325 the method_hash of a base type too.
5326 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5327 type methods. Overwrite entries with the same MethodHandle so
5328 that the ReflectedType is correct. The process leaves in base
5329 virtual functions and their overrides as distinct entries.
5330 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5331 matters since it was boxed in a ArrayList before.
5332 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5334 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5335 case of a virtual function and its override (choose the overload
5337 (Invocation.OverloadResolve): Avoid 'override' members during
5338 'applicable_type' calculation.
5340 2005-02-09 Raja R Harinath <rharinath@novell.com>
5342 Combine two near-redundant caches.
5343 * typemanager.cs (method_params): Rename from method_internal_params.
5344 (TypeManager.GetParameterData): New. Replace
5345 Invocation.GetParameterData.
5346 (TypeManager.LookupParametersByBuilder): Remove.
5347 * expression.cs (Invocation.method_parameter_cache): Remove.
5348 (Invocation.GetParameterData): Remove.
5350 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5353 2005-02-08 Raja R Harinath <rharinath@novell.com>
5356 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5357 TypeManager.multicast_delegate_type is null, resolve it by looking
5358 up "System.MulticastDelegate".
5359 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5361 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5362 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5363 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5366 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5367 (LabeledStatement.AddReference): New. Set 'referenced'.
5368 (Goto.Resolve): Use it.
5370 2005-02-05 John Luke <john.luke@gmail.com>
5372 * driver.cs: remove duplicate -doc line in Usage ()
5374 2005-02-04 Raja R Harinath <rharinath@novell.com>
5376 * location.cs (Location.AddFile): Fix CS2002 error report.
5378 2005-02-02 Martin Baulig <martin@ximian.com>
5380 * delegate.cs (Delegate.DefineType): Report an internal error if
5381 TypeManager.multicast_delegate_type is null. See bug #72015 for
5384 2005-02-02 Raja R Harinath <rharinath@novell.com>
5386 Fix a crasher in a variant of #31984.
5387 * const.cs (Constant.CheckBase): New override that defers the
5388 new-or-override check in case the base type hasn't been populated
5390 (Constant.Define): Ensure the new-or-override check is performed.
5392 2005-02-01 Duncan Mak <duncan@ximian.com>
5394 * const.cs (LookupConstantValue): Check that `ce' is not null
5395 before calling GetValue ().
5397 2005-02-01 Raja R Harinath <rharinath@novell.com>
5399 Fix test-334.cs (#69519).
5400 * cs-parser.jay (using_alias_directive): Pass in an expression to
5401 NamespaceEntry.UsingAlias.
5402 (using_namespace_directive): Pass in an expression to
5403 NamespaceEntry.Using.
5404 (namespace_name): Don't flatten to a string.
5405 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5406 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5408 (NamespaceEntry.UsingEntry): Likewise.
5409 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5411 (NamespaceEntry.LookupForUsing): Remove.
5412 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5414 (NamespaceEntry.Lookup): Remove support for dotted names.
5416 2005-02-01 Raja R Harinath <rharinath@novell.com>
5418 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5420 (NamespaceEntry.ImplicitParent): Compute on demand.
5421 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5422 parallels the current.
5423 (NamespaceEntry.LookupForUsing): Use it.
5424 (NamespaceEntry.Lookup): If the current namespace-entry is
5425 implicit, don't search aliases and using tables.
5427 2005-02-01 Raja R Harinath <rharinath@novell.com>
5430 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5432 (TypeContainer.BaseCache): Compute on demand.
5433 (TypeContainer.FindMembers): Define constants and types if they're
5434 not already created.
5435 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5437 * const.cs (Constant.Define): Make idempotent.
5439 2005-01-29 Miguel de Icaza <miguel@novell.com>
5441 * pending.cs: Produce better code (no nops produced by using Ldarg
5444 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5445 i - 1' it should be arg + 1.
5449 2005-01-28 Raja R Harinath <rharinath@novell.com>
5451 * attribute.cs (Attribute.CheckAttributeType): Make private
5453 (Attribute.ResolveType): Make virtual.
5454 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5455 handling of RootContext.Tree.Types.
5457 2005-01-27 Raja R Harinath <rharinath@novell.com>
5459 Update attribute-handling to use the SimpleName/MemberAccess
5461 * cs-parser.jay (attribute): Pass in an expression to the
5462 constructors of Attribute and GlobalAttribute.
5463 * attribute.cs (Attribute): Take an expression for the name.
5464 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5465 passed in attribute name expression.
5466 (Attribute.CheckAttributeType): Use it.
5467 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5468 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5469 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5470 argument to prevent error messages if the lookup fails.
5472 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5474 * expression.cs (Indirection): Implemented IVariable interface
5475 to support indirection in AddressOf operator.
5476 (PointerArithmetic.Emit): Add optimalization for case where
5477 result can be precomputed.
5479 2005-01-26 Martin Baulig <martin@ximian.com>
5481 * class.cs (TypeContainer.AttributeTargets): Return the correct
5482 AttributeTargets depending on our `Kind' instead of throwing an
5483 exception; fixes #71632.
5485 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5488 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5491 2005-01-25 Raja R Harinath <rharinath@novell.com>
5494 * expression.cs (MemberAccess.DoResolve): Don't complain with
5495 cs0572 when the LHS of a member access has identical name and type
5498 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5501 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5503 Create custom PermissionSet only for PermissionSetAttribute.
5505 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5508 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5509 delegates in static class.
5511 2005-01-24 Martin Baulig <martin@ximian.com>
5513 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5514 merging an implicit block, just use its reachability.
5516 * statement.cs (Block.Resolve): Make the unreachable code check
5517 work wrt. implicit blocks; see test-337 from #63842.
5519 2005-01-21 Alp Toker <alp@atoker.com>
5521 * cs-parser.jay: destructor_declaration's container is PartialContainer
5522 not Class when partial types are used, so use Kind prop instead of
5525 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5527 * cs-parser.jay: Improve error reporting when an interface
5530 2005-01-20 Dick Porter <dick@ximian.com>
5532 * support.cs: SeekableStreamReader fix from Sandor Dobos
5533 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5534 chars are read. Fixes bug 70369.
5536 2005-01-20 Raja R Harinath <rharinath@novell.com>
5538 * cs-parser.jay (catch_clause): Simplify current_block handling
5541 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5543 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5544 code with ImplicitStandardConversion to handle the implicit
5545 conversion of method groups into valid delegate invocations.
5547 The problem is that in parameter handling we were using this code
5548 path. Fixes bug #64698
5550 2005-01-19 Raja R Harinath <rharinath@novell.com>
5552 * cs-parser.jay: Fix several infelicities.
5553 - Avoid assigning to the parser value stack. Code like
5554 '$3 = null' is unclean. Synthesize a value for the code block
5556 - Avoid using oob_stack for storing location information. Use ...
5557 (_mark_): ... this. New (empty) rule. Saves the current location
5559 (foreach_statement): Avoid using oob_stack for current_block
5560 handling. Use technique used in for_statement and
5561 using_statement. Synthesize a value for the code block to store
5562 additional intermediate information.
5564 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5566 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5567 of a different type is only allowed to private fields of a
5568 containing type, not on fields of a base class.
5570 See test-174.cs and error cs0122-9.cs
5572 2005-01-13 Raja R Harinath <rharinath@novell.com>
5574 Fix test-335.cs (bug #58126).
5575 * cs-parser.jay (argument): Split out non-expression parts of the
5576 rule into 'non_simple_argument'.
5577 (invocation_expression): Support parenthesized invocations with
5578 multiple arguments, and with single non-simple arguments.
5580 2005-01-13 Raja R Harinath <rharinath@novell.com>
5582 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5585 2005-01-12 Raja R Harinath <rharinath@novell.com>
5587 Fix cs0038-1.cs, cs1640-6.cs.
5588 * ecore.cs (Expression.Resolve): Remove special-case for
5589 SimpleName in error-handling.
5590 (Expression.almostMatchedMembers): Relax access permission to
5592 (Expression.MemberLookupFailed): Handle duplicates in
5593 almostMatchedMembers list.
5594 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5595 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5596 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5597 overload if the passed in MemberInfo is a MethodBase.
5599 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5602 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5603 for non-CAS & merge permission sets properly.
5605 2005-01-11 Raja R Harinath <rharinath@novell.com>
5607 Improve standard-compliance of simple name and member access
5608 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5609 * ecore.cs (FullNamedExpression): New abstract base class
5610 for Namespaces and TypeExpressions.
5611 (ResolveFlags.SimpleName): Remove.
5612 (SimpleName): Remove support for dotted names.
5613 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5614 DeclSpace.FindType and DeclSpace.LookupType.
5615 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5616 (Expression.ExprClassName): Make member function.
5617 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5618 a namespace. Remove creation of dotted "SimpleName"s.
5619 (MemberAccess.DoResolve): Likewise.
5620 * decl.cs (DeclSpace.Cache): Make private.
5621 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5622 (DeclSpace.FindType): Update.
5623 (DeclSpace.LookupType): Move here from RootContext. Return a
5624 FullNamedExpression.
5625 * namespace.cs (Namespace): Derive from FullNamedExpression
5626 so that it can be part of expression resolution.
5627 (Namespace.Lookup): Return an FullNamedExpression.
5628 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5630 * rootcontext.cs (NamespaceLookup): Remove.
5631 (LookupType): Move to DeclSpace.
5632 * attribute.cs (CheckAttributeType): Update.
5633 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5634 (FindDocumentedTypeNonArray): Likewise.
5636 2005-01-11 Raja R Harinath <rharinath@novell.com>
5638 Fix cs0509.cs, cs1632.cs.
5639 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5640 is the same as IsInterface.
5641 (TypeContainer.GetClassBases): Likewise.
5642 * statement.cs (LabeledStatement.ig): New field.
5643 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5645 (LabeledStatement.DoEmit): Check that the label was created with
5646 the same ILGenerator.
5648 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5651 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5652 accessors to its properties.
5654 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5655 from accessors to property.
5657 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5660 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5663 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5665 * attribute.cs: Check for null and empty strings.
5667 I have lost another battle to Paolo.
5669 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5672 * class.cs (PropertyMethod): Set Parent field in ctors.
5673 (SetMethod.InternalParameters): Add unsafe switch hack.
5674 Override MarkForDuplicationCheck where it is appropriate.
5676 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5677 It says whether container allows members with the same name.
5679 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5680 Removed is_method parameter.
5682 2005-01-06 Duncan Mak <duncan@ximian.com>
5684 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5685 because the previous change led to incorrect reporting of CS1032
5686 ("Cannot define/undefine preprocessor symbols after first token in
5687 file"). Instead of using `tokens_seen' as the only flag that
5688 triggers CS1040, introduce `comments_seen'. This new flag is used
5689 to signify having seen comments on the current line, so it is
5690 unset after a newline.
5692 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5694 * doc.cs : When searching for a type, find nested type too.
5695 This fixes bug #71040.
5697 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5700 - Warn missing member comment on those classes which also does not
5701 have doc comments. Fixed bug #71041.
5702 - Don't warn missing doc comment on default constructor.
5705 2005-01-06 Duncan Mak <duncan@ximian.com>
5707 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5708 comments, set `tokens_seen' to true. This allows us to detect
5709 misplaced preprocessor directives (i.e. not at the beginning of
5710 the a line, nor after whitespaces). In that case, report error
5711 CS1040. This fixes bug #56460.
5713 * cs-parser.jay (interface_member_declaration): Add checks for
5714 IsExplicitImpl, and report CS0541 error if an interface member is
5715 defined as an explicit interface declaration.
5717 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5720 * class.cs (PropertyMethod): Set Parent field in ctors.
5721 (SetMethod.InternalParameters): Add unsafe switch hack.
5723 * decl.cs (MemberCore.Parent): Cannot be readonly.
5725 2005-01-06 Raja R Harinath <rharinath@novell.com>
5727 * decl.cs (DeclSpace.ResolveType): Remove.
5728 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5729 Merge in code from ...
5730 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5731 * class.cs, enum.cs: Update to changes.
5733 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5735 * anonymous.cs: Ensure that we init the scope of our parent if it
5736 has not been initialized yet.
5738 2004-12-30 Duncan Mak <duncan@ximian.com>
5740 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5741 if field.FieldBuilder is null. Fixes #70758.
5743 * convert.cs: Fixed some typos and updated some of the comments.
5744 (ImplicitStandardConversionExists):
5745 (TryImplicitIntConversion): If `target_type' is an interface and
5746 the type of `ic' implements this interface, return true or a new
5747 BoxedCast instead of null. This fixes #70468.
5749 2004-12-29 Duncan Mak <duncan@ximian.com>
5751 * expression.cs (Argument.Emit): Check that Expr is
5752 IMemoryLocation before casting to it, and report CS1510 otherwise.
5756 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5758 * statement.cs (Block.ThisVariable): remove the recursion here, to
5759 make the --profile more sane.
5761 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5763 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5764 assembly, by JB Evain.
5766 2004-12-17 Raja R Harinath <rharinath@novell.com>
5768 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5769 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5770 "parent" refers to enclosing type/class. "base" refers to superclass.
5772 2004-12-17 Raja R Harinath <rharinath@novell.com>
5774 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5775 Ensure that we only have GlobalAttributes.
5776 * attribute.cs (Attribute.Emit): Make non-virtual.
5777 (GlobalAttribute.Emit): Remove.
5778 (Attribute.Resolve): Make virtual.
5779 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5780 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5781 the argument. Don't create one.
5782 (Attribute.GetObsoleteAttribute): Likewise.
5783 (Attribute.GetClsCompliantAttributeValue): Likewise.
5784 * class.cs, decl.cs: Update to changes.
5786 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5788 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5790 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5792 * statement.cs (Foreach.Resolve): Add error 186 report.
5794 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5796 * expression.cs (Conditional.DoResolve): Add warning 429.
5798 * statement.cs (If.Resolve): Add warning 665.
5800 2004-12-16 Raja R Harinath <rharinath@novell.com>
5802 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5803 except when in the parser, and in GlobalAttribute.
5804 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5805 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5806 RootContext.Tree.Types.NamespaceEntry once work is done.
5807 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5808 and resets RootContext.Tree.Types.NamespaceEntry.
5810 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5812 * cs-parser.jay: Don't create a block for every variable.
5814 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5816 * location.cs: Provide extra information.
5818 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5819 variables from the captured environment, it is the ldarg_0.
5821 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5823 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5826 * class.cs: Changed warning level for 169 to avoid developer
5827 displeasure from warning flooding. It will be changed back when they
5828 fix most of current BCL warnings.
5830 * RootContext.cs: Pushed default WarningLevel to 3.
5832 * statement.cs: Removed unused variable.
5834 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5836 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5837 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5838 Add error 502 report.
5839 (StaticClass.DefineType): Add error 441 report.
5840 (Class.AllowedModifiersProp): New virtual property as temporary
5841 extension to AllowedModifiers.
5842 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5843 to share implementation with StaticClass and don't call virtual
5846 * driver.cs (MainDriver): Add error 1558 test.
5848 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5849 report. Moved error 36 test here.
5851 * statement.cs (Throw.Resolve): Add error 724 report.
5853 * typemanager.cs: Add out_attribute_type core type.
5855 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5857 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5859 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5861 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5864 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5866 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5867 Add error 3023 report.
5868 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5870 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5873 2004-12-12 John Luke <john.luke@gmail.com>
5875 * driver.cs (AddArgs): take -- into account when
5876 adding arguments, fixes bug 65710
5878 2004-12-12 Martin Baulig <martin@ximian.com>
5880 * expression.cs (Unary.TryReduceNegative): Added support for
5881 SByteConstant and ByteConstant.
5882 (Unary.Reduce): Check error values from TryReduceNegative().
5884 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5886 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5887 and report exception as error 182.
5889 2004-12-10 Raja R Harinath <rharinath@novell.com>
5891 * driver.cs (Main): Fix message when there are warnings.
5893 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5895 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5897 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5899 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5900 Reduced number of warnings.
5902 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5904 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5906 * driver.cs: Removed message.
5908 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5910 2004-12-08 <vargaz@freemail.hu>
5912 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5914 2004-12-08 Martin Baulig <martin@ximian.com>
5916 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5917 instead of a CS3002 for properties and indexer.
5919 2004-12-08 Martin Baulig <martin@ximian.com>
5921 * decl.cs (MemberName.ToString): Make this work again.
5923 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5925 * attribute.cs (Resolve): Add error 591 detection.
5927 * class.cs (FieldMember.Define): Add error 1547 detection.
5928 (Indexer.Define): Add error 620 detection.
5929 (Operator.Define): Add error 590 detection.
5931 * ecore.cs: Missing argument for error 79.
5933 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5936 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5939 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5942 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5944 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5945 Some operator comments were suppressed.
5946 * doc.cs : Implicit/explicit operator name in doc comments are like
5947 "op_Explicit(type)~returnType", so added suffix handling.
5949 2004-12-07 Martin Baulig <martin@ximian.com>
5952 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5953 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5954 (DeclSpace.ec): New protected field; store the EmitContext here.
5955 (DeclSpace.EmitContext): New public property; moved here from
5957 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5960 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5961 (Enum.Emit): Don't create a new EmitContext.
5963 * delegate.cs (Delegate.DefineType): Always create the
5966 * iterators.cs (Iterators.DefineIterator): Create a new
5967 EmitContext and store it in `ec'.
5969 2004-08-24 Martin Baulig <martin@ximian.com>
5972 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5973 this for accessibility checks.
5974 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5975 IsNestedFamilyAccessible.
5976 (TypeManager.IsSubclassOf): New method, do what the name actually
5979 2004-12-06 Raja R Harinath <rharinath@novell.com>
5981 Fix crash on cs0657-17.cs.
5982 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5983 Use RootContext.Tree.Types, not 'new RootTypes ()'.
5984 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5985 the case where the NamespaceEntry gets overwritten.
5987 2004-12-06 Marek Safar <marek.safar@seznam.cz>
5989 Fixed #69195, #56821
5990 * ecore.cs (ResolveBoolean): Tiny refactoring.
5992 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5993 of right expression resolving when left is false constant and
5994 operator is LogicalAnd OR true constant and operator is LogicalOr.
5996 * statement.cs (ResolveUnreachable): Always reports warning.
5998 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6000 * class.cs: Distinguish between 1721 and 1722 (just a little help
6001 for the programmer).
6003 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6005 * delegate.cs: Only allow this on new versions of the language.
6007 2004-12-02 Duncan Mak <duncan@ximian.com>
6009 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6011 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6012 here as a static method. Take an additional bool out parameter
6013 `must_do_cs1540_check' for signaling to InstanceResolve.
6014 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6015 member field from PropertyExpr class and made it an argument of
6017 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6018 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6019 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6020 and `remove_accessor' as well as InstanceResolve: report CS0122
6025 2004-12-03 Raja R Harinath <rharinath@novell.com>
6027 Fix test-327.cs, test-328.cs, and put in early infrastructure
6028 for eventually fixing #52697.
6029 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6030 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6032 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6033 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6034 (VerifyUsing, error246): Update.
6035 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6036 'NamespaceEntry.LookupNamespaceOrType'.
6038 2004-12-03 Martin Baulig <martin@ximian.com>
6040 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6041 method as our child, call AnonymousMethod.Compatible() on it.
6043 2004-12-03 Raja R Harinath <rharinath@novell.com>
6045 Disable XML documentation support in 'basic' profile.
6046 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6047 Redirect XmlElement to System.Object.
6048 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6049 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6050 * mcs.exe.sources: Add doc-bootstrap.cs.
6051 * doc-bootstrap.cs: New file. Contains empty stub implementation
6054 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6056 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6057 comments are allowed.
6059 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6061 * delegate.cs: Add checks for subtypes in paramaters and return values
6062 in VerifyMethod () to add support for Covariance/Contravariance
6065 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6067 * report.cs: Remove extra closing parenthesis.
6069 * convert.cs (Error_CannotImplicitConversion): If the name of the
6070 types are the same, provide some extra information.
6072 * class.cs (FieldBase): Use an unused bit field from the field to
6073 encode the `has_offset' property from the FieldMember. This saves
6074 a couple of Ks on bootstrap compilation.
6076 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6077 method as our child, return the AnonymousMethod resolved
6080 * expression.cs (New.DoResolve): Allow return values from
6081 NewDelegate to also include AnonymousMethods.
6085 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6088 * attribute.cs (Resolve): Improved implementation of params
6089 attribute arguments.
6091 * support.cs (ParameterData): Add HasParams to be faster.
6093 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6095 all things are for /doc support:
6097 * doc.cs: new file that supports XML documentation generation.
6098 * mcs.exe.sources: added doc.cs.
6100 Handle /doc command line option.
6101 Report error 2006 instead of 5 for missing file name for /doc.
6102 Generate XML documentation when required, after type resolution.
6104 Added support for picking up documentation (/// and /** ... */),
6105 including a new XmlCommentState enumeration.
6107 Added lines to fill Documentation element for field, constant,
6108 property, indexer, method, constructor, destructor, operator, event
6109 and class, struct, interface, delegate, enum.
6110 Added lines to warn incorrect comment.
6112 Added Documentation field (passed only when /doc was specified).
6114 Added DocComment, DocCommentHeader, GenerateDocComment() and
6115 OnGenerateDocComment() and some supporting private members for
6116 /doc feature to MemberCore.
6118 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6120 Added overriden DocCommentHeader.
6122 Added overriden DocCommentHeader and GenerateDocComment().
6124 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6126 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6127 unwrapping the enumeration values, chain to
6128 DoConstantNumericPromotions again, so we can promote things to the
6129 fundamental types (takes care of enums that are bytes, sbytes).
6133 2004-12-01 Raja R Harinath <rharinath@novell.com>
6135 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6136 Fix long-standing bug in type-lookup. Use FindType instead of
6137 LookupType when ec.ResolvingTypeTree.
6138 (Attribute.ResolveType, Attribute.Resolve)
6139 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6141 (Attributes.Search): Remove internal version. Update.
6142 (Attributes.SearchMulti): Update.
6143 (Attributes.GetClsCompliantAttribute): Remove.
6144 (Attributes.GetIndexerNameAttribute): Remove.
6145 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6146 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6147 * class.cs (Indexer.Define): Likewise.
6149 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6152 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6153 MarshallByReference members access.
6155 * expression.cs: Use CheckMarshallByRefAccess;
6156 Better error CS0197 message.
6158 * report.cs: Print whole related error message.
6160 2004-11-30 Raja R Harinath <rharinath@novell.com>
6162 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6163 the current directory to help debugging.
6165 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6167 * class (GetClassBases): Better error 60 report.
6168 (EventProperty): Disabled warning 67 detection.
6170 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6173 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6175 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6178 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6181 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6183 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6185 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6187 * attribute.cs (Attribute.Resolve): Refine error reporting and
6188 report a cs0117 if the identifier does not exist, to distinguish
6189 from 0617 which is a miss-use of the actual identifier.
6191 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6192 between cs0070 and cs0079.
6194 * class.cs (MemberBase.DoDefine): When reporting a wrong
6195 accessibility level, we use MethodCore to compare instead of
6196 Method (this was a regression in some refactoring effort).
6198 So now we correctly report cs0056 again.
6200 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6201 testing the target_type (which was known to be object_type) and
6202 not the source type (which is anonymous_method).
6204 Fixed reporting of error cs1660.
6206 * expression.cs (UserCast.Source): Expose the underlying cast.
6208 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6209 allowed types to find a match to int32 first (most common).
6211 In addition, it ignores any ImplicitUserConversions that did an
6212 internal implicit conversion (as the switch statement allows only
6213 one integral conversion to exist).
6215 * class.cs (PartialContainer.Create): rename `name' to
6216 `member_name' for clarity. Then replace the string calls with a
6217 call to MemberName.GetPartialName, as now using
6218 MemberName.ToString is an error (this is due to the side effects
6219 it had, that were fixed in the past).
6221 This will restore the error reporting on a number of partial class
6222 errors that were missusing this (and getting an exception as a
6223 results, which is now just a plain textual warning, because
6224 yyparse debug output would crash otherwise).
6226 2004-11-26 Raja R Harinath <rharinath@novell.com>
6228 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6230 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6232 * rootcontext.cs (LookupType): Make sure to cache lookups that
6233 don't give us a negative result. This saves about 5% of corlib
6236 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6238 * report.cs (AbstractMessage.Print): messages are sent to stderr
6240 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6241 non-interface in the list of interfaces (at this point, either
6242 parent was properly set, or a base class is being listed in the
6243 interfaces section).
6245 This flags error 1722, and resolves the crash from bug 69259.
6247 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6249 * statement.cs (Using.EmitExpressionFinally): make this work right
6250 for valuetypes. Fixes 69926.
6252 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6254 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6255 converted to an enum" here, before we try to change the underlying
6256 type. This code exists, but it is a different code path than the
6257 one used while encoding constants.
6259 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6260 old bug: when converting from the null literal to a pointer,
6261 return an EmptyCast, not the NullLiteral.
6263 This fixes #69921, the recent null_type changes probably made this
6266 (ImplicitReferenceConversionExists): In addition, resynchronized
6267 the code here, so it matches the same code in
6268 ImplicitReferenceConversionExists for the `from any class-type S
6269 to any interface-type T'.
6272 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6274 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6276 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6278 * cs-parser.jay: Use verbosity accordingly.
6280 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6282 * expression.cs (Unary.ResolveOperator): Do not report warning;
6283 AddressOf reads from variable.
6285 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6287 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6291 * attribute.cs (Attributable): Removed CheckTargets.
6292 (Attributes.Emit): Explicit attribute targets are tested here.
6294 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6295 not enabled for interfaces.
6297 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6298 (GetAssemblyName): Ouch next bug there.
6300 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6302 * expression.cs: Error 275 added.
6304 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6306 Fix bug #69177 (Implemented decimal constant support)
6308 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6309 (BinaryFold): Add DecimalConstant.
6311 * const.cs (Define): Decimal constant
6313 (ChangeType): Add decimal type handling.
6314 (LookupConstantValue): Don't set value for decimal type but
6315 emit DecimalConstantAttribute. Needed for constant optimization.
6317 * constant.cs (ToDecimal): New method.
6318 (ConvertToDecimal): New method.
6319 (IntConstant): Implemented ConvertToDecimal.
6320 (DecimalConstant.Emit): Emit optimized version for decimals in
6323 * expression.cs (ResolveOperator): Changed order of constant
6324 reduction to work correctly with native types which have
6325 overloaded operators.
6326 (ResolveMemberAccess): Extract constant value from attribute
6329 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6331 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6332 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6333 (ChangeType): Decimal is special.
6334 (TypeToCoreType): Add decimal type.
6336 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6338 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6341 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6343 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6346 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6348 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6350 * pending.cs (PendingImplementation): Grab only interfaces.
6352 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6354 * statement.cs (ForeachHelperMethods): Add location member and
6355 error 202 detection.
6357 2004-11-19 Raja R Harinath <rharinath@novell.com>
6359 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
6360 automatically handled by executable.make.
6361 (PROGRAM): Make profile-specific.
6363 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6365 * expression.cs (DoResolveBase): Fixed wrong warning for out
6368 2004-11-18 Martin Baulig <martin@ximian.com>
6370 Merged latest changes into gmcs. Please keep this comment in
6371 here, it makes it easier for me to see what changed in MCS since
6372 the last time I merged.
6374 2004-11-17 Raja R Harinath <rharinath@novell.com>
6376 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6377 (TypeHandle.GetMemberCache): New.
6378 (TypeHandle.TypeHandle): Update.
6379 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6380 (TypeManager.LookupParentInterfacesCache):
6381 Rename from LookupInterfaceCache. Optimize slightly.
6382 (TypeManager.MemberLookup_FindMembers): Update.
6383 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6385 (AddCacheContents): Rename from AddHashtable.
6386 * class.cs (TypeContainer.parent_container): Remove.
6387 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6388 (TypeContainer.DoDefineMembers): Don't initialize it.
6389 Update to name changes.
6391 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6393 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6394 that factors the code to check access modifiers on override.
6396 (PropertyBase): Use the code here.
6398 Patch from Lluis S'anchez, fixes bug #69361.
6400 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6402 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6403 routine that is used to report the use of a captured variable
6404 whose address has been taken.
6406 There are two checks: one when variables are being captured and
6407 the other check is when the address of a variable is taken.
6409 (because an anonymous methods might be resolved before *or* after
6410 the address has been taken) and
6412 * expression.cs (Conditional.DoResolve): Remove the special
6413 casing that Martin added to trueExpr and falseExpr being both
6414 NullLiteral. We get the right behavior now just by introducing
6415 the null_type into the compiler.
6417 * convert.cs (ExplicitConversion): Change the code to use
6418 null_type instead of testing `expr is NullLiteral'.
6419 (ImplicitConversionStandard): use null_type too.
6420 (ImplicitReferenceConversionExists): use null_type too.
6421 (ImplicitReferenceConversion): use null_type too.
6423 * literal.cs: The type of `NullLiteral' is now null_type instead
6425 (Resolve): Set the type here.
6427 * typemanager.cs: Introduce null_type.
6429 2004-11-17 Martin Baulig <martin@ximian.com>
6431 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6432 direction, like FindMembers() does. Fixes #69546, testcase is in
6435 2004-11-16 Martin Baulig <martin@ximian.com>
6437 This is based on a patch from Marek Safar, see bug #69082.
6438 Fixes bugs #63705 and #67130.
6440 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6441 method; create a MemberCache for an interface type and cache the
6444 * decl.cs (IMemberContainer.ParentContainer): Removed.
6445 (IMemberContainer.ParentCache): New property.
6446 (MemberCache.SetupCacheForInterface): Removed.
6447 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6448 to create a cache for an interface's "parent".
6450 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6453 2004-11-16 Martin Baulig <martin@ximian.com>
6455 Merged back from gmcs; these changes already went into gmcs a
6456 couple of weeks ago.
6459 (TypeManager.AddUserType): Removed the `ifaces' argument.
6460 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6462 (TypeManager.AddUserInterface): Removed.
6463 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6465 (TypeManager.GetInterfaces): Likewise.
6466 (TypeManager.GetExplicitInterfaces): Likewise.
6468 * ecore.cs (TypeExpr.GetInterfaces): Removed.
6470 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6471 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6473 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6475 * statement.cs: Avoid adding bools to a hashtable.
6477 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6479 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6480 calling an unsafe method from a safe location.
6482 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6485 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6487 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6489 * namespace.cs (VerifyUsing): use GetPartialName instead of
6492 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6494 * statement.cs (Return.Resolve): Fix regression in typo: if
6495 `in_exc', we have to request a NeedReturnLabel, this was a typo
6496 introduced in the anonymous method check-in. Fixes #69131.
6498 * Indexers were using the ShortName when defining themselves,
6499 causing a regression in the compiler bootstrap when applying the
6500 patch from 2004-11-02 (first part), now they use their full name
6501 and the bug is gone.
6503 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6505 * driver.cs: Strip the path from the names of embedded resources. Fixes
6508 2004-11-04 Raja R Harinath <rharinath@novell.com>
6510 Fix error message regression: cs0104-2.cs.
6511 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6512 (AliasEntry.Resolve): Update.
6513 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6515 (RootContext.LookupType): Update.
6517 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6519 * cs-parser.jay: Add support for handling accessor modifiers
6520 * class: Add support port accessor modifiers and error checking,
6521 define PropertyMethod.Define as virtual (not abstract anymore)
6522 * ecore.cs: Add checking for proeprties access with access modifiers
6523 * iterators.cs: Modify Accessor constructor call based in the modified
6525 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6527 * expression.cs (StringConcat): Handle being called twice,
6528 as when we have a concat in a field init with more than two
6531 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6533 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6534 special case explicit implementations, we should always produce
6535 the .property or .event declaration.
6537 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6538 since it will not return correct data if people use this
6539 unresolved in the presence of using statements (see test-313).
6541 * class.cs (MethodData.Define): If we are an explicit interface
6542 implementation, set the method name to the full name of the
6543 interface plus the name of the method.
6545 Notice that using the method.MethodName.GetFullName() does not
6546 work, as it will only contain the name as declared on the source
6547 file (it can be a shorthand in the presence of using statements)
6548 and not the fully qualifed type name, for example:
6552 class D : ICloneable {
6553 object ICloneable.Clone () {
6557 Would produce a method called `ICloneable.Clone' instead of
6558 `System.ICloneable.Clone'.
6560 * namespace.cs (Alias.Resolve): Use GetPartialName.
6562 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6564 * cs-parser.jay: Add error 1055 report.
6566 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6568 * assign.cs (Assign.DoResolve): Only do the transform of
6569 assignment into a New if the types are compatible, if not, fall
6570 through and let the implicit code deal with the errors and with
6571 the necessary conversions.
6573 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6575 * cs-parser.jay: Add error 1031 report.
6577 * cs-tokenizer.cs: Add location for error 1038.
6579 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6581 * cs-parser.jay: Add error 1016 report.
6583 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6585 * cs-parser.jay: Add errors 1575,1611 report.
6587 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6589 * cs-parser.jay: Add error 1001 report.
6591 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6594 * attribute.cs (GetMarshal): Add method argument for
6595 caller identification.
6597 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6598 agument for GetMarshal and RuntimeMissingSupport.
6600 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6602 * attribute.cs (ExtractSecurityPermissionSet): Removed
6603 TypeManager.code_access_permission_type.
6605 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6607 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6609 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6610 for obsolete use of a variable here. Fixes regression on errors
6611 cs0619-25 and cs0619-26.
6613 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6615 Fix #62358, implemented security attribute encoding.
6617 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6618 Tests permitted SecurityAction for assembly or other types.
6619 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6620 data from SecurityPermissionAttribute to PermisionSet class.
6622 * class.cs (ApplyAttributeBuilder): Added special handling
6623 for System.Security.Permissions.SecurityAttribute based types.
6625 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6626 special handling for System.Security.Permissions.SecurityAttribute
6629 * enum.cs (ApplyAttributeBuilder): Added special handling
6630 for System.Security.Permissions.SecurityAttribute based types.
6632 * parameter.cs (ApplyAttributeBuilder): Added special handling
6633 for System.Security.Permissions.SecurityAttribute based types.
6635 * rootcontext.cs: Next 2 core types.
6637 * typemanager.cs (TypeManager.security_permission_attr_type):
6638 Built in type for the SecurityPermission Attribute.
6639 (code_access_permission_type): Build in type.
6641 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6643 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6644 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6645 all of this information into
6646 EmitContext.EmitCapturedVariableInstance.
6648 * codegen.cs (EmitCapturedVariableInstance): move here the
6649 funcionality of emitting an ldarg.0 in the presence of a
6650 remapping. This centralizes the instance emit code.
6652 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6653 then emit a load of this: it means that we have reached the
6654 topmost ScopeInfo: the one that contains the pointer to the
6655 instance of the class hosting the anonymous method.
6657 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6658 captures to the topmost CaptureContext.
6660 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6662 * expression.cs (LocalVariableReference): Move the knowledge about
6663 the iterators into codegen's EmitCapturedVariableInstance.
6665 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6667 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6668 all code paths return a value from an anonymous method (it is the
6669 same as the 161 error, but for anonymous methods).
6671 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6673 The introduction of anonymous methods in the compiler changed
6674 various ways of doing things in the compiler. The most
6675 significant one is the hard split between the resolution phase
6676 and the emission phases of the compiler.
6678 For instance, routines that referenced local variables no
6679 longer can safely create temporary variables during the
6680 resolution phase: they must do so from the emission phase,
6681 since the variable might have been "captured", hence access to
6682 it can not be done with the local-variable operations from the runtime.
6686 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6687 is a toplevel block.
6689 (ToplevelBlock): A new kind of Block, these are the blocks that
6690 are created by the parser for all toplevel method bodies. These
6691 include methods, accessors and anonymous methods.
6693 These contain some extra information not found in regular blocks:
6694 A pointer to an optional CaptureContext (for tracking captured
6695 local variables and parameters). A pointer to the parent
6698 (Return.Resolve): Catch missmatches when returning a value from an
6699 anonymous method (error 1662).
6700 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6703 (Break.Resolve): ditto.
6705 (SwitchLabel): instead of defining the labels during the
6706 resolution phase, we now turned the public ILLabel and ILLabelCode
6707 labels into methods called GetILLabelCode() and GetILLabel() that
6708 only define the label during the Emit phase.
6710 (GotoCase): Track the SwitchLabel instead of the computed label
6711 (its contained therein). Emit the code by using
6712 SwitchLabel.GetILLabelCode ().
6714 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6715 whether the Local has been captured or not.
6717 (LocalInfo.IsCaptured): New property, used to tell whether the
6718 local has been captured.
6720 * anonymous.cs: Vastly updated to contain the anonymous method
6723 The main classes here are: CaptureContext which tracks any
6724 captured information for a toplevel block and ScopeInfo used to
6725 track the activation frames for various local variables.
6727 Each toplevel block has an optional capture context associated
6728 with it. When a method contains an anonymous method both the
6729 toplevel method and the anonymous method will create a capture
6730 context. When variables or parameters are captured, they are
6731 recorded on the CaptureContext that owns them, for example:
6735 MyDelegate d = delegate {
6740 Here `a' will be recorded as captured on the toplevel
6741 CapturedContext, the inner captured context will not have anything
6742 (it will only have data if local variables or parameters from it
6743 are captured in a nested anonymous method.
6745 The ScopeInfo is used to track the activation frames for local
6746 variables, for example:
6748 for (int i = 0; i < 10; i++)
6749 for (int j = 0; j < 10; j++){
6750 MyDelegate d = delegate {
6755 At runtime this captures a single captured variable `i', but it
6756 captures 10 different versions of the variable `j'. The variable
6757 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6758 recorded on a child.
6760 The toplevel ScopeInfo will also track information like the `this'
6761 pointer if instance variables were referenced (this is necessary
6762 as the anonymous method lives inside a nested class in the host
6763 type of the method).
6765 (AnonymousMethod): Expanded to track the Toplevel, implement
6766 `AnonymousMethod.Compatible' to tell whether an anonymous method
6767 can be converted to a target delegate type.
6769 The routine now also produces the anonymous method content
6771 (AnonymousDelegate): A helper class that derives from
6772 DelegateCreation, this is used to generate the code necessary to
6773 produce the delegate for the anonymous method that was created.
6775 * assign.cs: API adjustments for new changes in
6776 Convert.ImplicitStandardConversionExists.
6778 * class.cs: Adjustments to cope with the fact that now toplevel
6779 blocks are of type `ToplevelBlock'.
6781 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6782 insteda of standard blocks.
6784 Flag errors if params arguments are passed to anonymous methods.
6786 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6787 `CurrentAnonymousMethod' which points to the current Anonymous
6788 Method. The variable points to the AnonymousMethod class that
6789 holds the code being compiled. It is set in the new EmitContext
6790 created for the anonymous method.
6792 (EmitContext.Phase): Introduce a variable and an enumeration to
6793 assist in enforcing some rules about when and where we are allowed
6794 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6795 only one that enfonces this right now).
6797 (EmitContext.HaveCaptureInfo): new helper method that returns
6798 whether we have a CapturedContext initialized.
6800 (EmitContext.CaptureVariable): New method used to register that a
6801 LocalInfo must be flagged for capturing.
6803 (EmitContext.CapturedParameter): New method used to register that a
6804 parameters must be flagged for capturing.
6806 (EmitContext.CapturedField): New method used to register that a
6807 field must be flagged for capturing.
6809 (EmitContext.HaveCapturedVariables,
6810 EmitContext.HaveCapturedFields): Return whether there are captured
6811 variables or fields.
6813 (EmitContext.EmitMethodHostInstance): This is used to emit the
6814 instance for the anonymous method. The instance might be null
6815 (static methods), this (for anonymous methods that capture nothing
6816 and happen to live side-by-side with the current method body) or a
6817 more complicated expression if the method has a CaptureContext.
6819 (EmitContext.EmitTopBlock): Routine that drives the emission of
6820 code: it will first resolve the top block, then emit any metadata
6821 and then emit the code. The split is done so that we can extract
6822 any anonymous methods and flag any captured variables/parameters.
6824 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6825 during this phase, the ILGenerator should not be used as labels
6826 and local variables declared here might not be accessible to any
6827 code that is part of an anonymous method.
6829 Exceptions to this include the temporary variables that are
6830 created by some statements internally for holding temporary
6833 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6836 (EmitContext.TemporaryReturn): This method is typically called
6837 from the Emit phase, and its the only place where we allow the
6838 ReturnLabel to be defined other than the EmitMeta. The reason is
6839 that otherwise we would have to duplicate a lot of logic in the
6840 Resolve phases of various methods that today is on the Emit
6843 (EmitContext.NeedReturnLabel): This no longer creates the label,
6844 as the ILGenerator is not valid during the resolve phase.
6846 (EmitContext.EmitThis): Extended the knowledge in this class to
6847 work in anonymous methods in addition to iterators.
6849 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6850 code is necessary on the stack to access the instance to a local
6851 variable (the variable will be accessed as a field).
6853 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6854 EmitContext.EmitAddressOfParameter): Routines to support
6855 parameters (not completed at this point).
6857 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6858 will also remove the parameters.
6860 * convert.cs (Convert): Define a `ConstantEC' which points to a
6861 null. This is just to prefity some code that uses
6862 ImplicitStandardConversion code and do not have an EmitContext
6865 The idea is to flag explicitly that at that point in time, it is
6866 known that the conversion will not trigger the delegate checking
6867 code in implicit conversions (which requires a valid
6870 Everywhere: pass new EmitContext parameter since
6871 ImplicitStandardConversionExists now requires it to check for
6872 anonymous method conversions.
6874 (Convert.ImplicitStandardConversionExists): If the type of an
6875 expression is the anonymous_method_type, and the type is a
6876 delegate, we invoke the AnonymousMethod.Compatible method to check
6877 whether an implicit conversion is possible.
6879 (Convert.ImplicitConversionStandard): Only do implicit method
6880 group conversions if the language level is not ISO_1.
6882 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6883 MethodInfo for the Invoke method. used by Delegate and
6886 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6887 method conversions if the target type is a delegate.
6889 Removed extra debugging nops.
6891 (LocalVariableReference): Turn the `local_info' into a public
6894 Add `prepared' field, the same hack used for FieldExprs to cope
6895 with composed assignments, as Local variables do not necessarily
6896 operate purely on the stack as they used to: they can be captured
6899 Add `temp' for a temporary result, like fields.
6901 Refactor DoResolve and DoResolveLValue into DoResolveBase.
6903 It now copes with Local variables that are captured and emits the
6904 proper instance variable to load it from a field in the captured
6907 (ParameterReference.DoResolveBase): During the resolve phase,
6908 capture parameters if we are in an anonymous method.
6910 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6911 anonymous method, use the EmitContext helper routines to emit the
6912 parameter reference.
6914 * iterators.cs: Set RemapToProxy to true/false during the
6917 * parameters.cs (GetParameterByName): New helper method.
6919 * typemanager.cs (anonymous_method_type) a new type that
6920 represents an anonyous method. This is always an internal type,
6921 used as a fencepost to test against the anonymous-methodness of an
6924 2004-10-20 Marek Safar <marek.safar@seznam.cz>
6926 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6928 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6930 2004-10-18 Martin Baulig <martin@ximian.com>
6932 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6933 `Type' directly, but call ResolveType() on it.
6934 (Catch.Resolve): Likewise.
6935 (Foreach.Resolve): Likewise.
6937 2004-10-18 Martin Baulig <martin@ximian.com>
6939 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6940 `Type' directly, but call ResolveType() on it.
6941 (Probe.DoResolve): Likewise.
6942 (ArrayCreation.LookupType): Likewise.
6943 (TypeOf.DoResolve): Likewise.
6944 (SizeOf.DoResolve): Likewise.
6946 2004-10-18 Martin Baulig <martin@ximian.com>
6948 * expression.cs (Invocation.BetterFunction): Put back
6949 TypeManager.TypeToCoreType().
6951 2004-10-18 Raja R Harinath <rharinath@novell.com>
6953 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6956 2004-10-18 Martin Baulig <martin@ximian.com>
6958 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
6959 `Type' directly, but call ResolveType() on it.
6961 2004-10-18 Martin Baulig <martin@ximian.com>
6963 * class.cs (FieldMember.Define): Don't access the TypeExpr's
6964 `Type' directly, but call ResolveType() on it.
6965 (MemberBase.DoDefine): Likewise.
6967 * expression.cs (New.DoResolve): Don't access the TypeExpr's
6968 `Type' directly, but call ResolveType() on it.
6969 (ComposedCast.DoResolveAsTypeStep): Likewise.
6971 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6972 `Type' directly, but call ResolveType() on it.
6974 2004-10-17 John Luke <john.luke@gmail.com>
6976 * class.cs (Operator.GetSignatureForError): use CSharpName
6978 * parameter.cs (Parameter.GetSignatureForError): Returns
6979 correct name even if was not defined.
6981 2004-10-13 Raja R Harinath <rharinath@novell.com>
6984 * class.cs (TypeContainer.EmitContext): New property.
6985 (DefineNestedTypes): Create an emitcontext for each part.
6986 (MethodCore.DoDefineParameters): Use container's emitcontext.
6987 Pass type array to InternalParameters.
6988 (MemberBase.DoDefine): Use container's emitcontext.
6989 (FieldMember.Define): Likewise.
6990 (Event.Define): Likewise.
6991 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6992 Pass type array to InternalParameters.
6993 (SetIndexerMethod.GetParameterInfo): Likewise.
6994 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6995 * delegate.cs (Define): Pass emitcontext to
6996 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6997 array to InternalParameters.
6998 * expression.cs (ParameterReference.DoResolveBase): Pass
6999 emitcontext to GetParameterInfo.
7000 (ComposedCast.DoResolveAsTypeStep): Remove check on
7001 ec.ResolvingTypeTree.
7002 * parameter.cs (Parameter.Resolve): Change argument to
7003 EmitContext. Use ResolveAsTypeTerminal.
7004 (Parameter.GetSignature): Change argument to EmitContext.
7005 (Parameters.ComputeSignature): Likewise.
7006 (Parameters.ComputeParameterTypes): Likewise.
7007 (Parameters.GetParameterInfo): Likewise.
7008 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7009 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7010 * support.cs (InternalParameters..ctor): Remove variant that takes
7012 * typemanager.cs (system_intptr_expr): New.
7013 (InitExpressionTypes): Initialize it.
7015 2004-10-12 Chris Toshok <toshok@ximian.com>
7017 * cs-parser.jay: fix location for try_statement and catch_clause.
7019 2004-10-11 Martin Baulig <martin@ximian.com>
7021 * report.cs: Don't make --fatal abort on warnings, we have
7022 -warnaserror for that.
7024 2004-10-07 Raja R Harinath <rharinath@novell.com>
7026 More DeclSpace.ResolveType avoidance.
7027 * decl.cs (MemberCore.InUnsafe): New property.
7028 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7029 with newly created EmitContext.
7030 (FieldMember.Define): Likewise.
7031 * delegate.cs (Delegate.Define): Likewise.
7032 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7033 only if normal name-lookup fails.
7034 (TypeExpr.DoResolve): Enable error-checking.
7035 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7036 (SizeOf.DoResolve): Likewise.
7037 (ComposedCast.DoResolveAsTypeStep): Likewise.
7038 (StackAlloc.DoResolve): Likewise.
7039 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7040 (Block.Unsafe): New property.
7041 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7042 (Unsafe): Set 'unsafe' flag of contained block.
7043 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7044 (Fixed.Resolve): Likewise.
7045 (Catch.Resolve): Likewise.
7046 (Using.ResolveLocalVariableDecls): Likewise.
7047 (Foreach.Resolve): Likewise.
7049 2004-10-05 John Luke <john.luke@gmail.com>
7051 * cs-parser.jay: add location to error CS0175
7053 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7055 * ecore.cs (Expression.Constantity): Add support for turning null
7058 * const.cs (Const.Define): Allow constants to be reference types
7059 as long as the value is Null.
7061 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7063 * namespace.cs (NamespaceEntry.Using): No matter which warning
7064 level is set, check if this namespace name has already been added.
7066 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7068 * expression.cs: reftype [!=]= null should always use br[true,false].
7071 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7074 * attribute.cs: Enum conversion moved to
7075 GetAttributeArgumentExpression to be applied to the all
7078 2004-10-01 Raja R Harinath <rharinath@novell.com>
7080 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7081 * class.c (TypeContainer.DefineType): Flag error if
7082 base types aren't accessible due to access permissions.
7083 * decl.cs (DeclSpace.ResolveType): Move logic to
7084 Expression.ResolveAsTypeTerminal.
7085 (DeclSpace.ResolveTypeExpr): Thin layer over
7086 Expression.ResolveAsTypeTerminal.
7087 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7088 Refactor code into NestedAccess. Use it.
7089 (DeclSpace.NestedAccess): New.
7090 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7091 argument to silence errors. Check access permissions.
7092 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7093 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7094 (Cast.DoResolve): Likewise.
7095 (New.DoResolve): Likewise.
7096 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7097 (TypeOf.DoResolve): Likewise.
7099 * expression.cs (Invocation.BetterConversion): Return the Type of
7100 the better conversion. Implement section 14.4.2.3 more faithfully.
7101 (Invocation.BetterFunction): Make boolean. Make correspondence to
7102 section 14.4.2.2 explicit.
7103 (Invocation.OverloadResolve): Update.
7104 (Invocation): Remove is_base field.
7105 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7106 (Invocation.Emit): Likewise.
7108 2004-09-27 Raja R Harinath <rharinath@novell.com>
7110 * README: Update to changes.
7112 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7114 * cs-parser.jay: Reverted 642 warning fix.
7116 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7119 * decl.cs (FindMemberWithSameName): Indexer can have more than
7122 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7124 * expression.cs (LocalVariableReference.DoResolveLValue):
7125 Do not report warning 219 for out values.
7126 (EmptyExpression.Null): New member to avoid extra allocations.
7128 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7130 * cs-parser.jay: Fix wrong warning 642 report.
7132 * cs-tokenizer.cs (CheckNextToken): New helper;
7133 Inspect next character if is same as expected.
7135 2004-09-23 Martin Baulig <martin@ximian.com>
7137 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7138 (Convert.ImplicitReferenceConversionExists): Likewise.
7140 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7142 * class.cs (Operator.Define): Add error 448 and 559 report.
7144 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7146 * class.cs (MemberBase.IsTypePermitted): New protected
7147 method for checking error CS0610.
7149 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7151 * class.cs (TypeContainer.HasExplicitLayout): New property
7152 Returns whether container has StructLayout attribute set Explicit.
7153 (FieldMember): New abstract class for consts and fields.
7154 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7155 (Field): Reuse FieldMember.
7157 * const.cs (Const): Reuse FieldMember.
7159 * rootcontext.cs: EmitConstants call moved to class.
7161 2004-09-22 Martin Baulig <martin@ximian.com>
7163 Thanks to Peter Sestoft for this bug report.
7165 * expression.cs (Conditional): If both the `trueExpr' and the
7166 `falseExpr' is a NullLiteral, return a NullLiteral.
7168 2004-09-22 Martin Baulig <martin@ximian.com>
7170 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7171 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7172 for the "get_Current" call.
7174 2004-09-22 Martin Baulig <martin@ximian.com>
7176 Marek and me just fixed one of our oldest bugs: #28562 :-)
7178 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7180 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7181 we're an EnumConstant, just return that.
7182 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7183 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7184 to get the value which'll actually be written into the attribute.
7185 However, we have to use GetValue() to access the attribute's value
7188 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7190 * constant.cs (Constant.IsNegative): New abstract property
7193 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7194 (StackAlloc.DoResolve): Reused IsNegative.
7196 2004-09-21 Martin Baulig <martin@ximian.com>
7198 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7199 if we're used in an iterator, we may be called from different
7202 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7203 we actually have an exception block.
7205 2004-09-20 John Luke <jluke@cfl.rr.com>
7207 * class.cs, cs-parser.jay: Improve the error report for 1520:
7208 report the actual line where the error happens, not where the
7211 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7212 Pass location information that was available elsewhere.
7214 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
7216 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7217 runtime to delay sign assemblies.
7219 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7221 * cs-parser.jay: Do not report the stack trace, this is barely
7224 2004-08-22 John Luke <john.luke@gmail.com>
7226 * driver.cs : check that a resource id is not already used
7227 before adding it, report CS1508 if it is, bug #63637
7229 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7231 * ecore.cs: Removed dead code.
7233 2004-09-18 Marek Safar <marek.safar@seznam.cz>
7235 * class.cs: Do not report warning CS0067 on the interfaces.
7237 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7239 * cs-parser.jay: Add error 504 report.
7241 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7243 * rootcontext.cs: WarningLevel is 4 by default now.
7245 * statement.cs (Fixed.Resolve): Do not null
7248 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7251 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7252 deep search when property is not virtual.
7253 (PropertyExpr.ResolveAccessors): Make one call for both
7256 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7259 * statement.cs: Error 152 report constains also location.
7261 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7264 * const.cs: Explicitly set constant as static.
7266 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7269 * cs-parser.jay: Add error 1017 report.
7271 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7273 Fixed bug #59980, #64224
7274 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7276 * typemanager.cs (IsSpecialMethod): Simplified
7278 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7280 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7281 condition with better params.
7283 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7286 * attribute.cs (Resolve): Property has to have both
7289 2004-09-14 Martin Baulig <martin@ximian.com>
7291 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7293 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7296 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7297 called and is obsolete then this member suppress message
7298 when call is inside next [Obsolete] method or type.
7300 * expression.cs: Use TestObsoleteMethodUsage member.
7302 2004-09-14 Martin Baulig <martin@ximian.com>
7304 * cs-parser.jay: Sync a bit with the GMCS version.
7306 2004-09-14 Martin Baulig <martin@ximian.com>
7308 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7309 (CSharpParser.yacc_verbose_flag): New public field.
7311 * genericparser.cs: Removed.
7313 2004-09-14 Raja R Harinath <rharinath@novell.com>
7315 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7317 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7319 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7321 2004-09-10 Martin Baulig <martin@ximian.com>
7323 Backported my MemberName changes from GMCS into MCS.
7325 - we are now using a special `MemberName' class instead of using
7326 strings; in GMCS, the `MemberName' also contains the type
7329 - changed the grammar rules a bit:
7330 * the old `member_name' is now a `namespace_or_type_name':
7331 The rule is that we use `namespace_or_type_name' everywhere
7332 where we expect either a "member name" (GetEnumerator) or a
7333 "member name" with an explicit interface name
7334 (IEnumerable.GetEnumerator).
7335 In GMCS, the explicit interface name may include type arguments
7336 (IEnumerable<T>.GetEnumerator).
7337 * we use `member_name' instead of just `IDENTIFIER' for
7339 The rule is that we use `member_name' wherever a member may
7340 have type parameters in GMCS.
7342 * decl.cs (MemberName): New public class.
7343 (MemberCore.MemberName): New public readonly field.
7344 (MemberCore.ctor): Take a `MemberName' argument, not a string.
7345 (DeclSpace): Likewise.
7347 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7348 * enum.cs (Enum.ctor): Likewise.
7350 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7352 (AliasEntry.ctor): Take a MemberName, not an Expression.
7353 (AliasEntry.UsingAlias): Likewise.
7355 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7356 (IMethodData.MemberName): Changed type from string to MemberName.
7357 (MemberBase.ExplicitInterfaceName): Likewise.
7358 (AbstractPropertyEventMethod.SetupName): Make this private.
7359 (AbstractPropertyEventMethod.ctor): Added `string prefix'
7360 argument; compute the member name here.
7361 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7362 on the `member.MemberName' and the `prefix'.
7364 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7366 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7367 thus, we get a `MemberName' instead of a `string'. These
7368 declarations may have type parameters in GMCS.
7369 (interface_method_declaration, delegate_declaration): Likewise.
7370 (class_declaration, interface_declaration): Likewise.
7371 (method_header): Use `namespace_or_type_name' instead of
7372 `member_name'. We may be an explicit interface implementation.
7373 (property_declaration, event_declaration): Likewise.
7374 (member_name): This is now just an `IDENTIFIER', not a
7375 `namespace_or_type_name'.
7376 (type_name, interface_type): Removed.
7377 (namespace_or_type_name): Return a MemberName, not an Expression.
7378 (primary_expression): Use `member_name' instead of `IDENTIFIER';
7379 call GetTypeExpression() on the MemberName to get an expression.
7380 (IndexerDeclaration.interface_type): Changed type from string to
7382 (MakeName): Operate on MemberName's instead of string's.
7384 2004-09-13 Raja R Harinath <rharinath@novell.com>
7387 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7388 (NamespaceEntry.Lookup): Add new argument to flag if we want the
7389 lookup to avoid symbols introduced by 'using'.
7390 * rootcontext.cs (NamespaceLookup): Update.
7392 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7394 * class.cs (TypeContainer.DoDefineMembers): Do not call
7395 DefineDefaultConstructor for static classes.
7397 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7399 * attribute.cs (Attribute.Resolve): Add error 653 report.
7401 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7403 (Method.ApplyAttributeBuilder): Add error 685 report.
7404 (Operator.Define): Add error 564 report.
7406 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7408 * expression.cs (Invocation.DoResolve): Add error
7411 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7414 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7416 * class.cs (ConstructorInitializer.Resolve):
7417 Wrong error number (515->516).
7419 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7421 * class.cs (Indexer.Define): Add error 631 report.
7423 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7425 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7427 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7429 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7431 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7433 * cs-parser.jay: Added error CS0241 report.
7435 2004-09-10 Raja R Harinath <rharinath@novell.com>
7437 * cs-parser.jay (fixed_statement): Introduce a scope for the
7438 declaration in the 'fixed' statement.
7440 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7442 * cs-parser.jay: Added CS0230 error report.
7444 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7446 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7448 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7450 * expression.cs (Argument.Resolve): Added error CS0192 and
7453 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7455 C# 2.0 #pragma warning feature
7457 * cs-tokenizer.cs (PreProcessPragma): New method;
7458 Handles #pragma directive.
7460 * report.cs (WarningRegions): New class; Support
7461 class for #pragma warning directive. It tests whether
7462 warning is enabled for a given line.
7464 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7466 * const.cs: Add more descriptive error report, tahnks to
7469 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7471 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7473 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7475 * expression.cs: Apply patch from Ben: Remove dead code from
7476 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7477 as that code just threw an exception anwyays.
7479 * const.cs: Remove the call to the turnintoconstant, for details
7482 * literal.cs: The type of the null-literal is the null type; So
7483 we use a placeholder type (literal.cs:System.Null, defined here)
7486 * expression.cs (Conditional.DoResolve): Remove some old code that
7487 is no longer needed, conversions have been fixed.
7489 (ArrayCreationExpression.DoResolve): Return false if we fail to
7490 resolve the inner expression.
7492 2004-09-07 Raja R Harinath <rharinath@novell.com>
7495 * cs-parser.jay (delegate_declaration): Record a delegate
7496 declaration as a type declaration.
7497 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7499 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7501 * parameter.cs: Do not crash if the type can not be resolved.
7503 * expression.cs: Report errors with unsafe pointers, fixes #64896
7505 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7507 * expression.cs: Pointer arith always needs to do a conv.i
7508 if the operand is a long. fix 65320
7510 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7512 Fixed cs0619-37.cs, cs0619-38.cs
7514 * enum.cs (GetObsoleteAttribute): Removed.
7516 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7517 on Enum member is double staged. The first is tested member
7520 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7522 Fixed #56986, #63631, #65231
7524 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7525 adds member to name container.
7526 (TypeContainer.AddToTypeContainer): New method, adds type to
7528 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7529 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7530 AddOperator): Simplified by reusing AddToMemberContainer.
7531 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7533 (Method.CheckForDuplications): Fixed implementation to test all
7535 (MemberBase): Detection whether member is explicit interface
7536 implementation is now in constructor.
7537 (MemberBase.UpdateMemberName): Handles IndexerName.
7538 (Accessor): Changed to keep also location information.
7539 (AbstractPropertyEventMethod): Is derived from MemberCore.
7540 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7541 will be emited or not.
7542 (PropertyBase.AreAccessorsDuplicateImplementation):
7543 Tests whether accessors are not in collision with some method.
7544 (Operator): Is derived from MethodCore to simplify common
7547 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7549 (DeclSpace.AddToContainer): Adds the member to defined_names
7550 table. It tests for duplications and enclosing name conflicts.
7552 * enum.cs (EnumMember): Clean up to reuse the base structures
7554 2004-09-03 Martin Baulig <martin@ximian.com>
7556 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7557 into TypeContainer, to make partial classes work again.
7559 2004-09-03 Martin Baulig <martin@ximian.com>
7561 * rootcontext.cs (RootContext.V2): Removed.
7563 2004-03-23 Martin Baulig <martin@ximian.com>
7565 * expression.cs (Invocation.OverloadResolve): Added `bool
7566 may_fail' argument and use it instead of the Location.IsNull() hack.
7568 2004-09-03 Martin Baulig <martin@ximian.com>
7570 Merged latest changes into gmcs. Please keep this comment in
7571 here, it makes it easier for me to see what changed in MCS since
7572 the last time I merged.
7574 2004-09-03 Raja R Harinath <rharinath@novell.com>
7577 * expression.cs (BetterConversion): Don't allow either conversion
7578 to be null. Remove redundant implicit conversion test when 'q ==
7579 null' -- when this function is invoked, we already know that the
7580 implicit conversion exists.
7581 (BetterFunction): Assume that 'best' is non-null. Remove
7582 redundant reimplementation of IsApplicable when 'best' is null.
7583 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7584 number of arguments.
7585 (IsAncestralType): Extract from OverloadResolve.
7586 (OverloadResolve): Make robust to the MethodGroupExpr being
7587 unsorted. Implement all the logic of Section 14.5.5.1, and
7588 support overloading of methods from multiple applicable types.
7589 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7591 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7592 (RealError, Warning): Append type of report to related symbol.
7594 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7596 * enum.cs: Fixed CLS-Compliance checks for enum members.
7597 Error tests cs3008-8.cs, cs3014-8.cs
7599 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7601 Fixed bug #62342, #63102
7602 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7603 like ImplementMethod.
7605 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7607 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7610 2004-09-02 Martin Baulig <martin@ximian.com>
7612 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7613 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7616 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7618 C# 2.0 Static classes implemented
7620 * class.cs (TypeContainer): instance_constructors,
7621 initialized_fields, initialized_static_fields,
7622 default_constructor, base_inteface_types are protected to be
7623 accessible from StaticClass.
7624 (TypeContainer.DefineDefaultConstructor): New virtual method
7625 for custom default constructor generating
7626 (StaticClass): New class to handle "Static classes" feature.
7628 * cs-parser.jay: Handle static keyword on class like instance
7631 * driver.cs: Added "/langversion" command line switch with two
7632 options (iso-1, default).
7634 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7636 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7638 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7640 * delegate.cs: Style.
7642 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7644 * delegate.cs: Add seperate instance expr field for miguel.
7646 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7648 * PointerArithmetic (Resolve): make sure we are not doing
7649 pointer arith on void*. Also, make sure we are resolved
7650 by not setting eclass until resolve.
7652 All callers: Make sure that PointerArithmetic gets resolved.
7654 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7656 * ArrayCreation (LookupType): If the type does not resolve
7657 to an array, give an error.
7659 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7661 * statement.cs (Try.Resolve): Fixed bug #64222
7663 2004-08-27 Martin Baulig <martin@ximian.com>
7666 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7669 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7671 * ecore.cs (Constantify): Get underlying type via
7672 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7673 Windows in special cases.
7675 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7677 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7678 for obtaining also private methods.
7679 (GetRemoveMethod): Used GetRemoveMethod (true)
7680 for obtaining also private methods.
7682 2004-08-24 Martin Baulig <martin@ximian.com>
7684 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7685 MethodAttributes.HideBySig for operators.
7687 2004-08-23 Martin Baulig <martin@ximian.com>
7689 Back to the old error reporting system :-)
7691 * report.cs (Message): Removed.
7692 (Report.MessageData, ErrorData, WarningData): Removed.
7693 (Report.Error, Warning): Back to the old system.
7695 2004-08-23 Martin Baulig <martin@ximian.com>
7697 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7699 * class.cs (TypeContainer.ParentContainer): New public virtual
7700 method; replaces the explicit interface implementation.
7701 (ClassPart.ParentContainer): Override.
7703 2004-08-23 Martin Baulig <martin@ximian.com>
7705 * statement.cs (Switch): Added support for constant switches; see
7706 #59428 or test-285.cs.
7708 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7711 * statement.cs (GetEnumeratorFilter): Removed useless
7712 logic because C# specs is strict. GetEnumerator must be
7715 2004-08-22 Martin Baulig <martin@ximian.com>
7717 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7718 a switch and may break, reset the barrier. Fixes #59867.
7720 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7722 CLS-Compliance speed up (~5% for corlib)
7724 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7725 New method. Tests container for CLS-Compliant names
7727 * class.cs (TypeContainer.VerifyClsName): New method.
7728 Checks whether container name is CLS Compliant.
7729 (Constructor): Implements IMethodData.
7731 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7732 low-case table for CLS Compliance test.
7733 (MemberCache.VerifyClsParameterConflict): New method.
7734 Checks method parameters for CS3006 error.
7736 * enum.cs (EnumMember): Is derived from MemberCore.
7737 (Enum.VerifyClsName): Optimized for better performance.
7739 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7741 * report.cs: Renamed Error_T to Error and changed all
7744 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7746 * class.cs (TypeContainer.IndexerArrayList): New inner class
7747 container for indexers.
7748 (TypeContainer.DefaultIndexerName): New constant for default
7749 indexer name. Replaced all "Item" with this constant.
7750 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7752 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7753 DefaultMemberAttribute constructor.
7755 2004-08-05 Martin Baulig <martin@ximian.com>
7757 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7760 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7762 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7763 multi platforms problem.
7765 * compiler.csproj: Included shared files.
7767 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7769 Fix bug 60333, 55971 in the more general way
7770 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7771 Added arg_type argument for constant conversion.
7772 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7774 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7777 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7778 OperatorArrayList, MethodCoreArrayList for typecontainer
7779 containers. Changed class member types to these new types.
7780 (MethodArrayList.DefineMembers): Added test for CS0659.
7782 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7784 * cfold.cs: Synchronize the folding with the code in expression.cs
7785 Binary.DoNumericPromotions for uint operands.
7787 * attribute.cs: Revert patch from Raja, it introduced a regression
7788 while building Blam-1.2.1 (hard to isolate a test case).
7790 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7794 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7796 (MethodCore.parent_method): New member. The method we're overriding
7797 if this is an override method.
7798 (MethodCore.CheckBase): Moved from Method class and made common.
7799 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7801 (MethodCore.CheckForDuplications): New abstract method. For custom
7802 member duplication search in a container
7803 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7804 method and its return type.
7805 (Event.conflict_symbol): New member. Symbol with same name in the
7809 (MemberCache.FindMemberWithSameName): New method. The method
7810 is looking for conflict with inherited symbols.
7812 2004-08-04 Martin Baulig <martin@ximian.com>
7814 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7816 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7818 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7820 * report.cs (Message): New enum for better error, warning reference in
7822 (MessageData): New inner abstract class. It generally handles printing of
7823 error and warning messages.
7824 Removed unused Error, Warning, Message methods.
7826 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7828 Fix for cs0592-8.cs test
7830 (Attributable.ValidAttributeTargets): Made public.
7831 (Attribute.ExplicitTarget): New member for explicit target value.
7832 (Attribute.CheckTargets): Now we translate explicit attribute
7833 target to Target here.
7835 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7837 * ecore.cs (MethodGroupExpr): new IsBase property.
7839 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7841 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7842 rather than an instance expr.
7844 (DelegateCreation.Emit): Use the method group rather than
7845 the instance expression. Also, if you have base.Foo as the
7846 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7848 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7850 (NewDelegate.DoResolve): Only check for the existance of Invoke
7851 if the method is going to be needed. Use MethodGroupExpr.
7853 (NewDelegate.Emit): Remove, DelegateCreation implements this.
7855 * expression.cs: For pointer arith., make sure to use
7856 the size of the type, not the size of the pointer to
7859 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7862 * class.cs (Class): Added error CS0502 test.
7864 2004-08-03 John Luke <jluke@cfl.rr.com>
7865 Raja R Harinath <rharinath@novell.com>
7868 * attribute.cs (Attribute.complained_before): New flag.
7869 (Attribute.ResolveType, Attribute.Resolve),
7870 (Attribute.DefinePInvokeMethod): Set it.
7871 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7873 2004-08-03 Martin Baulig <martin@ximian.com>
7875 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7876 use a user-defined operator; we still need to do numeric
7877 promotions in case one argument is a builtin type and the other
7878 one has an implicit conversion to that type. Fixes #62322.
7880 2004-08-02 Martin Baulig <martin@ximian.com>
7882 * statement.cs (LocalInfo.Flags): Added `IsThis'.
7883 (LocalInfo.IsThis): New public property.
7884 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7886 2004-08-01 Martin Baulig <martin@ximian.com>
7888 * class.cs (TypeContainer.GetClassBases): Don't set the default
7889 here since we may get called from GetPartialBases().
7890 (TypeContainer.DefineType): If GetClassBases() didn't return a
7891 parent, use the default one.
7893 2004-07-30 Duncan Mak <duncan@ximian.com>
7895 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7897 2004-07-30 Martin Baulig <martin@ximian.com>
7899 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7901 * class.cs (SourceMethod): New public class, derive from the
7902 symbol writer's ISourceMethod.
7903 (Method): Use the new symbol writer API.
7905 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7906 as argument and use the new symbol writer.
7909 (SourceFile): Implement the symbol writer's ISourceFile.
7910 (Location.SymbolDocument): Removed.
7911 (Location.SourceFile): New public property.
7913 * symbolwriter.cs: Use the new symbol writer API.
7915 2004-07-30 Raja R Harinath <rharinath@novell.com>
7917 * Makefile (install-local): Remove. Functionality moved to
7920 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
7922 * Makefile: Install mcs.exe.config file together with mcs.exe.
7923 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7924 correct runtime version.
7926 2004-07-25 Martin Baulig <martin@ximian.com>
7929 (TypeContainer.RegisterOrder): Removed, this was unused.
7930 (TypeContainer, interface_order): Removed.
7931 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7932 TypeContainer as argument since we can also be called with a
7933 `PartialContainer' for a partial class/struct/interface.
7934 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7935 of checking whether we're an `Interface' - we could be a
7937 (PartialContainer.Register): Override; call
7938 AddClass()/AddStruct()/AddInterface() on our parent.
7940 * cs-parser.jay (interface_member_declaration): Add things to the
7941 `current_container', not the `current_class'.
7943 * rootcontext.cs (RegisterOrder): The overloaded version which
7944 takes an `Interface' was unused, removed.
7946 * typemanager.cs (TypeManager.LookupInterface): Return a
7947 `TypeContainer', not an `Interface'.
7948 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7949 contain a `PartialContainer' for an interface, so check it's
7950 `Kind' to figure out what it is.
7952 2004-07-25 Martin Baulig <martin@ximian.com>
7954 * class.cs (Class.DefaultTypeAttributes): New public constant.
7955 (Struct.DefaultTypeAttributes): Likewise.
7956 (Interface.DefaultTypeAttributes): Likewise.
7957 (PartialContainer.TypeAttr): Override this and add the
7958 DefaultTypeAttributes.
7960 2004-07-25 Martin Baulig <martin@ximian.com>
7962 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7963 we can just use the `Parent' field instead.
7965 2004-07-25 Martin Baulig <martin@ximian.com>
7967 * class.cs (TypeContainer.Emit): Renamed to EmitType().
7969 2004-07-25 Martin Baulig <martin@ximian.com>
7971 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7972 our parts before defining any methods.
7973 (TypeContainer.VerifyImplements): Make this virtual.
7974 (ClassPart.VerifyImplements): Override and call VerifyImplements()
7975 on our PartialContainer.
7977 2004-07-25 Martin Baulig <martin@ximian.com>
7979 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7981 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7982 argument, we can just use the `Parent' field instead.
7985 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
7986 (MemberBase.DoDefine): Likewise.
7988 2004-07-24 Martin Baulig <martin@ximian.com>
7990 * decl.cs (MemberCore.Parent): New public field.
7991 (DeclSpace.Parent): Moved to MemberCore.
7993 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7994 (MemberBase.ctor): Added TypeContainer argument, pass it to our
7996 (FieldBase, Field, Operator): Likewise.
7997 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7998 (EventField, Event): Likewise.
8000 2004-07-23 Martin Baulig <martin@ximian.com>
8002 * class.cs (PartialContainer): New public class.
8003 (ClassPart): New public class.
8004 (TypeContainer): Added support for partial classes.
8005 (TypeContainer.GetClassBases): Splitted some of the functionality
8006 out into GetNormalBases() and GetPartialBases().
8008 * cs-tokenizer.cs (Token.PARTIAL): New token.
8009 (Tokenizer.consume_identifier): Added some hacks to recognize
8010 `partial', but only if it's immediately followed by `class',
8011 `struct' or `interface'.
8013 * cs-parser.jay: Added support for partial clases.
8015 2004-07-23 Martin Baulig <martin@ximian.com>
8017 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8018 a `DeclSpace' and also made it readonly.
8019 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8020 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8021 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8023 * cs-parser.jay: Pass the `current_class', not the
8024 `current_container' (at the moment, this is still the same thing)
8025 to a new Method, Property, Event, Indexer or Constructor.
8027 2004-07-23 Martin Baulig <martin@ximian.com>
8029 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8030 and removed the `current_interface' one.
8031 (struct_declaration, class_declaration, interface_declaration):
8032 Set `current_class' to the newly created class/struct/interface;
8033 set their `Bases' and call Register() before parsing their body.
8035 2004-07-23 Martin Baulig <martin@ximian.com>
8037 * class.cs (Kind): New public enum.
8038 (TypeContainer): Made this class abstract.
8039 (TypeContainer.Kind): New public readonly field.
8040 (TypeContainer.CheckDef): New public method; moved here from
8042 (TypeContainer.Register): New public abstract method.
8043 (TypeContainer.GetPendingImplementations): New public abstract
8045 (TypeContainer.GetClassBases): Removed the `is_class' and
8046 `is_iface' parameters.
8047 (TypeContainer.DefineNestedTypes): Formerly known as
8049 (ClassOrStruct): Made this class abstract.
8051 * tree.cs (RootTypes): New public type.
8053 2004-07-20 Martin Baulig <martin@ximian.com>
8055 * tree.cs (Tree.RecordNamespace): Removed.
8056 (Tree.Namespaces): Removed.
8058 * rootcontext.cs (RootContext.IsNamespace): Removed.
8060 * cs-parser.jay (namespace_declaration): Just create a new
8061 NamespaceEntry here.
8063 2004-07-20 Martin Baulig <martin@ximian.com>
8065 * statement.cs (ExceptionStatement): New abstract class. This is
8066 now used as a base class for everyone who's using `finally'.
8067 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8068 our local variables before using them.
8070 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8071 virtual method. This is used by Yield.Resolve() to "steal" an
8072 outer block's `finally' clauses.
8073 (FlowBranchingException): The .ctor now takes an ExceptionStatement
8076 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8077 version which takes an ExceptionStatement. This version must be
8078 used to create exception branchings.
8081 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8082 (Iterator.EmitMoveNext): Added exception support; protect the
8083 block with a `fault' clause, properly handle 'finally' clauses.
8084 (Iterator.EmitDispose): Run all the `finally' clauses here.
8086 2004-07-20 Martin Baulig <martin@ximian.com>
8088 * iterator.cs: This is the first of a set of changes in the
8089 iterator code. Match the spec more closely: if we're an
8090 IEnumerable, then GetEnumerator() must be called. The first time
8091 GetEnumerator() is called, it returns the current instance; all
8092 subsequent invocations (if any) must create a copy.
8094 2004-07-19 Miguel de Icaza <miguel@ximian.com>
8096 * expression.cs: Resolve the constant expression before returning
8099 2004-07-19 Martin Baulig <martin@ximian.com>
8101 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8102 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8103 the return type of the new EmitContext.
8105 2004-07-18 Martin Baulig <martin@ximian.com>
8107 * class.cs (Property.Define): Fix iterators.
8109 * iterators.cs (Iterator.Define): Moved the
8110 `container.AddInterator (this)' call here from the .ctor; only do
8111 it if we resolved successfully.
8113 2004-07-17 Miguel de Icaza <miguel@ximian.com>
8115 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8116 `true' for preprocessing directives that we parse. The return
8117 value indicates whether we should return to regular tokenizing or
8118 not, not whether it was parsed successfully.
8120 In the past if we were in: #if false ... #line #endif, we would
8121 resume parsing after `#line'. See bug 61604.
8123 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8124 building: IsEnumType should return true only for enums, not for
8125 enums or System.Enum itself. This fixes #61593.
8127 Likely what happened is that corlib was wrong: mcs depended on
8128 this bug in some places. The bug got fixed, we had to add the
8129 hack, which caused bug 61593.
8131 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8132 that was a workaround for the older conditions.
8134 2004-07-16 Ben Maurer <bmaurer@ximian.com>
8136 * assign.cs: IAssignMethod has a new interface, as documented
8137 inline. All assignment code now uses this new api.
8139 * ecore.cs, expression.cs: All classes which implement
8140 IAssignMethod now use the new interface.
8142 * expression.cs (Invocation): add a hack to EmitCall so that
8143 IndexerAccess can be the target of a compound assignment without
8144 evaluating its arguments twice.
8146 * statement.cs: Handle changes in Invocation api.
8148 2004-07-16 Martin Baulig <martin@ximian.com>
8150 * iterators.cs: Rewrote this. We're now using one single Proxy
8151 class for both the IEnumerable and the IEnumerator interface and
8152 `Iterator' derives from Class so we can use the high-level API.
8154 * class.cs (TypeContainer.AddIterator): New method.
8155 (TypeContainer.DoDefineType): New protected virtual method, which
8156 is called from DefineType().
8157 (TypeContainer.DoDefineMembers): Call DefineType() and
8158 DefineMembers() on all our iterators.
8159 (TypeContainer.Emit): Call Emit() on all our iterators.
8160 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8162 * codegen.cs (EmitContext.CurrentIterator): New public field.
8164 2004-07-15 Martin Baulig <martin@ximian.com>
8167 (TypeManager.not_supported_exception_type): New type.
8169 2004-07-14 Martin Baulig <martin@ximian.com>
8171 * iterators.cs: Use real error numbers.
8173 2004-07-14 Martin Baulig <martin@ximian.com>
8175 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8176 requires this to be a System.Collection.IEnumerable and not a
8177 class implementing that interface.
8178 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8180 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8182 * class.cs: Fixed previous fix, it broke some error tests.
8184 2004-07-12 Martin Baulig <martin@ximian.com>
8186 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8189 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8191 * assign.cs (LocalTemporary): Add new argument: is_address,If
8192 `is_address' is true, then the value that we store is the address
8193 to the real value, and not the value itself.
8195 * ecore.cs (PropertyExpr): use the new local temporary
8196 stuff to allow us to handle X.Y += z (where X is a struct)
8198 2004-07-08 Martin Baulig <martin@ximian.com>
8200 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8201 not always return, just like we're doing in Using.Resolve().
8203 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8205 * cs-parser.jay (fixed_statement): flag this as Pinned.
8207 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8209 * typemanager.cs (TypeManager): Removed MakePinned method, this
8210 mechanism is replaced with the .NET 2.x compatible mechanism of
8211 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8213 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8214 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8215 `IsFixed' property which has a different meaning.
8217 2004-07-02 Raja R Harinath <rharinath@novell.com>
8219 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8220 visible from inside a nested class, not just the names of the
8221 immediately enclosing class.
8224 2004-06-24 Raja R Harinath <rharinath@novell.com>
8226 * expression.cs (BetterConversion): Remove buggy special-case
8227 handling of "implicit constant expression conversions". At this
8228 point, we already know that the conversion is possible -- we're
8229 only checking to see which is better.
8231 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8233 * cs-parser.jay: Added error CS0210 test.
8235 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8237 * cs-parser.jay: Added error CS0134 test.
8239 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8242 * cs-parser.jay: Added error CS0145 test.
8244 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8246 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8248 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8250 * expression.cs (StackAlloc.Resolve): The argument may not
8251 be a constant; deal with this case.
8253 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8255 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8256 GetIndexerAttributeValue.
8257 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8259 * class.cs (Indexer.Define): Added error tests for CS0415,
8262 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8264 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8267 2004-06-23 Martin Baulig <martin@ximian.com>
8269 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8270 neither return nor throw, reset the barrier as well. Fixes #60457.
8272 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8274 * class.cs : EventAttributes is now set to None by default.
8275 This fixes bug #60459.
8277 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8280 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8281 Don't throw exception but return null (it's sufficient now).
8283 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8285 * typemanager.cs (GetArgumentTypes): Faster implementation.
8287 2004-06-18 Martin Baulig <martin@ximian.com>
8289 * attribute.cs (Attribute.Resolve): Check whether we're an
8290 EmptyCast which a Constant child. Fixes #60333.
8292 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8294 * statement.cs (EmitCollectionForeach): Account for the fact that
8295 not all valuetypes are in areas which we can take the address of.
8296 For these variables, we store to a temporary variable. Also, make
8297 sure that we dont emit a `callvirt' on a valuetype method.
8299 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8301 * expression.cs (StackAlloc.DoReSolve): Added test for
8302 negative parameter (CS0247).
8304 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8307 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8309 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8312 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8315 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8317 Fix bug #58254 & cs1555.cs, cs1556.cs
8318 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8320 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8322 * cs-parser.jay: Added error CS1669 test for indexers.
8324 2004-06-11 Martin Baulig <martin@ximian.com>
8326 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8327 call this twice: for params and varargs methods.
8329 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8332 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8334 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8336 * attribute.cs (Attribute.GetValidTargets): Made public.
8339 (AbstractPropertyEventMethod): New class for better code sharing.
8340 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8342 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8344 2004-06-11 Raja R Harinath <rharinath@novell.com>
8347 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8348 that the call to Resolve is part of a MemberAccess.
8349 (Expression.Resolve): Use it for SimpleName resolution.
8350 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8351 Add 'intermediate' boolean argument.
8352 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
8353 error message when the SimpleName can be resolved ambiguously
8354 between an expression and a type.
8355 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8357 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8358 call on the left-side.
8360 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8363 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8365 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8367 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8369 2004-06-11 Martin Baulig <martin@ximian.com>
8371 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8372 varargs methods if applicable.
8374 2004-06-11 Martin Baulig <martin@ximian.com>
8376 * expression.cs (Invocation.EmitCall): Don't use
8377 `method.CallingConvention == CallingConventions.VarArgs' since the
8378 method could also have `CallingConventions.HasThis'.
8380 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8382 * class.cs (Event.GetSignatureForError): Implemented.
8383 Fixed crash in error test cs3010.cs
8385 2004-06-10 Miguel de Icaza <miguel@ximian.com>
8387 * cs-tokenizer.cs: Change the way we track __arglist to be
8388 consistent with the other keywords.
8390 2004-06-09 Miguel de Icaza <miguel@ximian.com>
8392 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8395 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
8397 * codegen.cs: Check that all referenced assemblies have a strongname
8398 before strongnaming the compiled assembly. If not report error CS1577.
8399 Fix bug #56563. Patch by Jackson Harper.
8400 * typemanager.cs: Added a method to return all referenced assemblies.
8401 Fix bug #56563. Patch by Jackson Harper.
8403 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8406 (Method.ApplyAttributeBuilder): Moved and added conditional
8407 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8410 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8412 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8415 * class.cs: (EventField.attribute_targets): Changed default target.
8417 2004-06-08 Martin Baulig <martin@ximian.com>
8419 * expression.cs (Invocation.EmitCall): Enable varargs methods.
8421 2004-06-08 Martin Baulig <martin@ximian.com>
8423 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8425 2004-06-07 Martin Baulig <martin@ximian.com>
8427 Added support for varargs methods.
8429 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8432 * cs-parser.jay: Added support for `__arglist'.
8434 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8436 * expression.cs (Argument.AType): Added `ArgList'.
8437 (Invocation): Added support for varargs methods.
8438 (ArglistAccess): New public class.
8439 (Arglist): New public class.
8441 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8443 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
8444 a method's top-level block if the method has varargs.
8446 * support.cs (ReflectionParameters, InternalParameters): Added
8447 support for varargs methods.
8449 2004-06-07 Miguel de Icaza <miguel@ximian.com>
8451 * class.cs: Provide location in indexer error report.
8453 * driver.cs: Use standard names.
8455 * namespace.cs: Catch the use of using after a namespace has been
8456 declared also on using aliases.
8458 2004-06-03 Raja R Harinath <rharinath@novell.com>
8461 * typemanager.cs (closure_private_ok, closure_invocation_type)
8462 (closure_qualifier_type, closure_invocation_assembly)
8463 (FilterWithClosure): Move to ...
8464 (Closure): New internal nested class.
8465 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8466 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8467 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8468 (MemberLookup, MemberLookupFailed): Use it.
8469 * expression.cs (New.DoResolve): Treat the lookup for the
8470 constructor as being qualified by the 'new'ed type.
8471 (Indexers.GetIndexersForTypeOrInterface): Update.
8473 2004-06-03 Marek Safar <marek.safar@seznam.cz>
8476 (GetConditionalAttributeValue): New method. Returns
8477 condition of ConditionalAttribute.
8478 (SearchMulti): New method. Returns all attributes of type 't'.
8479 Use it when attribute is AllowMultiple = true.
8480 (IsConditionalMethodExcluded): New method.
8483 (Method.IsExcluded): Implemented. Returns true if method has conditional
8484 attribute and the conditions is not defined (method is excluded).
8485 (IMethodData): Extended interface for ConditionalAttribute support.
8486 (PropertyMethod.IsExcluded): Implemented.
8489 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8492 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8495 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
8497 * expression.cs (ArrayCreationExpression): Make this just an
8498 `expression'. It can't be a statement, so the code here was
8501 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8504 * typemanager.cs (GetFullNameSignature): New method for
8507 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8510 * class.cs (MemberBase.GetSignatureForError): New virtual method.
8511 Use this method when MethodBuilder is null.
8512 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8513 Added test for error CS0626 (MONO reports error for this situation).
8514 (IMethodData.GetSignatureForError): Extended interface.
8516 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8519 (AttributeTester.GetObsoleteAttribute): Returns instance of
8520 ObsoleteAttribute when type is obsolete.
8523 (TypeContainer.VerifyObsoleteAttribute): Override.
8524 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8525 (MethodCode.VerifyObsoleteAttribute): Override.
8526 (MemberBase.VerifyObsoleteAttribute): Override.
8529 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8530 and report proper error.
8533 Delegate.VerifyObsoleteAttribute): Override.
8536 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8537 and report proper error.
8538 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8541 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8545 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8546 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8547 Added test for ObsoleteAttribute.
8550 (Catch): Derived from Statement.
8552 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8554 Fixed bug #59071 & cs0160.cs
8556 * statement.cs (Try.Resolve): Check here whether order of catch
8557 clauses matches their dependencies.
8559 2004-05-31 Miguel de Icaza <miguel@ximian.com>
8561 * Reverted patch to namespace.cs (Use lookuptypedirect). This
8562 caused a regression: #59343. Referencing nested classes from an
8563 assembly stopped working.
8565 2004-05-31 Martin Baulig <martin@ximian.com>
8567 MCS is now frozen for beta 2.
8569 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8571 * convert.cs: add a trivial cache for overload operator resolution.
8573 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8575 * decl.cs: If possible, use lookuptypedirect here. We can only do
8576 this if there is no `.' after the namespace. Avoids using
8577 LookupType, which does lots of slow processing.
8578 (FindNestedType) New method, does what it says :-).
8579 * namespace.cs: use LookupTypeDirect.
8580 * rootcontext.cs: use membercache, if possible.
8581 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8583 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8586 According to the spec,
8588 In a member access of the form E.I, if E is a single identifier,
8589 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8590 field, property, localvariable, or parameter with the same type as
8591 the meaning of E as a type-name (§3.8), then both possible
8592 meanings of E are permitted.
8594 We did not check that E as a simple-name had the same type as E as
8597 This trivial check gives us 5-7% on bootstrap time.
8599 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8601 * expression.cs (Invocation.OverloadResolve): Avoid the
8602 use of hashtables and boxing here by allocating on demand.
8604 2004-05-30 Martin Baulig <martin@ximian.com>
8606 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8607 we're doing a silent lookup. Don't try to lookup nested types in
8608 TypeManager.object_type (thanks to Ben Maurer).
8610 2004-05-30 Martin Baulig <martin@ximian.com>
8612 Committing a patch from Ben Maurer.
8614 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8616 2004-05-29 Martin Baulig <martin@ximian.com>
8618 * class.cs (IMethodData.ShouldIgnore): New method.
8620 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8621 `Location' argument, we don't need it anywhere. Use
8622 `IMethodData.ShouldIgnore ()' instead of
8623 `MethodData.GetMethodFlags ()'.
8624 (TypeManager.AddMethod): Removed.
8625 (TypeManager.AddMethod2): Renamed to AddMethod.
8627 2004-05-29 Martin Baulig <martin@ximian.com>
8629 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8631 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8632 converting from a class type S to an interface type and we already
8633 have an object on the stack, don't box it again. Fixes #52578.
8635 2004-05-29 Martin Baulig <martin@ximian.com>
8637 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8638 Added support for `params' parameters. Fixes #59267.
8640 2004-05-29 Martin Baulig <martin@ximian.com>
8642 * literal.cs (NullPointer): Provide a private .ctor which sets
8643 `type' to TypeManager.object_type. Fixes #59048.
8645 2004-05-29 Martin Baulig <martin@ximian.com>
8647 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8648 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8650 * ecore.cs (EventExpr.instance_expr): Make the field private.
8652 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8654 Fixed bug #50080 & cs0214-2.cs
8655 * expression.cs (Cast.DoResolve): Check unsafe context here.
8657 * statement.cs (Resolve.DoResolve): Likewise.
8659 2004-05-26 Martin Baulig <martin@ximian.com>
8661 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8663 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8664 (RootContext.LookupType): Pass down the `silent' flag.
8666 2004-05-25 Martin Baulig <martin@ximian.com>
8669 (MethodGroupExpr.IdenticalTypeName): New public property.
8670 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8671 expression actually refers to a type.
8673 2004-05-25 Martin Baulig <martin@ximian.com>
8675 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8676 for #56176 and made it actually work.
8678 2004-05-25 Martin Baulig <martin@ximian.com>
8680 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8681 (FieldExpr, PropertyExpr): Override and implement
8682 CacheTemporaries. Fixes #52279.
8684 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8686 * location.cs: In the new compiler listing a file twice is a
8687 warning, not an error.
8689 2004-05-24 Martin Baulig <martin@ximian.com>
8691 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8692 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8694 2004-05-24 Martin Baulig <martin@ximian.com>
8696 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8697 walking the `using' list. Fixes #53921.
8699 2004-05-24 Martin Baulig <martin@ximian.com>
8701 * const.cs (Const.LookupConstantValue): Added support for
8702 EmptyCast's; fixes #55251.
8704 2004-05-24 Martin Baulig <martin@ximian.com>
8706 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8707 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8708 which does the CS0135 check. The reason is that we first need to
8709 check whether the variable actually exists.
8711 2004-05-24 Martin Baulig <martin@ximian.com>
8713 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8714 than RootContext.LookupType() to find the explicit interface
8717 2004-05-24 Raja R Harinath <rharinath@novell.com>
8719 * Makefile: Simplify. Use executable.make.
8720 * mcs.exe.sources: New file. List of sources of mcs.exe.
8722 2004-05-24 Anders Carlsson <andersca@gnome.org>
8726 Use the invariant culture when doing String.Compare for CLS case
8729 2004-05-23 Martin Baulig <martin@ximian.com>
8731 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8732 don't have any dots. Fixes #52622, added cs0246-8.cs.
8734 * namespace.cs (NamespaceEntry.Lookup): Likewise.
8736 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8738 * class.cs (MemberBase.Define): Reuse MemberType member for
8739 resolved type. Other methods can use it too.
8741 2004-05-23 Martin Baulig <martin@ximian.com>
8743 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8744 the variable also exists in the current block (otherwise, we need
8745 to report a CS0103). Fixes #58670.
8747 2004-05-23 Martin Baulig <martin@ximian.com>
8749 * flowanalysis.cs (Reachability.Reachable): Compute this
8750 on-the-fly rather than storing it as a field.
8752 2004-05-23 Martin Baulig <martin@ximian.com>
8754 * flowanalysis.cs (Reachability.And): Manually compute the
8755 resulting `barrier' from the reachability.
8757 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8760 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8761 instance of ObsoleteAttribute when symbol is obsolete.
8764 (IMethodData): Extended interface for ObsoleteAttribute support.
8766 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8768 * attribute.cs: Fix bug #55970
8770 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8774 (GetObsoleteAttribute): New method. Creates the instance of
8776 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8777 ObsoleteAttribute when member is obsolete.
8778 (AttributeTester.Report_ObsoleteMessage): Common method for
8779 Obsolete error/warning reporting.
8782 (TypeContainer.base_classs_type): New member for storing parent type.
8785 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8786 for this MemberCore.
8788 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8790 * attribute.cs, const.cs: Fix bug #58590
8792 2004-05-21 Martin Baulig <martin@ximian.com>
8794 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8795 out parameters if the end of the method is unreachable. Fixes
8798 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8800 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8801 Hari was right, why extra method.
8803 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8805 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8807 2004-05-20 Martin Baulig <martin@ximian.com>
8809 Merged this back from gmcs to keep the differences to a minumum.
8811 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8812 instead of a Declspace.
8813 (Attribute.ResolveType): Likewise.
8814 (Attributes.Search): Likewise.
8815 (Attributes.Contains): Likewise.
8816 (Attributes.GetClsCompliantAttribute): Likewise.
8818 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8820 (MethodData.ApplyAttributes): Take an EmitContext instead of a
8823 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8825 Fix bug #58688 (MCS does not report error when the same attribute
8828 * attribute.cs (Attribute.Emit): Distinction between null and default.
8830 2004-05-19 Raja R Harinath <rharinath@novell.com>
8832 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8833 of a top-level attribute without an attribute target.
8834 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8836 (Attribute.Conditional_GetConditionName),
8837 (Attribute.Obsolete_GetObsoleteMessage): Update.
8838 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8839 part of ScanForIndexerName.
8840 (Attribute.CanIgnoreInvalidAttribute): New function.
8841 (Attribute.ScanForIndexerName): Move to ...
8842 (Attributes.ScanForIndexerName): ... here.
8843 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8844 (Attributes.Search): New internal variant that can choose not to
8845 complain if types aren't resolved. The original signature now
8847 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8848 complaints suppressed.
8849 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8850 only if it not useful.
8851 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8852 top-level for attributes that are shared between the assembly
8853 and a top-level class.
8854 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8855 * class.cs: Update to reflect changes.
8856 (DefineIndexers): Fuse loops.
8857 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
8858 a couple more variants of attribute names.
8860 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8862 Fix bug #52585 (Implemented explicit attribute declaration)
8865 (Attributable.ValidAttributeTargets): New abstract method. It gets
8866 list of valid attribute targets for explicit target declaration.
8867 (Attribute.Target): It holds target itself.
8868 (AttributeSection): Removed.
8869 (Attribute.CheckTargets): New method. It checks whether attribute
8870 target is valid for the current element.
8873 (EventProperty): New class. For events that are declared like
8874 property (with add and remove accessors).
8875 (EventField): New class. For events that are declared like field.
8878 * cs-parser.jay: Implemented explicit attribute target declaration.
8880 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
8881 Override ValidAttributeTargets.
8884 (ReturnParameter): Class for applying custom attributes on
8886 (ParameterAtribute): New class. Class for applying custom
8887 attributes on the parameter type.
8889 2004-05-17 Miguel de Icaza <miguel@ximian.com>
8891 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8894 (Method): Allow UNSAFE here.
8896 * modifiers.cs: Support unsafe reporting.
8898 2004-05-17 Marek Safar <marek.safar@seznam.cz>
8900 * decl.cs: Fix bug #58478.
8902 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8904 * statement.cs: When checking for unreachable code on an EmptyStatement,
8905 set the location. Fixes bug #58488.
8907 2004-05-13 Miguel de Icaza <miguel@ximian.com>
8909 * driver.cs: Add -pkg handling.
8911 From Gonzalo: UseShelLExecute=false
8913 2004-05-12 Marek Safar <marek.safar@seznam.cz>
8916 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8918 (Attribute.IsClsCompliaceRequired): Moved to base for better
8920 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8921 when attribute is AttributeUsageAttribute.
8922 (Attribute.GetValidTargets): Simplified.
8923 (Attribute.GetAttributeUsage): New method returns AttributeUsage
8924 attribute for this type.
8925 (Attribute.ApplyAttributes): Method renamed to Emit and make
8927 (GlobalAttributeSection): New class for special handling of global
8928 attributes (assembly, module).
8929 (AttributeSection.Emit): New method.
8931 * class.cs: Implemented Attributable abstract methods.
8932 (MethodCore.LabelParameters): Moved to Parameter class.
8933 (Accessor): Is back simple class.
8934 (PropertyMethod): Implemented Attributable abstract class.
8935 (DelegateMethod): Implemented Attributable abstract class.
8936 (Event): New constructor for disctintion between normal Event
8937 and Event with accessors.
8939 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8941 * codegen.cs, const.cs, decl.cs, delegate.cs:
8942 (CommonAssemblyModulClass): Implemented Attributable abstract class
8945 * enum.cs: Implement IAttributeSupport interface.
8946 (EnumMember): New class for emum members. Implemented Attributable
8950 (ParameterBase): Is abstract.
8951 (ReturnParameter): New class for easier [return:] attribute handling.
8953 * typemanager.cs: Removed builder_to_attr.
8955 2004-05-11 Raja R Harinath <rharinath@novell.com>
8958 * attribute.cs (Attribute.GetPositionalValue): New function.
8959 * class.cs (TypeContainer.VerifyMembers): New function.
8960 (TypeContainer.Emit): Use it.
8961 (ClassOrStruct): New base class for Class and Struct.
8962 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
8963 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8965 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8966 then each non-static field should have a FieldOffset attribute.
8967 Otherwise, none of the fields should have a FieldOffset attribute.
8968 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
8969 and FieldOffset attributes.
8970 * typemanager.cs (TypeManager.struct_layout_attribute_type)
8971 (TypeManager.field_offset_attribute_type): New core types.
8972 (TypeManager.InitCoreTypes): Initialize them.
8974 2004-05-11 Michal Moskal <malekith@pld-linux.org>
8976 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8977 Return correct type.
8980 2004-05-09 Miguel de Icaza <miguel@ximian.com>
8982 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8983 be implicitly converted to ulong.
8985 * expression.cs: The logic for allowing operator &, | and ^ worked
8986 was wrong, it worked before because we did not report an error in
8987 an else branch. Fixes 57895.
8989 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8990 allow volatile fields to be reference types.
8992 2004-05-07 Miguel de Icaza <miguel@ximian.com>
8994 * driver.cs: Add support for /debug-
8996 2004-05-07 Raja R Harinath <rharinath@novell.com>
8998 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
8999 Add a 'complain' parameter to silence errors.
9000 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9001 silently overlooked type-resolutions.
9002 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9004 (Attributes.Search): New function.
9005 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9006 (Attributes.GetAttributeFullName): Remove hack.
9007 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9008 Update to reflect changes.
9009 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9010 Use Attributes.Search instead of nested loops.
9012 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9015 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9016 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9017 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9019 * report.cs: (Report.Warning): Renamed to Warning_T because of
9020 parameter collision.
9022 2004-05-05 Raja R Harinath <rharinath@novell.com>
9024 * expression.cs (MemberAccess.ResolveMemberAccess):
9025 Exit with non-zero status after Report.Error.
9026 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9028 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9030 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9032 * support.cs: Don't hang when the file is empty.
9034 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9036 * support.cs: In SeekableStreamReader, compute the preamble size of the
9037 underlying stream. Position changes should take into account that initial
9040 2004-05-03 Todd Berman <tberman@sevenl.net>
9042 * driver.cs: remove unused GetSysVersion function.
9044 2004-05-03 Todd Berman <tberman@sevenl.net>
9046 * driver.cs: Remove the hack from saturday, as well as the hack
9047 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9048 link_paths to get that bit proper.
9050 2004-05-01 Todd Berman <tberman@sevenl.net>
9052 * driver.cs: Try a LoadFrom before a Load, this checks the current
9053 path. This is currently a bug in mono that is be fixed, however, this
9054 provides a workaround for now. This will be removed when the bug
9057 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9059 * CryptoConvert.cs: Updated to latest version. Fix issue with
9060 incomplete key pairs (#57941).
9062 2004-05-01 Todd Berman <tberman@sevenl.net>
9064 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9067 2004-04-30 Jackson Harper <jackson@ximian.com>
9069 * codegen.cs: Open keys readonly.
9071 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9073 * typemanager.cs: don't report cyclic struct layout when a struct
9074 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9075 which has 2 Pango.Rectangle fields.
9077 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9079 * expression.cs: Handle IntPtr comparisons with IL code
9080 rather than a method call.
9082 2004-04-29 Martin Baulig <martin@ximian.com>
9084 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9085 the list of PropertyInfo's in class hierarchy and find the
9086 accessor. Fixes #56013.
9088 2004-04-29 Martin Baulig <martin@ximian.com>
9090 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9092 2004-04-29 Martin Baulig <martin@ximian.com>
9094 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9096 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9098 2004-04-29 Martin Baulig <martin@ximian.com>
9100 * class.cs (ConstructorInitializer.Resolve): Check whether the
9101 parent .ctor is accessible. Fixes #52146.
9103 2004-04-29 Martin Baulig <martin@ximian.com>
9105 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9107 * statement.cs (Using.EmitLocalVariableDecls): Use
9108 TypeManager.idisposable_type, not typeof (IDisposable).
9109 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9111 2004-04-29 Martin Baulig <martin@ximian.com>
9113 * class.cs (Event.Define): Don't emit the field and don't set
9114 RTSpecialName and SpecialName for events on interfaces. Fixes
9117 2004-04-29 Raja R Harinath <rharinath@novell.com>
9119 Refactor Attribute.ApplyAttributes.
9120 * attribute.cs (Attributable): New base class for objects that can
9121 have Attributes applied on them.
9122 (Attribute): Make AttributeUsage fields public.
9123 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9124 (Attribute.IsInternalCall): New property.
9125 (Attribute.UsageAttr): Convert to a public read-only property.
9126 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9127 (Attribute.ResolveType, Attribute.Resolve)
9128 (Attribute.ScanForIndexerName): Update to reflect changes.
9129 (Attribute.CheckAttributeTarget): Re-format.
9130 (Attribute.ApplyAttributes): Refactor, to various
9131 Attributable.ApplyAttributeBuilder methods.
9132 * decl.cs (MemberCore): Make Attributable.
9133 * class.cs (Accessor): Make Attributable.
9134 (MethodData.ApplyAttributes): Use proper attribute types, not
9136 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9137 (TypeContainer.ApplyAttributeBuilder)
9138 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9139 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9140 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9141 (Operator.ApplyAttributeBuilder): New factored-out methods.
9142 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9143 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9144 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9145 * parameter.cs (ParameterBase): New Attributable base class
9146 that can also represent Return types.
9147 (Parameter): Update to the changes.
9149 2004-04-29 Jackson Harper <jackson@ximian.com>
9151 * driver.cs: Prefer the corlib system version when looking for
9152 assemblies in the GAC. This is still a hack, but its a better hack
9155 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9157 * decl.cs, enum.cs: Improved error 3005 reporting.
9159 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9160 (related_symbols): New private member for list of symbols
9161 related to reported error/warning.
9163 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9165 2004-04-29 Martin Baulig <martin@ximian.com>
9167 * ecore.cs (Expression.Constantify): If we're an enum and
9168 TypeManager.TypeToCoreType() doesn't give us another type, use
9169 t.UnderlyingSystemType. Fixes #56178.
9171 2004-04-29 Martin Baulig <martin@ximian.com>
9173 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9174 interfaces and for each interface, only add members directly
9175 declared in that interface. Fixes #53255.
9177 2004-04-28 Martin Baulig <martin@ximian.com>
9179 * expression.cs (ConditionalLogicalOperator): Use a temporary
9180 variable for `left' to avoid that we evaluate it more than once;
9183 2004-04-28 Martin Baulig <martin@ximian.com>
9185 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9188 2004-04-28 Martin Baulig <martin@ximian.com>
9190 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9193 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9194 whether the type is not void (CS1547).
9196 2004-04-28 Martin Baulig <martin@ximian.com>
9198 * expression.cs (Unary.DoResolveLValue): Override this and report
9199 CS0131 for anything but Operator.Indirection.
9201 2004-04-28 Martin Baulig <martin@ximian.com>
9203 Committing a patch from Ben Maurer; see bug #50820.
9205 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9208 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9211 2004-04-28 Martin Baulig <martin@ximian.com>
9213 Committing a patch from Ben Maurer; see bug #50820.
9215 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9218 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9221 2004-04-28 Martin Baulig <martin@ximian.com>
9223 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9224 (Block.AddLabel): Call DoLookupLabel() to only search in the
9227 2004-04-28 Martin Baulig <martin@ximian.com>
9229 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9230 comparing StringConstants and NullLiterals in Equality and Inequality.
9232 2004-04-28 Jackson Harper <jackson@ximian.com>
9234 * driver.cs: Attempt to load referenced assemblies from the
9235 GAC. This is the quick and dirty version of this method that
9236 doesnt take into account versions and just takes the first
9237 canidate found. Will be good enough for now as we will not have more
9238 then one version installed into the GAC until I update this method.
9240 2004-04-28 Martin Baulig <martin@ximian.com>
9242 * typemanager.cs (TypeManager.CheckStructCycles): New public
9243 static method to check for cycles in the struct layout.
9245 * rootcontext.cs (RootContext.PopulateTypes): Call
9246 TypeManager.CheckStructCycles() for each TypeContainer.
9247 [Note: We only need to visit each type once.]
9249 2004-04-28 Martin Baulig <martin@ximian.com>
9251 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9253 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9254 success and added `out object value'. Use a `bool resolved' field
9255 to check whether we've already been called rather than
9256 `ConstantValue != null' since this breaks for NullLiterals.
9258 2004-04-28 Raja R Harinath <rharinath@novell.com>
9260 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9261 setting of this flag, since the 'set' method may be non-public.
9263 2004-04-28 Raja R Harinath <rharinath@novell.com>
9265 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9266 check on current_vector.Block.
9268 2004-04-27 Martin Baulig <martin@ximian.com>
9270 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9271 a field initializer. Fixes #56459.
9273 2004-04-27 Martin Baulig <martin@ximian.com>
9275 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9276 we're not attempting to use an indexer. Fixes #52154.
9278 2004-04-27 Martin Baulig <martin@ximian.com>
9280 * statement.cs (Return): Don't create a return label if we don't
9281 need it; reverts my change from January 20th. Thanks to Ben
9284 2004-04-27 Martin Baulig <martin@ximian.com>
9286 According to the spec, `goto' can only leave a nested scope, but
9289 * statement.cs (Block.LookupLabel): Only lookup in the current
9290 block, don't recurse into parent or child blocks.
9291 (Block.AddLabel): Check in parent and child blocks, report
9292 CS0140/CS0158 if we find a duplicate.
9293 (Block): Removed this indexer for label lookups.
9294 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9295 this already does the error reporting for us.
9298 (FlowBranching.UsageVector.Block): New public variable; may be null.
9299 (FlowBranching.CreateSibling): Added `Block' argument.
9300 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9301 label for the target of a `goto' and check whether we're not
9302 leaving a `finally'.
9304 2004-04-27 Martin Baulig <martin@ximian.com>
9306 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9307 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9310 2004-04-27 Martin Baulig <martin@ximian.com>
9312 * statement.cs (Block.AddLabel): Also check for implicit blocks
9313 and added a CS0158 check.
9315 2004-04-27 Martin Baulig <martin@ximian.com>
9317 * flowanalysis.cs (FlowBranchingLoop): New class.
9318 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9319 UsageVector's instead of an ArrayList.
9320 (FlowBranching.Label): Likewise.
9321 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9322 (FlowBranching.AddBreakVector): New method.
9324 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9326 * attribute.cs: Small regression fix: only convert the type if we
9327 the type is different, fixes System.Drawing build.
9329 2004-04-27 Martin Baulig <martin@ximian.com>
9331 * attribute.cs (Attribute.Resolve): If we have a constant value
9332 for a named field or property, implicity convert it to the correct
9335 2004-04-27 Raja R Harinath <rharinath@novell.com>
9337 * statement.cs (Block.Block): Implicit blocks share
9338 'child_variable_names' fields with parent blocks.
9339 (Block.AddChildVariableNames): Remove.
9340 (Block.AddVariable): Mark variable as "used by a child block" in
9341 every surrounding block.
9342 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9343 been used in a child block, complain about violation of "Invariant
9344 meaning in blocks" rule.
9345 * cs-parser.jay (declare_local_variables): Don't use
9346 AddChildVariableNames.
9347 (foreach_statement): Don't create an implicit block: 'foreach'
9350 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9352 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9353 converting from 0L to ulong. Fixes 57522.
9355 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9357 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9358 derived class hides via 'new' keyword field from base class (test-242.cs).
9359 TODO: Handle this in the more general way.
9361 * class.cs (CheckBase): Ditto.
9363 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9365 * decl.cs (caching_flags): New member for storing cached values
9367 (MemberCore.Flags): New enum where bit flags for caching_flags
9369 (MemberCore.cls_compliance): Moved to caching_flags.
9370 (DeclSpace.Created): Moved to caching_flags.
9372 * class.cs: Use caching_flags instead of DeclSpace.Created
9374 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9376 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9377 if we are only a derived class, not a nested class.
9379 * typemanager.cs: Same as above, but do this at the MemberLookup
9380 level (used by field and methods, properties are handled in
9381 PropertyExpr). Allow for the qualified access if we are a nested
9384 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9386 * class.cs: Refactoring.
9387 (IMethodData): New inteface; Holds links to parent members
9388 to avoid member duplication (reduced memory allocation).
9389 (Method): Implemented IMethodData interface.
9390 (PropertyBase): New inner classes for get/set methods.
9391 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9392 (Event): New inner classes for add/remove methods.
9393 (Event.DelegateMethod): Implemented IMethodData interface.
9395 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9396 EmitContext (related to class.cs refactoring).
9398 2004-04-21 Raja R Harinath <rharinath@novell.com>
9400 * delegate.cs (Delegate.VerifyApplicability): If the number of
9401 arguments are the same as the number of parameters, first try to
9402 verify applicability ignoring any 'params' modifier on the last
9406 2004-04-16 Raja R Harinath <rharinath@novell.com>
9408 * class.cs (TypeContainer.AddIndexer): Use
9409 'ExplicitInterfaceName' to determine if interface name was
9410 explicitly specified. 'InterfaceType' is not initialized at this time.
9411 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9412 Indexers array is already in the required order. Initialize
9413 'IndexerName' only if there are normal indexers.
9414 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9415 (TypeContainer.Emit): Emit DefaultMember attribute only if
9416 IndexerName is initialized.
9419 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9421 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9424 2004-04-15 Raja R Harinath <rharinath@novell.com>
9426 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9430 * attribute.cs (Attribute.Resolve): Check for duplicate named
9434 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9436 * iterators.cs (MarkYield): track whether we are in an exception,
9437 and generate code accordingly. Use a temporary value to store the
9438 result for our state.
9440 I had ignored a bit the interaction of try/catch with iterators
9441 since their behavior was not entirely obvious, but now it is
9442 possible to verify that our behavior is the same as MS .NET 2.0
9446 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9448 * iterators.cs: Avoid creating temporaries if there is no work to
9451 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9452 Enumerations, use TypeManager.EnumToUnderlying and call
9455 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9458 (This.Emit): Use EmitContext.EmitThis to emit our
9461 (This.EmitAssign): Ditto.
9463 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9464 codepaths, we will move all the functionality into
9467 (FieldExpr.EmitAssign): Ditto.
9469 This fixes several hidden bugs that I uncovered while doing a code
9470 review of this today.
9472 * codegen.cs (EmitThis): reworked so the semantics are more clear
9473 and also support value types "this" instances.
9475 * iterators.cs: Changed so that for iterators in value types, we
9476 do not pass the value type as a parameter.
9478 Initialization of the enumerator helpers is now done in the caller
9479 instead of passing the parameters to the constructors and having
9480 the constructor set the fields.
9482 The fields have now `assembly' visibility instead of private.
9484 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9486 * expression.cs (Argument.Resolve): Check if fields passed as ref
9487 or out are contained in a MarshalByRefObject.
9489 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9490 another compiler type.
9492 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9494 * class.cs (Indexer.Define): use the new name checking method.
9495 Also, return false on an error.
9496 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9497 (is_identifier_[start/part]_character): make static.
9499 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9501 * expression.cs (Binary.ResolveOperator): Do no append strings
9502 twice: since we can be invoked more than once (array evaluation)
9503 on the same concatenation, take care of this here. Based on a fix
9504 from Ben (bug #56454)
9506 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9508 * codegen.cs: Fix another case where CS1548 must be reported (when
9509 delay-sign isn't specified and no private is available #56564). Fix
9510 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9511 error when MCS is used on the MS runtime and we need to delay-sign
9512 (which seems unsupported by AssemblyBuilder - see #56621).
9514 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9516 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9517 (TypeManager.ComputeNamespaces): Faster implementation for
9520 * compiler.csproj: Updated AssemblyName to mcs.
9522 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9524 * rootcontext.cs: Add new types to the boot resolution.
9526 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9527 MulticastDelegate is not allowed.
9529 * typemanager.cs: Add new types to lookup: System.TypedReference
9532 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9533 check for TypedReference or ArgIterator, they are not allowed.
9535 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9536 makes us properly catch 1510 in some conditions (see bug 56016 for
9539 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9541 * CryptoConvert.cs: update from corlib version
9544 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9546 * class.cs (Indexer.Define): Check indexername declaration
9548 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9550 * attribute.cs (IsClsCompliant): Fixed problem with handling
9551 all three states (compliant, not-compliant, undetected).
9553 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9555 * attribute.cs (Attribute): Location is now public.
9556 (Resolve): Store resolved arguments (pos_values) in attribute class.
9557 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9558 (GetClsCompliantAttributeValue): New method that gets
9559 CLSCompliantAttribute value.
9560 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9561 if exists else null.
9562 (AttributeTester): New class for CLS-Compliant verification routines.
9564 * class.cs (Emit): Add CLS-Compliant verification.
9565 (Method.GetSignatureForError): Implemented.
9566 (Constructor.GetSignatureForError): Implemented
9567 (Constructor.HasCompliantArgs): Returns if constructor has
9568 CLS-Compliant arguments.
9569 (Constructor.Emit): Override.
9570 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9571 is needed to test only parameters.
9572 (FieldBase.GetSignatureForError): Implemented.
9573 (TypeContainer): New member for storing base interfaces.
9574 (TypeContainer.FindMembers): Search in base interfaces too.
9576 * codegen.cs (GetClsComplianceAttribute): New method that gets
9577 assembly or module CLSCompliantAttribute value.
9578 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9580 (ModuleClass.Emit): Add error 3012 test.
9582 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9584 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9585 state for all decl types.
9586 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9587 if CLS-Compliant tests are required.
9588 (IsClsCompliaceRequired): New method. Analyze whether code
9589 must be CLS-Compliant.
9590 (IsExposedFromAssembly): New method. Returns true when MemberCore
9591 is exposed from assembly.
9592 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9593 value or gets cached value.
9594 (HasClsCompliantAttribute): New method. Returns true if MemberCore
9595 is explicitly marked with CLSCompliantAttribute.
9596 (IsIdentifierClsCompliant): New abstract method. This method is
9597 used to testing error 3005.
9598 (IsIdentifierAndParamClsCompliant): New method. Common helper method
9599 for identifier and parameters CLS-Compliant testing.
9600 (VerifyClsCompliance): New method. The main virtual method for
9601 CLS-Compliant verifications.
9602 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9603 null. I don't know why is null (too many public members !).
9604 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9605 and get value of first CLSCompliantAttribute that found.
9607 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9608 (VerifyClsCompliance): Override and add extra tests.
9610 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9611 clscheck- disable CLS-Compliant verification event if assembly is has
9612 CLSCompliantAttribute(true).
9614 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9615 ApllyAttribute is now called in emit section as in the other cases.
9616 Possible future Emit integration.
9617 (IsIdentifierClsCompliant): New override.
9618 (VerifyClsCompliance): New override.
9619 (GetEnumeratorName): Returns full enum name.
9621 * parameter.cs (GetSignatureForError): Implemented.
9623 * report.cs (WarningData): New struct for Warning message information.
9624 (LocationOfPreviousError): New method.
9625 (Warning): New method. Reports warning based on the warning table.
9626 (Error_T): New method. Reports error based on the error table.
9628 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9629 verifications are done here.
9631 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9633 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9634 CLSCompliantAttribute.
9635 (all_imported_types): New member holds all imported types from other
9637 (LoadAllImportedTypes): New method fills static table with exported types
9638 from all referenced assemblies.
9639 (Modules): New property returns all assembly modules.
9641 2004-03-30 Miguel de Icaza <miguel@ximian.com>
9643 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9644 throwing a parser error.
9646 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9647 which removes the hardcoded get_/set_ prefixes for properties, as
9648 IL allows for the properties to be named something else.
9652 * expression.cs: Do not override operand before we know if it is
9655 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9657 * typemanager.cs: support for pinned variables.
9659 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9661 * decl.cs, typemanager.cs: Avoid using an arraylist
9662 as a buffer if there is only one result set.
9664 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9666 * expression.cs: Make sure you cant call a static method
9667 with an instance expression, bug #56174.
9669 2004-03-29 Miguel de Icaza <miguel@ximian.com>
9671 * class.cs (IsDuplicateImplementation): Improve error reporting to
9672 flag 663 (method only differs in parameter modifier).
9674 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9675 in preprocessor directives.
9677 * location.cs (LookupFile): Allow for the empty path.
9679 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
9680 better approach for some of that patch, but its failing with the
9681 CharSet enumeration. For now try/catch will do.
9683 * typemanager.cs: Do not crash if a struct does not have fields.
9686 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9688 * expression.cs: cs0213, cant fix a fixed expression.
9691 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9693 * cs-parser.jay: detect invalid embeded statements gracefully.
9696 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9698 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9701 the invocation type may not be a subclass of the tye of the item/
9702 The type of the item must be a subclass of the invocation item.
9707 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
9709 * attribute.cs: Added methods to get a string and a bool from an
9710 attribute. Required to information from AssemblyKeyFileAttribute,
9711 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9712 * codegen.cs: Modified AssemblyName creation to include support for
9713 strongnames. Catch additional exceptions to report them as CS1548.
9714 * compiler.csproj: Updated include CryptoConvert.cs.
9715 * compiler.csproj.user: Removed file - user specific configuration.
9716 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
9717 Mono.Security assembly. The original class is maintained and tested in
9718 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9719 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9720 like CSC 8.0 (C# v2) supports.
9721 * Makefile: Added CryptoConvert.cs to mcs sources.
9722 * rootcontext.cs: Added new options for strongnames.
9724 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
9726 * driver.cs: For --expect-error, report error code `2'
9727 if the program compiled with no errors, error code `1' if
9728 it compiled with an error other than the one expected.
9730 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
9732 * compiler.csproj: Updated for Visual Studio .NET 2003.
9733 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9734 * compiler.sln: Updated for Visual Studio .NET 2003.
9736 2004-03-24 Ravi Pratap M <ravi@ximian.com>
9738 * expression.cs: Fix bug #47234. We basically need to apply the
9739 rule that we prefer the conversion of null to a reference type
9740 when faced with a conversion to 'object' (csc behaviour).
9742 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9744 * statement.cs: Shorter form for foreach, eliminates
9745 a local variable. r=Martin.
9747 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9749 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9750 checks if we can use brtrue/brfalse to test for 0.
9751 * expression.cs: use the above in the test for using brtrue/brfalse.
9754 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9756 * expression.cs: Rewrite string concat stuff. Benefits:
9758 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9759 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9760 rather than a concat chain.
9762 * typemanager.cs: Add lookups for more concat overloads.
9764 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9766 * expression.cs: Emit shorter il code for array init.
9783 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
9785 * statement.cs: Before, two switch blocks would be merged if the
9786 total size of the blocks (end_item - begin_item + 1) was less than
9787 two times the combined sizes of the blocks.
9789 Now, it will only merge if after the merge at least half of the
9794 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
9796 * class.cs : csc build fix for GetMethods(). See bug #52503.
9798 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
9800 * expression.cs: Make sure fp comparisons work with NaN.
9801 This fixes bug #54303. Mig approved this patch a long
9802 time ago, but we were not able to test b/c the runtime
9805 2004-03-19 Miguel de Icaza <miguel@ximian.com>
9807 * ecore.cs (TypExpr.GetHashCode): implement this overload.
9809 2004-03-19 Martin Baulig <martin@ximian.com>
9811 * class.cs (MemberCore.IsDuplicateImplementation): Report the
9812 error here and not in our caller.
9814 2004-03-19 Martin Baulig <martin@ximian.com>
9816 * interface.cs: Completely killed this file.
9817 (Interface): We're now a TypeContainer and live in class.cs.
9819 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9820 argument; we're now also called for interfaces.
9821 (TypeContainer.DefineMembers): Allow this method being called
9823 (TypeContainer.GetMethods): New public method; formerly known as
9824 Interface.GetMethod(). This is used by PendingImplementation.
9825 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9826 it's now private and non-static.
9827 (Interface): Moved this here; it's now implemented similar to
9829 (Method, Property, Event, Indexer): Added `bool is_interface'
9830 argument to their .ctor's.
9831 (MemberBase.IsInterface): New public field.
9833 * cs-parser.jay: Create normal Method, Property, Event, Indexer
9834 instances instead of InterfaceMethod, InterfaceProperty, etc.
9835 (opt_interface_base): Removed; we now use `opt_class_base' instead.
9836 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9838 2004-03-19 Martin Baulig <martin@ximian.com>
9840 * class.cs (MethodCore.IsDuplicateImplementation): New private
9841 method which does the CS0111 checking.
9842 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9843 Use IsDuplicateImplementation().
9845 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9847 * decl.cs (FindMemberToOverride): New method to find the correct
9848 method or property to override in the base class.
9850 - Make Method/Property use the above method to find the
9851 version in the base class.
9852 - Remove the InheritableMemberSignatureCompare as it is now
9855 This patch makes large code bases much faster to compile, as it is
9856 O(n) rather than O(n^2) to do this validation.
9858 Also, it fixes bug 52458 which is that nested classes are not
9859 taken into account when finding the base class member.
9861 Reviewed/Approved by Martin.
9863 2004-03-17 Marek Safar <marek.safar@seznam.cz>
9865 * interface.cs: In all interface classes removed redundant
9866 member initialization.
9868 2004-03-16 Martin Baulig <martin@ximian.com>
9870 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9872 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9874 * decl.cs (DefineTypeAndParents): New helper method to define a
9875 type's containers before the type itself is defined; This is a
9876 bug exposed by the recent changes to Windows.Forms when an
9877 implemented interface was defined inside a class that had not been
9880 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9882 (Check): Loop correctly to report errors modifiers
9883 (UNSAFE was not in the loop, since it was the same as TOP).
9885 * interface.cs: Every interface member now takes a ModFlags,
9886 instead of a "is_new" bool, which we set on the base MemberCore.
9888 Every place where we called "UnsafeOk" in the interface, now we
9889 call the proper member (InterfaceMethod.UnsafeOK) instead to get
9890 the unsafe settings from the member declaration instead of the
9891 container interface.
9893 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
9895 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9896 `set_indexer_name' to the pending bits (one per type).
9898 We fixed a bug today that was picking the wrong method to
9899 override, since for properties the existing InterfaceMethod code
9900 basically ignored the method name. Now we make sure that the
9901 method name is one of the valid indexer names.
9903 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
9905 * support.cs (SeekableStreamReader): Keep track of stream byte
9906 positions and don't mix them with character offsets to the buffer.
9908 Patch from Gustavo Giráldez
9910 2004-03-15 Marek Safar <marek.safar@seznam.cz>
9912 * interface.cs (InterfaceSetGetBase): Removed double member
9913 initialization, base class does it as well.
9915 2004-03-13 Martin Baulig <martin@ximian.com>
9917 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9918 when compiling corlib.
9920 2004-03-13 Miguel de Icaza <miguel@ximian.com>
9922 * convert.cs (ExplicitConversion): We were reporting an error on
9923 certain conversions (object_type source to a value type, when the
9924 expression was `null') before we had a chance to pass it through
9925 the user defined conversions.
9927 * driver.cs: Replace / and \ in resource specifications to dots.
9930 * class.cs: Add check for duplicate operators. Fixes 52477
9932 2004-03-11 Miguel de Icaza <miguel@ximian.com>
9934 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9935 that are in the middle of the statements, not only at the end.
9938 * class.cs (TypeContainer.AddField): No longer set the
9939 `HaveStaticConstructor' flag, now we call it
9940 `UserDefineStaticConstructor' to diferentiate the slightly
9941 semantic difference.
9943 The situation is that we were not adding BeforeFieldInit (from
9944 Modifiers.TypeAttr) to classes that could have it.
9945 BeforeFieldInit should be set to classes that have no static
9950 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9952 And most importantly Zoltan's comment:
9954 http://bugzilla.ximian.com/show_bug.cgi?id=44229
9956 "I think beforefieldinit means 'it's ok to initialize the type sometime
9957 before its static fields are used', i.e. initialization does not need
9958 to be triggered by the first access to the type. Setting this flag
9959 helps the JIT to compile better code, since it can run the static
9960 constructor at JIT time, and does not need to generate code to call it
9961 (possibly lots of times) at runtime. Unfortunately, mcs does not set
9962 this flag for lots of classes like String.
9964 csc sets this flag if the type does not have an explicit static
9965 constructor. The reasoning seems to be that if there are only static
9966 initalizers for a type, and no static constructor, then the programmer
9967 does not care when this initialization happens, so beforefieldinit
9970 This bug prevents the AOT compiler from being usable, since it
9971 generates so many calls to mono_runtime_class_init that the AOT code
9972 is much slower than the JITted code. The JITted code is faster,
9973 because it does not generate these calls if the vtable is type is
9974 already initialized, which is true in the majority of cases. But the
9975 AOT compiler can't do this."
9977 2004-03-10 Miguel de Icaza <miguel@ximian.com>
9979 * class.cs (MethodData.Emit): Refactor the code so symbolic
9980 information is generated for destructors; For some reasons we
9981 were taking a code path that did not generate symbolic information
9984 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
9986 * class.cs: Create a Constructor.CheckBase method that
9987 takes care of all validation type code. The method
9988 contains some code that was moved from Define.
9990 It also includes new code that checks for duplicate ctors.
9991 This fixes bug #55148.
9993 2004-03-09 Joshua Tauberer <tauberer@for.net>
9995 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9996 a { ... }-style array creation invokes EmitStaticInitializers
9997 which is not good for reference-type arrays. String, decimal
9998 and now null constants (NullCast) are not counted toward
9999 static initializers.
10001 2004-03-05 Martin Baulig <martin@ximian.com>
10003 * location.cs (SourceFile.HasLineDirective): New public field;
10004 specifies whether the file contains or is referenced by a "#line"
10006 (Location.DefineSymbolDocuments): Ignore source files which
10007 either contain or are referenced by a "#line" directive.
10009 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10011 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10012 direct access to our parent, so check the method inline there.
10014 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10016 * expression.cs (Invocation.EmitCall): Miguel's last commit
10017 caused a regression. If you had:
10022 In Foo the implict this would be null.
10024 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10026 * expression.cs (Invocation.EmitCall): If the method is not
10027 virtual, do not emit a CallVirt to it, use Call.
10029 * typemanager.cs (GetFullNameSignature): Improve the method to
10030 cope with ".ctor" and replace it with the type name.
10032 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10033 as an argument the ConstructorBuilder where it is being defined,
10034 to catch the recursive constructor invocations.
10036 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10038 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10039 routines to check if a type is an enumerable/enumerator allow
10040 classes that implement the IEnumerable or IEnumerator interfaces.
10042 * class.cs (Property, Operator): Implement IIteratorContainer, and
10043 implement SetYields.
10045 (Property.Define): Do the block swapping for get_methods in the
10046 context of iterators. We need to check if Properties also
10047 include indexers or not.
10049 (Operator): Assign the Block before invoking the
10050 OperatorMethod.Define, so we can trigger the Iterator code
10053 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10054 Property and Operator classes are not created when we parse the
10055 declarator but until we have the block completed, so we use a
10056 singleton SimpleIteratorContainer.Simple to flag whether the
10057 SetYields has been invoked.
10059 We propagate this setting then to the Property or the Operator to
10060 allow the `yield' to function.
10062 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10064 * codegen.cs: Implemented attribute support for modules.
10065 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10066 Assembly/Module functionality.
10068 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10069 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10070 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10072 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10074 * interface.cs (FindMembers): The operation is performed on all base
10075 interfaces and not only on the first. It is required for future CLS Compliance patch.
10077 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10079 * statement.cs, codegen.cs:
10080 This patch deals with patterns such as:
10082 public class List : IEnumerable {
10084 public MyEnumerator GetEnumerator () {
10085 return new MyEnumerator(this);
10088 IEnumerator IEnumerable.GetEnumerator () {
10092 public struct MyEnumerator : IEnumerator {
10097 Before, there were a few things we did wrong:
10098 1) we would emit callvirt on a struct, which is illegal
10099 2) we emited ldarg when we needed to emit ldarga
10100 3) we would mistakenly call the interface methods on an enumerator
10101 type that derived from IEnumerator and was in another assembly. For example:
10103 public class MyEnumerator : IEnumerator
10105 Would have the interface methods called, even if there were public impls of the
10106 method. In a struct, this lead to invalid IL code.
10108 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10110 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10113 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10115 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10117 * cs-parser.jay: Fix small regression: we were not testing V2
10118 compiler features correctly.
10120 * interface.cs: If the emit context is null, then create one
10122 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10124 * decl.cs (GetSignatureForError): New virtual method to get full name
10125 for error messages.
10127 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10128 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10130 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10131 Duplicated members and code in these classes has been removed.
10132 Better encapsulation in these classes.
10134 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10136 * assign.cs (Assign.DoResolve): When dealing with compound
10137 assignments, there is a new rule in ECMA C# 2.4 (might have been
10138 there before, but it is documented here) that states that in:
10142 If b is of type int, and the `op' is a shift-operator, then the
10143 above is evaluated as:
10147 * expression.cs (Binary.ResolveOperator): Instead of testing for
10148 int/uint/long/ulong, try to implicitly convert to any of those
10149 types and use that in pointer arithmetic.
10151 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10152 method to print information for from the type, not from the
10153 null-method we were given.
10155 2004-02-01 Duncan Mak <duncan@ximian.com>
10157 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10158 parsing for cmd, fixes bug #53694.
10160 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10162 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10163 in the member name duplication tests. Property and operator name duplication
10164 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10166 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10168 * interface.cs (PopulateMethod): Fixed crash when interface method
10169 returns not existing type (error test cs0246-3.cs).
10171 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10173 * cs-parser.jay (interface_accessors): Re-write actions to also
10174 store attributes attached to get and set methods. Fix spelling
10177 (inteface_property_declaration): Modify accordingly.
10179 (InterfaceAccessorInfo): New helper class to store information to pass
10180 around between rules that use interface_accessors.
10182 * interface.cs (Emit): Apply attributes on the get and set
10183 accessors of properties and indexers too.
10185 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10186 right MethodBuilder when applying attributes to the get and set accessors.
10188 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10190 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10192 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10194 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10196 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10198 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10199 changes that treat `yield' specially when present before `break'
10200 or `return' tokens.
10202 * cs-tokenizer.cs: yield is no longer a keyword.
10204 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10206 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10207 setting for default constructors.
10208 For default constructors are almost every time set wrong Modifier. The
10209 generated IL code has been alright. But inside mcs this values was
10210 wrong and this was reason why several of my CLS Compliance tests
10213 2004-01-22 Martin Baulig <martin@ximian.com>
10215 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10216 not a QualifiedIdentifier. This is what `type_name_expression'
10217 was previously doing.
10218 (type_name_expression): Removed; the code is now in
10219 `namespace_or_type_name'.
10220 (qualified_identifier): Removed, use `namespace_or_type_name'
10222 (QualifiedIdentifier): Removed this class.
10224 2004-01-22 Martin Baulig <martin@ximian.com>
10226 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10227 not a string as alias name.
10229 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10231 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10232 #52730 bug, and instead compute correctly the need to use a
10233 temporary variable when requesting an address based on the
10234 static/instace modified of the field and the constructor.
10236 2004-01-21 Martin Baulig <martin@ximian.com>
10238 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10239 class and namespace before looking up aliases. Fixes #52517.
10241 2004-01-21 Martin Baulig <martin@ximian.com>
10243 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10244 assinged in a 'try'; fixes exception4.cs.
10246 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10247 * class.cs : Implemented parameter-less constructor for TypeContainer
10249 * decl.cs: Attributes are now stored here. New property OptAttributes
10251 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10253 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10255 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10257 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10258 (CSharpSignature): New method for indexer and property signature.
10260 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10262 * pending.cs (IsVirtualFilter): Faster implementation.
10264 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10266 * typemanager.cs: Avoid inclusion of same assembly more than once.
10268 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10270 * cs-parser.jay: Fixed problem where the last assembly attribute
10271 has been applied also to following declaration (class, struct, etc.)
10273 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10275 * class.cs: Added error CS0538, CS0539 reporting.
10276 Fixed crash on Microsoft runtime when field type is void.
10278 * cs-parser.jay: Added error CS0537 reporting.
10280 * pending.cs: Added error CS0535 reporting.
10281 Improved error report for errors CS0536, CS0534.
10283 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10285 Merge a few bits from the Anonymous Method MCS tree.
10287 * statement.cs (ToplevelBlock): New class for toplevel methods,
10288 will hold anonymous methods, lifted variables.
10290 * cs-parser.jay: Create toplevel blocks for delegates and for
10291 regular blocks of code.
10293 2004-01-20 Martin Baulig <martin@ximian.com>
10295 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10296 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10297 and `NeedExplicitReturn'; added `IsLastStatement'.
10298 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10299 have a `ReturnLabel' or we're not unreachable.
10301 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10302 child's reachability; don't just override ours with it. Fixes
10303 #58058 (lluis's example).
10304 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10305 InFinally(), InLoop(), InSwitch() and
10306 BreakCrossesTryCatchBoundary() methods.
10308 * statement.cs (Return): Do all error checking in Resolve().
10309 Unless we are the last statement in a top-level block, always
10310 create a return label and jump to it.
10311 (Break, Continue): Do all error checking in Resolve(); also make
10312 sure we aren't leaving a `finally'.
10313 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10314 statement in a top-level block.
10315 (Block.Flags): Added `IsDestructor'.
10316 (Block.IsDestructor): New public property.
10318 2004-01-20 Martin Baulig <martin@ximian.com>
10320 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10322 2004-01-20 Martin Baulig <martin@ximian.com>
10324 * statement.cs (Statement.ResolveUnreachable): New public method.
10325 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10326 (Block.Resolve): Resolve unreachable statements.
10328 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10330 * expression.cs: We need to fix the case where we do
10331 not have a temp variable here.
10333 * assign.cs: Only expression compound assignments need
10334 temporary variables.
10336 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10338 * flowanalysis.cs: Reduce memory allocation in a few ways:
10339 - A block with no variables should not allocate a bit
10341 - A method with no out parameters does not need any tracking
10342 for assignment of the parameters, so we need not allocate
10345 public readonly Type[] VariableTypes;
10346 public readonly string[] VariableNames;
10347 Are redundant. The data is already stored in the variable
10348 map, so we need not allocate another array for it.
10349 - We need to add alot of checks for if (params | locals) == null
10350 due to the first two changes.
10352 2004-01-18 Miguel de Icaza <miguel@ximian.com>
10354 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10355 implement IMemoryLocation, we store a copy on a local variable and
10356 take the address of it. Patch from Benjamin Jemlich
10358 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10359 to use a special "type_name_expression" rule which reduces the
10360 number of "QualifiedIdentifier" classes created, and instead
10361 directly creates MemberAccess expressions.
10363 2004-01-17 Miguel de Icaza <miguel@ximian.com>
10365 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10366 that fixes #52853. Null literal assignment to ValueType
10368 * class.cs (MethodData.Emit): Instead of checking the name of the
10369 method to determine if its a destructor, create a new derived
10370 class from Method called Destructor, and test for that.
10372 * cs-parser.jay: Create a Destructor object instead of a Method.
10374 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10378 2004-01-16 Miguel de Icaza <miguel@ximian.com>
10380 * expression.cs (Binary.ResolveOperator): Perform an implicit
10381 conversion from MethodGroups to their delegate types on the
10382 Addition operation.
10384 * delegate.cs: Introduce a new class DelegateCreation that is the
10385 base class for `NewDelegate' and `ImplicitDelegateCreation',
10386 factor some code in here.
10388 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10389 conversion from MethodGroups to compatible delegate types.
10391 * ecore.cs (Expression.Resolve): Do not flag error 654
10392 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10393 we allow conversions from MethodGroups to delegate types now.
10395 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10396 assignments in v2 either.
10398 2004-01-10 Miguel de Icaza <miguel@ximian.com>
10400 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10401 static read-only fields in ctors.
10403 Applied patch from Benjamin Jemlich
10405 * expression.cs (UnaryMutator): Avoid leaking local variables.
10407 2004-01-09 Miguel de Icaza <miguel@ximian.com>
10409 * cs-tokenizer.cs (IsCastToken): Allow the various native types
10410 here to return true, as they can be used like this:
10412 (XXX) int.MEMBER ()
10414 Fixed 49836 and all the other dups
10416 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
10418 * driver.cs: Implement /win32res and /win32icon.
10420 2004-01-08 Miguel de Icaza <miguel@ximian.com>
10422 * cs-parser.jay: Add a rule to improve error handling for the
10423 common mistake of placing modifiers after the type.
10425 2004-01-07 Miguel de Icaza <miguel@ximian.com>
10427 * cs-parser.jay (interface_event_declaration): Catch
10428 initialization of events on interfaces, and report cs0068
10430 * cs-parser.jay (interface_event_declaration): Catch
10431 initialization of events.
10433 * ecore.cs: Better report missing constructors.
10435 * expression.cs (Binary.ResolveOperator): My previous bug fix had
10436 the error reporting done in the wrong place. Fix.
10438 * expression.cs (Binary.ResolveOperator): Catch the
10439 operator + (E x, E y) error earlier, and later allow for implicit
10440 conversions in operator +/- (E e, U x) from U to the underlying
10443 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10444 52596, if the container class is abstract, the default constructor
10445 is protected otherwise its public (before, we were always public).
10447 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10450 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10451 Jemlich that fixes bug #52597, MCS was generating invalid code for
10452 idisposable structs. Thanks to Ben for following up with this
10455 2004-01-06 Miguel de Icaza <miguel@ximian.com>
10457 * driver.cs: Allow assemblies without code to be generated, fixes
10460 2004-01-07 Nick Drochak <ndrochak@gol.com>
10462 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10464 2004-01-05 Miguel de Icaza <miguel@ximian.com>
10466 * cs-parser.jay: Add rules to improve error reporting if fields or
10467 methods are declared at the namespace level (error 116)
10469 * Add rules to catch event add/remove
10471 2004-01-04 David Sheldon <dave-mono@earth.li>
10473 * expression.cs: Added matching ")" to error message for
10476 2004-01-03 Todd Berman <tberman@gentoo.org>
10478 * ecore.cs, attribute.cs:
10479 Applying fix from #52429.
10481 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10483 * ecore.cs, expression.cs, statement.cs:
10484 Total rewrite of how we handle branching. We
10485 now handle complex boolean expressions with fewer
10486 jumps. As well if (x == 0) no longer emits a ceq.
10488 if (x is Foo) is much faster now, because we generate
10491 Overall, we get a pretty big improvement on our benchmark
10492 tests. The code we generate is smaller and more readable.
10494 I did a full two-stage bootstrap. The patch was reviewed
10495 by Martin and Miguel.
10497 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10499 * cs-parser.jay: Make primary_expression not take a QI.
10500 we dont need this because the member_access rule covers
10501 us here. So we replace the rule with just IDENTIFIER.
10503 This has two good effects. First, we remove a s/r conflict.
10504 Second, we allocate many fewer QualifiedIdentifier objects.
10506 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10508 * attribute.cs: Handle MarshalAs attributes as pseudo, and
10509 set the correct information via SRE. This prevents
10510 hanging on the MS runtime. Fixes #29374.
10512 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10514 * convert.cs: correctly handle conversions to value types
10515 from Enum and ValueType as unboxing conversions.
10517 Fixes bug #52569. Patch by Benjamin Jemlich.
10519 2004-01-02 Ravi Pratap <ravi@ximian.com>
10521 * expression.cs (BetterConversion): Prefer int -> uint
10522 over int -> ulong (csc's behaviour). This fixed bug #52046.
10524 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10526 * decl.cs (MemberCache.FindMembers): now returns a
10529 * typemanager.cs: In general, go with with ^^.
10530 (CopyNewMethods): take an IList.
10531 (RealMemberLookup): Only allocate an arraylist
10532 if we copy from two sets of methods.
10534 This change basically does two things:
10535 1) Fewer array lists allocated due to CopyNewMethods.
10536 2) the explicit cast in MemberList costed ALOT.
10538 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10540 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10541 a hashtable to avoid needless string allocations when an identifier is
10542 used more than once (the common case).
10544 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10546 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10547 is broken, it will not return anything. So, we
10548 have to use the information we have in mcs to
10551 * typemanager.cs: Add a cache for GetInterfaces,
10552 since this will now be used more often (due to ^^)
10554 (GetExplicitInterfaces) New method that gets the
10555 declared, not effective, interfaces on a type
10556 builder (eg, if you have interface IFoo, interface
10557 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10560 This patch makes MCS able to bootstrap itself on
10563 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10565 * expression.cs: Remove the Nop's that Miguel put
10568 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10570 * report.cs, codegen.cs: Give the real stack trace to
10571 the error when an exception is thrown.
10573 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10575 * decl.cs: only allocate hashtables for ifaces if
10578 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10580 * expression.cs: fix the error from cs0121-2.cs
10581 (a parent interface has two child interfaces that
10582 have a function with the same name and 0 params
10583 and the function is called through the parent).
10585 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10587 * class.cs, rootcontext.cs, typmanager.cs: do not
10590 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10592 * codegen.cs: remove stack for the ec flow branching.
10593 It is already a linked list, so no need.
10595 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10597 * Makefile: Allow custom profiler here.
10599 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10601 * typemanager.cs (LookupType):
10602 - Use a static char [], because split takes
10603 a param array for args, so it was allocating
10605 - Do not store true in a hashtable, it boxes.
10607 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10609 * flowanalysis.cs: bytify common enums.
10611 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10613 * modifiers.cs: Add a new set of flags for the
10614 flags allowed on explicit interface impls.
10615 * cs-parser.jay: catch the use of modifiers in
10616 interfaces correctly.
10617 * class.cs: catch private void IFoo.Blah ().
10619 All related to bug #50572.
10621 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10623 * decl.cs: Rewrite the consistant accessability checking.
10624 Accessability is not linear, it must be implemented in
10625 a tableish way. Fixes #49704.
10627 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10629 * expression.cs: Handle negation in a checked context.
10630 We must use subtraction from zero. Fixes #38674.
10632 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10634 * class.cs: Ignore static void main in DLLs.
10635 * rootcontext.cs: Handle the target type here,
10636 since we are have to access it from class.cs
10637 * driver.cs: account for the above.
10639 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10641 * report.cs: Give line numbers and files if available.
10643 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10645 * driver.cs: Implement /addmodule.
10647 * typemanager.cs: Change 'modules' field so it now contains Modules not
10650 2003-12-20 Martin Baulig <martin@ximian.com>
10652 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10653 (FieldBase.IsAssigned): Removed this field.
10654 (FieldBase.SetAssigned): New public method.
10655 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10657 2003-12-20 Martin Baulig <martin@ximian.com>
10659 * expression.cs (LocalVariableReference.DoResolve): Don't set
10660 `vi.Used' if we're called from DoResolveLValue().
10662 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10663 returns the usage vector it just merged into the current one -
10664 pass this one to UsageWarning().
10665 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10666 of the `EmitContext', don't call this recursively on our children.
10668 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
10670 * driver.cs: Implement /target:module.
10672 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10674 * support.cs (CharArrayHashtable): New helper class.
10676 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
10677 char arrays, not strings, so we can avoid creating a string in
10678 consume_identifier if the identifier is a keyword.
10680 2003-12-16 Martin Baulig <martin@ximian.com>
10682 * statement.cs (LocalInfo.Assigned): Removed this property.
10683 (LocalInfo.Flags): Removed `Assigned'.
10684 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10685 and uses flow analysis.
10686 (Block.UsageWarning): Made this method private.
10687 (Block.Resolve): Call UsageWarning() if appropriate.
10689 * expression.cs (LocalVariableReference.DoResolve): Always set
10690 LocalInfo.Used here.
10692 2003-12-13 Martin Baulig <martin@ximian.com>
10694 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10695 any value here; we're now using flow analysis to figure out
10696 whether a statement/block returns a value.
10698 2003-12-13 Martin Baulig <martin@ximian.com>
10700 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10702 (FlowBranching.MergeFinally): Don't call
10703 `branching.CheckOutParameters()' here, this is called in
10705 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10706 when adding the `finally' vector.
10708 2003-12-13 Martin Baulig <martin@ximian.com>
10711 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10712 actually work and also fix #48962.
10714 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10716 * decl.cs: Do not check System.Object for nested types,
10717 since we know it does not have any. Big bang for buck:
10720 Run 1: 8.35 seconds
10721 Run 2: 8.32 seconds
10722 corlib: 17.99 seconds
10724 Run 1: 8.17 seconds
10725 Run 2: 8.17 seconds
10726 corlib: 17.39 seconds
10728 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10730 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10731 time we are returning 0 members, so we save alot here.
10733 2003-12-11 Martin Baulig <martin@ximian.com>
10735 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10736 `MergeChild()', also just take the `FlowBranching' as argument;
10737 call Merge() on it and return the result.
10738 (FlowBranching.Merge): We don't need to do anything if we just
10741 2003-12-11 Martin Baulig <martin@ximian.com>
10743 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10744 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10745 Maurer for this idea.
10747 2003-12-11 Martin Baulig <martin@ximian.com>
10749 * flowanalysis.cs (MergeResult): This class is now gone; we now
10750 use the `UsageVector' for this. The reason for this is that if a
10751 branching just has one sibling, we don't need to "merge" them at
10752 all - that's the next step to do.
10753 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10756 2003-12-11 Martin Baulig <martin@ximian.com>
10758 Reworked flow analyis and made it more precise and bug-free. The
10759 most important change is that we're now using a special `Reachability'
10760 class instead of having "magic" meanings of `FlowReturns'. I'll
10761 do some more cleanups and optimizations and also add some more
10762 documentation this week.
10764 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10765 largely reworked this class.
10766 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10767 the new `Reachability' class instead of having "magic" values here.
10768 (FlowBranching): We're now using an instance of `Reachability'
10769 instead of having separate `Returns', `Breaks' etc. fields.
10771 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10772 based on flow analysis; ignore the return value of block.Emit ().
10774 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10776 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10777 if they are private.
10779 2003-12-09 Martin Baulig <martin@ximian.com>
10781 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10782 call them directly on the UsageVector.
10784 2003-12-09 Martin Baulig <martin@ximian.com>
10786 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10787 Changed return type from `FlowReturns' to `Reachability'.
10789 2003-12-09 Martin Baulig <martin@ximian.com>
10791 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10792 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10793 `Reachable' fields with a single `Reachability' one.
10795 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10797 * class.cs (FindMembers): Remove foreach's.
10802 Run 1: 8.74 seconds
10803 Run 2: 8.71 seconds
10806 Run 1: 8.64 seconds
10807 Run 2: 8.58 seconds
10810 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10815 This patch does a few things:
10816 1. EmptyStatement is now a singleton, so it is never reallocated.
10817 2. All blah is EmptyStatement constructs have been changed to
10818 blah == EmptyStatement.Value, which is much faster and valid
10819 now that EmptyStatement is a singleton.
10820 3. When resolving a block, rather than allocating a new array for
10821 the non-empty statements, empty statements are replaced with
10822 EmptyStatement.Value
10823 4. Some recursive functions have been made non-recursive.
10824 Mainly the performance impact is from (3), however (1) and (2) are needed for
10825 this to work. (4) does not make a big difference in normal situations, however
10826 it makes the profile look saner.
10831 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10832 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10833 Total memory allocated: 56397 KB
10836 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10837 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10838 Total memory allocated: 55666 KB
10840 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10842 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10843 than the hashtable in a hashtable version
10845 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10846 we always end up concating a string. This results in a huge perf
10847 loss, because many strings have to be tracked by the GC. In this
10848 patch, we first use a hashtable that works with two keys, so that
10849 the strings do not need to be concat'ed.
10853 Run 1: 8.74 seconds
10854 Run 2: 8.71 seconds
10857 Run 1: 8.65 seconds
10858 Run 2: 8.56 seconds
10860 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10862 * Makefile: Add a new target `do-time' that does a quick and simple
10863 profile, leaving easy to parse output.
10865 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10867 * codegen.cs (Init): Create the dynamic assembly with
10868 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10870 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10872 * support.cs: Make the PtrHashtable use only one
10873 instance of its comparer.
10875 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10877 * typemanager.cs: Fix lookup of GetNamespaces.
10879 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10881 * expression.cs: Removed redundant line.
10883 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10884 ArrayLists, use for loops with bounds.
10886 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10889 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10890 arraylists, use for loop with bounds.
10892 The above three changes give us a 0.071 second performance
10893 improvement out of 3.294 seconds down to 3.223. On my machine
10894 the above changes reduced the memory usage by 1,387 KB during
10895 compiler bootstrap.
10897 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10898 QualifiedIdentifiers. Before we created a new string through
10899 concatenation, and mostly later on, the result would be
10900 manipulated by DecomposeQI through string manipulation.
10902 This reduced the compiler memory usage for bootstrapping from
10903 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10904 compile times in 0.05 seconds.
10906 2003-11-28 Dick Porter <dick@ximian.com>
10908 * support.cs: Do string compares with the Invariant culture.
10916 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10917 the comparison is done with the Invariant culture.
10919 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10921 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10922 GetEnumerator method.
10924 (ProbeCollectionType): Iterate starting at the most specific type
10925 upwards looking for a GetEnumerator
10927 * expression.cs: Shift count can be up to 31 for int/uint and 63
10930 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10932 * statement.cs (Block.LookupLabel): Also look for the label on the
10933 children blocks. Use a hash table to keep track of visited
10936 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10937 we actually did transform the other operand, otherwise fall back
10938 to the common codepath that casts to long.
10940 * cs-tokenizer.cs: Use the same code pattern as the int case.
10941 Maybe I should do the parsing myself, and avoid depending on the
10942 Parse routines to get this done.
10944 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10946 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10947 which fixes bug 51347. This time test it.
10949 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10950 attributes for example can not tell the difference between these.
10951 The difference was only a syntax feature of the language.
10953 * attribute.cs: Apply attributes to delegates.
10955 * delegate.cs: Call the apply attributes method.
10957 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10959 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10960 comparing 0 vs Byte.MinValue, not the value
10962 (ImplicitConversionRequired): When reporting a conversion error,
10963 use error 31 to print out the constant error instead of the
10966 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10967 which fixes bug 51347.
10969 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10971 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10972 which fixes the -warnaserror command line option.
10974 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10976 * cfold.cs (DoNumericPromotions): During constant folding of
10977 additions on UIntConstant, special case intconstants with
10978 IntConstants like we do on the expression binary operator.
10980 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10982 * convert.cs (ImplicitReferenceConversion): We were missing a case
10983 (System.Enum are not value types or class types, so we need to
10984 classify them separatedly).
10986 * driver.cs: We do not support error 2007.
10988 2003-11-12 Jackson Harper <jackson@ximian.com>
10990 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10991 system directory. Also use the full file name so users can
10992 libraries names mscorlib-o-tron.dll in a non system dir.
10994 2003-11-10 Martin Baulig <martin@ximian.com>
10996 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10997 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10998 calling `ResolveType()' on them, directly assign their `Type'.
11000 2003-11-08 Martin Baulig <martin@ximian.com>
11002 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11003 return value and the `out parent' parameter.
11004 (TypeContainer.DefineType): Moved the CS0644 check into
11005 GetClassBases(). Don't pass the interface types to the
11006 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11007 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11009 * ecore.cs (TypeExpr.IsAttribute): New property.
11010 (TypeExpr.GetInterfaces): New method.
11012 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11013 TypeExpr instead of a Type.
11014 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11015 (Interface.DefineType): Don't pass the interface types to the
11016 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11017 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11019 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11020 instead of a `Type[]'.
11021 (TypeManager.RegisterBuilder): Likewise.
11022 (TypeManager.AddUserInterface): Likewise.
11023 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11024 `Type[]' and also return a `TypeExpr[]'.
11025 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11027 2003-11-08 Martin Baulig <martin@ximian.com>
11029 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11032 2003-11-08 Martin Baulig <martin@ximian.com>
11034 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11035 TypeManager.ResolveExpressionTypes().
11037 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11038 instead of an Expression.
11039 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11040 (TypeExpression): New public class; formerly known as `TypeExpr'.
11042 * expression.cs (ComposedCast): Derive from TypeExpr.
11044 * typemanager.cs (TypeManager.system_*_expr): These are now
11045 TypExpr's instead of Expression's.
11046 (TypeManager.ResolveExpressionTypes): New public static function;
11047 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11050 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11052 * expression.cs (New.DoResolve): Do not dereference value that
11053 might be a null return.
11055 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11056 sure that the constant value has the right type. Fixes an
11057 unreported bug, similar to 50425.
11059 * const.cs (Const.LookupConstantValue): Call
11060 ImplicitStandardConversionExists before doing a conversion to
11061 avoid havng the TypeManager.ChangeType do conversions.
11063 Reduced the number of casts used
11065 (Const.ChangeType): New routine to enable reuse of the constant
11066 type changing code from statement.
11068 * typemanager.cs (ChangeType): Move common initialization to
11069 static global variables.
11073 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11074 every value type to go through, even if it was void. Fix that.
11076 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11077 character of the define, and the is_identifier_part_character for
11078 the rest of the string.
11080 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11082 * expression.cs (UnaryMutator.EmitCode): When I updated
11083 LocalVariableReference.DoResolve, I overdid it, and dropped an
11084 optimization done on local variable references.
11086 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11088 * ecore.cs: Convert the return from Ldlen into an int.
11090 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11092 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11093 the accessibility, this is a special case for toplevel non-public
11094 classes (internal for instance).
11096 2003-10-20 Nick Drochak <ndrochak@gol.com>
11098 * ecore.cs: Fix typo and build. Needed another right paren.
11100 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11102 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11103 `internal' case regular and protected, but not allowing protected
11104 to be evaluated later. Bug 49840
11106 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11108 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11109 to kb.Nlast, and not the kb.nFirst to isolate the switch
11112 Extract the underlying type, so enumerations of long/ulong are
11113 treated like long/ulong.
11115 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11117 * expression.cs (New): Overload the meaning of RequestedType to
11118 track the possible creation of the NewDelegate type, since
11119 DoResolve is invoked more than once for new constructors on field
11122 See bugs: #48800 and #37014
11124 * cs-parser.jay (declare_local_constants): Take an arraylist
11125 instead of a single constant.
11127 (local_constant_declaration): It should take a
11128 constant_declarators, not a constant_declarator. Fixes 49487
11130 * convert.cs: Fix error report.
11132 2003-10-13 Jackson Harper <jackson@ximian.com>
11134 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11137 2003-10-09 Martin Baulig <martin@ximian.com>
11139 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11141 (MethodCore.DoDefineParameters): Removed the TypeContainer
11142 argument; use the DeclSpace which was passed to the .ctor instead.
11143 (MethodCore.CheckParameter): Take a DeclSpace instead of a
11144 TypeContainer; we only need a DeclSpace here.
11146 2003-10-09 Martin Baulig <martin@ximian.com>
11148 * class.cs (MethodData): Added additional `DeclSpace ds' argument
11150 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11151 EmitContext's .ctor.
11153 2003-10-09 Martin Baulig <martin@ximian.com>
11155 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11156 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11157 AsAccessible(), moved them as well.
11159 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11161 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11163 * cs-parser.jay : Renamed yyName to yyNames related to jay.
11165 2003-10-07 Miguel de Icaza <miguel@ximian.com>
11167 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11168 generation for >=, as spotted by Paolo, bug 48679.
11169 Patch from David Waite.
11171 * cs-tokenizer.cs: Add handling for #pragma.
11173 * cs-parser.jay: Allow for both yield and yield return in the
11174 syntax. The anti-cobolization of C# fight will go on!
11176 * class.cs (TypeBuilder.DefineType): Catch error condition here
11177 (Parent.DefineType erroring out and returning null).
11179 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11180 coping with enumerations variables, we were mistakenly processing
11181 them as a regular value type instead of built-in types. Fixes the
11184 * typemanager.cs (IsBuiltinOrEnum): New method.
11186 2003-09-30 Miguel de Icaza <miguel@ximian.com>
11188 * cs-parser.jay: Upgrade: yield now needs the return clause.
11190 2003-09-19 Martin Baulig <martin@ximian.com>
11192 * decl.cs (MemberCache.SetupCacheForInterface): Take a
11193 `MemberCache parent' argument. Normally, an interface doesn't
11194 have a parent type except System.Object, but we use this in gmcs
11195 for generic type parameters.
11197 2003-09-18 Martin Baulig <martin@ximian.com>
11199 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11200 on `type.IsInterface'; don't check whether the type has a parent
11201 to determine whether it's an interface.
11203 2003-09-15 Martin Baulig <martin@ximian.com>
11205 * class.cs (TypeContainer.DefineType): Added an error flag to
11206 avoid reporting duplicate CS0146's ("class definition is
11209 * driver.cs (Driver.MainDriver): Abort if
11210 RootContext.ResolveTree() reported any errors.
11212 2003-09-07 Martin Baulig <martin@ximian.com>
11214 * report.cs (Error, Warning): Added overloaded versions which take
11215 a `params object[] args' and call String.Format().
11217 2003-09-07 Martin Baulig <martin@ximian.com>
11219 * decl.cs (DeclSpace..ctor): Don't call
11220 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11221 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
11222 (DeclSpace.RecordDecl): New method.
11224 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11226 2003-09-02 Ravi Pratap <ravi@ximian.com>
11228 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11229 value attributes to be applied to ParameterBuilders.
11231 * class.cs (MethodCore.LabelParameters): Make static and more
11232 generic so that it can be used from other places - like interface
11233 methods, for instance.
11235 * interface.cs (Interface.Emit): Call LabelParameters before
11236 emitting attributes on the InterfaceMethod.
11238 2003-08-26 Martin Baulig <martin@ximian.com>
11240 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11241 resolving aliases; fixes #47927.
11243 2003-08-26 Martin Baulig <martin@ximian.com>
11245 * statement.cs (Using.DoResolve): This is internally emitting a
11246 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11247 do not always return. Fixes #47681.
11249 2003-08-26 Martin Baulig <martin@ximian.com>
11251 * decl.cs (MemberCore): Moved WarningNotHiding(),
11252 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11254 (AdditionResult): Make this nested in DeclSpace.
11255 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11256 argument; call NamespaceEntry.Define() unless we're nested in a
11259 * namespace.cs (Namespace.DefineName): New public function. This
11260 is called from DeclSpace's .ctor to add
11261 (Namespace.Lookup): Include DeclSpaces in the lookup.
11263 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11265 * const.cs (Const): Derive from MemberBase, not MemberCore.
11267 2003-08-25 Martin Baulig <martin@ximian.com>
11269 * convert.cs (Convert.ExplicitReferenceConversion): When
11270 converting from an interface type to a class, unbox if the target
11271 type is a struct type. Fixes #47822.
11273 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11275 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11278 2003-08-22 Martin Baulig <martin@ximian.com>
11280 * class.cs (TypeManager.DefineType): When defining a nested type,
11281 call DefineType() on our parent; fixes #47801.
11283 2003-08-22 Martin Baulig <martin@ximian.com>
11285 * class.cs (MethodData.Define): While checking if a method is an
11286 interface implementation, improve the test a bit more to fix #47654.
11288 2003-08-22 Martin Baulig <martin@ximian.com>
11290 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11291 correctly; fixes #47722.
11293 2003-08-22 Martin Baulig <martin@ximian.com>
11295 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11296 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11298 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11300 2003-08-22 Martin Baulig <martin@ximian.com>
11302 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11303 can only be assigned in static constructors. Fixes #47161.
11305 2003-08-22 Martin Baulig <martin@ximian.com>
11307 Rewrote and improved the flow analysis code.
11309 * flowbranching.cs (FlowBranching): Make this class abstract.
11310 (FlowBranching.CreateBranching): New static function to create a
11311 new flow branching.
11312 (FlowBranchingBlock, FlowBranchingException): New classes.
11313 (FlowBranching.UsageVector.Type): New public readonly field.
11314 (FlowBranching.UsageVector.Breaks): Removed the setter.
11315 (FlowBranching.UsageVector.Returns): Removed the setter.
11316 (FlowBranching.UsageVector): Added Break(), Return(),
11317 NeverReachable() and Throw() methods to modify the reachability.
11318 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11319 done by FlowBranching.Merge().
11320 (FlowBranching.UsageVector.MergeChild): New method; merges the
11321 merge result into the current vector.
11322 (FlowBranching.Merge): New abstract method to merge a branching.
11324 2003-08-12 Martin Baulig <martin@ximian.com>
11326 * expression.cs (Indirection.CacheTemporaries): Create the
11327 LocalTemporary with the pointer type, not its element type.
11329 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11331 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11332 token was a keyword or not.
11334 Add `error' options where an IDENTIFIER was expected; Provide
11335 CheckToken and CheckIdentifierToken convenience error reporting
11338 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11340 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11341 NameSpaceEntry NameSpaceEntry.
11343 (LookupInterfaceOrClass): Avoid creating a full qualified name
11344 from namespace and name: avoid doing lookups when we know the
11345 namespace is non-existant. Use new Tree.LookupByNamespace which
11346 looks up DeclSpaces based on their namespace, name pair.
11348 * driver.cs: Provide a new `parser verbose' to display the
11349 exception thrown during parsing. This is turned off by default
11350 now, so the output of a failure from mcs is more graceful.
11352 * namespace.cs: Track all the namespaces defined in a hashtable
11355 (IsNamespace): New method
11357 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11359 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11360 we know that we need to concatenate (full typename can never be
11365 * statement.cs: Use a bitfield; Do not initialize to null things
11366 which are done by the constructor by default.
11368 * cs-parser.jay: bug fix, parameter was 4, not 3.
11370 * expression.cs: Just use the property;
11372 * statement.cs: No need for GetVariableInfo method.
11374 2003-08-08 Martin Baulig <martin@ximian.com>
11376 * flowanalysis.cs (FlowReturns): This is now nested in the
11377 `FlowBranching' class.
11378 (MyBitVector): Moved this here from statement.cs.
11379 (FlowBranching.SiblingType): New enum type.
11380 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11382 2003-08-07 Martin Baulig <martin@ximian.com>
11384 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11385 `FlowBranching' class and called `BranchingType'.
11387 2003-08-07 Martin Baulig <martin@ximian.com>
11389 * flowanalysis.cs: Moved all the control flow analysis code into
11392 2003-08-07 Martin Baulig <martin@ximian.com>
11394 * assign.cs (Assign.DoResolve): `target' must either be an
11395 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11398 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11400 * expression.cs (BinaryMethod): This kind of expression is created by the
11401 Binary class if it determines that the operator has to be handled
11404 (BinaryDelegate): This kind of expression is created if we are
11405 dealing with a + or - operator on delegates.
11407 (Binary): remove method, argumetns, and DelegateOperator: when
11408 dealing with methods,
11410 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11412 * statement.cs (Block): use bitfields for the three extra booleans
11413 we had in use. Remove unused topblock parameter.
11415 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11417 * assign.cs: Drop extra unneeded tests.
11419 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11421 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11423 * statement.cs (Foreach): Use VariableStorage instead of
11426 * codegen.cs (VariableStorage): New class used by clients that
11427 require a variable stored: locals or fields for variables that
11428 need to live across yield.
11430 Maybe provide a convenience api for EmitThis+EmitLoad?
11432 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11435 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11437 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11438 RemapParameterLValue): New methods that are used to turn a
11439 precomputed FieldInfo into an expression like this:
11443 The idea is to use this instead of making LocalVariableReference
11444 have more than one meaning.
11446 * cs-parser.jay: Add error production to BASE.
11448 * ecore.cs: Deal with TypeManager.GetField returning null, which
11449 is now a valid return value.
11451 (FieldExprNoAddress): New expression for Fields whose address can
11454 * expression.cs (LocalVariableReference): During the resolve
11455 phases, create new expressions if we are in a remapping context.
11456 Remove code that dealt with remapping here.
11458 (ParameterReference): same.
11460 (ProxyInstance): New expression, like the `This' expression, but
11461 it is born fully resolved. We know what we are doing, so remove
11462 the errors that are targeted to user-provided uses of `this'.
11464 * statement.cs (Foreach): our variable is now stored as an
11465 Expression; During resolution, follow the protocol, dont just
11466 assume it will return this.
11468 2003-08-06 Martin Baulig <martin@ximian.com>
11470 * support.cs (SeekableStreamReader.cs): New public class.
11472 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11473 SeekableStreamReader instead of the normal StreamReader.
11475 2003-08-04 Martin Baulig <martin@ximian.com>
11477 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11478 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11479 deambiguate casts and delegate invocations.
11480 (parenthesized_expression): Use the new tokens to ensure this is
11481 not a cast of method invocation.
11483 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11484 when reading a `)' and Deambiguate_CloseParens () was previously
11487 * expression.cs (ParenthesizedExpression): New class. This is
11488 just used for the CS0075 test.
11489 (Binary.DoResolve): Check for CS0075.
11491 2003-07-29 Ravi Pratap <ravi@ximian.com>
11493 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11494 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11495 reference comparison.
11497 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11498 examine the ReturnType for equality - this is necessary in the
11499 cases of implicit and explicit operators whose signature also
11500 includes the return type.
11502 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11504 * namespace.cs: Cache the result of the namespace computation,
11505 instead of computing it every time.
11507 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11509 * decl.cs: Use a global arraylist that we reuse over invocations
11510 to avoid excesive memory consumption. Reduces memory usage on an
11511 mcs compile by one meg (45 average).
11513 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11514 private, work around that.
11516 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11518 * literal.cs (IntLiteral): Define Zero and One static literals.
11520 * cs-parser.jay (integer_literal): use static literals to reduce
11521 memory usage for the most used literals (0, 1 and -1). 211kb
11522 reduced in memory usage.
11524 Replace all calls to `new ArrayList' with `new
11525 ArrayList(4)' which is a good average number for most allocations,
11526 and also requires only 16 bytes of memory for its buffer by
11529 This reduced MCS memory usage in seven megabytes for the RSS after
11532 2003-07-28 Ravi Pratap <ravi@ximian.com>
11534 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11535 handle params methods the correct way by forming only one
11536 applicable set with params and normal methods in them. Earlier we
11537 were looking at params methods only if we found no normal methods
11538 which was not the correct thing to do.
11540 (Invocation.BetterFunction): Take separate arguments indicating
11541 when candidate and the best method are params methods in their
11544 This fixes bugs #43367 and #46199.
11546 * attribute.cs: Documentation updates.
11548 (CheckAttribute): Rename to CheckAttributeTarget.
11549 (GetValidPlaces): Rename to GetValidTargets.
11551 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11552 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11556 2003-07-28 Martin Baulig <martin@ximian.com>
11558 * class.cs (TypeContainer.DefineMembers): Use the base type's full
11559 name when looking up the base class of a nested class. Fixes #46977.
11561 2003-07-26 Martin Baulig <martin@ximian.com>
11563 * expression.cs (Indexers.Indexer): New nested struct; contains
11564 getter, setter and the indexer's type.
11565 (Indexers.Properties): This is now an ArrayList of
11566 Indexers.Indexer's.
11567 (IndexerAccess.DoResolveLValue): Correctly set the type if the
11568 indexer doesn't have any getters.
11570 * assign.cs (Assign.DoResolve): Also do the implicit conversions
11571 for embedded property and indexer assignments.
11573 2003-07-26 Martin Baulig <martin@ximian.com>
11575 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11576 preprocessor directive is not the first non-whitespace character
11579 2003-07-26 Martin Baulig <martin@ximian.com>
11581 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11582 namespace parsing, follow the spec more closely.
11584 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11585 NamespaceEntry.Lookup().
11587 2003-07-25 Martin Baulig <martin@ximian.com>
11589 * MethodCore.cs (OverridesSomething): New public field; it's set
11590 from TypeContainer.DefineMembers if this method overrides
11591 something (which doesn't need to be a method). Fix #39462.
11593 2003-07-25 Ravi Pratap <ravi@ximian.com>
11595 * typemanager.cs (GetMembers): Ensure that the list of members is
11596 reversed. This keeps things in sync.
11598 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11599 find an AttributeUsage attribute.
11601 * expression.cs (Invocation.OverloadResolve): Perform the check
11602 which disallows Invoke to be directly called on a Delegate.
11604 (Error_InvokeOnDelegate): Report error cs1533.
11606 2003-07-25 Martin Baulig <martin@ximian.com>
11608 * expression.cs (Indexers.GetIndexersForType): Only look in the
11609 interface hierarchy if the requested type is already an
11610 interface. Fixes #46788 while keeping #46502 fixed.
11612 2003-07-25 Martin Baulig <martin@ximian.com>
11614 * class.cs (TypeContainer.DefineMembers): Check whether all
11615 readonly fields have been assigned and report warning CS0649 if
11618 * statement.cs (LocalInfo.IsFixed): Always return true if this is
11621 2003-07-24 Ravi Pratap <ravi@ximian.com>
11623 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11624 returned from GetMethods to make things consistent with the
11625 assumptions MCS makes about ordering of methods.
11627 This should comprehensively fix bug #45127 and it does :-)
11629 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11630 ordering is actually reverse.
11632 * Clean up some debug messages I left lying around.
11634 * interface.cs (Populate*): Get rid of code which emits attributes
11635 since the stage in which we emit attributes is the 'Emit' stage,
11636 not the define stage.
11638 (Emit): Move attribute emission for interface members here.
11640 2003-07-22 Ravi Pratap <ravi@ximian.com>
11642 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11643 closely: we eliminate methods in base types when we have an
11644 applicable method in a top-level type.
11646 Please see section 14.5.5.1 for an exact description of what goes
11649 This fixes bug #45127 and a host of other related to corlib compilation.
11651 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11652 array is the method corresponding to the top-level type (this is
11653 because of the changes made to icall.c) so we change this
11656 (MethodGroupExpr.Name): This too.
11658 * typemanager.cs (GetElementType): New method which does the right
11659 thing when compiling corlib.
11661 * everywhere: Make use of the above in the relevant places.
11663 2003-07-22 Martin Baulig <martin@ximian.com>
11665 * cs-parser.jay (invocation_expression): Moved
11666 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11667 `cast_expression', but create a InvocationOrCast which later
11668 resolves to either an Invocation or a Cast.
11670 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11671 method; call this before EmitStatement() to make sure that this
11672 expression can be used as a statement.
11674 * expression.cs (InvocationOrCast): New class; resolves to either
11675 an Invocation or a Cast.
11677 * statement.cs (StatementExpression): Call ResolveStatement() on
11678 the ExpressionStatement before emitting it.
11680 2003-07-21 Martin Baulig <martin@ximian.com>
11682 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11683 `ref' and `out' attributes match; fixes #46220.
11684 (MemberAccess.ResolveMemberAccess): You can't reference a type
11685 through an expression; fixes #33180.
11686 (Indexers.GetIndexersForType): Don't return the indexers from
11687 interfaces the class implements; fixes #46502.
11689 2003-07-21 Martin Baulig <martin@ximian.com>
11691 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11692 CS0661 checks; fixes bug #30442.
11694 2003-07-21 Martin Baulig <martin@ximian.com>
11696 * decl.cs (AdditionResult): Added `Error'.
11698 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11700 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11701 makes cs0031.cs actually work.
11703 2003-07-20 Martin Baulig <martin@ximian.com>
11705 * namespace.cs: Fixed that bug which caused a crash when compiling
11706 the debugger's GUI.
11708 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11710 * typemanager.cs (LookupTypeReflection): Never expose types which
11711 are NotPublic, NestedPrivate, NestedAssembly, or
11712 NestedFamANDAssem. We used to return these, and later do a check
11713 that would report a meaningful error, but the problem is that we
11714 would not get the real match, if there was a name override.
11716 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11718 * namespace.cs (Namespace, Name): Do not compute the namespace
11719 name dynamically, compute it in the constructor. This reduced
11720 memory usage by 1697 KB.
11722 * driver.cs: Use --pause to pause at the end.
11724 2003-07-17 Peter Williams <peter@newton.cx>
11726 * Makefile: Change the name of the test target so that it doesn't
11727 conflict with the recursive test target.
11729 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11731 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11732 AddressOf): Do not use EmitThis, that was wrong, use the actual
11735 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11737 * class.cs (MethodData.Define): While checking if a method is an
11738 interface implementation, improve the test: If we are not public
11739 (use new test here: use the computed MethodAttributes directly,
11740 instead of the parsed modifier flags) check if the `implementing'
11741 method comes from an interface or not.
11743 * pending.cs (VerifyPendingMethods): Slightly better error
11746 * makefile: add test target that does the mcs bootstrap.
11748 2003-07-16 Ravi Pratap <ravi@ximian.com>
11750 * interface.cs (Define): Do nothing here since there are no
11751 members to populate etc. Move the attribute emission out of here
11752 since this was just totally the wrong place to put it. Attribute
11753 application happens during the 'Emit' phase, not in the 'Define'
11756 (Emit): Add this method and move the attribute emission here
11758 * rootcontext.cs (EmitCode): Call the Emit method on interface
11761 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11763 * expression.cs (OverloadResolve): Report error only if Location
11764 is not 'Null' which means that there was a probe going on.
11766 2003-07-14 Martin Baulig <martin@ximian.com>
11768 * expression.cs (ConditionalLogicalOperator): New public class to
11769 implement user defined conditional logical operators.
11770 This is section 14.11.2 in the spec and bug #40505.
11772 2003-07-14 Martin Baulig <martin@ximian.com>
11774 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11776 2003-07-14 Martin Baulig <martin@ximian.com>
11778 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11780 * ecore.cs (IVariable.VerifyFixed): New interface method.
11782 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11783 operator, check whether the variable is actually fixed. Fixes bug
11784 #36055. Set a variable definitely assigned when taking its
11785 address as required by the spec.
11787 * statement.cs (LocalInfo.IsFixed): New field.
11788 (LocalInfo.MakePinned): Set `IsFixed' to true.
11790 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11792 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11793 for .ctors, ensure that we only ask for members declared in the
11794 attribute type (BindingFlags.DeclaredOnly).
11798 * expression.cs (Error_WrongNumArguments): Report error 1501
11799 correctly the way CSC does.
11801 2003-07-13 Martin Baulig <martin@ximian.com>
11803 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11804 lookup on the fully qualified name, to make things like "X.X" work
11805 where "X.X" is a fully qualified type name, but we also have a
11806 namespace "X" in the using list. Fixes #41975.
11808 2003-07-13 Martin Baulig <martin@ximian.com>
11810 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11811 function. If we're a CompoundAssign, we need to create an embedded
11812 CompoundAssign, not an embedded Assign.
11813 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11816 2003-07-13 Martin Baulig <martin@ximian.com>
11818 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11819 work to fix bug #46088.
11821 2003-07-13 Ravi Pratap <ravi@ximian.com>
11823 * class.cs (Operator.Emit): Do not emit attributes here - it is
11824 taken care of by the Method class that we delegate too. This takes
11825 care of bug #45876.
11827 2003-07-10 Martin Baulig <martin@ximian.com>
11829 * expression.cs (TypeOfVoid): New class.
11830 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11832 2003-07-10 Martin Baulig <martin@ximian.com>
11834 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11837 2003-07-10 Martin Baulig <martin@ximian.com>
11839 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11840 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11842 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11844 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11846 2003-07-10 Martin Baulig <martin@ximian.com>
11848 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11849 of decimal. Fixes #42850.
11851 NOTE: I also fixed the created byte blob, but this doesn't work on
11852 the MS runtime and csc never produces any byte blobs for decimal
11855 2003-07-10 Martin Baulig <martin@ximian.com>
11857 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11858 structs; fixes #32068.
11859 (Block.AddChildVariableNames): Fixed #44302.
11861 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11863 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11865 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11867 * attribute.cs: And this test is onger needed.
11869 2003-07-08 Martin Baulig <martin@ximian.com>
11871 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11872 inaccessible types. Fixes #36313.
11874 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11876 * namespace.cs (NamespaceEntry): Create implicit entries for all
11877 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11878 implicit entries for N1.N2 and N1.
11880 2003-07-08 Martin Baulig <martin@ximian.com>
11882 Rewrote the handling of namespaces to fix a lot of the issues
11883 wrt. `using' aliases etc.
11885 * namespace.cs (Namespace): Splitted this class into a
11886 per-assembly `Namespace' and a per-file `NamespaceEntry'.
11888 * typemanager.cs (TypeManager.IsNamespace): Removed.
11889 (TypeManager.ComputeNamespaces): Only compute namespaces from
11890 loaded assemblies here, not the namespaces from the assembly we're
11891 currently compiling.
11893 2003-07-08 Martin Baulig <martin@ximian.com>
11895 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11897 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11899 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11902 I thought about the memory savings here, but LookupTypeReflection
11903 is used under already very constrained scenarios. Compiling
11904 corlib or mcs only exposes one hit, so it would not really reduce
11905 any memory consumption.
11907 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11909 * typemanager.cs: fixes bug #45889 by only adding public types from
11910 other assemblies to the list of known types.
11912 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11914 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11915 on the type we resolved.
11917 2003-07-05 Martin Baulig <martin@ximian.com>
11919 * pending.cs (PendingImplementation.ParentImplements): Don't
11920 create the proxy if the parent is abstract.
11922 * class.cs (TypeContainer.DefineIndexers): Process explicit
11923 interface implementations first. Fixes #37714.
11925 2003-07-04 Miguel de Icaza <miguel@ximian.com>
11927 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11928 defined recursively; but since we modify the input parameters
11929 (left is set to `this' temporarily), we reset this value if the
11930 left_is_explicit is false, which gives the original semantics to
11933 * literal.cs (NullPointer): new class used to represent a null
11934 literal in a pointer context.
11936 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11937 type is a pointer, use a NullPointer object instead of a
11938 NullLiteral. Closes 43687
11940 (ExplicitConversion): Convert pointer values using
11941 the conv opcode to the proper type.
11943 * ecore.cs (New): change ValueTypeVariable property into a method,
11944 that returns whether the valuetype is suitable for being used.
11946 * expression.cs (Binary.DoNumericPromotions): Only return if we
11947 the int constant was a valid uint, and we can return both left and
11948 right as uints. If not, we continue processing, to trigger the
11949 type conversion. This fixes 39018.
11951 * statement.cs (Block.EmitMeta): During constant resolution, set
11952 the CurrentBlock property on the emitcontext, so that we resolve
11953 constants propertly.
11955 2003-07-02 Martin Baulig <martin@ximian.com>
11957 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11958 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11960 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11961 than emitting it here.
11963 * statement.cs: Fixed some more flow analysis bugs.
11965 2003-07-02 Martin Baulig <martin@ximian.com>
11967 * class.cs (MethodData.Define): When implementing interface
11968 methods, set Final unless we're Virtual.
11970 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11971 check work for interface methods.
11973 2003-07-01 Martin Baulig <martin@ximian.com>
11975 * ecore.cs (EmitContext.This): Replaced this property with a
11976 GetThis() method which takes a Location argument. This ensures
11977 that we get the correct error location for a CS0188.
11979 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11981 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11982 ImplicitStandardConversion.
11984 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11986 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11988 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11991 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11993 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11996 (MethodData.Define): Turn off initlocals for unsafe methods.
11998 2003-06-29 Miguel de Icaza <miguel@ximian.com>
12000 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12001 complete; Fixes #37521.
12003 * delegate.cs: Use Modifiers.TypeAttr to compute the
12004 TypeAttributes, instead of rolling our own. This makes the flags
12005 correct for the delegates.
12007 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12009 * class.cs (Constructor.Define): Set the private flag for static
12010 constructors as well.
12012 * cs-parser.jay (statement_expression): Set the return value to
12013 null, to avoid a crash when we catch an error.
12015 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12017 * cs-parser.jay: Applied patch from Jackson that adds support for
12018 extern and unsafe modifiers to destructor declarations.
12020 * expression.cs: Report error 21 if the user is trying to index a
12023 * driver.cs: Add an error message, suggested by the bug report.
12025 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12026 if we do not have a ": this ()" constructor initializer. Fixes 45149
12028 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12030 * namespace.cs: Add some information to reduce FAQs.
12032 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12034 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12035 underlying enumeration types. Fixes #43915.
12037 * expression.cs: Treat ushort/short as legal values to be used in
12038 bitwise operations.
12040 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12042 * delegate.cs: transfer custom attributes for paramenters from
12043 the delegate declaration to Invoke and BeginInvoke.
12045 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12047 * attribute.cs: handle custom marshalers and emit marshal info
12050 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12052 * makefile.gnu: Added anonymous.cs to the compiler sources.
12054 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12056 * iterators.cs: Change the name of the proxy class to include two
12059 * cs-parser.jay: Update grammar to include anonymous methods.
12061 * anonymous.cs: new file.
12063 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12065 * class.cs (Field.Define): Add missing test for pointers and
12068 2003-05-27 Ravi Pratap <ravi@ximian.com>
12070 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12071 we use the stobj opcode.
12073 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12074 since it wasn't the correct fix.
12076 It still is puzzling that we are required to use stobj for IntPtr
12077 which seems to be a ValueType.
12079 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12081 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12082 during regular simple name resolution. Now, the trick is that
12083 instead of returning for processing the simplename, we do a
12084 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12085 contextual lookup type). If a match is found, return that, if
12086 not, return for further composition.
12088 This fixes long-standing 30485.
12090 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12091 using the address to initialize an object, do an Stobj instead of
12092 using the regular Stelem.
12094 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12095 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12096 Because if we are a BaseIndexerAccess that value will be true.
12099 * statement.cs (GotoCase.Resolve): Return after reporting an
12100 error, do not attempt to continue.
12102 * expression.cs (PointerArithmetic.Emit): If our operand is a
12103 long, convert our constants to match the operand before
12104 multiplying. Convert to I type before adding. Fixes 43670.
12106 2003-05-14 Ravi Pratap <ravi@ximian.com>
12108 * enum.cs (ImplicitConversionExists) : Rename to
12109 ImplicitEnumConversionExists to remove ambiguity.
12111 * ecore.cs (NullCast): New type of cast expression class which
12112 basically is very similar to EmptyCast with the difference being
12113 it still is a constant since it is used only to cast a null to
12115 (eg. (string) null)
12117 * convert.cs (ImplicitReferenceConversion): When casting a null
12118 literal, we return a NullCast.
12120 * literal.cs (NullLiteralTyped): Remove - I don't see why this
12121 should be around anymore.
12123 The renaming (reported was slightly wrong). Corrections:
12125 ConvertImplicitStandard -> ImplicitConversionStandard
12126 ConvertExplicitStandard -> ExplicitConversionStandard
12128 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12129 before passing them in !
12131 * convert.cs (ImplicitConversionStandard): When comparing for
12132 equal expr and target types, ensure that expr is not a
12135 In general, we must not be checking (expr_type ==
12136 target_type) in the top level conversion methods
12137 (ImplicitConversion, ExplicitConversion etc). This checking is
12138 done in the methods that they delegate to.
12140 2003-05-20 Miguel de Icaza <miguel@ximian.com>
12142 * convert.cs: Move Error_CannotConvertType,
12143 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12144 ImplicitNumericConversion, ImplicitConversionExists,
12145 ImplicitUserConversionExists, StandardConversionExists,
12146 FindMostEncompassedType, FindMostSpecificSource,
12147 FindMostSpecificTarget, ImplicitUserConversion,
12148 ExplicitUserConversion, GetConversionOperators,
12149 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12150 TryImplicitIntConversion, Error_CannotConvertImplicit,
12151 ConvertImplicitRequired, ConvertNumericExplicit,
12152 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12153 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12156 Perform the following renames:
12158 StandardConversionExists -> ImplicitStandardConversionExists
12159 ConvertImplicit -> ImplicitConversion
12160 ConvertImplicitStandard -> ImplicitStandardConversion
12161 TryImplicitIntConversion -> ImplicitIntConversion
12162 ConvertImplicitRequired -> ImplicitConversionRequired
12163 ConvertNumericExplicit -> ExplicitNumericConversion
12164 ConvertReferenceExplicit -> ExplicitReferenceConversion
12165 ConvertExplicit -> ExplicitConversion
12166 ConvertExplicitStandard -> ExplicitStandardConversion
12168 2003-05-19 Martin Baulig <martin@ximian.com>
12170 * statement.cs (TypeInfo.StructInfo): Made this type protected.
12171 (TypeInfo): Added support for structs having structs as fields.
12173 * ecore.cs (FieldExpr): Implement IVariable.
12174 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12175 VariableInfo for the field.
12177 2003-05-18 Martin Baulig <martin@ximian.com>
12179 * expression.cs (This.DoResolve): Report a CS0027 if we're
12180 emitting a field initializer.
12182 2003-05-18 Martin Baulig <martin@ximian.com>
12184 * expression.cs (This.ResolveBase): New public function.
12185 (This.DoResolve): Check for CS0188.
12187 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12190 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12191 `instance_expression' to null if we don't have any non-static
12194 2003-05-18 Martin Baulig <martin@ximian.com>
12196 Reworked the way how local variables and parameters are handled by
12197 the flow analysis code.
12199 * statement.cs (TypeInfo, VariableMap): New public classes.
12200 (VariableInfo): New public class. This is now responsible for
12201 checking whether a variable has been assigned. It is used for
12202 parameters and local variables.
12203 (Block.EmitMeta): Take the InternalParameters as argument; compute
12204 the layout of the flow vectors here.
12205 (Block.LocalMap, Block.ParameterMap): New public properties.
12206 (FlowBranching): The .ctor doesn't get the InternalParameters
12207 anymore since Block.EmitMeta() now computes the layout of the flow
12209 (MyStructInfo): This class is now known as `StructInfo' and nested
12210 in `TypeInfo'; we don't access this directly anymore.
12212 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12213 property and removed IsAssigned(), IsFieldAssigned(),
12214 SetAssigned() and SetFieldAssigned(); we now call them on the
12215 VariableInfo so we don't need to duplicate this code everywhere.
12217 * expression.cs (ParameterReference): Added `Block block' argument
12219 (LocalVariableReference, ParameterReference, This): The new
12220 VariableInfo class is now responsible for all the definite
12223 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12224 IsParameterAssigned, SetParameterAssigned): Removed.
12226 2003-05-18 Martin Baulig <martin@ximian.com>
12228 * typemanager.cs (InitCoreTypes): Try calling
12229 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12230 the 3-args-version. Corlib now also needs our `void_type'.
12231 (GetMethod): Added overloaded version which takes an optional
12232 `bool report_errors' to allow lookups of optional methods.
12234 2003-05-12 Martin Baulig <martin@ximian.com>
12236 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12237 only used for locals and not for parameters.
12239 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12241 * support.cs (InternalParameters.ParameterType): Return the
12242 ExternalType of the parameter.
12244 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12247 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12249 * class.cs (MethodData.Define): Do not set the `newslot' on
12250 interface members, if they are also flagged as "override".
12252 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12253 better code for ++i and i++. This only works for static fields
12254 and local variables.
12256 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12257 want to pull the DeclSpace out of the builder_to_declspace instead
12258 of the TypeBuilder (like in TypeContainer.FindMembers).
12260 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12261 instead of LookupTypeContainer. Fixes the crash on .NET for
12262 looking up interface members.
12264 * const.cs: Create our own emit context during the Definition
12265 stage, so that constants are evaluated in the proper context, when
12266 a recursive definition happens.
12268 2003-05-11 Martin Baulig <martin@ximian.com>
12270 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12271 new block for a switch section.
12272 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12273 the adding/lookup in the switch block. Fixes #39828.
12275 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12277 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12278 functionality: I needed to convert the data after I had performed
12279 the add/sub operation into the operands type size.
12281 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12282 pass the type for the box operation, otherwise the resulting
12283 object would have been of type object.
12285 (BoxedCast): Add constructor to specify the type to box as.
12287 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12289 * iterators.cs: I was reusing the `count' variable inadvertently,
12290 take steps to not allow this to happen.
12292 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12294 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12295 by creating an array at the point where the params starts and
12296 putting all those arguments there, then adjusting the size of the
12299 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12301 * expression.cs (New.AddressOf): Implement interface
12302 IMemoryLocation. This is used when the `new' operator is used in
12303 the context of an invocation to a method on a value type.
12305 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12308 * namespace.cs: Also check the using aliases here.
12310 * driver.cs: Move the test for using validity after the types have
12311 been entered, so we do a single pass that also includes the using
12314 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12315 in the regular case. CreateSiblingForFinally is doing extra
12318 * attribute.cs (GetAttributeArgumentExpression): Store the result
12319 on an out value, and use the return value to indicate failure
12320 instead of using null (which is a valid return for Constant.GetValue).
12322 * statement.cs: Perform the analysis flow for the increment
12323 portion after the statement, because this will be the real flow of
12324 execution. Fixes #42385
12326 * codegen.cs (EmitContext.EmitArgument,
12327 EmitContext.EmitStoreArgument): New helper functions when the
12328 RemapToProxy flag is set.
12330 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12333 Add support for remapping parameters.
12335 * iterators.cs: Propagate parameter values; Store parameter
12336 values in the proxy classes.
12338 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12340 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12341 need a proxy reference; I do not know what I was thinking
12343 * cs-parser.jay (constructor_initializer): catch another error,
12344 and display nice message.
12346 (field_declaration): catch void field declaration
12347 to flag a better error.
12349 * class.cs (MemberBase.CheckBase): Report an error instead of a
12350 warning if a new protected member is declared in a struct.
12351 (Field.Define): catch the error of readonly/volatile.
12353 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12355 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12356 volatile variable is taken
12358 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12360 * statement.cs (Fixed.Resolve): Report an error if we are not in
12363 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12365 * typemanager.cs: reuse the code that handles type clashes for
12366 delegates and enumerations.
12368 * class.cs (Report28): Always report.
12370 * expression.cs (EncodeAsAttribute): Allow nulls here.
12372 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12374 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12375 the functionality for testing whether an expression is valid for
12376 an attribute here. Also handle the case of arrays of elements
12379 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12380 encoding a linear array into an array of objects that are suitable
12381 to be passed to an CustomAttributeBuilder.
12383 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12385 * ecore.cs: (FieldExpr): Handle field remapping here.
12387 * iteratators.cs: Pass the instance variable (if the method is an
12388 instance method) to the constructors, so we can access the field
12389 variables on the class.
12391 TODO: Test this with structs. I think the THIS variable on
12392 structs might have to be a pointer, and not a refenrece
12394 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12396 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12397 local variables to fields in a proxy class.
12399 * iterators.cs (PopulateProxy): Rename our internal fields to
12401 Create a <THIS> field if we are an instance method, so we can
12402 reference our parent container variables.
12403 (MapVariable): Called back from the EmitContext code to enter a
12404 new variable to field mapping into the proxy class (we just create
12408 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12409 for using the remapped locals to fields.
12411 I placed the code here, because that gives the same semantics to
12412 local variables, and only changes the Emit code.
12414 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12415 statements inside iterators.
12416 (VariableInfo): Add a FieldBuilder for the cases when we are
12417 remapping local variables to fields in a proxy class
12419 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12420 current_block != null.
12422 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12423 not cope with strings, as it has been moved to the
12424 TableSwitchEmit. Fixed bug in switch generation.
12426 * expression.cs (New.DoResolve): Provide more context for the user
12427 when reporting an error.
12429 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12432 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12433 check the permissions for it. Note than in a type-resolution
12434 context the check was already present in DeclSpace.ResolveType,
12435 but was missing from the MemberAccess.
12437 (ArrayCreation.CheckIndices): warn if the user has
12438 more nested levels of expressions, but there are no more
12439 dimensions specified. Avoids crash on bug 41906.
12441 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12443 * statement.cs (Block): replace Implicit bool, for a generic
12445 New flag: `Unchecked'. This is used during the EmitMeta phase
12446 (which is out-of-line with the regular Resolve/Emit process for a
12447 statement, as this is done ahead of time, but still gets a chance
12448 to call constant resolve).
12450 (Block.Flags): new enum for adding a new flag.
12452 (Block.EmitMeta): track the state of unchecked.
12454 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12455 to enable constant resolution to work there as well.
12457 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12459 * typemanager.cs (ienumerable_type): Also look up
12460 System.Collections.IEnumerable.
12462 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12464 TODO: Test more than one conditional per method.
12466 * class.cs (Indexer.Define): Report the location where the user is
12467 referencing the unsupported feature.
12469 (MethodData): Overload the use of `conditionals' to
12470 minimize the creation of needless ArrayLists. This saves roughly
12471 212kb on my machine.
12473 (Method): Implement the new IIteratorContainer interface.
12474 (Method.SetYields): Implement the method by setting the ModFlags
12475 to contain METHOD_YIELDS.
12477 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12478 which just got set to null.
12480 * iterators.cs: New file.
12482 (Yield, YieldBreak): New statements.
12484 * statement.cs (Return.Resolve): Flag an error if we are used in
12485 an iterator method.
12487 * codegen.cs (InIterator): New flag set if the code is being
12488 compiled in an iterator method.
12490 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12491 internal modifier, and we just use it to avoid adding extra
12492 fields, as this is seldom used.
12494 * cs-parser.jay: Add yield_statement (yield and yield break).
12496 * driver.cs: New flag -v2 to turn on version 2 features.
12498 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12499 hashtable when v2 is enabled.
12501 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12503 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12504 there is already a namespace defined with this name.
12506 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12507 people upgraded their corlibs.
12509 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12510 always use fully qualified types, no need to use the compiler
12513 (TypeManager.IsNamespace): Use binarysearch.
12515 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12516 AddDelegate): I did not quite use the new IsValid API properly: I
12517 have to pass the short-name and the fullname. I was passing only
12518 the basename instead of the fullname sometimes.
12520 (TypeContainer.DefineType): call NamespaceClash.
12522 * interface.cs (Interface.DefineType): use NamespaceClash before
12525 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12528 * enum.cs: (Enum.DefineType): use NamespaceClash before
12531 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12532 speed increase. First, use the negative_hits cache when we get a
12533 negative. Second, add the type with its full original name
12534 instead of the new . and + encoded name (reflection uses + to
12535 separate type from a nested type). Use LookupTypeReflection
12536 directly which bypasses the type->name hashtable (that we already
12537 know does not contain the type.
12539 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12540 location/container type.
12542 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12544 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12546 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12548 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12549 method is being referenced in the method group from a static
12550 context, and report error 120 if so.
12552 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12555 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12556 is created, we create the A namespace).
12558 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12561 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12563 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12564 invocation to ModuleBuilder.GetType with the same values will
12565 return a new type instance, so we need to cache its return
12568 * expression.cs (Binary.ResolveOperator): Only allow the compare
12569 operators on enums if they are of the same type.
12571 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12572 types of ValueType on their own case. Before we were giving them
12573 the same treatment as objects.
12575 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12576 fullname. Short name is used to compare against container name.
12577 Fullname is used to check against defined namespace names.
12579 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12580 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12582 (Method.CheckBase): Call parent.
12583 (MemberBase.CheckBase): Check for protected members on sealed
12585 (PropertyBase.CheckBase): Call parent.
12586 (Field.Define): Call parent.
12588 * report.cs: Negative error codes are now mapped to 8000 - code,
12589 so that the display is render more nicely.
12591 * typemanager.cs: Do not use try/catch, instead report a regular
12594 (GetPointerType, GetReferenceType): These methods provide
12595 mechanisms to obtain the T* and T& from a T. We had the code
12596 previously scattered around the code base, and it also used
12597 TypeManager.LookupType that would go through plenty of caches.
12598 This one goes directly to the type source.
12600 In some places we did the Type.GetType followed by
12601 ModuleBuilder.GetType, but not in others, so this unifies the
12602 processing as well.
12604 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12605 statements now that we have namespace information.
12607 * typemanager.cs (IsNamespace): New method, returns whether the
12608 string presented is a namespace or not.
12610 (ComputeNamespaces): New public entry point, computes the list of
12611 available namespaces, using the GetNamespaces API call in Mono, or
12612 the slower version in MS.NET.
12614 Now before we start the semantic analysis phase, we have a
12615 complete list of namespaces including everything that the user has
12618 Deleted old code to cache namespaces in .nsc files.
12620 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12622 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12623 class/struct location definition Location for the implicit
12624 constructor location.
12626 (Operator.Define): Use the location of the operator for the
12627 implicit Method definition.
12629 (Constructor.Emit): use the constructor location for the implicit
12630 base initializer constructor.
12632 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12633 and the Expression class now contains two new methods:
12635 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12636 isolate type lookup from the rest of the resolution process.
12638 Since we use Expressions to hold type definitions due to the way
12639 we parse the input we have historically overloaded Resolve to
12640 perform the Type lookups if a special flag is passed. Now this is
12641 eliminated and two methods take their place.
12643 The differences in the two methods between xStep and xTerminal is
12644 that xStep is involved in our current lookup system that uses
12645 SimpleNames to compose a name, while xTerminal is used just to
12646 catch the case where the simplename lookup failed.
12648 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12650 * expression.cs (ResolveMemberAccess): Remove redundant code.
12651 TypeExpr expressions are always born fully resolved.
12653 * interface.cs (PopulateMethod): Do not lookup the types twice.
12654 We were doing it once during SemanticAnalysis and once during
12657 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12658 in local variable type definitions, were being returned as a
12659 SimpleName (we decomposed everything into a string), that is
12660 because primary_expression was being used instead of a type in the
12661 grammar (reduce/reduce conflicts).
12663 The part that was wrong is that we converted the expression into a
12664 string (an oversimplification in one hand, compounded with primary
12665 expressions doing string concatenation).
12671 Would return "A.B.C[]" as a SimpleName. This stopped things like
12672 using clauses from working on this particular context. And a type
12673 was being matched directly against "A.B.C[]".
12675 We now use the correct approach, and allow for ComposedCast to be
12676 part of the unary expression. So the "A.B.C []" become a composed
12677 cast of "A.B.C" (as a nested group of MemberAccess with a
12678 SimpleName at the end) plus the rank composition "[]".
12682 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12684 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12685 for the access level checking.
12687 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12688 `TypeContainer container', because I kept getting confused when I
12689 was debugging this code.
12691 * expression.cs (Indexers): Instead of tracking getters/setters,
12692 we now track them in parallel. We create one arraylist less, but
12693 most importantly it is possible now for the LValue code to find a
12694 matching get for a set.
12696 (IndexerAccess.DoResolveLValue): Update the code.
12697 GetIndexersForType has been modified already to extract all the
12698 indexers from a type. The code assumed it did not.
12700 Also make the code set the correct return type for the indexer.
12701 This was fixed a long time ago for properties, but was missing for
12702 indexers. It used to be void_type.
12704 (Binary.Emit): Test first for doubles instead of
12705 floats, as they are more common.
12707 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12708 when dealing with floats and the <=, >= operators. This fixes bug
12711 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12712 to load the array value by emitting a load on the foreach variable
12713 type. This was incorrect.
12715 We now emit the code to load an element using the the array
12716 variable type, and then we emit the conversion operator.
12720 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12722 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12724 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12726 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12727 test for protection before we test for signatures.
12729 (MethodSignature.ToString): implement.
12731 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12732 to the case where we reduced into a LongConstant.
12734 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12735 depend on whether the information is acurrate, because the
12736 Microsoft runtime will always claim that the array type is public,
12737 regardless of the real state.
12739 If the type is a pointer, another problem happens: the type is
12740 reported as non-public in Microsoft.
12742 In both cases we have to call CheckAccessLevel recursively with
12743 the underlying type as the argument to be tested.
12745 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12747 * assign.cs (Assign.Emit): If we are dealing with a compound
12748 assignment expression, we should use the code path that stores the
12749 intermediate result in a temporary value. This fixes #40903.
12751 *expression.cs (Indirection.ToString): Provide ToString method for
12754 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12756 * class.cs: Null out fields holding references to Block objects so
12757 they can be garbage collected.
12759 * expression.cs (OverloadResolve): Remove unused local.
12761 2003-04-07 Martin Baulig <martin@ximian.com>
12763 * codegen.cs (EmitContext.CurrentFile): New public field.
12764 (EmitContext.Mark): Use the CurrentFile to check whether the
12765 location is in the correct file.
12766 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12768 2003-04-07 Martin Baulig <martin@ximian.com>
12770 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12772 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12773 location. [FIXME: The location argument which gets passed to this
12774 method is sometimes wrong!]
12776 2003-04-07 Nick Drochak <ndrochak@gol.com>
12778 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12780 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12782 * expression.cs (Indirection.EmitAssign): We were using the
12783 temporary, but returning immediately instead of continuing the
12786 2003-04-06 Martin Baulig <martin@ximian.com>
12788 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12789 if it's a nested child, but also deriving from the outer class.
12792 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12793 nested child, but also deriving from the outer class. See
12795 (FilterWithClosure): We may access private members of the outer
12796 class if we're a nested child and deriving from the outer class.
12797 (RealMemberLookup): Only set `closure_private_ok' if the
12798 `original_bf' contained BindingFlags.NonPublic.
12800 2003-04-05 Martin Baulig <martin@ximian.com>
12802 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12804 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12806 * class.cs (Event.Define): Do not allow abstract events to have
12809 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12811 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12812 block in event declarations.
12814 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12815 value type, get its address.
12817 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12818 leaving a class on the stack instead of a boolean value (int
12819 0/1). Change the code so we compare against null, and then the
12820 result against zero.
12822 * class.cs (TypeContainer.GetClassBases): We were checking for the
12823 parent class being sealed too late.
12825 * expression.cs (Binary.Emit): For <= and >= when dealing with
12826 floating point values, use cgt.un and clt.un instead of cgt and
12829 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12831 * statement.cs: Apply the same optimization as MS: skip the
12832 GetEnumerator returning an IEnumerator, and use the one returning a
12833 CharEnumerator instead. This allows us to avoid the try-finally block
12836 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12838 * cs-parser.jay: Attributes cannot be applied to
12839 namespaces. Fixes #40473
12841 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12844 (Add*): check if the name is valid using the full name for constants,
12845 fields, properties and events.
12847 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12849 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12850 char constants to be part of the enumeration.
12852 * expression.cs (Conditional.DoResolve): Add support for operator
12853 true. Implements the missing functionality from 14.12
12855 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12856 operator true/false as required by the spec.
12858 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12859 implicit conversion to boolean.
12861 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12862 also one where the type implements `operator true'.
12864 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12865 get an expression that will invoke operator true based on an
12868 (GetConversionOperators): Removed the hack that called op_True
12871 (Expression.ResolveBoolean): Move this from Statement.
12873 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12875 * ecore.cs (FieldExpr): do not allow initialization of initonly
12876 fields on derived classes
12878 2003-03-13 Martin Baulig <martin@ximian.com>
12880 * statement.cs (Block.Emit): Call ig.BeginScope() and
12881 ig.EndScope() when compiling with debugging info; call
12882 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12884 2003-03-08 Miguel de Icaza <miguel@ximian.com>
12886 * expression.cs (Indexers): Do not construct immediately, allow
12887 for new members to be appended as we go. Fixes 38143
12889 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12891 * expression.cs: save/restore context when resolving an unchecked
12894 2003-03-05 Miguel de Icaza <miguel@ximian.com>
12896 * cfold.cs: Catch division by zero in modulus operator during
12899 2003-03-03 Miguel de Icaza <miguel@ximian.com>
12901 * interface.cs (Interface.DefineMembers): Avoid defining members
12904 2003-02-27 Miguel de Icaza <miguel@ximian.com>
12906 * driver.cs: handle the +/- options for -noconfig
12908 * statement.cs (Unckeched.Resolve): Also track the state of
12909 unchecked in the Resolve phase.
12911 2003-02-27 Martin Baulig <martin@ximian.com>
12913 * ecore.cs (Expression.MemberLookup): Don't create a
12914 MethodGroupExpr for something which is not a method. Fixes #38291.
12916 2003-02-25 Miguel de Icaza <miguel@ximian.com>
12918 * class.cs (MemberBase.CheckParameters): Also check that the type
12919 is unmanaged if it is a pointer.
12921 * expression.cs (SizeOf.Resolve): Add location information.
12923 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12924 a managed type is declared.
12926 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12927 parameter modifiers as well. Fixes bug 38606
12929 * class.cs: Very sad. Am backing out the speed up changes
12930 introduced by the ArrayList -> Array in the TypeContainer, as they
12931 were not actually that much faster, and introduced a bug (no error
12932 reports on duplicated methods).
12934 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12935 source first, this will guarantee that we have a valid expression
12936 before calling in lower levels functions that will require a
12937 resolved object. Then use this original_source in the
12938 target.ResolveLValue instead of the original source that was
12941 Another change. Use target.Resolve instead of LValueResolve.
12942 Although we are resolving for LValues, we will let the Assign code
12943 take care of that (it will be called again from Resolve). This
12944 basically allows code like this:
12946 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12947 class Y { void A (X x) { x [0] += o; }
12949 The problem was that the indexer was trying to resolve for
12950 set_Item (idx, object o) and never finding one. The real set_Item
12951 was set_Item (idx, X). By delaying the process we get the right
12956 2003-02-23 Martin Baulig <martin@ximian.com>
12958 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12959 while calling DoEmit ().
12961 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12962 source files; if you use the #line directive inside a method, the
12963 compiler stops emitting line numbers for the debugger until it
12964 reaches the end of the method or another #line directive which
12965 restores the original file.
12967 2003-02-23 Martin Baulig <martin@ximian.com>
12969 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12971 2003-02-23 Martin Baulig <martin@ximian.com>
12973 * statement.cs (Block.AddChildVariableNames): We need to call this
12974 recursively, not just for our immediate children.
12976 2003-02-23 Martin Baulig <martin@ximian.com>
12978 * class.cs (Event.Define): Always make the field private, like csc does.
12980 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12981 actually work, fixes bug #37521.
12983 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12985 * delegate.cs: When creating the various temporary "Parameters"
12986 classes, make sure that we call the ComputeAndDefineParameterTypes
12987 on those new parameters (just like we do with the formal ones), to
12988 allow them to be resolved in the context of the DeclSpace.
12990 This fixes the bug that Dick observed in Bugzilla #38530.
12992 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12994 * expression.cs (ResolveMemberAccess): When resolving a constant,
12995 do not attempt to pull a constant if the value was not able to
12996 generate a valid constant.
12998 * const.cs (LookupConstantValue): Do not report more errors than required.
13000 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13002 * expression.cs: fixes bug #38328.
13004 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13006 * class.cs: Changed all the various members that can be part of a
13007 class from being an ArrayList to be an Array of the right type.
13008 During the DefineType type_list, interface_list, delegate_list and
13009 enum_list are turned into types, interfaces, delegates and enums
13012 And during the member population, indexer_list, event_list,
13013 constant_list, field_list, instance_constructor_list, method_list,
13014 operator_list and property_list are turned into their real arrays.
13016 Although we could probably perform this operation earlier, for
13017 good error reporting we need to keep the lists and remove the
13018 lists for longer than required.
13020 This optimization was triggered by Paolo profiling the compiler
13021 speed on the output of `gen-sample-program.pl' perl script.
13023 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13024 not crash in methods like MemberLookupFailed that use this field.
13026 This problem arises when the compiler fails to resolve a type
13027 during interface type definition for example.
13029 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13031 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13032 inherit from System.Object, so we have to stop at null, not only
13033 when reaching System.Object.
13035 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13037 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13038 DeclaredOnly because the parent indexer might have had a different
13039 name, but did not loop until the top of the hierarchy was reached.
13041 The problem this one fixes is 35492: when a class implemented an
13042 indexer from an interface, we were getting the interface method
13043 (which was abstract) and we were flagging an error (can not invoke
13046 This also keeps bug 33089 functioning, and test-148 functioning.
13048 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13049 out if a method is special is to see if it is declared in a
13050 property or event, or whether it is one of the predefined operator
13051 names. This should fix correctly #36804.
13053 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13055 The goal here is to remove the dependency on EmptyCast.Peel ().
13056 Killing it completely.
13058 The problem is that currently in a number of places where
13059 constants are expected, we have to "probe" for an EmptyCast, and
13060 Peel, which is not the correct thing to do, as this will be
13061 repetitive and will likely lead to errors.
13063 The idea is to remove any EmptyCasts that are used in casts that
13064 can be reduced to constants, so we only have to cope with
13067 This bug hunt was triggered by Bug 37363 and the desire to remove
13068 the duplicate pattern where we were "peeling" emptycasts to check
13069 whether they were constants. Now constants will always be
13072 * ecore.cs: Use an enumconstant here instead of wrapping with
13075 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13076 throwing me off. By handling this we can get rid of a few hacks.
13078 * statement.cs (Switch): Removed Peel() code.
13080 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13082 * class.cs: Location information for error 508
13084 * expression.cs (New.DoResolve): Add a guard against double
13085 resolution of an expression.
13087 The New DoResolve might be called twice when initializing field
13088 expressions (see EmitFieldInitializers, the call to
13089 GetInitializerExpression will perform a resolve on the expression,
13090 and later the assign will trigger another resolution
13092 This leads to bugs (#37014)
13094 * delegate.cs: The signature for EndInvoke should contain any ref
13095 or out parameters as well. We were not doing this in the past.
13097 * class.cs (Field.Define): Do not overwrite the type definition
13098 inside the `volatile' group. Turns out that volatile enumerations
13099 were changing the type here to perform a validity test, which
13102 2003-02-12 Miguel de Icaza <miguel@ximian.com>
13104 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13105 and structs, we do not want to load the instance variable
13107 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13108 enum_type has to be handled like an object reference (implicit
13109 conversions exists from this to object), but the regular IsClass
13110 and IsValueType tests will never return true for this one.
13112 Also we use TypeManager.IsValueType instead of type.IsValueType,
13113 just for consistency with the rest of the code (this is only
13114 needed if we ever use the construct exposed by test-180.cs inside
13115 corlib, which we dont today).
13117 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
13119 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13122 2003-02-09 Martin Baulig <martin@ximian.com>
13124 * namespace.cs (Namespace..ctor): Added SourceFile argument.
13125 (Namespace.DefineNamespaces): New static public method; this is
13126 called when we're compiling with debugging to add all namespaces
13127 to the symbol file.
13129 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13130 pass it to the Namespace's .ctor.
13132 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13133 and MethodBase arguments; pass the namespace ID to the symwriter;
13134 pass the MethodBase instead of the token to the symwriter.
13135 (SymbolWriter.DefineNamespace): New method to add a namespace to
13138 2003-02-09 Martin Baulig <martin@ximian.com>
13140 * symbolwriter.cs: New file. This is a wrapper around
13141 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
13142 methods here in near future.
13144 2003-02-09 Martin Baulig <martin@ximian.com>
13146 * codegen.cs (EmitContext.Mark): Just pass the arguments to
13147 ILGenerator.MarkSequencePoint() which are actually used by the
13150 2003-02-09 Martin Baulig <martin@ximian.com>
13152 * location.cs (SourceFile): New public sealed class. This
13153 contains the name and an index which is used in the location's token.
13154 (Location): Reserve an appropriate number of bits in the token for
13155 the source file instead of walking over that list, this gives us a
13156 really huge performance improvement when compiling with debugging.
13158 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13159 `SourceFile' argument instead of a string.
13160 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13161 but don't parse/tokenize here, we need to generate the list of all
13162 source files before we do that.
13163 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13166 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13167 instead of a string.
13169 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13172 2003-02-09 Martin Baulig <martin@ximian.com>
13174 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13175 filename on `#line default'.
13177 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13179 * statement.cs: don't clear the pinned var when the fixed statement
13180 returns from the method (fixes bug#37752).
13182 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13184 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13187 2003-02-07 Martin Baulig <martin@ximian.com>
13189 * driver.cs: Removed the `--debug-args' command line argument.
13191 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13192 automatically by the AsssemblyBuilder.
13193 (CodeGen.InitializeSymbolWriter): We don't need to call any
13194 initialization function on the symbol writer anymore. This method
13195 doesn't take any arguments.
13197 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13199 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13200 from referenced assemblies as well.
13202 2003-02-02 Martin Baulig <martin@ximian.com>
13204 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13206 2003-02-02 Martin Baulig <martin@ximian.com>
13208 * class.cs (Constructor.Emit): Open the symbol writer before
13209 emitting the constructor initializer.
13210 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13211 single-stepping through constructor initializers.
13213 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13215 * class.cs: Handle error 549: do not allow virtual methods in
13218 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13220 * decl.cs: Check access levels when resolving types
13222 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13224 * statement.cs: Add parameters and locals set in catch blocks that might
13225 return to set vector
13227 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13229 * class.cs (Operator): Set the SpecialName flags for operators.
13231 * expression.cs (Invocation.DoResolve): Only block calls to
13232 accessors and operators on SpecialName methods.
13234 (Cast.TryReduce): Handle conversions from char constants.
13237 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13239 * statement.cs: small memory and time optimization in FlowBranching.
13241 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13243 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13244 problem that the last fix but in the other sid (Set).
13246 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13247 access when there is no indexer in the hierarchy.
13249 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13251 * class.cs: Combine some if statements.
13253 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13255 * driver.cs: fixed bug #37187.
13257 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13259 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13260 any indexer, it's needed to build a list with all the indexers in the
13261 hierarchy (AllGetters), else we have problems. Fixes #35653.
13263 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13265 * class.cs (MethodData.Define): It is wrong for an interface
13266 implementation to be static in both cases: explicit and implicit.
13267 We were only handling this in one case.
13269 Improve the if situation there to not have negations.
13271 * class.cs (Field.Define): Turns out that we do not need to check
13272 the unsafe bit on field definition, only on usage. Remove the test.
13274 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13276 * driver.cs: use assembly.Location instead of Codebase (the latest
13277 patch made mcs fail when using MS assemblies).
13279 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13281 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13282 get the path to *corlib.dll.
13284 2003-01-21 Nick Drochak <ndrochak@gol.com>
13288 * typemanager.cs: Remove compiler warnings
13290 2003-01-20 Duncan Mak <duncan@ximian.com>
13292 * AssemblyInfo.cs: Bump the version number to 0.19.
13294 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13296 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13298 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13300 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13302 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13304 * cs-parser.jay: Small fix: we were not comparing the constructor
13305 name correctly. Thanks to Zoltan for the initial pointer.
13307 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13309 * cs-tokenizer.cs: Set file name when specified with #line
13311 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13313 * cs-parser.jay: Only perform the constructor checks here if we
13314 are named like the class; This will help provider a better
13315 error. The constructor path is taken when a type definition is
13316 not found, but most likely the user forgot to add the type, so
13317 report that rather than the constructor error.
13319 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13321 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13324 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13326 * cs-parser.jay: Add cleanup call.
13328 2003-01-13 Duncan Mak <duncan@ximian.com>
13330 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13331 consistent with other methods.
13333 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13335 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13337 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13339 * attribute.cs: only set GuidAttr to true when we have a
13342 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13346 * typemanager.cs: fixes to allow mcs compile corlib with the new
13347 Type.IsSubclassOf fix.
13349 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13351 * expression.cs (LocalVariableReference.DoResolve): Classify a
13352 constant as a value, not as a variable. Also, set the type for
13355 * cs-parser.jay (fixed_statement): take a type instead of a
13356 pointer_type, so we can produce a better error message later.
13358 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13361 (For.DoEmit): Make inifinite loops have a
13362 non-conditional branch back.
13364 (Fixed.DoEmit): First populate the pinned variables, then emit the
13365 statement, then clear the variables. Before I was emitting the
13366 code once for each fixed piece.
13369 2003-01-08 Martin Baulig <martin@ximian.com>
13371 * statement.cs (FlowBranching.MergeChild): A break in a
13372 SWITCH_SECTION does not leave a loop. Fixes #36155.
13374 2003-01-08 Martin Baulig <martin@ximian.com>
13376 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13377 lives in the same number space than `param_map'. Fixes #36154.
13379 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13381 * cs-parser.jay (constructor_declaration): Set the
13382 Constructor.ModFlags before probing for it. This makes the
13383 compiler report 514, 515 and 132 (the code was there, but got
13386 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13387 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13388 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13390 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13392 * enum.cs: create the enum static fields using the enum type.
13394 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13396 * class.cs: don't try to create the ParamBuilder for the return
13397 type if it's not needed (and handle it breaking for the ms runtime
13400 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13402 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13404 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13406 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13407 the command. This showed up while compiling the JANET source
13408 code, which used \r as its only newline separator.
13410 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13412 * class.cs (Method.Define): If we are an operator (because it
13413 reuses our code), then set the SpecialName and HideBySig. #36128
13415 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13417 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13418 exception, report error 120 `object reference required'.
13420 * driver.cs: Add --pause option, used during to measure the size
13421 of the process as it goes with --timestamp.
13423 * expression.cs (Invocation.DoResolve): Do not allow methods with
13424 SpecialName to be invoked.
13426 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13428 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13429 number before adding it.
13431 2002-12-21 Ravi Pratap <ravi@ximian.com>
13433 * ecore.cs (StandardImplicitConversion): When in an unsafe
13434 context, we allow conversion between void * to any other pointer
13435 type. This fixes bug #35973.
13437 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13439 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13440 is not thrown when extensionless outputs are used
13442 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13444 * rootcontext.cs: fixed compilation of corlib.
13446 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13448 * attribute.cs (Attributes.Contains): Add new method.
13450 * class.cs (MethodCore.LabelParameters): if the parameter is an
13451 `out' parameter, check that no attribute `[In]' has been passed.
13453 * enum.cs: Handle the `value__' name in an enumeration.
13455 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13457 * decl.cs: Added special case to allow overrides on "protected
13460 2002-12-18 Ravi Pratap <ravi@ximian.com>
13462 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13463 since it makes much more sense.
13465 (Attributes.ctor): Don't require a Location parameter.
13467 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13469 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13470 since we already have that information per attribute.
13472 * everywhere : make appropriate changes.
13474 * class.cs (LabelParameters): Write the code which actually
13475 applies attributes to the return type. We can't do this on the MS
13476 .NET runtime so we flag a warning in the case an exception is
13479 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13481 * const.cs: Handle implicit null conversions here too.
13483 2002-12-17 Ravi Pratap <ravi@ximian.com>
13485 * class.cs (MethodCore.LabelParameters): Remove the extra
13486 Type [] parameter since it is completely unnecessary. Instead
13487 pass in the method's attributes so that we can extract
13488 the "return" attribute.
13490 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13492 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13493 of ignoring it and letting the compile continue.
13495 * typemanager.cs (ChangeType): use an extra argument to return an
13496 error condition instead of throwing an exception.
13498 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13500 * expression.cs (Unary.TryReduce): mimic the code for the regular
13501 code path. Perform an implicit cast in the cases where we can
13502 implicitly convert to one of the integral types, and then reduce
13503 based on that constant. This fixes bug #35483.
13505 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13507 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13509 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13511 * namespace.cs: fixed bug #35489.
13513 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13515 * class.cs: Remove some dead code.
13517 * cs-parser.jay: Estimate the number of methods needed
13518 (RootContext.MethodCount);
13520 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13521 numbers instead of StringBuilders.
13523 * support.cs (PtrHashtable): Add constructor with initial size;
13524 We can now reduce reallocations of the method table.
13526 2002-12-10 Ravi Pratap <ravi@ximian.com>
13528 * attribute.cs (ApplyAttributes): Keep track of the emitted
13529 attributes on a per-target basis. This fixes bug #35413.
13531 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13533 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13534 default to the Windows 1252 encoding.
13536 (UnixParseOption): Support version, thanks to Alp for the missing
13539 * AssemblyInfo.cs: Add nice assembly information.
13541 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13544 * cs-parser.jay: Allow a trailing comma before the close bracked
13545 in the attribute_section production.
13547 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13548 address of the instance was being taken, I will take this out,
13549 because we take the address of the object immediately here.
13551 2002-12-09 Ravi Pratap <ravi@ximian.com>
13553 * typemanager.cs (AreMultipleAllowed): Take care of the most
13554 obvious case where attribute type is not in the current assembly -
13557 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13559 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13560 definitions, instead of doing that afterwards.
13562 Also we use a nice little hack, depending on the constructor, we
13563 know if we are a "composed" name or a simple name. Hence, we
13564 avoid the IndexOf test, and we avoid
13566 * codegen.cs: Add code to assist in a bug reporter to track down
13567 the source of a compiler crash.
13569 2002-12-07 Ravi Pratap <ravi@ximian.com>
13571 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13572 types have been emitted for a given element and flag an error
13573 if something which does not have AllowMultiple set is used more
13576 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13577 attribute types and their corresponding AllowMultiple properties
13579 (AreMultipleAllowed): Check the property for a given type.
13581 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13582 property in the case we have a TypeContainer.
13584 (Attributes.AddAttribute): Detect duplicates and just skip on
13585 adding them. This trivial fix catches a pretty gross error in our
13586 attribute emission - global attributes were being emitted twice!
13588 Bugzilla bug #33187 is now fixed.
13590 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13592 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13593 instead of pp_and).
13595 * expression.cs (Binary.ResolveOperator): I can only use the
13596 Concat (string, string, string) and Concat (string, string,
13597 string, string) if the child is actually a concatenation of
13600 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13602 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13603 context where we need a 2-character lookahead.
13605 * pending.cs (PendingImplementation): Rework so we can keep track
13606 of interface types all the time, and flag those which were
13607 implemented by parents as optional.
13609 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13611 * expression.cs (Binary.ResolveOperator): Use
13612 String.Concat(string,string,string) or
13613 String.Concat(string,string,string,string) when possible.
13615 * typemanager: More helper methods.
13618 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13620 * pending.cs: remove the bogus return from GetMissingInterfaces()
13621 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13623 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13625 * namespace.cs: avoid duplicated 'using xxx' being added to
13626 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13627 when we get more than one 'using' statement for the same namespace.
13628 Report a CS0105 warning for it.
13630 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13632 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13633 of calling getChar/putback, uses internal knowledge of it.
13635 (xtoken): Reorder tokenizer so most common patterns are checked
13636 first. This reduces the compilation time in another 5% (from 8.11s
13637 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13639 The parsing time is 22% of the compilation in mcs, and from that
13640 64% is spent on the tokenization process.
13642 I tried using a binary search for keywords, but this is slower
13643 than the hashtable. Another option would be to do a couple of
13646 * Not use a StringBuilder, instead use an array of chars,
13647 with a set value. Notice that this way we could catch
13648 the 645 error without having to do it *afterwards*.
13650 * We could write a hand-parser to avoid the hashtable
13651 compares altogether.
13653 The identifier consumption process takes 37% of the tokenization
13654 time. Another 15% is spent on is_number. 56% of the time spent
13655 on is_number is spent on Int64.Parse:
13657 * We could probably choose based on the string length to
13658 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13661 Another 3% is spend on wrapping `xtoken' in the `token' function.
13663 Handle 0xa0 as whitespace (#34752)
13665 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13667 * typemanager.cs (IsCLRType): New routine to tell whether a type
13668 is one of the builtin types.
13670 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13671 typecode in more places instead of doing pointer comparissions.
13672 We could leverage some knowledge about the way the typecodes are
13675 New code to cache namespaces in assemblies, it is currently not
13676 invoked, to be used soon.
13678 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13680 * expression.cs (Binary.ResolveOperator): specially handle
13681 strings, and do not perform user-defined operator overloading for
13684 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13686 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13687 internalcall as it is a pretty simple operation; Avoid whenever
13688 possible to call Char.IsLetter.
13690 (consume_identifier): Cut by half the number of
13691 hashtable calls by merging the is_keyword and GetKeyword behavior.
13693 Do not short-circuit, because if we do, we
13694 report errors (ie, #if false && true would produce an invalid
13698 2002-11-24 Martin Baulig <martin@ximian.com>
13700 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13701 check constant ranges and report a CS0221. Fixes #33186.
13703 2002-11-24 Martin Baulig <martin@ximian.com>
13705 * cs-parser.jay: Make this work for uninitialized variable
13706 declarations in the `for' initializer. Fixes #32416.
13708 2002-11-24 Martin Baulig <martin@ximian.com>
13710 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13711 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13713 2002-11-24 Martin Baulig <martin@ximian.com>
13715 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13716 argument; if true, we also check for user-defined conversions.
13717 This is only needed if both arguments are of a user-defined type.
13718 Fixes #30443, added test-175.cs.
13719 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13721 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13723 2002-11-24 Martin Baulig <martin@ximian.com>
13725 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13726 function to get the store opcode.
13727 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13728 only emit the Ldelema if the store opcode is Stobj. You must run
13729 both test-34 and test-167 to test this. Fixes #34529.
13731 2002-11-23 Martin Baulig <martin@ximian.com>
13733 * ecore.cs (Expression.MemberLookup): Added additional
13734 `qualifier_type' argument which is used when we're being called
13735 from MemberAccess.DoResolve() and null if we're called from a
13737 (Expression.MemberLookupFailed): New method to report errors; this
13738 does the CS1540 check and reports the correct error message.
13740 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13741 argument for the CS1540 check and redone the way how we're dealing
13742 with private members. See the comment in the source code for details.
13743 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13744 `closure_start_type' to `closure_qualifier_type' and check whether
13745 it's not null. It was not this filter being broken, it was just
13746 being called with the wrong arguments.
13748 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13749 and pass it the correct `qualifier_type'; this also does the error
13752 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13754 * expression.cs (Invocation.EmitParams): If the we are dealing
13755 with a non-built-in value type, load its address as well.
13757 (ArrayCreation): Use a a pretty constant instead
13758 of the hardcoded value 2. Use 6 instead of 2 for the number of
13759 static initializers.
13761 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13762 because they are not really value types, just glorified integers.
13764 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13766 * ecore.cs: Remove redundant code for enumerations, make them use
13767 the same code path as everything else, fixes the casting issue
13768 with enumerations in Windows.Forms.
13770 * attribute.cs: Do only cast to string if it is a string, the
13771 validation happens later.
13773 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13774 people upgrade their corlibs.
13776 * ecore.cs: Oops, enumerations were not following the entire code path
13778 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13780 * typemanager.cs (FilterWithClosure): Commented out the test for
13781 1540 in typemanager.cs, as it has problems when accessing
13782 protected methods from a parent class (see test-174.cs).
13784 * attribute.cs (Attribute.ValidateGuid): new method.
13785 (Attribute.Resolve): Use above.
13787 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13789 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13791 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13792 handling for enumerations, as we only needed the TypeContainer
13793 functionality to begin with (this is required for the fix below to
13794 work for enums that reference constants in a container class for
13797 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13799 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13800 a valid TypeBuilder to perform lookups on.o
13802 * class.cs (InheritableMemberSignatureCompare): Use true in the
13803 call to GetGetMethod and GetSetMethod, because we are comparing
13804 the signature, and we need to get the methods *even* if they are
13807 (PropertyBase.CheckBase): ditto.
13809 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13810 GotoCase.Resolve): Use Peel on EmpytCasts.
13812 * ecore.cs (EmptyCast): drop child, add Peel method.
13814 2002-11-17 Martin Baulig <martin@ximian.com>
13816 * ecore.cs (EmptyCast.Child): New public property.
13818 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13819 label resolved to an EmptyCast. Fixes #34162.
13820 (GotoCase.Resolve): Likewise.
13821 (Block.EmitMeta): Likewise.
13823 2002-11-17 Martin Baulig <martin@ximian.com>
13825 * expression.cs (Invocation.BetterConversion): Prefer int over
13826 uint; short over ushort; long over ulong for integer literals.
13827 Use ImplicitConversionExists instead of StandardConversionExists
13828 since we also need to check for user-defined implicit conversions.
13829 Fixes #34165. Added test-173.cs.
13831 2002-11-16 Martin Baulig <martin@ximian.com>
13833 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13834 with the `true' and `false' literals. Fixes #33151.
13836 2002-11-16 Martin Baulig <martin@ximian.com>
13838 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13839 October 22nd; don't do the cs1540 check for static members.
13841 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13842 now using our own filter here and doing the cs1540 check again.
13844 2002-11-16 Martin Baulig <martin@ximian.com>
13846 * support.cs (InternalParameters): Don't crash if we don't have
13847 any fixed parameters. Fixes #33532.
13849 2002-11-16 Martin Baulig <martin@ximian.com>
13851 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13852 when looking up static methods to make this work on Windows.
13855 2002-11-16 Martin Baulig <martin@ximian.com>
13857 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13858 a setter rather than using PropertyInfo.CanWrite.
13860 2002-11-15 Nick Drochak <ndrochak@gol.com>
13862 * class.cs: Allow acces to block member by subclasses. Fixes build
13865 2002-11-14 Martin Baulig <martin@ximian.com>
13867 * class.cs (Constructor.Emit): Added the extern/block check.
13870 2002-11-14 Martin Baulig <martin@ximian.com>
13872 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13873 iteration while looking for indexers, this is needed because the
13874 indexer may have a different name in our base classes. Fixed the
13875 error reporting (no indexers at all, not get accessor, no
13876 overloaded match). Fixes bug #33089.
13877 (IndexerAccess.DoResolveLValue): Likewise.
13879 2002-11-14 Martin Baulig <martin@ximian.com>
13881 * class.cs (PropertyBase.CheckBase): Make this work for multiple
13882 indexers. Fixes the first part of bug #33089.
13883 (MethodSignature.InheritableMemberSignatureCompare): Added support
13886 2002-11-13 Ravi Pratap <ravi@ximian.com>
13888 * attribute.cs (Attribute.Resolve): Catch the
13889 NullReferenceException and report it since it isn't supposed to
13892 2002-11-12 Miguel de Icaza <miguel@ximian.com>
13894 * expression.cs (Binary.EmitBranchable): Also handle the cases for
13895 LogicalOr and LogicalAnd that can benefit from recursively
13896 handling EmitBranchable. The code now should be nice for Paolo.
13898 2002-11-08 Miguel de Icaza <miguel@ximian.com>
13900 * typemanager.cs (LookupType): Added a negative-hit hashtable for
13901 the Type lookups, as we perform quite a number of lookups on
13902 non-Types. This can be removed once we can deterministically tell
13903 whether we have a type or a namespace in advance.
13905 But this might require special hacks from our corlib.
13909 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13910 and double which avoids a conversion from an integer to a double.
13912 * expression.cs: tiny optimization, avoid calling IsConstant,
13913 because it effectively performs the lookup twice.
13915 2002-11-06 Miguel de Icaza <miguel@ximian.com>
13917 But a bogus return here to keep the semantics of the old code
13918 until the Mono runtime is fixed.
13920 * pending.cs (GetMissingInterfaces): New method used to remove all
13921 the interfaces that are already implemented by our parent
13922 classes from the list of pending methods.
13924 * interface.cs: Add checks for calls after ResolveTypeExpr.
13926 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13928 * class.cs (Class.Emit): Report warning 67: event not used if the
13929 warning level is beyond 3.
13931 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13932 being a NullLiteral.
13934 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13937 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13938 path that might fail if a type can not be resolved.
13940 * expression.cs (Binary.Emit): Emit unsigned versions of the
13943 * driver.cs: use error 5.
13945 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13947 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13949 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13951 * cs-parser.jay (switch_section): A beautiful patch from Martin
13952 Baulig that fixed 33094.
13954 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13956 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13957 Check whether the base is abstract and report an error if so.
13959 * expression.cs (IndexerAccess.DoResolveLValue,
13960 IndexerAccess.DoResolve): ditto.
13962 (Invocation.DoResolve): ditto.
13964 (Invocation.FullMethodDesc): Improve the report string.
13966 * statement.cs (Block): Eliminate IsVariableDefined as it is
13967 basically just a wrapper for GetVariableInfo.
13969 * ecore.cs (SimpleName): Use new
13971 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13972 type, as we return the actual parameter ref/unref state on a
13975 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13977 * support.cs: Return proper flags REF/OUT fixing the previous
13980 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13981 not used to mean `ref' but `ref or out' in ParameterReference
13983 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13984 full type signature instead of calling TypeManger.CSharpName
13987 * support.cs (InternalParameters.ParameterDesc): Do not compare
13988 directly to the modflags, because REF/OUT will actually be bitsets
13991 * delegate.cs (VerifyMethod): Check also the modifiers.
13993 * cs-tokenizer.cs: Fix bug where floating point values with an
13994 exponent where a sign was missing was ignored.
13996 * driver.cs: Allow multiple assemblies to be specified in a single
13999 2002-10-28 Miguel de Icaza <miguel@ximian.com>
14001 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
14002 because identifiers after a parenthesis would end up in this kind
14003 of production, and we needed to desamiguate it for having casts
14006 (UserDefinedType *) xxx
14008 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14010 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14011 we should set on the Bindingflags.NonPublic, but not turn on
14012 private_ok. private_ok controls whether a Private member is
14013 returned (this is chekced on the filter routine), while the
14014 BindingFlags.NonPublic just controls whether private/protected
14015 will be allowed. This fixes the problem part of the problem of
14016 private properties being allowed to be used in derived classes.
14018 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14019 so we can call the children DoResolveLValue method (this will
14020 properly signal errors on lvalue assignments to base properties)
14022 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14023 getter are null, and we have a property info, we know that this
14024 happened because the lookup failed, so we report an error 122 for
14025 protection level violation.
14027 We also silently return if setter and getter are null in the
14028 resolve functions, this condition only happens if we have flagged
14029 the error before. This is the other half of the problem.
14031 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14032 not have accessibility information, that is why we were returning
14033 true in the filter function in typemanager.cs.
14035 To properly report 122 (property is inaccessible because of its
14036 protection level) correctly, we report this error in ResolveAccess
14037 by failing if both the setter and the getter are lacking (ie, the
14040 DoResolve and DoLResolve have been modified to check for both
14041 setter/getter being null and returning silently, the reason being
14042 that I did not want to put the knowledge about this error in upper
14045 int old = Report.Errors;
14046 x = new PropertyExpr (...);
14047 if (old != Report.Errors)
14052 So the property expr is returned, but it is invalid, so the error
14053 will be flagged during the resolve process.
14055 * class.cs: Remove InheritablePropertySignatureCompare from the
14056 class, as we no longer depend on the property signature to compute
14057 whether it is possible to implement a method or not.
14059 The reason is that calling PropertyInfo.GetGetMethod will return
14060 null (in .NET, in Mono it works, and we should change this), in
14061 cases where the Get Method does not exist in that particular
14066 class X { public virtual int A { get { return 1; } } }
14068 class Z : Y { public override int A { get { return 2; } } }
14070 Would fail in Z because the parent (Y) would not have the property
14071 defined. So we avoid this completely now (because the alternative
14072 fix was ugly and slow), and we now depend exclusively on the
14075 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14076 reference method, instead of using the property.
14078 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14079 routines are gone now.
14081 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14082 names, they were incorrectly named.
14084 * cs-tokenizer.cs: Return are more gentle token on failure.
14086 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14087 had an out-of-sync index variable, which caused it to remove from
14088 the list of pending methods the wrong method sometimes.
14090 2002-10-22 Miguel de Icaza <miguel@ximian.com>
14092 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14093 CanWrite, because those refer to this particular instance of the
14094 property, and do not take into account the fact that we can
14095 override single members of a property.
14097 Constructor requires an EmitContext. The resolution process does
14098 not happen here, but we need to compute the accessors before,
14099 because the resolution does not always happen for properties.
14101 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14102 subclass, before we did not update this flag, but we did update
14105 (GetAccessors): Drop this routine, as it did not work in the
14106 presence of partially overwritten set/get methods.
14108 Notice that this broke the cs1540 detection, but that will require
14111 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14115 * driver.cs: issue a warning instead of an error if we don't support
14116 debugging for the platform. Also ignore a couple of errors that may
14117 arise when trying to write the symbols. Undo my previous patch.
14119 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14121 * driver.cs: ignore /debug switch except for Unix platforms.
14123 2002-10-23 Nick Drochak <ndrochak@gol.com>
14125 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14127 2002-10-21 Miguel de Icaza <miguel@ximian.com>
14129 * driver.cs: Do not make mcs-debug conditional, so we do not break
14130 builds that use it.
14132 * statement.cs (UsageVector.MergeChildren): I would like Martin to
14133 review this patch. But basically after all the children variables
14134 have been merged, the value of "Breaks" was not being set to
14135 new_breaks for Switch blocks. I think that it should be set after
14136 it has executed. Currently I set this to the value of new_breaks,
14137 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14138 conservative, but I do not understand this code very well.
14140 I did not break anything in the build, so that is good ;-)
14142 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14144 2002-10-20 Mark Crichton <crichton@gimp.org>
14146 * cfold.cs: Fixed compile blocker. Really fixed it this time.
14148 2002-10-20 Nick Drochak <ndrochak@gol.com>
14150 * cfold.cs: Fixed compile blocker.
14152 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14154 * driver.cs: I was chekcing the key, not the file.
14156 2002-10-19 Ravi Pratap <ravi@ximian.com>
14158 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14159 message that we were generating - we just need to silently return
14162 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14164 * class.cs (Event.Define): Change my previous commit, as this
14165 breaks the debugger. This is a temporary hack, as it seems like
14166 the compiler is generating events incorrectly to begin with.
14168 * expression.cs (Binary.ResolveOperator): Added support for
14169 "U operator - (E x, E y)"
14171 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14174 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14175 init-only variables, but this path did not take into account that
14176 there might be also instance readonly variables. Correct this
14179 This fixes bug 32253
14181 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14184 * driver.cs: Change the extension for modules to `netmodule'
14186 * cs-parser.jay: Improved slightly the location tracking for
14187 the debugger symbols.
14189 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14190 modifiers that were specified instead of the hardcoded value
14191 (FamAndAssem). This was basically ignoring the static modifier,
14192 and others. Fixes 32429.
14194 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14195 fixed a bug in the process (32476)
14197 * expression.cs (ArrayAccess.EmitAssign): Patch from
14198 hwang_rob@yahoo.ca that fixes bug 31834.3
14200 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14202 * driver.cs: Make the module extension .netmodule.
14204 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14206 * driver.cs: Report an error if the resource file is not found
14207 instead of crashing.
14209 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14210 false, like Emit does.
14212 2002-10-16 Nick Drochak <ndrochak@gol.com>
14214 * typemanager.cs: Remove unused private member. Also reported mcs
14215 bug to report this as a warning like csc.
14217 2002-10-15 Martin Baulig <martin@gnome.org>
14219 * statement.cs (Statement.Emit): Made this a virtual method; emits
14220 the line number info and calls DoEmit().
14221 (Statement.DoEmit): New protected abstract method, formerly knows
14222 as Statement.Emit().
14224 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14226 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14228 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14229 have fixed a remaining problem: not every AddXXXX was adding a
14230 fully qualified name.
14232 Now everyone registers a fully qualified name in the DeclSpace as
14233 being defined instead of the partial name.
14235 Downsides: we are slower than we need to be due to the excess
14236 copies and the names being registered this way.
14238 The reason for this is that we currently depend (on the corlib
14239 bootstrap for instance) that types are fully qualified, because
14240 we dump all the types in the namespace, and we should really have
14241 types inserted into the proper namespace, so we can only store the
14242 basenames in the defined_names array.
14244 2002-10-10 Martin Baulig <martin@gnome.org>
14246 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14247 from bug #31834, see the bug report for a testcase which is
14250 2002-10-10 Martin Baulig <martin@gnome.org>
14252 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14253 flow analysis code for this.
14255 * statement.cs (Do, While, For): Tell the flow analysis code about
14257 (FlowBranching.UsageVector): Added support for infinite loops.
14258 (Block.Resolve): Moved the dead code elimination here and use flow
14261 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14263 * class.cs (Field.Define): Catch cycles on struct type
14266 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14267 fields if the fields are static. We only need to check instance
14270 * expression.cs (As.DoResolve): Test for reference type.
14272 * statement.cs (Using.ResolveExpression): Use
14273 ConvertImplicitRequired, not ConvertImplicit which reports an
14275 (Using.ResolveLocalVariableDecls): ditto.
14277 * expression.cs (Binary.ResolveOperator): Report errors in a few
14278 places where we had to.
14280 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14282 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14284 * expression.cs: Use StoreFromPtr instead of extracting the type
14285 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14287 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14288 an enumeration value to a System.Enum, but System.Enum is not a
14289 value type, but an class type, so we need to box.
14291 (Expression.ConvertExplicit): One codepath could return
14292 errors but not flag them. Fix this. Fixes #31853
14294 * parameter.cs (Resolve): Do not allow void as a parameter type.
14296 2002-10-06 Martin Baulig <martin@gnome.org>
14298 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14299 if it's a class type and not a struct. Fixes #31815.
14301 2002-10-06 Martin Baulig <martin@gnome.org>
14303 * statement.cs: Reworked the flow analysis code a bit to make it
14304 usable for dead code elimination.
14306 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14308 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14310 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14312 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14313 to fix the test 165, will investigate deeper.
14315 2002-10-04 Martin Baulig <martin@gnome.org>
14317 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14318 finally blocks actually work.
14319 (Try.Resolve): We don't need to create a sibling for `finally' if
14320 there is no finally block.
14322 2002-10-04 Martin Baulig <martin@gnome.org>
14324 * class.cs (Constructor.Define): The default accessibility for a
14325 non-default constructor is private, not public.
14327 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14329 * class.cs (Constructor): Make AllowedModifiers public, add
14332 * cs-parser.jay: Perform the modifiers test here, as the
14333 constructor for the Constructor class usually receives a zero
14334 because of the way we create it (first we create, later we
14335 customize, and we were never checking the modifiers).
14337 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14338 is a version of LookupTypeReflection that includes the type-name
14339 cache. This can be used as a fast path for functions that know
14340 the fully qualified name and are only calling into *.GetType() to
14341 obtain a composed type.
14343 This is also used by TypeManager.LookupType during its type
14346 (LookupType): We now also track the real type name, as sometimes
14347 we can get a quey for the real type name from things like
14348 ComposedCast. This fixes bug 31422.
14350 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14351 complete type fullname, it does not have to go through the type
14352 resolution system to obtain the composed version of the type (for
14353 obtaining arrays or pointers).
14355 (Conditional.Emit): Use the EmitBoolExpression to
14356 generate nicer code, as requested by Paolo.
14358 (ArrayCreation.CheckIndices): Use the patch from
14359 hwang_rob@yahoo.ca to validate the array initializers.
14361 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14363 * class.cs (ConstructorInitializer.Emit): simplify code by using
14364 Invocation.EmitCall, and at the same time, fix the bugs in calling
14365 parent constructors that took variable arguments.
14367 * ecore.cs (Expression.ConvertNumericExplicit,
14368 Expression.ImplicitNumericConversion): Remove the code that
14369 manually wrapped decimal (InternalTypeConstructor call is now gone
14372 * expression.cs (Cast.TryReduce): Also handle decimal types when
14373 trying to perform a constant fold on the type.
14375 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14377 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14378 that only turned off an error report, and did nothing else.
14380 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14382 * driver.cs: Handle and ignore /fullpaths
14384 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14386 * expression.cs (Binary.ResolveOperator): Catch the case where
14387 DoNumericPromotions returns true,
14389 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14391 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14393 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14396 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14398 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14399 conversion exists, but it is also required that the conversion be
14400 performed. This manifested in "(Type64Enum) 2".
14402 * class.cs (TypeManager.AddMethod): The fix is not to change
14403 AddEnum, because that one was using a fully qualified name (every
14404 DeclSpace derivative does), but to change the AddMethod routine
14405 that was using an un-namespaced name. This now correctly reports
14406 the duplicated name.
14408 Revert patch until I can properly fix it. The issue
14409 is that we have a shared Type space across all namespaces
14410 currently, which is wrong.
14412 Options include making the Namespace a DeclSpace, and merge
14413 current_namespace/current_container in the parser.
14415 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14417 * cs-parser.jay: Improve error reporting when we get a different
14418 kind of expression in local_variable_type and
14419 local_variable_pointer_type.
14421 Propagate this to avoid missleading errors being reported.
14423 * ecore.cs (ImplicitReferenceConversion): treat
14424 TypeManager.value_type as a target just like object_type. As
14429 Is valid, and needs to result in the int 1 being boxed before it
14430 is assigned to the value type v.
14432 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14433 to validate the enumeration name.
14435 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14436 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14437 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14439 * ecore.cs (TryImplicitIntConversion): When doing an
14440 implicit-enumeration-conversion, check if the type is 64-bits and
14441 perform a conversion before passing to EnumConstant.
14443 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14445 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14446 report ambiguous type references. Unlike the MS version, we
14447 report what the ambiguity is. Innovation at work ;-)
14449 (DeclSpace.FindType): Require a location argument to
14450 display when we display an ambiguous error.
14452 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14454 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14456 * expression.cs (EmitDynamicInitializers): Apply patch from
14457 hwang_rob@yahoo.ca that fixes the order in which we emit our
14460 2002-09-21 Martin Baulig <martin@gnome.org>
14462 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14463 delegate takes no arguments.
14465 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14467 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14470 * expression.cs: Extract the underlying type.
14472 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14474 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14476 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14478 * class.cs (TypeContainer.DefineType): We can not use the nice
14479 PackingSize with the size set to 1 DefineType method, because it
14480 will not allow us to define the interfaces that the struct
14483 This completes the fixing of bug 27287
14485 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14486 means also structs. This fixes part of the problem.
14487 (Expresion.ImplicitReferenceConversionExists): ditto.
14489 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14490 error if there were no errors reported during the type lookup
14491 process, to avoid duplicates or redundant errors. Without this
14492 you would get an ambiguous errors plus a type not found. We have
14493 beaten the user enough with the first error.
14495 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14498 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14499 during the resolution process, stop the lookup, this avoids
14500 repeated error reports (same error twice).
14502 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14504 * typemanager.cs (LookupType): Redo the type lookup code to match
14505 the needs of System.Reflection.
14507 The issue is that System.Reflection requires references to nested
14508 types to begin with a "+" sign instead of a dot. So toplevel
14509 types look like: "NameSpace.TopLevelClass", and nested ones look
14510 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14513 2002-09-19 Martin Baulig <martin@gnome.org>
14515 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14516 says that a method always returns or always throws an exception,
14517 don't report the CS0161.
14519 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14520 set `Returns = new_returns'.
14522 2002-09-19 Martin Baulig <martin@gnome.org>
14524 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14525 to an enum constant, check for a CS0176.
14527 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14529 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14530 for operators that must be in pairs and report errors.
14532 * ecore.cs (SimpleName.DoResolveType): During the initial type
14533 resolution process, when we define types recursively, we must
14534 check first for types in our current scope before we perform
14535 lookups in the enclosing scopes.
14537 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14539 (Invocation.VerifyArgumentsCompat): Call
14540 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14541 I thought we were supposed to always call this, but there are a
14542 few places in the code where we dont do it.
14544 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14546 * driver.cs: Add support in -linkres and -resource to specify the
14547 name of the identifier.
14549 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14551 * ecore.cs (StandardConversionExists): Sync with the conversion
14552 code: allow anything-* to void* conversions.
14554 (FindMostSpecificSource): Use an Expression argument
14555 instead of a Type, because we might be handed over a Literal which
14556 gets a few more implicit conversions that plain types do not. So
14557 this information was being lost.
14559 Also, we drop the temporary type-holder expression when not
14562 2002-09-17 Martin Baulig <martin@gnome.org>
14564 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14565 this is an explicit interface implementation.
14567 2002-09-17 Martin Baulig <martin@gnome.org>
14569 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14570 different `IndexerName' attributes.
14572 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14573 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14574 virtual CommonResolve().
14576 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14578 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14579 and convert that to the UnderlyingType.
14581 * statement.cs (Foreach.Resolve): Indexers are just like variables
14582 or PropertyAccesses.
14584 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14585 inside quoted strings, we were not doing this before.
14587 2002-09-16 Martin Baulig <martin@gnome.org>
14589 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14590 resolve it. This is needed for the definite assignment check of the
14591 instance expression, fixes bug #29846.
14592 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14594 2002-09-16 Nick Drochak <ndrochak@gol.com>
14596 * parameter.cs: Fix compile error. Cannot reference static member
14597 from an instance object. Is this an mcs bug?
14599 2002-09-14 Martin Baulig <martin@gnome.org>
14601 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14602 multiple times. Fixes bug #30295, added test-166.cs.
14604 2002-09-14 Martin Baulig <martin@gnome.org>
14606 * statement.cs (Block.Emit): Don't emit unreachable code.
14607 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14608 `break' statements.
14609 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14611 2002-09-14 Martin Baulig <martin@gnome.org>
14613 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14616 2002-09-14 Martin Baulig <martin@gnome.org>
14618 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14619 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14620 be false on the ms runtime.
14622 2002-09-13 Martin Baulig <martin@gnome.org>
14624 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14625 the CS0038 error message.
14627 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14629 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14630 constant inside, return it.
14632 2002-09-12 Martin Baulig <martin@gnome.org>
14634 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14635 implicit conversion can be done between enum types.
14637 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14638 check whether an implicit conversion to the current enum's UnderlyingType
14639 exists and report an error if not.
14641 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14642 without debugging support.
14644 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14645 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14647 2002-09-12 Martin Baulig <martin@gnome.org>
14649 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14651 * ecore.cs (IMemberExpr.DeclaringType): New property.
14652 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14653 nonstatic member of an outer type (CS0038).
14655 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14657 * driver.cs: Activate the using-error detector at warning level
14658 4 (at least for MS-compatible APIs).
14660 * namespace.cs (VerifyUsing): Small buglett fix.
14662 * pending.cs (PendingImplementation): pass the container pointer.
14664 * interface.cs (GetMethods): Allow for recursive definition. Long
14665 term, I would like to move every type to support recursive
14666 definitions, not the current ordering mechanism that we have right
14669 The situation is this: Attributes are handled before interfaces,
14670 so we can apply attributes to interfaces. But some attributes
14671 implement interfaces, we will now handle the simple cases
14672 (recursive definitions will just get an error).
14674 * parameter.cs: Only invalidate types at the end if we fail to
14677 2002-09-09 Martin Baulig <martin@gnome.org>
14679 * ecore.cs (PropertyExpr.Emit): Also check for
14680 TypeManager.system_int_array_get_length so this'll also work when
14681 compiling corlib. Fixes #30003.
14683 2002-09-09 Martin Baulig <martin@gnome.org>
14685 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14686 and throw an exception if we can't get the type's size. Fixed #30040,
14689 2002-09-09 Martin Baulig <martin@gnome.org>
14691 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14693 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14694 context. Fixes bug #30027.
14696 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14697 virtual functions. Fixes bug #30043, added test-164.cs.
14699 2002-09-08 Ravi Pratap <ravi@ximian.com>
14701 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14703 2002-09-08 Nick Drochak <ndrochak@gol.com>
14705 * driver.cs: Use an object to get the windows codepage since it's not a
14708 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14710 * statement.cs (For.Emit): for infinite loops (test == null)
14711 return whether there is a break inside, not always "true".
14713 * namespace.cs (UsingEntry): New struct to hold the name of the
14714 using definition, the location where it is defined, and whether it
14715 has been used in a successful type lookup.
14717 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14722 2002-09-06 Ravi Pratap <ravi@ximian.com>
14724 * attribute.cs : Fix incorrect code which relied on catching
14725 a NullReferenceException to detect a null being passed in
14726 where an object was expected.
14728 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14730 * statement.cs (Try): flag the catch variable as assigned
14732 * expression.cs (Cast): Simplified by using ResolveType instead of
14733 manually resolving.
14735 * statement.cs (Catch): Fix bug by using ResolveType.
14737 2002-09-06 Ravi Pratap <ravi@ximian.com>
14739 * expression.cs (BetterConversion): Special case for when we have
14740 a NullLiteral as the argument and we have to choose between string
14741 and object types - we choose string the way csc does.
14743 * attribute.cs (Attribute.Resolve): Catch the
14744 NullReferenceException and report error #182 since the Mono
14745 runtime no more has the bug and having this exception raised means
14746 we tried to select a constructor which takes an object and is
14749 2002-09-05 Ravi Pratap <ravi@ximian.com>
14751 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14752 message (1502, 1503) when we can't locate a method after overload
14753 resolution. This is much more informative and closes the bug
14756 * interface.cs (PopulateMethod): Return if there are no argument
14757 types. Fixes a NullReferenceException bug.
14759 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14760 expressions too. Previously we were checking only in one place for
14761 positional arguments leaving out named arguments.
14763 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14764 type to the enum type is not allowed. Remove code corresponding to
14767 (ConvertNumericExplicit): Allow explicit conversions from
14768 the underlying type to enum type. This precisely follows the spec
14769 and closes a bug filed by Gonzalo.
14771 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14774 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14776 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14778 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14779 it was important that we stored the right value after the
14780 reduction in `converted'.
14782 2002-09-04 Martin Baulig <martin@gnome.org>
14784 * location.cs (Location.SymbolDocument): Use full pathnames for the
14787 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14789 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14790 of the expression resolve mechanism, because that will catch the
14791 SimpleName error failures.
14793 (Conditional): If we can not resolve the
14794 expression, return, do not crash.
14796 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14799 (location): display token name instead of its number.
14801 2002-08-28 Martin Baulig <martin@gnome.org>
14803 * expression.cs (Binary.ResolveOperator): Don't silently return
14804 but return an error if an operator cannot be applied between two
14807 2002-08-28 Martin Baulig <martin@gnome.org>
14809 * class.cs (Constructor.Define): Set the permission attributes
14810 correctly instead of making all constructors public.
14812 2002-08-28 Martin Baulig <martin@gnome.org>
14814 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14815 for private members before reporting a CS0103; if we find anything,
14818 2002-08-28 Martin Baulig <martin@gnome.org>
14820 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14821 to check whether `closure_start_type == closure_invocation_type',
14822 we also need to check whether `m.DeclaringType == closure_invocation_type'
14823 before bypassing the permission checks. We might be accessing
14824 protected/private members from the base class.
14825 (TypeManager.RealMemberLookup): Only set private_ok if private
14826 members were requested via BindingFlags.NonPublic.
14828 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14830 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14831 MethodGroupExpr.IsExplicitImpl if appropriate.
14832 (Invocation.DoResolve): Don't report the CS0120 for explicit
14833 interface implementations.
14835 2002-08-27 Martin Baulig <martin@gnome.org>
14837 * expression.cs (Invocation.DoResolve): If this is a static
14838 method and we don't have an InstanceExpression, we must report
14841 2002-08-25 Martin Baulig <martin@gnome.org>
14843 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14844 `==' between a valuetype and an object.
14846 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14848 * ecore.cs (TypeExpr): Provide a ToString method.
14850 2002-08-24 Martin Baulig <martin@gnome.org>
14852 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14853 now called proggie.dbg and it's a binary file.
14855 2002-08-23 Martin Baulig <martin@gnome.org>
14857 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14859 2002-08-23 Martin Baulig <martin@gnome.org>
14861 * struct.cs (MyStructInfo.ctor): Make this work with empty
14862 structs; it's not allowed to use foreach() on null.
14864 2002-08-23 Martin Baulig <martin@gnome.org>
14866 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14867 writer the full pathname of the generated assembly.
14869 2002-08-23 Martin Baulig <martin@gnome.org>
14871 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14872 A `finally' block never returns or breaks; improved handling of
14875 2002-08-23 Martin Baulig <martin@gnome.org>
14877 * statement.cs (Throw.Resolve): Allow `throw null'.
14879 2002-08-23 Martin Baulig <martin@gnome.org>
14881 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14882 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14883 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
14884 MemberLookup would return a wrong event if this is an explicit
14885 interface implementation and the class has an event with the same
14888 2002-08-23 Martin Baulig <martin@gnome.org>
14890 * statement.cs (Block.AddChildVariableNames): New public method.
14891 (Block.AddChildVariableName): Likewise.
14892 (Block.IsVariableNameUsedInChildBlock): Likewise.
14893 (Block.AddVariable): Check whether a variable name has already
14894 been used in a child block.
14896 * cs-parser.jay (declare_local_variables): Mark all variable names
14897 from the current block as being used in a child block in the
14900 2002-08-23 Martin Baulig <martin@gnome.org>
14902 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14903 find the symbol writer.
14905 * driver.cs: csc also allows the arguments to /define being
14906 separated by commas, not only by semicolons.
14908 2002-08-23 Martin Baulig <martin@gnome.org>
14910 * interface.cs (Interface.GetMembers): Added static check for events.
14912 2002-08-15 Martin Baulig <martin@gnome.org>
14914 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14915 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14917 * ecore.cs (Expression.MemberLookup): Added documentation and explained
14918 why the MethodData.EmitDestructor() change was necessary.
14920 2002-08-20 Martin Baulig <martin@gnome.org>
14922 * class.cs (TypeContainer.FindMembers): Added static check for events.
14924 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14926 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14927 use Type.GetEvents(), not Type.FindMembers().
14929 2002-08-20 Martin Baulig <martin@gnome.org>
14931 * decl.cs (MemberCache): Added a special method cache which will
14932 be used for method-only searched. This ensures that a method
14933 search will return a MethodInfo with the correct ReflectedType for
14936 2002-08-20 Martin Baulig <martin@gnome.org>
14938 * decl.cs (DeclSpace.FindMembers): Made this public.
14940 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14942 * delegate.cs: fixed build on windows.
14943 [FIXME: Filed as bug #29150: MCS must report these errors.]
14945 2002-08-19 Ravi Pratap <ravi@ximian.com>
14947 * ecore.cs (StandardConversionExists): Return a false
14948 if we are trying to convert the void type to anything else
14949 since that is not allowed.
14951 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14952 we flag error 70 in the event an event is trying to be accessed
14953 directly from outside the declaring type.
14955 2002-08-20 Martin Baulig <martin@gnome.org>
14957 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14958 MemberCache from typemanager.cs to decl.cs.
14960 2002-08-19 Martin Baulig <martin@gnome.org>
14962 * class.cs (TypeContainer): Implement IMemberContainer.
14963 (TypeContainer.DefineMembers): Create the MemberCache.
14964 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14965 return public members if BindingFlags.Public was given, check
14966 whether members are static.
14968 2002-08-16 Martin Baulig <martin@gnome.org>
14970 * decl.cs (DeclSpace.Define): Splitted this in Define and
14971 DefineMembers. DefineMembers is called first and initializes the
14974 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14975 DefineMembers() on all our DeclSpaces.
14977 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14978 but call DefineMembers() on all nested interfaces. We call their
14979 Define() in our new Define() function.
14981 * interface.cs (Interface): Implement IMemberContainer.
14982 (Interface.Define): Moved all code except the attribute stuf to
14984 (Interface.DefineMembers): Initialize the member cache.
14986 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14987 need this anymore since we can use MemberCache.FindMembers directly.
14989 2002-08-19 Martin Baulig <martin@gnome.org>
14991 * typemanager.cs (MemberCache): When creating the cache for an
14992 interface type, add all inherited members.
14993 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14994 to `out bool used_cache' and documented it.
14995 (TypeManager.MemberLookup): If we already used the cache in the first
14996 iteration, we don't need to do the interfaces check.
14998 2002-08-19 Martin Baulig <martin@gnome.org>
15000 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
15001 here from IMemberFinder and don't implement this interface anymore.
15002 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15004 * typemanager.cs (IMemberFinder): This interface is now only used by
15005 classes which actually support the member cache.
15006 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15007 since we only put DeclSpaces into this Hashtable.
15008 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15009 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15011 2002-08-16 Martin Baulig <martin@gnome.org>
15013 * typemanager.cs (ICachingMemberFinder): Removed.
15014 (IMemberFinder.MemberCache): New property.
15015 (TypeManager.FindMembers): Merged this with RealFindMembers().
15016 This function will never be called from TypeManager.MemberLookup()
15017 so we can't use the cache here, just the IMemberFinder.
15018 (TypeManager.MemberLookup_FindMembers): Check whether the
15019 IMemberFinder has a MemberCache and call the cache's FindMembers
15021 (MemberCache): Rewrote larger parts of this yet another time and
15022 cleaned it up a bit.
15024 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15026 * driver.cs (LoadArgs): Support quoting.
15028 (Usage): Show the CSC-like command line arguments.
15030 Improved a few error messages.
15032 2002-08-15 Martin Baulig <martin@gnome.org>
15034 * typemanager.cs (IMemberContainer.Type): New property.
15035 (IMemberContainer.IsInterface): New property.
15037 The following changes are conditional to BROKEN_RUNTIME, which is
15038 defined at the top of the file.
15040 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15041 class'es members, but add all members from TypeHandle.ObjectType
15042 if we're an interface.
15043 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15044 is the current type.
15045 (MemberCache.CacheEntry.Container): Removed this field.
15046 (TypeHandle.GetMembers): Include inherited members.
15048 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15050 * typemanager.cs: fixed compilation and added a comment on a field that
15053 2002-08-15 Martin Baulig <martin@gnome.org>
15055 * class.cs (ConstructorInitializer.Resolve): In the
15056 Expression.MemberLookup call, use the queried_type as
15059 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15060 declared' attribute, it's always true.
15061 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15062 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15063 temporary wrapper for FindMembers which tells MemberLookup whether
15064 members from the base classes are included in the return value.
15065 This will go away soon.
15066 (TypeManager.MemberLookup): Use this temporary hack here; once the
15067 new MemberCache is completed, we don't need to do the DeclaredOnly
15068 looping here anymore since the MemberCache will take care of this.
15069 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15070 (MemberCache): When creating the MemberCache for a class, get
15071 members from the current class and all its base classes.
15072 (MemberCache.CacheEntry.Container): New field. This is a
15073 temporary hack until the Mono runtime is fixed to distinguish
15074 between ReflectedType and DeclaringType. It allows us to use MCS
15075 with both the MS runtime and the unfixed Mono runtime without
15076 problems and without accecting performance.
15077 (MemberCache.SearchMembers): The DeclaredOnly looping from
15078 TypeManager.MemberLookup is now done here.
15080 2002-08-14 Martin Baulig <martin@gnome.org>
15082 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15083 Type.GetFields on dynamic types but get the fields from the
15084 corresponding TypeContainer.
15085 (MyStructInfo.GetStructInfo): Added check for enum types.
15087 * typemanager.cs (MemberList.IsSynchronized): Implemented.
15088 (MemberList.SyncRoot): Implemented.
15089 (TypeManager.FilterWithClosure): No need to check permissions if
15090 closure_start_type == closure_invocation_type, don't crash if
15091 closure_invocation_type is null.
15093 2002-08-13 Martin Baulig <martin@gnome.org>
15095 Rewrote TypeContainer.FindMembers to use a member cache. This
15096 gives us a speed increase of about 35% for the self-hosting MCS
15097 build and of about 15-20% for the class libs (both on GNU/Linux).
15099 * report.cs (Timer): New class to get enhanced profiling. This
15100 whole class is "TIMER" conditional since it remarkably slows down
15103 * class.cs (MemberList): New class. This is an IList wrapper
15104 which we're now using instead of passing MemberInfo[]'s around to
15105 avoid copying this array unnecessarily.
15106 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15107 (ICachingMemberFinder, IMemberContainer): New interface.
15108 (TypeManager.FilterWithClosure): If `criteria' is null, the name
15109 has already been checked, otherwise use it for the name comparision.
15110 (TypeManager.FindMembers): Renamed to RealMemberFinder and
15111 provided wrapper which tries to use ICachingMemberFinder.FindMembers
15112 if possible. Returns a MemberList, not a MemberInfo [].
15113 (TypeHandle): New class, implements IMemberContainer. We create
15114 one instance of this class per type, it contains a MemberCache
15115 which is used to do the member lookups.
15116 (MemberCache): New class. Each instance of this class contains
15117 all members of a type and a name-based hash table.
15118 (MemberCache.FindMembers): This is our new member lookup
15119 function. First, it looks up all members of the requested name in
15120 the hash table. Then, it walks this list and sorts out all
15121 applicable members and returns them.
15123 2002-08-13 Martin Baulig <martin@gnome.org>
15125 In addition to a nice code cleanup, this gives us a performance
15126 increase of about 1.4% on GNU/Linux - not much, but it's already
15127 half a second for the self-hosting MCS compilation.
15129 * typemanager.cs (IMemberFinder): New interface. It is used by
15130 TypeManager.FindMembers to call FindMembers on a TypeContainer,
15131 Enum, Delegate or Interface.
15132 (TypeManager.finder_to_member_finder): New PtrHashtable.
15133 (TypeManager.finder_to_container): Removed.
15134 (TypeManager.finder_to_delegate): Removed.
15135 (TypeManager.finder_to_interface): Removed.
15136 (TypeManager.finder_to_enum): Removed.
15138 * interface.cs (Interface): Implement IMemberFinder.
15140 * delegate.cs (Delegate): Implement IMemberFinder.
15142 * enum.cs (Enum): Implement IMemberFinder.
15144 * class.cs (TypeContainer): Implement IMemberFinder.
15146 2002-08-12 Martin Baulig <martin@gnome.org>
15148 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15150 2002-08-12 Martin Baulig <martin@gnome.org>
15152 * ecore.cs (ITypeExpression): New interface for expressions which
15154 (TypeExpression): Renamed to TypeLookupExpression.
15155 (Expression.DoResolve): If we're doing a types-only lookup, the
15156 expression must implement the ITypeExpression interface and we
15157 call DoResolveType() on it.
15158 (SimpleName): Implement the new ITypeExpression interface.
15159 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15160 hack, the situation that we're only looking up types can't happen
15161 anymore when this method is called. Moved the type lookup code to
15162 DoResolveType() and call it.
15163 (SimpleName.DoResolveType): This ITypeExpression interface method
15164 is now doing the types-only lookup.
15165 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15166 (ResolveFlags): Added MaskExprClass.
15168 * expression.cs (MemberAccess): Implement the ITypeExpression
15170 (MemberAccess.DoResolve): Added support for a types-only lookup
15171 when we're called via ITypeExpression.DoResolveType().
15172 (ComposedCast): Implement the ITypeExpression interface.
15174 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15175 Expression.Resolve() with ResolveFlags.Type instead.
15177 2002-08-12 Martin Baulig <martin@gnome.org>
15179 * interface.cs (Interface.Define): Apply attributes.
15181 * attribute.cs (Attribute.ApplyAttributes): Added support for
15182 interface attributes.
15184 2002-08-11 Martin Baulig <martin@gnome.org>
15186 * statement.cs (Block.Emit): Only check the "this" variable if we
15187 do not always throw an exception.
15189 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15190 whether the property has a set accessor.
15192 2002-08-11 Martin Baulig <martin@gnome.org>
15194 Added control flow analysis support for structs.
15196 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15197 with control flow analysis turned off.
15198 (IVariable): New interface.
15199 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15200 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15201 (FieldExpr.DoResolve): Resolve the instance expression with flow
15202 analysis turned off and do the definite assignment check after the
15203 resolving when we know what the expression will resolve to.
15205 * expression.cs (LocalVariableReference, ParameterReference):
15206 Implement the new IVariable interface, only call the flow analysis
15207 code if ec.DoFlowAnalysis is true.
15208 (This): Added constructor which takes a Block argument. Implement
15209 the new IVariable interface.
15210 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15211 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15212 This does the definite assignment checks for struct members.
15214 * class.cs (Constructor.Emit): If this is a non-static `struct'
15215 constructor which doesn't have any initializer, call
15216 Block.AddThisVariable() to tell the flow analysis code that all
15217 struct elements must be initialized before control returns from
15220 * statement.cs (MyStructInfo): New public class.
15221 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15222 argument to this indexer. If non-zero, check an individual struct
15223 member, not the whole struct.
15224 (FlowBranching.CheckOutParameters): Check struct members.
15225 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15226 overloaded versions of these methods which take an additional
15227 `int field_idx' argument to check struct members.
15228 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15229 overloaded versions of these methods which take an additional
15230 `string field_name' argument to check struct member.s
15231 (VariableInfo): Implement the IVariable interface.
15232 (VariableInfo.StructInfo): New public property. Returns the
15233 MyStructInfo instance of the variable if it's a struct or null.
15234 (Block.AddThisVariable): New public method. This is called from
15235 Constructor.Emit() for non-static `struct' constructor which do
15236 not have any initializer. It creates a special variable for the
15237 "this" instance variable which will be checked by the flow
15238 analysis code to ensure that all of the struct's fields are
15239 initialized before control returns from the constructor.
15240 (UsageVector): Added support for struct members. If a
15241 variable/parameter is a struct with N members, we reserve a slot
15242 in the usage vector for each member. A struct is considered fully
15243 initialized if either the struct itself (slot 0) or all its
15244 members are initialized.
15246 2002-08-08 Martin Baulig <martin@gnome.org>
15248 * driver.cs (Driver.MainDriver): Only report an error CS5001
15249 if there were no compilation errors.
15251 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15252 `UnsafeContext' property to determine whether the parent is in
15253 unsafe context rather than checking the parent's ModFlags:
15254 classes nested in an unsafe class are unsafe as well.
15256 2002-08-08 Martin Baulig <martin@gnome.org>
15258 * statement.cs (UsageVector.MergeChildren): Distinguish between
15259 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15260 we return. Added test17() and test18() to test-154.cs.
15262 2002-08-08 Martin Baulig <martin@gnome.org>
15264 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15265 Family access, make sure the invoking type isn't a subclass of the
15266 queried type (that'd be a CS1540).
15268 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15269 this method which takes an additional `Type invocation_type'.
15271 * expression.cs (BaseAccess.DoResolve): Use the base type as
15272 invocation and query type.
15273 (MemberAccess.DoResolve): If the lookup failed and we're about to
15274 report a CS0122, try a lookup with the ec.ContainerType - if this
15275 succeeds, we must report a CS1540.
15277 2002-08-08 Martin Baulig <martin@gnome.org>
15279 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15280 (MethodGroupExpr): Implement the IMemberExpr interface.
15282 * expression (MemberAccess.ResolveMemberAccess): No need to have
15283 any special code for MethodGroupExprs anymore, they're now
15286 2002-08-08 Martin Baulig <martin@gnome.org>
15288 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15289 Family, FamANDAssem and FamORAssem permissions.
15290 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15292 2002-08-08 Martin Baulig <martin@gnome.org>
15294 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15295 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15298 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15300 * driver.cs: implemented /resource option to embed managed resources.
15302 2002-08-07 Martin Baulig <martin@gnome.org>
15304 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15305 (FieldBase.HasFieldInitializer): New public property.
15306 (FieldBase.GetInitializerExpression): New public method. Resolves and
15307 returns the field initializer and makes sure it is only resolved once.
15308 (TypeContainer.EmitFieldInitializers): Call
15309 FieldBase.GetInitializerExpression to get the initializer, this ensures
15310 that it isn't resolved multiple times.
15312 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15313 the resolving process (SimpleName/MemberLookup) that we're currently
15314 emitting a field initializer (which must not access any instance members,
15315 this is an error CS0236).
15317 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15318 argument, if the `IsFieldInitializer' flag is set, we must report and
15319 error CS0236 and not an error CS0120.
15321 2002-08-07 Martin Baulig <martin@gnome.org>
15323 * ecore.cs (IMemberExpr): New public interface.
15324 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15325 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15326 if the expression is an IMemberExpr.
15328 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15329 to be null, implicitly default to `this' if we're non-static in
15330 this case. Simplified the code a lot by using the new IMemberExpr
15331 interface. Also fixed bug #28176 here.
15333 2002-08-06 Martin Baulig <martin@gnome.org>
15335 * cs-parser.jay (SimpleLookup): Removed. We need to create
15336 ParameterReferences during semantic analysis so that we can do a
15337 type-only search when resolving Cast, TypeOf and SizeOf.
15338 (block): Pass the `current_local_parameters' to the Block's
15341 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15342 argument to the constructor.
15343 (ConstructorInitializer.Resolve): Create a temporary implicit
15344 block with the parameters.
15346 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15347 references here if we aren't doing a type-only search.
15349 * statement.cs (Block): Added constructor which takes a
15350 `Parameters parameters' argument.
15351 (Block.Parameters): New public property.
15353 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15354 to `Parameters' and made it public readonly.
15356 2002-08-06 Martin Baulig <martin@gnome.org>
15358 * ecore.cs (Expression.Warning): Made this public as well.
15360 * report.cs (Report.Debug): Print the contents of collections.
15362 2002-08-06 Martin Baulig <martin@gnome.org>
15364 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15365 used to tell Resolve() which kinds of expressions it may return.
15366 (Expression.Resolve): Added overloaded version of this method which
15367 takes a `ResolveFlags flags' argument. This can be used to tell
15368 Resolve() which kinds of expressions it may return. Reports a
15370 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15371 ResolveFlags.SimpleName.
15372 (Expression.Error118): Added overloaded version of this method which
15373 takes a `ResolveFlags flags' argument. It uses the flags to determine
15374 which kinds of expressions are allowed.
15376 * expression.cs (Argument.ResolveMethodGroup): New public method.
15377 Resolves an argument, but allows a MethodGroup to be returned.
15378 This is used when invoking a delegate.
15380 * TODO: Updated a bit.
15382 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15384 Fixed compilation with csc.
15386 * ecore.cs: Expression.Error made public. Is this correct? Should
15387 Warning be made public too?
15389 * expression.cs: use ea.Location instead of ea.loc.
15390 [FIXME: Filed as bug #28607: MCS must report these errors.]
15392 2002-08-06 Martin Baulig <martin@gnome.org>
15394 * ecore.cs (Expression.loc): Moved the location here instead of
15395 duplicating it in all derived classes.
15396 (Expression.Location): New public property.
15397 (Expression.Error, Expression.Warning): Made them non-static and
15398 removed the location argument.
15399 (Expression.Warning): Added overloaded version which takes an
15400 `int level' argument.
15401 (Expression.Error118): Make this non-static and removed the
15402 expression and location arguments.
15403 (TypeExpr): Added location argument to the constructor.
15405 * expression.cs (StaticCallExpr): Added location argument to
15407 (Indirection, PointerArithmetic): Likewise.
15408 (CheckedExpr, UnCheckedExpr): Likewise.
15409 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15410 (StringPtr): Likewise.
15413 2002-08-05 Martin Baulig <martin@gnome.org>
15415 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15417 * assign.cs (Assign.DoResolve): Check whether the source
15418 expression is a value or variable.
15420 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15421 while resolving the corresponding blocks.
15423 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15424 an error, don't silently return null.
15426 * statement.cs (Block.AddVariable): Do the error reporting here
15427 and distinguish between CS0128 and CS0136.
15428 (Block.DoResolve): Report all unused labels (warning CS0164).
15429 (LabeledStatement): Pass the location to the constructor.
15430 (LabeledStatement.HasBeenReferenced): New property.
15431 (LabeledStatement.Resolve): Set it to true here.
15433 * statement.cs (Return.Emit): Return success even after reporting
15434 a type mismatch error (CS0126 or CS0127), this is what csc does and
15435 it avoids confusing the users with any consecutive errors.
15437 2002-08-05 Martin Baulig <martin@gnome.org>
15439 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15441 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15443 * expression.cs (MemberAccess.DoResolve): Silently return if an
15444 error has already been reported.
15446 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15447 error has already been reported.
15449 2002-08-05 Martin Baulig <martin@gnome.org>
15451 * statement.cs (UsageVector): Only initialize the `parameters'
15452 vector if we actually have any "out" parameters.
15454 2002-08-05 Martin Baulig <martin@gnome.org>
15456 * expression.cs (Binary.ResolveOperator): When combining delegates,
15457 they must have the same type.
15459 2002-08-05 Martin Baulig <martin@gnome.org>
15461 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15462 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15463 work with the ms runtime and we also don't need it: if we're a
15464 PropertyBuilder and not in the `indexer_arguments' hash, then we
15465 are a property and not an indexer.
15467 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15468 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15469 since the latter one doesn't work with the ms runtime.
15471 2002-08-03 Martin Baulig <martin@gnome.org>
15473 Fixed bugs #27998 and #22735.
15475 * class.cs (Method.IsOperator): New public field.
15476 (Method.CheckBase): Report CS0111 if there's already a method
15477 with the same parameters in the current class. Report CS0508 when
15478 attempting to change the return type of an inherited method.
15479 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15480 and it's not marked abstract or extern.
15481 (PropertyBase): New abstract base class for Property and Indexer.
15482 (PropertyBase.CheckBase): Moved here from Property and made it work
15484 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15485 the same so we can reuse it there.
15486 (Property, Indexer): Derive from PropertyBase.
15487 (MethodSignature.inheritable_property_signature_filter): New delegate
15488 to find properties and indexers.
15490 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15491 argument and improved error reporting.
15493 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15494 EmptyReadOnlyParameters and made it a property.
15496 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15497 version of this method which takes a `PropertyInfo indexer'.
15498 (TypeManager.RegisterIndexer): New method.
15500 * class.cs: Added myself as author of this file :-)
15502 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15504 * class.cs: fixed compilation on windoze.
15506 2002-08-03 Martin Baulig <martin@gnome.org>
15508 * interface.cs (Interface.GetInterfaceBases): Check whether all
15509 base interfaces are at least as accessible than the current one.
15511 * class.cs (TypeContainer.GetClassBases): Check whether base types
15512 are at least as accessible than the current type.
15513 (TypeContainer.AsAccessible): Implemented and made non-static.
15514 (MemberBase.CheckParameters): Report errors if the accessibility
15517 * delegate.cs (Delegate.Delegate): The default visibility is
15518 internal for top-level types and private for nested types.
15519 (Delegate.Define): Report errors if the accessibility checks fail.
15521 * enum.cs (Enum.Enum): The default visibility is internal for
15522 top-level types and private for nested types.
15523 (Enum.DefineType): Compute the correct visibility.
15525 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15526 function which takes a `bool is_toplevel' instead of a TypeContainer.
15528 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15531 2002-08-02 Martin Baulig <martin@gnome.org>
15533 * expression.cs (LocalVariableReferenc): Added constructor which
15534 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15535 (LocalVariableReference.IsReadOnly): New property.
15536 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15537 variable is readonly, use our own readonly flag to do this; you can
15538 use the new constructor to get a writable reference to a read-only
15541 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15542 reference to the local variable.
15544 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15546 * rootcontext.cs (ResolveCore): Also include System.Exception
15548 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15549 we reach an EmptyStatement.
15551 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15554 * expression.cs (Binary.ResolveOperator): Check error result in
15557 use brtrue/brfalse directly and avoid compares to null.
15559 2002-08-02 Martin Baulig <martin@gnome.org>
15561 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15562 Fixes bug #28407, added test-155.cs.
15564 2002-08-01 Martin Baulig <martin@gnome.org>
15566 * class.cs (Event.EmitDefaultMethod): Make this work with static
15567 events. Fixes #28311, added verify-3.cs.
15569 2002-08-01 Martin Baulig <martin@gnome.org>
15571 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15572 `is_disposable' fields.
15573 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15574 `hm.is_disposable' if we're using the collection pattern.
15575 (Foreach.EmitCollectionForeach): Use the correct type for the
15576 enumerator's local variable, only emit the try/finally block if
15577 necessary (fixes #27713).
15579 2002-08-01 Martin Baulig <martin@gnome.org>
15581 * ecore.cs (Expression.report118): Renamed to Error118 and made
15584 * statement.cs (Throw.Resolve): Check whether the expression is of
15585 the correct type (CS0118) and whether the type derives from
15586 System.Exception (CS0155).
15587 (Catch.Resolve): New method. Do the type lookup here and check
15588 whether it derives from System.Exception (CS0155).
15589 (Catch.CatchType, Catch.IsGeneral): New public properties.
15591 * typemanager.cs (TypeManager.exception_type): Added.
15593 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15595 * driver.cs: Updated About function.
15597 2002-07-31 Martin Baulig <martin@gnome.org>
15599 Implemented Control Flow Analysis.
15601 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15602 (EmitContext.CurrentBranching): Added.
15603 (EmitContext.StartFlowBranching): Added.
15604 (EmitContext.EndFlowBranching): Added.
15605 (EmitContext.KillFlowBranching): Added.
15606 (EmitContext.IsVariableAssigned): Added.
15607 (EmitContext.SetVariableAssigned): Added.
15608 (EmitContext.IsParameterAssigned): Added.
15609 (EmitContext.SetParameterAssigned): Added.
15610 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15611 Added control flow analysis stuff here.
15613 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15614 resolve the expression as lvalue.
15615 (LocalVariableReference.DoResolve): Check whether the variable has
15616 already been assigned.
15617 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15618 the parameter as assigned here.
15619 (ParameterReference.DoResolve): Check whether the parameter has already
15621 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15622 expression as lvalue.
15624 * statement.cs (FlowBranching): New class for the flow analysis code.
15625 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15626 (LabeledStatement.IsDefined): New public property.
15627 (LabeledStatement.AddUsageVector): New public method to tell flow
15628 analyis that the label may be reached via a forward jump.
15629 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15631 (VariableInfo.Number): New public field. This is used by flow analysis
15632 to number all locals of a block.
15633 (Block.CountVariables): New public property. This is the number of
15634 local variables in this block (including the locals from all parent
15636 (Block.EmitMeta): Number all the variables.
15638 * statement.cs: Added flow analysis support to all classes.
15640 2002-07-31 Martin Baulig <martin@gnome.org>
15642 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15643 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15644 then use this argument.
15646 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15648 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15649 use this to specify /define options.
15651 2002-07-29 Martin Baulig <martin@gnome.org>
15653 * statement.cs (Fixed): Moved all code that does variable lookups
15654 and resolvings from Emit to Resolve.
15656 * statement.cs (For): Moved all code that does variable lookups
15657 and resolvings from Emit to Resolve.
15659 * statement.cs (Using): Moved all code that does variable lookups
15660 and resolvings from Emit to Resolve.
15662 2002-07-29 Martin Baulig <martin@gnome.org>
15664 * attribute.cs (Attribute.Resolve): Explicitly catch a
15665 System.NullReferenceException when creating the
15666 CustromAttributeBuilder and report a different warning message.
15668 2002-07-29 Martin Baulig <martin@gnome.org>
15670 * support.cs (ParameterData.ParameterName): Added method to
15671 get the name of a parameter.
15673 * typemanager.cs (TypeManager.IsValueType): New public method.
15675 2002-07-29 Martin Baulig <martin@gnome.org>
15677 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15678 is a flag which specifies that it's either ref or out.
15679 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15680 the out parameter to `out Parameter.Modifier mod', also set the
15681 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15683 * support.cs (InternalParameters.ParameterModifier): Distinguish
15684 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15685 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15687 * expression.cs (Argument.GetParameterModifier): Distinguish
15688 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15689 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15691 2002-07-29 Martin Baulig <martin@gnome.org>
15693 * expression.cs (ParameterReference.ParameterReference): Added
15694 `Location loc' argument to the constructor.
15696 * cs-parser.jay: Pass location to ParameterReference.
15698 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15700 * statement.cs (Try): Initialize the location.
15702 * cs-parser.jay: pass location to Try.
15704 * expression.cs (Unary.Reduce): Change the prototype to return
15705 whether a constant fold could be performed or not. The result is
15706 returned in an out parameters. In the case of Indirection and
15707 AddressOf, we want to perform the full tests.
15709 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15711 * statement.cs (Statement.Emit): Flag dead code.
15713 2002-07-27 Andrew Birkett <andy@nobugs.org>
15715 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15717 2002-07-27 Martin Baulig <martin@gnome.org>
15719 * class.cs (MethodData.Define): Put back call to
15720 TypeManager.AddMethod(), accidentally commented this out.
15722 * report.cs (Debug): New public method to print debugging information,
15723 this is `[Conditional ("DEBUG")]'.
15725 2002-07-26 Martin Baulig <martin@gnome.org>
15727 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15728 (switch_statement): Push the current_block to the switch_stack and
15729 pop it again when we're done with the switch.
15730 (switch_section): The new block is a child of the current_block.
15731 Fixes bug #24007, added test-152.cs.
15733 2002-07-27 Martin Baulig <martin@gnome.org>
15735 * expression.cs (Invocation.EmitArguments): When calling a varargs
15736 function with only its fixed arguments, we need to pass an empty
15739 2002-07-27 Martin Baulig <martin@gnome.org>
15741 Mono 0.13 has been released.
15743 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15745 * driver.cs: Rename --resource to --linkres, because that is what
15746 we do currently, we dont support --resource yet.
15748 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15750 2002-07-25 Martin Baulig <martin@gnome.org>
15752 * class.cs (MethodData): New public class. This is a `method builder'
15753 class for a method or one accessor of a Property/Indexer/Event.
15754 (MethodData.GetMethodFlags): Moved here from MemberBase.
15755 (MethodData.ApplyAttributes): Likewise.
15756 (MethodData.ApplyObsoleteAttribute): Likewise.
15757 (MethodData.ApplyConditionalAttribute): Likewise.
15758 (MethodData.ApplyDllImportAttribute): Likewise.
15759 (MethodData.CheckAbstractAndExternal): Likewise.
15760 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15761 (MethodData.Emit): Formerly known as Method.Emit().
15762 (MemberBase): Moved everything which was specific to a single
15763 accessor/method to MethodData.
15764 (Method): Create a new MethodData and call Define() and Emit() on it.
15765 (Property, Indexer, Event): Create a new MethodData objects for each
15766 accessor and call Define() and Emit() on them.
15768 2002-07-25 Martin Baulig <martin@gnome.org>
15770 Made MethodCore derive from MemberBase to reuse the code from there.
15771 MemberBase now also checks for attributes.
15773 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15774 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15776 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15777 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15778 (MemberBase.ApplyAttributes): New virtual method; applies the
15779 attributes to a method or accessor.
15780 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15781 (MemberBase.ApplyConditionalAttribute): Likewise.
15782 (MemberBase.ApplyDllImportAttribute): Likewise.
15783 (MemberBase.CheckAbstractAndExternal): Likewise.
15784 (MethodCore.ParameterTypes): This is now a property instead of a
15785 method, it's initialized from DoDefineParameters().
15786 (MethodCore.ParameterInfo): Removed the set accessor.
15787 (MethodCore.DoDefineParameters): New protected virtual method to
15788 initialize ParameterTypes and ParameterInfo.
15789 (Method.GetReturnType): We can now simply return the MemberType.
15790 (Method.GetMethodFlags): Override the MemberBase version and add
15791 the conditional flags.
15792 (Method.CheckBase): Moved some code from Define() here, call
15793 DoDefineParameters() here.
15794 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15795 here to avoid some larger code duplication.
15796 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15797 ensure that abstract and external accessors don't declare a body.
15799 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15800 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15801 lookup in the attribute's parent classes, so we need to abort as soon
15802 as we found the first match.
15803 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15804 the attribute has no arguments.
15806 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15809 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15811 * cs-parser.jay: reverted previous patch.
15813 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15815 * cs-parser.jay: fixed bug #22119.
15817 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15819 * attribute.cs: fixed compilation. The error was:
15820 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15821 be assigned to before control leaves the current method."
15822 [FIXME: Filed as bug #28186: MCS must report this error.]
15824 2002-07-25 Martin Baulig <martin@gnome.org>
15826 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15827 method to pull the condition name ouf of a Conditional attribute.
15828 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15829 the obsolete message and error flag out of an Obsolete attribute.
15831 * class.cs (Method.GetMethodFlags): New public method to get the
15832 TypeManager.MethodFlags for this method.
15833 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15835 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15836 if we're overriding a virtual function, set the new private variable
15837 `parent_method'; call the new TypeManager.AddMethod().
15839 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15840 the MethodBuilder and the Method in a PtrHashtable.
15841 (TypeManager.builder_to_method): Added for this purpose.
15842 (TypeManager.MethodFlags): Added IsObsoleteError.
15843 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15844 Obsolete and Conditional arguments in MethodBuilders. If we discover
15845 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15846 the message from the attribute.
15848 2002-07-24 Martin Baulig <martin@gnome.org>
15850 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15851 preprocessor directives, ensure that the argument to #define/#undef is
15852 exactly one identifier and that it's actually an identifier.
15854 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15857 2002-07-24 Martin Baulig <martin@gnome.org>
15859 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15860 initialize it to TypeManager.object_type in the constructor.
15861 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15862 of the `hm.get_current' method if we're using the collection pattern.
15863 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15864 for the explicit conversion to make it work when we're using the collection
15865 pattern and the `Current' property has a different return type than `object'.
15868 2002-07-24 Martin Baulig <martin@gnome.org>
15870 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15871 does not match, but don't report any errors. This method is called in
15872 order for all methods in a MethodGroupExpr until a matching method is
15873 found, so we don't want to bail out if the first method doesn't match.
15874 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15875 matches, report the 123. Fixes #28070.
15877 2002-07-24 Martin Baulig <martin@gnome.org>
15879 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15880 TypeManager.TypeToCoreType() to the top of the method so the
15881 following equality checks will work. Fixes #28107.
15883 2002-07-24 Martin Baulig <martin@gnome.org>
15885 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15886 operand is of type uint, and the other operand is of type sbyte,
15887 short or int, the operands are converted to type long." -
15888 Actually do what this comment already told us. Fixes bug #28106,
15891 2002-07-24 Martin Baulig <martin@gnome.org>
15893 * class.cs (MethodBase): New abstract class. This is now a base
15894 class for Property, Indexer and Event to avoid some code duplication
15895 in their Define() and DefineMethods() methods.
15896 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15897 generic methods for Define() and DefineMethods().
15898 (FieldBase): Derive from MemberBase, not MemberCore.
15899 (Property): Derive from MemberBase, not MemberCore.
15900 (Property.DefineMethod): Moved all the code from this method to the
15901 new MethodBase.DefineAccessor(), just call it with appropriate
15903 (Property.Define): Call the new Property.DoDefine(), this does some
15904 sanity checks and we don't need to duplicate the code everywhere.
15905 (Event): Derive from MemberBase, not MemberCore.
15906 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15907 accessors, this will also make them work with interface events.
15908 (Indexer): Derive from MemberBase, not MemberCore.
15909 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15910 (Indexer.Define): Use the new MethodBase functions.
15912 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15913 argument to the constructor.
15914 (Interface.FindMembers): Added support for interface events.
15915 (Interface.PopluateEvent): Implemented.
15917 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
15919 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15921 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15922 but this is required to check for a method name being the same as
15923 the containing class.
15927 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15929 * interface.cs: initialize variable.
15931 2002-07-23 Martin Baulig <martin@gnome.org>
15933 Implemented the IndexerName attribute in interfaces.
15935 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15936 name if this is an explicit interface implementation.
15937 (Indexer.InterfaceIndexerName): New public variable. If we're
15938 implementing an interface indexer, this is the IndexerName in that
15939 interface. Otherwise, it's the IndexerName.
15940 (Indexer.DefineMethod): If we're implementing interface indexer,
15941 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15942 and Pending.ImplementIndexer methods.
15943 (Indexer.Define): Also define the PropertyBuilder if we're
15944 implementing an interface indexer and this is neither an explicit
15945 interface implementation nor do the IndexerName match the one in
15948 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15949 If a method is defined here, then we always need to create a proxy
15950 for it. This is used when implementing interface indexers.
15951 (Pending.IsInterfaceIndexer): New public method.
15952 (Pending.ImplementIndexer): New public method.
15953 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15954 This is used when implementing interface indexers to define a proxy
15956 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15957 define a proxy if necessary.
15959 * interface.cs (Interface.IndexerName): New public variable.
15960 (Interface.PopulateIndexer): Set the IndexerName.
15961 (Interface.DefineIndexers): New private method. Populate all the
15962 indexers and make sure their IndexerNames match.
15964 * typemanager.cs (IndexerPropertyName): Added support for interface
15967 2002-07-22 Martin Baulig <martin@gnome.org>
15969 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15970 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15971 ret if HasReturnLabel.
15972 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15975 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15976 and set the ec.LoopBeginTryCatchLevel.
15977 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15978 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15979 the current ec.TryCatchLevel, the branch goes out of an exception
15980 block. In this case, we need to use Leave and not Br.
15982 2002-07-22 Martin Baulig <martin@gnome.org>
15984 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15985 block unless the block does not always return or it is contained in
15986 another try { ... } catch { ... } block. Fixes bug #26506.
15987 Added verify-1.cs to the test suite.
15989 2002-07-22 Martin Baulig <martin@gnome.org>
15991 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15992 then we do not always return. Fixes bug #24985.
15994 2002-07-22 Martin Baulig <martin@gnome.org>
15996 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15997 lookup on a per-class level; ie. walk up the class hierarchy until we
15998 found at least one applicable method, then choose the best among them.
15999 Fixes bug #24463 and test-29.cs.
16001 2002-07-22 Martin Baulig <martin@gnome.org>
16003 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16004 return types of the methods. The return type is not part of the
16005 signature and we must not check it to make the `new' modifier work.
16006 Fixes bug #27999, also added test-147.cs.
16007 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16009 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16010 on the method's return type.
16012 2002-07-21 Martin Baulig <martin@gnome.org>
16014 * assign.cs: Make this work if the rightmost source is a constant and
16015 we need to do an implicit type conversion. Also adding a few more tests
16016 to test-38.cs which should have caught this.
16018 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16019 target in the makefile for this. The makefile.gnu is primarily intended
16020 for end-users who don't want to debug the compiler.
16022 2002-07-21 Martin Baulig <martin@gnome.org>
16024 * assign.cs: Improved the Assign class so it can now handle embedded
16025 assignments (X = Y = Z = something). As a side-effect this'll now also
16026 consume less local variables. test-38.cs now passes with MCS, added
16027 a few new test cases to that test.
16029 2002-07-20 Martin Baulig <martin@gnome.org>
16031 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16032 instructions. Fixes bug #27977, also added test-146.cs.
16034 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16036 * cs-tokenizer.cs: fixed getHex ().
16038 2002-07-19 Martin Baulig <martin@gnome.org>
16040 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16041 not Type.GetType() to lookup the array type. This is needed when
16042 we're constructing an array of a user-defined type.
16043 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16044 single-dimensional arrays, but also for single-dimensial arrays of
16047 2002-07-19 Martin Baulig <martin@gnome.org>
16049 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16050 this function is called, it's not allowed to share LocalBuilders
16051 among ILGenerators.
16053 2002-07-19 Martin Baulig <martin@gnome.org>
16055 * expression.cs (Argument.Resolve): Report an error 118 when trying
16056 to pass a type as argument.
16058 2002-07-18 Martin Baulig <martin@gnome.org>
16060 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16061 Conv_R_Un for the signed `long' type.
16063 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16065 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16066 `expr' for the temporary result, as that will fail if we do
16067 multiple resolves on the same expression.
16069 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16071 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16072 ec.TypeContainer for looking up aliases.
16074 * class.cs (TypeContainer): Remove LookupAlias from here.
16076 * decl.cs (DeclSpace); Move here.
16078 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16080 * class.cs (FindMembers): Only call filter if the constructor
16081 bulider is not null.
16083 Also handle delegates in `NestedTypes' now. Now we will perform
16084 type lookups using the standard resolution process. This also
16087 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16088 This uses Expressions (the limited kind that can be parsed by the
16089 tree) instead of strings.
16091 * expression.cs (ComposedCast.ToString): Implement, used to flag
16092 errors since now we have to render expressions.
16094 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
16097 * ecore.cs (SimpleName.ToString): ditto.
16099 * cs-parser.jay: Instead of using strings to assemble types, use
16100 Expressions to assemble the type (using SimpleName, ComposedCast,
16101 MemberAccess). This should fix the type lookups in declarations,
16102 because we were using a different code path for this.
16104 * statement.cs (Block.Resolve): Continue processing statements
16105 even when there is an error.
16107 2002-07-17 Miguel de Icaza <miguel@ximian.com>
16109 * class.cs (Event.Define): Also remove the `remove' method from
16110 the list of pending items.
16112 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16113 generate more compact code.
16115 2002-07-17 Martin Baulig <martin@gnome.org>
16117 * const.cs (Const.LookupConstantValue): Add support for constant
16118 `unchecked' and `checked' expressions.
16119 Also adding test case test-140.cs for this.
16121 2002-07-17 Martin Baulig <martin@gnome.org>
16123 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16124 check whether mi.ReturnType implements the IEnumerator interface; the
16125 `==' and the IsAssignableFrom() will fail in this situation.
16127 2002-07-16 Ravi Pratap <ravi@ximian.com>
16129 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
16132 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16134 * expression.cs: fixed bug #27811.
16136 2002-07-14 Miguel de Icaza <miguel@ximian.com>
16138 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16139 Molaro: when we are a ref, the value already contains a pointer
16140 value, do not take the address of it.
16142 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16143 * removed mb-parser.jay and mb-tokenizer.cs
16145 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16147 * expression.cs: check against the building corlib void type.
16149 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16151 * ecore.cs: fix for valuetype static readonly fields: when
16152 initializing them, we need their address, not the address of a copy.
16154 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16156 * typemanager.cs: register also enum_type in corlib.
16158 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16160 * class.cs: allow calling this (but not base) initializers in structs.
16162 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16164 * ecore.cs: make sure we compare against the building base types
16167 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16169 * typemanager.cs: fix TypeToCoreType() to handle void and object
16170 (corlib gets no more typerefs after this change).
16172 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16174 * expression.cs (ArrayCreation.EmitArrayArguments): use
16175 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16177 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16178 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16179 array indexes, the runtime actually forbids them.
16181 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16182 for array arguments here.
16184 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16185 instead of the default for ValueTypes.
16187 (New.DoEmit): Use IsValueType instead of
16188 IsSubclassOf (value_type)
16189 (New.DoResolve): ditto.
16190 (Invocation.EmitCall): ditto.
16192 * assign.cs (Assign): ditto.
16194 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16195 Statements *are* currently doing part of their resolution during
16198 Expressions do always resolve during resolve, but statements are
16199 only required to propagate resolution to their children.
16201 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16203 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16205 (LoadAssembly): Do not add the dll if it is already specified
16207 (MainDriver): Add the System directory to the link path at the end,
16208 after all the other -L arguments.
16210 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16211 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16212 ldelem.u1) and using the opposite for sbytes.
16214 This fixes Digger, and we can finally run it.
16216 * driver.cs (UnixParseOption): Move the option parsing here.
16217 (CSCParseOption): Implement CSC-like parsing of options.
16219 We now support both modes of operation, the old Unix way, and the
16220 new CSC-like way. This should help those who wanted to make cross
16221 platform makefiles.
16223 The only thing broken is that /r:, /reference: and /lib: are not
16224 implemented, because I want to make those have the same semantics
16225 as the CSC compiler has, and kill once and for all the confussion
16226 around this. Will be doing this tomorrow.
16228 * statement.cs (Unsafe.Resolve): The state is checked during
16229 resolve, not emit, so we have to set the flags for IsUnsfe here.
16231 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16233 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16234 not catch the Error_ObjectRefRequired in SimpleName (as it is
16235 possible to have a class/instance variable name that later gets
16236 deambiguated), we have to check this here.
16238 2002-07-10 Ravi Pratap <ravi@ximian.com>
16240 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16241 make static and put into Expression.
16243 (Event.Define): Register the private field of the event with the
16244 TypeManager so that GetFieldFromEvent can get at it.
16246 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16247 keep track of the private field associated with an event which
16250 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16253 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16255 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16257 * expression.cs (Binary.EmitBranchable): this routine emits the
16258 Binary expression in a branchable context. This basically means:
16259 we need to branch somewhere, not just get the value on the stack.
16261 This works together with Statement.EmitBoolExpression.
16263 * statement.cs (Statement.EmitBoolExpression): Use
16266 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16268 * statement.cs (For): Reduce the number of jumps in loops.
16270 (For): Implement loop inversion for the For statement.
16272 (Break): We can be breaking out of a Try/Catch controlled section
16273 (foreach might have an implicit try/catch clause), so we need to
16274 use Leave instead of Br.
16276 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16277 now). If the instace expression supports IMemoryLocation, we use
16278 the AddressOf method from the IMemoryLocation to extract the
16279 address instead of emitting the instance.
16281 This showed up with `This', as we were emitting the instance
16282 always (Emit) instead of the Address of This. Particularly
16283 interesting when This is a value type, as we dont want the Emit
16284 effect (which was to load the object).
16286 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16288 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16290 * statement.cs (Checked): Set the CheckedState during the resolve
16291 process too, as the ConvCast operations track the checked state on
16292 the resolve process, and not emit.
16294 * cs-parser.jay (namespace_member_declaration): Flag that we have
16295 found a declaration when we do. This is used to flag error 1529
16297 * driver.cs: Report ok when we display the help only.
16299 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16301 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16303 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16305 * cs-tokenizer.cs (define): We also have to track locally the
16306 defines. AllDefines is just used for the Conditional Attribute,
16307 but we also need the local defines for the current source code.
16309 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16311 * statement.cs (While, For, Do): These loops can exit through a
16312 Break statement, use this information to tell whether the
16313 statement is the last piece of code.
16315 (Break): Flag that we break.
16317 * codegen.cs (EmitContexts): New `Breaks' state variable.
16319 2002-07-03 Martin Baulig <martin@gnome.org>
16321 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16322 modifiers in method declarations in structs. Otherwise, you won't
16323 be able to override things like Object.Equals().
16325 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16327 * class.cs (Method, Property, Indexer): Do not allow the public
16328 modifier to be used in explicit interface implementations.
16330 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16331 override modifiers in method declarations in structs
16333 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16335 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16336 integer or real overflow, report an error
16338 2002-07-02 Martin Baulig <martin@gnome.org>
16340 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16341 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16342 to tell the runtime about our newly created System.Object and
16343 System.ValueType types.
16345 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16347 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16348 struct instead of Ldarg/Starg.
16350 2002-07-02 Martin Baulig <martin@gnome.org>
16352 * expression.cs (Indirection.Indirection): Call
16353 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16355 2002-07-02 Martin Baulig <martin@gnome.org>
16357 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16358 ValueType, call TypeManager.TypeToCoreType() on it.
16359 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16360 the OpCodes.Newarr argument.
16362 2002-07-02 Martin Baulig <martin@gnome.org>
16364 * expression.cs (Invocation.EmitCall): When compiling corlib,
16365 replace all calls to the system's System.Array type to calls to
16366 the newly created one.
16368 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16369 System.Array methods.
16370 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16371 from the system's System.Array type which must be replaced.
16373 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16375 * typemanager.cs: load unverifiable_code_ctor so we can build
16376 corlib using the correct type. Avoid using GetTypeCode() with
16378 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16379 TypeManager.object_type to allow building corlib.
16381 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16383 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16385 2002-07-01 Martin Baulig <martin@gnome.org>
16387 * class.cs: Make the last change actually work, we need to check
16388 whether `ifaces != null' to avoid a crash.
16390 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16392 * class.cs: when we build structs without fields that implement
16393 interfaces, we need to add the interfaces separately, since there is
16394 no API to both set the size and add the interfaces at type creation
16397 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16399 * expression.cs: the dimension arguments to the array constructors
16400 need to be converted if they are a long.
16402 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16404 * class.cs: don't emit ldarg.0 if there is no parent constructor
16405 (fixes showstopper for corlib).
16407 2002-06-29 Martin Baulig <martin@gnome.org>
16409 MCS now compiles corlib on GNU/Linux :-)
16411 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16412 ie. check for MethodImplOptions.InternalCall.
16414 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16415 and TypeManager.attribute_type are null, so we must explicitly check
16416 whether parent is not null to find out whether it's an attribute type.
16417 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16418 and SetBuilder, not only if the property is neither abstract nor external.
16419 This is necessary to set the MethodImplOptions on the accessor methods.
16420 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16421 SetBuilder, see Property.Emit().
16423 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16424 populate "System.Object", "System.ValueType" and "System.Attribute" since
16425 they've already been populated from BootCorlib_PopulateCoreTypes().
16427 2002-06-29 Martin Baulig <martin@gnome.org>
16429 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16430 is the NullLiteral, we also need to make sure that target_type is not
16433 2002-06-29 Martin Baulig <martin@gnome.org>
16435 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16436 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16437 before calling BootstrapCorlib_ResolveDelegate ().
16439 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16441 * statement.cs: fixed build-breaker. All tests passed ok.
16443 2002-06-27 Martin Baulig <martin@gnome.org>
16445 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16446 for System.Decimal when compiling corlib.
16448 2002-06-27 Martin Baulig <martin@gnome.org>
16450 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16451 switch blocks which contain nothing but a default clause.
16453 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16455 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16457 2002-06-27 Martin Baulig <martin@gnome.org>
16459 * ecore.cs (PropertyExpr.PropertyExpr): Call
16460 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16462 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16463 is already a TypeBuilder.
16465 2002-06-27 Martin Baulig <martin@gnome.org>
16467 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16468 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16469 the "from an array-type to System.Array" case. This makes it work
16470 when compiling corlib.
16472 2002-06-27 Martin Baulig <martin@gnome.org>
16474 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16475 non-static PropertyExpr, set its InstanceExpression. This makes
16476 the `ICollection.Count' property work in System/Array.cs.
16478 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16480 * driver.cs: Made error handling more consistent. Errors now
16481 tracked by Report class, so many methods which used to return int
16482 now return void. Main() now prints success/failure and
16483 errors/warnings message.
16485 Renamed '--probe' compiler argument to '--expect-error'. Removed
16486 the magic number return values (123 and 124). Now, if the
16487 expected error occurs, the compiler exits with success (exit value
16488 0). If the compilation completes without seeing that particular
16489 error, the compiler exits with failure (exit value 1). The
16490 makefile in mcs/errors has been changed to handle the new behaviour.
16492 * report.cs: Made 'expected error' number a property and renamed
16493 it from 'Probe' to 'ExpectedError'.
16495 * genericparser.cs: Removed error handling support, since it is
16496 now all done by Report class.
16498 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16499 class, so parse() no longer returns an int.
16501 * namespace.cs: Use Report.Error instead of GenericParser.error
16503 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16505 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16506 TypeContainer.AddOperator): At the front of the list put the
16507 explicit implementations, so they get resolved/defined first.
16509 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16511 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16512 interface type is implemented by this TypeContainer. Used during
16513 explicit interface implementation.
16515 (Property.Define, Indexer.Define, Method.Define): Validate that
16516 the given interface in the explicit implementation is one of the
16517 base classes for the containing type.
16519 Also if we are explicitly implementing an interface, but there is
16520 no match in the pending implementation table, report an error.
16522 (Property.Define): Only define the property if we are
16523 not explicitly implementing a property from an interface. Use the
16524 correct name also for those properties (the same CSC uses,
16525 although that is really not needed).
16527 (Property.Emit): Do not emit attributes for explicitly implemented
16528 properties, as there is no TypeBuilder.
16530 (Indexer.Emit): ditto.
16532 Hiding then means that we do not really *implement* a pending
16533 implementation, which makes code fail.
16535 2002-06-22 Martin Baulig <martin@gnome.org>
16537 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16538 the return value of Object.GetType(). [FIXME: we need to do this whenever
16539 we get a type back from the reflection library].
16541 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16543 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16545 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16547 * attribute.cs: Return null if we can not look up the type.
16549 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16550 the interface types found.
16552 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16553 interface types found.
16555 * typemanager.cs (GetInterfaces): Make this routine returns alll
16556 the interfaces and work around the lame differences between
16557 System.Type and System.Reflection.Emit.TypeBuilder in the results
16558 result for GetInterfaces.
16560 (ExpandInterfaces): Given an array of interface types, expand and
16561 eliminate repeated ocurrences of an interface. This expands in
16562 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16565 2002-06-21 Martin Baulig <martin@gnome.org>
16567 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16570 2002-06-21 Martin Baulig <martin@gnome.org>
16572 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16573 and called with one of the core types, return the corresponding typebuilder for
16576 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16579 2002-06-21 Martin Baulig <martin@gnome.org>
16581 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16582 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16583 (Expression.ConvertReferenceExplicit): Likewise.
16585 * expression.cs (ElementAccess.DoResolve): Likewise.
16586 (ElementAccess.DoResolveLValue): Likewise.
16588 2002-06-10 Martin Baulig <martin@gnome.org>
16590 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16591 add the "value" parameter to the parameter list.
16593 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16596 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16598 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16599 the argument to an int, uint, long or ulong, per the spec. Also
16600 catch negative constants in array creation.
16602 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16604 * class.cs: do not allow the same interface to appear twice in
16605 the definition list.
16607 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16609 * ecore.cs: don't use ldlen with System.Array.
16611 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16613 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16615 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16617 * modifiers.cs: produce correct field attributes for protected
16618 internal. Easy fix so miguel can work on ther harder stuff:-)
16620 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16622 * pending.cs: New file. Move the code from class.cs here.
16623 Support clearning the pending flag for all methods (when not doing
16624 explicit interface implementation).
16626 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16628 * rootcontext.cs: added a couple more types needed to bootstrap.
16630 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16632 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16633 constructor in the type, instead of any constructor in the type
16634 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16635 a bug in the Mono runtime when applying the params attribute).
16637 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16638 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16640 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16642 * expression.cs (Unary.ResolveOperator): Use TypeManager
16643 to resolve the type.
16645 2002-06-13 Ravi Pratap <ravi@ximian.com>
16647 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16650 * enum.cs (AddEnumMember): Add support to store the attributes associated
16651 with each member too.
16653 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16654 field builders too - this takes care of the enum member case.
16656 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16658 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16659 address-of operator on both value types and pointers.
16661 2002-06-10 Martin Baulig <martin@gnome.org>
16663 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16664 PropertyBuilder to the `property_builders' list.
16666 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16667 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16668 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16669 find any indexers which are inherited from an interface.
16671 2002-06-09 Martin Baulig <martin@gnome.org>
16673 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16674 the same type as the constant if necessary. There's also a test-130.cs
16677 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16679 * typemanager.cs (TypeManager.ChangeType): Previously known as
16680 Enum.ChangeEnumType().
16682 2002-06-09 Martin Baulig <martin@gnome.org>
16684 * expression.cs (Cast.TryReduce): Added support for consts.
16686 2002-06-08 Ravi Pratap <ravi@ximian.com>
16688 * class.cs (Accessor): Hold attributes information so we can pass
16691 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16692 Modify to pass in attributes attached to the methods.
16694 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16696 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16697 to handle the Accessor kind :-)
16699 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16701 2002-06-08 Martin Baulig <martin@gnome.org>
16703 * expression.cs (Unary.TryReduceNegative): Added support for
16706 2002-06-08 Martin Baulig <martin@gnome.org>
16708 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16709 name can't be found in the `defined_names' - the caller will do a
16710 MemberLookup in this case and thus find methods in System.Enum
16711 such as Enum.IsDefined().
16713 2002-06-08 Martin Baulig <martin@gnome.org>
16715 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16716 Convert.ChangeType() which works with TypeBuilder created types.
16717 (Enum.LookupEnumValue, Enum.Define): Use it here.
16719 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16720 `TypeBuilder.BaseType != null' check.
16721 (TypeContainer.FindMembers): Only lookup parent members if we
16722 actually have a parent.
16723 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16724 (ConstructorInitializer.Resolve): Likewise.
16726 * interface.cs (Interface.FindMembers): Added
16727 `TypeBuilder.BaseType != null' check.
16729 * rootcontext.cs (RootContext.ResolveCore): Added
16730 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16731 classes_second_stage.
16733 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16734 debug_type and trace_type when compiling with --nostdlib.
16736 2002-06-07 Martin Baulig <martin@gnome.org>
16738 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16739 (AddField): Set it to true when adding a non-static field.
16740 (DefineType): Use `have_nonstatic_fields' to find out whether we
16741 have non-static fields, not `Fields != null'.
16743 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16745 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16746 dereferencing a null on the static-field code path)
16748 2002-05-30 Martin Baulig <martin@gnome.org>
16750 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16751 to take command line arguments. Use reflection to call the new
16752 custom `Initialize' function on the symbol writer and pass it the
16753 command line arguments.
16755 * driver.cs (--debug-args): New command line argument to pass command
16756 line arguments to the symbol writer.
16758 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16760 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16761 the target type for indexers and properties. Thanks to Joe for
16764 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16766 * typemanager.cs (MethodFlags): returns the method flags
16767 (Obsolete/ShouldIgnore) that control warning emission and whether
16768 the invocation should be made, or ignored.
16770 * expression.cs (Invocation.Emit): Remove previous hack, we should
16771 not do this on matching a base type, we should do this based on an attribute
16773 Only emit calls to System.Diagnostics.Debug and
16774 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16775 on the command line.
16777 * rootcontext.cs: Global settings for tracing and debugging.
16779 * cs-tokenizer.cs (define): New utility function to track
16780 defines. Set the global settings for TRACE and DEBUG if found.
16782 2002-05-25 Ravi Pratap <ravi@ximian.com>
16784 * interface.cs (Populate*): Pass in the TypeContainer as well as
16785 the DeclSpace as parameters so that we can create EmitContexts and
16786 then use that to apply attributes etc.
16788 (PopulateMethod, PopulateEvent, PopulateProperty)
16789 (PopulateIndexer): Apply attributes everywhere.
16791 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16794 (ApplyAttributes): Update accordingly.
16796 We now apply interface attributes for all members too.
16798 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16800 * class.cs (Indexer.Define); Correctly check if we are explicit
16801 implementation (instead of checking the Name for a ".", we
16802 directly look up if the InterfaceType was specified).
16804 Delay the creation of the PropertyBuilder.
16806 Only create the PropertyBuilder if we are not an explicit
16807 interface implementation. This means that explicit interface
16808 implementation members do not participate in regular function
16809 lookups, and hence fixes another major ambiguity problem in
16810 overload resolution (that was the visible effect).
16812 (DefineMethod): Return whether we are doing an interface
16815 * typemanager.cs: Temporary hack until we get attributes in
16816 interfaces (Ravi is working on that) and we get IndexerName
16817 support in interfaces.
16819 * interface.cs: Register the indexers as properties.
16821 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16822 warning, I have verified that this is a bug in the .NET runtime
16823 (JavaScript suffers of the same problem).
16825 * typemanager.cs (MemberLookup): When looking up members for
16826 interfaces, the parent of an interface is the implicit
16827 System.Object (so we succeed in searches of Object methods in an
16828 interface method invocation. Example: IEnumerable x; x.ToString
16831 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16833 * class.cs (Event): Events should also register if they do
16834 implement the methods that an interface requires.
16836 * typemanager.cs (MemberLookup); use the new GetInterfaces
16839 (GetInterfaces): The code used to lookup interfaces for a type is
16840 used in more than one place, factor it here.
16842 * driver.cs: Track the errors at the bottom of the file, we kept
16845 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16846 instance if the method we are calling is static!
16848 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16850 * attribute.cs (ApplyAttributes): Make this function filter out
16851 the IndexerName attribute (as that attribute in reality is never
16852 applied) and return the string constant for the IndexerName
16855 * class.cs (TypeContainer.Emit): Validate that all the indexers
16856 have the same IndexerName attribute, and if so, set the
16857 DefaultName attribute on the class.
16859 * typemanager.cs: The return value might contain other stuff (not
16860 only methods). For instance, consider a method with an "Item"
16861 property and an Item method.
16863 * class.cs: If there is a problem with the parameter types,
16866 2002-05-24 Ravi Pratap <ravi@ximian.com>
16868 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16869 looks at user defined conversion after making a call to
16870 StandardConversionExists - we need this for overload resolution.
16872 * expression.cs : Update accordingly the various method calls.
16874 This fixes 2 bugs filed against implicit user defined conversions
16876 2002-05-22 Miguel de Icaza <miguel@ximian.com>
16878 * statement.cs: Track the result of the assignment.
16880 2002-05-21 Miguel de Icaza <miguel@ximian.com>
16882 * expression.cs (MemberAccess): Improved error reporting for
16883 inaccessible members.
16885 2002-05-22 Martin Baulig <martin@gnome.org>
16887 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
16888 itself with debugging support.
16890 2002-05-22 Martin Baulig <martin@gnome.org>
16892 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16893 Removed, this isn't needed anymore.
16895 2002-05-20 Martin Baulig <martin@gnome.org>
16897 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16898 be underlying type for an enum.
16900 2002-05-20 Miguel de Icaza <miguel@ximian.com>
16902 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16903 that splits out the loading of just the core types.
16905 * rootcontext.cs (ResolveCore): Split the struct resolution in
16906 two, so we can load the enumeration underlying types before any
16909 * expression.cs (Is): Bandaid until we fix properly Switch (see
16910 bug #24985 for details).
16912 * typemanager.cs (ImplementsInterface): The hashtable will contain
16913 a null if there are no interfaces implemented.
16915 2002-05-18 Miguel de Icaza <miguel@ximian.com>
16917 * cs-parser.jay (indexer_declarator): It is fine to have array
16920 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16922 * typemanager.cs: (RegisterBuilder): New function used to register
16923 TypeBuilders that implement interfaces. Since
16924 TypeBuilder.GetInterfaces (as usual) does not work with lame
16926 (AddUserType): register interfaces.
16928 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16929 dealing with TypeBuilder. Also, arrays are showing up as
16930 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16931 methods can not be invoked on them!
16933 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16934 (ImplicitReferenceConversionExists): Split out from
16935 StandardConversionExists.
16937 * expression.cs (As): We were only implementing one of the three
16938 cases for the as operator. We now implement them all.
16939 (Is): Implement the various other cases for Is as well.
16941 * typemanager.cs (CACHE): New define used to control if we want or
16942 not the FindMembers cache. Seems to have a negative impact on
16943 performance currently
16945 (MemberLookup): Nested types have full acess to
16946 enclosing type members
16948 Remove code that coped with instance/static returns for events, we
16949 now catch this in RealFindMembers.
16951 (RealFindMembers): only perform static lookup if the instance
16952 lookup did not return a type or an event.
16954 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16956 * assign.cs (CompoundAssign): We pass more semantic information
16957 now to Compound Assignments than we did before: now we have all
16958 the information at hand, and now we resolve the target *before* we
16959 do the expression expansion, which allows the "CacheValue" method
16960 to have the effect we intended (before, a [x] += 1 would generate
16961 two differen ArrayAccess expressions from the ElementAccess,
16962 during the resolution process).
16964 (CompoundAssign.DoResolve): Resolve target and original_source here.
16966 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16968 * expression.cs (ArrayAccess): dropped debugging information.
16970 * typemanager.cs: Small bug fix: I was always returning i_members,
16971 instead of one of i_members or s_members (depending on which had
16974 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16975 method is invoked before any code generation takes place, and it
16976 is a mechanism to inform that the expression will be invoked more
16977 than once, and that the method should use temporary values to
16978 avoid having side effects
16980 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16982 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16985 * expression.cs (Indirection, ArrayAccess): Add support for
16986 CacheTemporaries in these two bad boys.
16988 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16989 ldobj or ldind_ref.
16990 (StoreFromPtr): Handle stobj as well.
16992 * expression.cs (UnaryMutator): Share more code.
16994 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16995 down: I was not tracking the Filter function as well, which
16996 was affecting the results of the cache.
16998 2002-05-15 Miguel de Icaza <miguel@ximian.com>
17000 * attribute.cs: Remove the hack to handle the CharSet property on
17003 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17005 * attribute.cs (DoResolve): More uglyness, we now only try to
17006 resolve the attribute partially, to extract the CharSet
17007 information (only if we are a StructLayout attribute). Otherwise
17009 (GetExtraTypeInfo): Add some code to conditionally kill in the
17010 future this. I am more and more convinced that the .NET
17011 framework has special code to handle the attribute setting on
17014 * expression.cs (IsParamsMethodApplicable): Revert my previous
17015 foreach change here, it was wrong.
17017 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17019 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17020 (pp_expr): do not abort on unknown input, just return.
17021 (eval): abort if there are pending chars.
17023 * attribute.cs (Attribute.Resolve): Positional parameters are
17024 optional. Deal with that case.
17026 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17027 the Ansi/Unicode/Auto information for the type.
17029 (TypeContainer.DefineType): instantiate the EmitContext here, as
17030 we will be using it during the type definition (to resolve
17031 attributes) and during the emit phase.
17033 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17034 to pull type information out of the attributes
17036 (Attribute.Resolve): track the constructor builder, and allow for
17037 multiple invocations (structs and classes will use this).
17039 * ecore.cs (MemberLookupFinal): new version with all the
17040 parameters customizable.
17042 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17043 constructors. Return if the result value is null (as the error
17044 would have been flagged already by MemberLookupFinal)
17046 Do not allow instances of abstract classes or interfaces to be
17049 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17050 We have to compare the assembly property here when dealing with
17051 FamANDAssem and Assembly access modifiers, because we might be
17052 creating an assembly from *modules* (that means that we are not
17053 getting TypeBuilders for types defined in other modules that are
17054 part of this assembly).
17056 (Method.Emit): If the method is marked abstract and has a body,
17059 (TypeContainer.DefineMembers): If both the defined member and the
17060 parent name match are methods, then do not emit any warnings: let
17061 the Method.Define routine take care of flagging warnings. But if
17062 there is a mismatch (method overrides something else, or method is
17063 overriwritten by something, then emit warning).
17065 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17066 set to null, this means `do not check for the return type on the
17069 (Method.Define): set the return type for the method signature to
17070 null, so that we get methods with the same name and parameters and
17071 different return types. This is used to flag warning 114 (you are
17072 hiding a method, and you probably want to use the new/override
17075 * typemanager.cs (MemberLookup): Implemented proper access
17076 control, closing a long standing set of bug reports. The problem
17077 was that the Framework only has two bits: Public and NonPublic,
17078 and NonPublic includes private and protected methods, but we need
17079 to enforce the FamANDAssem, FamOrAssem and Family.
17081 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17083 * statement.cs (GotoCase): Return true: Ammounts to giving up
17084 knowledge on whether we return or not, and letting the other case
17085 be responsible for it.
17087 2002-05-10 Miguel de Icaza <miguel@ximian.com>
17089 * driver.cs: Do not load directories for each file processed, only
17090 do it if there is a pattern.
17092 * ecore.cs: Report readonly assigns here as well, as we might have
17093 been resolved only by MemberAccess.
17095 (SimpleName.SimpleNameResolve): Also be useful for LValue
17096 resolution. We need this to propagate assign to local readonly variables
17098 * typemanager.cs: Use a ptrhashtable for the criteria, because we
17099 do not want to reuse potential criteria memory.
17101 * class.cs (MyEventBuilder): Set reflected_type;
17103 * ecore.cs (Constantify): Added support for constifying bools.
17105 (RootContext.LookupType): Added a cache for values looked up in
17106 the declaration space.
17108 * typemanager.cs (FindMembers): Now is a front-end to
17109 RealFindMembers, and provides a two-level hashtable-based cache to
17112 15% performance improvement: from 22.5 to 19.2 seconds.
17114 * expression.cs (IsParamsMethodApplicable): use foreach.
17115 (Invocation.DoResolve): ditto.
17116 (New.DoResolve): ditto.
17117 (ArrayCreation.DoResolve): ditto.
17119 * ecore.cs (FindMostEncompassingType): use foreach.
17121 * delegate.cs (NewDelegate.DoResolve): Use foreach
17123 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17124 (RemoveMethods): use foreach.
17126 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17127 nested foreach statements instead of for, and also break out of
17128 the inner loop once a match is found.
17130 (Invocation.OverloadResolve): Use foreach, simplify the code.
17132 2002-05-08 Miguel de Icaza <miguel@ximian.com>
17134 * cfold.cs (BinaryFold): During an enumeration evaluation context,
17135 we actually unwrap the expression to allow for extra information
17138 * expression.cs: Use Shr_Un on unsigned operations.
17140 2002-05-08 Ravi Pratap <ravi@ximian.com>
17142 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
17143 applicable operators was not being considered correctly. This closes
17144 the bug Miguel reported.
17146 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17148 * attribute.cs: check that the type derives from System.Attribute
17149 and report the correct error in that case (moved the duplicate code to
17150 its own method, too).
17152 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17154 * attribute.cs: lookup attribute type name as the spec says: first the
17155 bare attribute name and then name + "Attribute" (nant compiles with
17156 mcs after this fix).
17158 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17160 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17161 Because of the way we parse things, we should try to see if a
17162 UIntConstant can fit in an integer.
17164 2002-05-07 Ravi Pratap <ravi@ximian.com>
17166 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17167 when we are in an explicit context.
17169 (ConvertReferenceExplicit): When converting from Iface type S to Class
17170 T make sure the rules are implemented as an OR.
17172 * parameter.cs (ParameterType): Make it a property for now although the
17173 purpose really isn't anything immediate.
17175 * expression.cs (Is*Applicable): Do better checking on the parameter type
17176 of a ref/out parameter. The ones from the system assemblies are already
17177 marked with the correct type so we don't need to do any correction.
17179 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17180 the object type is standard too so include that.
17182 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17184 * ecore.cs (StandardConversionExists): Augment with missing code:
17185 deal with IntConstant, LongConstants and Enumerations.
17187 * assign.cs: Report the error, instead of failing silently
17189 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17190 typecontainer that they are declared, because the
17191 typecontainer/namespace will have the list of using clauses that
17192 need to be applied.
17194 Assembly Attributes were escaping the normal registration
17197 (EmitCode): Apply attributes within an EmitContext that represents
17198 the container they were declared on.
17200 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17202 2002-05-06 Ravi Pratap <ravi@ximian.com>
17204 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17205 Revamp completely - make much cleaner as we now operate only
17208 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17209 to implement the logic detailed in the spec more correctly.
17211 (UserDefinedConversion): Update accordingly.
17213 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17215 * statement.cs: Return flow analysis information up.
17217 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17220 (token): Do not consume an extra character before calling
17223 2002-05-06 Piers Haken <piersh@friskit.com>
17225 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17227 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17229 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17230 EmitContext during the instance constructor initializer
17231 resolution, to stop access to instance variables.
17233 This is mandated by the spec, last paragraph of the `constructor
17234 initializers' section.
17236 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17238 * cs-parser.jay, class.cs (Accessor): new class used to represent
17239 an accessor (get or set). In the past we used `null' to represent
17240 a missing accessor. But this is ambiguous because there was no
17241 way to tell in abstract indexers/properties if one of them was
17244 Now there is a way of addressing that.
17246 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17247 instead of FindMembers.
17249 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17250 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17252 * attribute.cs: Treat indexers and properties as the same in terms
17253 of applying attributes
17255 * ecore.cs (FindMostEncompassedType): Use statically initialized
17256 EmptyExpressions()s like we do elsewhere to avoid creating useless
17257 objects (and we take this out of the tight loop).
17259 (GetConversionOperators): Move the code to extract the actual
17260 operators to a separate routine to clean things up.
17262 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17264 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17265 events are always registered FieldBuilders.
17267 * class.cs (FieldBase): New class shared by Fields
17269 * delegate.cs: If we are a toplevel delegate, use our full name.
17270 If we are a nested delegate, then only use our tail name.
17272 2002-05-02 Ravi Pratap <ravi@ximian.com>
17274 * expression.cs (IsApplicable): Ensure that we add the "&" to
17275 ref/out types before comparing it with the type of the argument.
17277 (IsParamsMethodApplicable): Ditto.
17279 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17282 * delegate.cs : Handle the case when we have more than one applicable
17283 method. Flag an error only when we finish checking all.
17285 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17287 * expression.cs: Add support for boolean static initializers.
17289 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17291 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17293 * parameter.cs (ComputeParameterTypes,
17294 ComputeAndDefineParameterTypes): Better error handling: now we
17295 clear the `types' cache if we fail during any of the type lookups.
17296 We also return the status code correctly to our caller
17298 * delegate.cs: If we fail to define a delegate, abort the extra
17301 * expression.cs (Binary.ResolveOperator): for
17302 operator==(object,object) and operator !=(object, object) we also
17303 have to verify that there is an implicit conversion from one to
17306 (ArrayAccess.DoResolve): Array Access can operate on
17309 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17311 * assign.cs (CompoundAssign): A new class used as a "flag" that
17312 the assignment actually is happening as part of a compound
17313 assignment operator.
17315 During compound assignment, a few new rules exist to enable things
17322 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17323 to the type of x) if y is implicitly convertible to the type of x,
17324 and the operator is a builtin operator and the return type of the
17325 operator is explicitly convertible to the type of x.
17327 * rootcontext.cs: Reset warning level to 2. 4 catches various
17328 "interesting" features in mcs, we must clean this up at some
17329 point, but currently am trying to kill other bugs ;-)
17331 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17332 in container classes as well.
17334 * expression.cs (Binary.ResolveOperator): Handle string case
17335 before anything else (as operator overloading does emit an error
17336 before doing anything else).
17338 This code could go away when we move to a table driven model, but
17339 i could not come up with a good plan last night.
17341 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17343 * typemanager.cs (CSharpName): reimplementation using regex.
17344 * class.cs: added null check for fields in Emit
17345 * rootcontext.cs: set warninglevel to 4
17347 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17349 * typemanager.cs (CSharpName): reimplemented with Lupus
17352 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17354 * statement.cs (If): correclty implement Resolve, because we were
17355 not catching sem errors in there. The same process is needed
17357 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17360 (Statement.Warning_DeadCodeFound): Factorize code.
17361 (While): Report dead code here too.
17363 (Statement): Added Resolve virtual method to allow
17364 for resolution split from the emit code.
17366 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17368 * statement.cs (EmitBoolExpression): No longer try to resolve the
17370 (MakeBoolean): New utility function that resolve, implicitly
17371 converts to boolean and tags the expression.
17374 (If, Do): Implement dead code elimination.
17375 (While): Implement loop inversion
17377 (Do, While, For, If): Resolve the expression prior to calling our
17380 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17383 - added method Report28 (warning: program has more than one entry point)
17384 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17385 - modified method Method.Define, the part at the end of the method
17387 * rootcontext.cs: added static public Location EntryPointLocation;
17389 * ../errors/cs0028.cs : Add test case for the above warning.
17392 - modified method CSharpName to allow arrays of primitive type to
17393 be printed nicely (e.g. instead of System.Int32[][] it now prints
17395 - added method CSharpSignature: returns the signature of a method
17396 in string format to be used in reporting errors, warnings, etc.
17398 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17401 2002-04-26 Ravi Pratap <ravi@ximian.com>
17403 * delegate.cs (Define): Fix extremely silly bug where I was
17404 setting the type of the 'object' parameter of the BeginInvoke
17405 method to System.IAsyncResult instead of System.Object ;-)
17407 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17409 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17412 (Constructor.Emit): return if we fail to initialize the
17413 constructor. Another door closed!
17415 * expression.cs (New.DoResolve): Improve error message (from -6 to
17416 1501). Use DeclaredOnly lookup to find the exact constructor.
17418 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17419 loop. This is useful.
17421 * cs-parser.jay: Adjust the default parameters so that destructors
17422 have the proper signature.
17424 2002-04-26 Martin Baulig <martin@gnome.org>
17426 * driver.cs (LoadAssembly): If `assembly' contains any characters
17427 which are only valid in path names and not in assembly names
17428 (currently slash, backslash and point), use Assembly.LoadFrom ()
17429 instead of Assembly.Load () on the `assembly' (before iteration
17430 over the link_paths).
17432 2002-04-26 Martin Baulig <martin@gnome.org>
17434 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17436 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17438 * class.cs (Property): use the new typemanager.MemberLookup
17440 (TypeContainer.MemberLookup): Implement using the
17441 TypeManager.MemberLookup now.
17443 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17444 and return MemberInfos, so that these can be used without an
17445 EmitContext (what we had before).
17447 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17449 * expression.cs: Fix the case where the argument to params if the
17450 type of the params. I omitted handling this before. Fixed
17452 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17454 * driver.cs: Call BootCorlib_PopulateCoreType
17456 * class.cs (Property.CheckBase): Check for properties only, not
17459 * interface.cs: Temporary hack: try/catch around the
17460 CustomAttributeBuilder, because I am getting an exception that I
17463 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17464 types whose definitions are required to be there (attributes are
17465 defined before standard types).
17467 Compute definitions as we boot the various types, as they are used
17468 immediately (value_type class will need object_type, but if we do
17469 not initialize object_type, we will pass a null, which will let
17470 the runtime pick the System.Object from the existing corlib, which
17471 is not what we want).
17473 2002-04-22 Patrik Torstensson <totte@labs2.com>
17475 * cs-tokenizer.cs: fixed a number of trim() issues.
17477 2002-04-22 Ravi Pratap <ravi@ximian.com>
17479 * expression.cs (Argument.Type): Ensure that we return the correct
17480 type when we have out or ref parameters [in which case we
17483 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17485 * class.cs (Property, Indexer): Allow extern modifier in there.
17487 * typemanager.cs (InitBaseTypes): Initializes object_type and
17488 value_type, since those will be used early on during the bootstrap
17489 process to compile corlib.
17491 (InitCoreTypes): Move code from here to InitBaseTypes.
17493 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17495 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17496 single-dimension arrays as using the ldlen opcode.
17498 Daniel Lewis discovered this optimization.
17500 * typemanager.cs: Add signature for System.Array::get_Length
17502 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17504 * statement.cs: report the error when the foreach does not apply to an
17505 array nor a collection.
17507 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17509 * expression.cs: Add implicit conversions to the operator ~.
17511 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17513 * typemanager.cs: Locate the decimal constructor.
17515 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17517 * attribute.cs: use the new property of TypeOf.
17518 * expression.cs: added 'get' property around typearg.
17520 These changes fix a build breaker reported by NickD. Is this the
17521 correct way to fix? If not, please, revert my changes and make it
17524 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17526 * attribute.cs: Add support for typeof in attribute invocations.
17527 I am not sure that this is right though.
17529 2002-04-14 Duncan Mak <duncan@ximian.com>
17531 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17532 Binary.Operator.Division case.
17534 2002-04-13 Ravi Pratap <ravi@ximian.com>
17536 * class.cs (DefineType): Ensure that we do a proper check on
17537 attribute types and also register it with the TypeManager.
17539 (TypeContainer.Targets): The default for attribute types is
17540 AttributeTargets.All.
17542 * attribute.cs (ApplyAttributes): Registering the attribute type
17543 is done elsewhere, not when we discover we have a Usage attribute.
17545 2002-04-12 Ravi Pratap <ravi@ximian.com>
17547 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17548 and get rid of is_delegate parameter.
17550 * everywhere : update.
17552 2002-04-12 Ravi Pratap <ravi@ximian.com>
17554 * cs-parser.jay (compilation_unit): Revamp completely to use
17555 some new ideas that I got from Rhys' grammar to solve the problems
17556 with assembly level attributes.
17558 (outer_declaration): New grammar production.
17560 (attribute_sections): Add.
17562 (opt_attributes): Base on attribute_sections
17564 (namespace_declaration): Allow opt_attributes to tackle the case
17565 when we have assembly level attributes - we are clever in this
17568 * attribute.cs (ApplyAttributes): Do not worry about assembly
17569 attributes in the non-global context.
17571 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17572 instead of SetGlobalAttributes.
17574 * class.cs, rootcontext.cs : Ensure we define and generate
17575 attribute types before anything else.
17577 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17578 and flag the new error -20 for the case when the attribute type
17579 does not have valid targets specified. csc does not catch this.
17581 * ../errors/errors.txt : update for error # -20
17583 2002-04-11 Ravi Pratap <ravi@ximian.com>
17585 * support.cs (InternalParameters.ParameterModifier): Do some null
17586 checking and return sane values.
17588 * class.cs (Method.Define): If we are a PInvoke method, ensure
17589 that we are static and extern. Report error # 601
17591 * ../errors/cs0601.cs : Add test case for the above error.
17593 2002-04-07 Ravi Pratap <ravi@ximian.com>
17595 * rootcontext.cs (attribute_types): We need to keep type of
17596 all attribute types separately and emit code for them first.
17598 (RegisterAttribute) : Implement.
17600 * class.cs (DefineType): Check if the current Type is a custom
17601 attribute type and register it accordingly.
17603 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17604 adding the first attribute twice and rename to
17606 (SetGlobalAttributes): this.
17608 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17611 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17612 if we are processing global arguments. Hmm, I am unsure of this.
17614 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17616 * expression.cs: added static array of strings to avoid calling
17617 Enum.ToString () for Operator in Binary. Significant recover of
17620 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17622 * class.cs (FindMembers): Allow the Builders of the various
17623 members to be null. If they are skip them. This only happens
17624 during the PInvoke declaration.
17626 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17628 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17629 failure, so we do not keep going afterwards.
17631 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17632 wanted to pass `false' as the `is_delegate' argument. If this is
17633 the case, why not use delegate_type == null to mean `is_delegate =
17634 false' and anything else as is_delegate = true.
17636 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17638 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17639 code for the section, not the beginning of the tests.
17641 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17643 * cfold.cs: Handle operator + (Enum x, Underlying x)
17645 * expression.cs (Binary): same. Warn about errors where we have
17646 Enum/Enum in operator + as well.
17648 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17651 - added support for switch(bool)
17652 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17653 - add TableSwitchEmit() to handle table-based switch statements
17655 2002-04-05 Ravi Pratap <ravi@ximian.com>
17657 * expression.cs (Invocation.OverloadResolve): Factor out code which
17658 does parameter compatibility checking with arguments so that we can
17659 re-use the code even from Delegate.VerifyApplicability
17661 (VerifyArgumentsCompat): Move above code here.
17663 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17664 and instead make a call to the above method.
17666 2002-03-31 Ravi Pratap <ravi@ximian.com>
17668 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17669 We use it to keep track of classes which are attribute types.
17671 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17673 * delegate.cs (Delegate.Define): Correctly define the types in the
17674 presence of fixed and array parameters.
17676 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17679 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17680 include NonPublic after the first iteration.
17682 * class.cs (Indexer.CheckBase): Only check if both parents are
17685 * cs-parser.jay (accessor_body): If empty, set to null.
17687 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17688 same code path here to resolve constants names that we did have in
17689 MemberAccess.DoResolve. There is too much code duplicated here.
17691 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17693 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17695 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17698 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17699 tokens, numbers and strings.
17701 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17704 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17705 asyncronous parameters and the regular parameters.
17707 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17708 specify the target directory.
17710 * expression.cs: (This.DoResolve): Simplify
17711 (As.Emit): Optimize, do not generate IsInst if the expression is
17712 always of the given type.
17714 (Is.DoResolve): Bug fix, we were reporting both always/never for
17717 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17718 creating too many unnecessary arrays.
17720 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17722 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17723 fields instead of rolling our own initializer. Takes care of all
17724 implicit conversions, and drops unnecessary static checks/argument.
17726 2002-03-31 Dick Porter <dick@ximian.com>
17728 * driver.cs: use the GetDirectories() return values properly, and
17729 use "/" as path separator.
17731 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17733 * expression.cs (Unary): Optimize - - expr into expr.
17734 (Binary): Optimize a + (-b) into a -b.
17736 * codegen.cs (CodeGen): Made all methods static.
17738 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17742 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17743 TypeBuilder property.
17745 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17748 * tree.cs: Removed the various RecordXXXX, and replaced with a
17749 single RecordDecl. Removed all the accessor methods, and just
17750 left a single access point Type
17752 * enum.cs: Rename DefineEnum to DefineType.
17754 * decl.cs: New abstract method `DefineType' used to unify the
17755 Defines for Enumerations, Interfaces, TypeContainers and
17758 (FindType): Moved LookupInterfaceOrClass here. Moved the
17759 LookupBaseClasses method that used to live in class.cs and
17760 interface.cs here, and renamed to FindType.
17762 * delegate.cs: Implement DefineType. Take advantage of the
17763 refactored pattern for locating the parent builder without taking
17764 the parent_builder argument (which we know does not work if we are
17765 nested, and triggering a toplevel definition).
17767 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17769 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17770 accessibility of a member has changed during override and report
17773 * class.cs (Method.Define, Property.Define): Only complain on
17774 overrides if the method is private, any other accessibility is
17775 fine (and since we just checked the permission is the same, we are
17778 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17779 and elif are processed always. The other pre-processing
17780 directives are only processed if we are "taking" the path
17782 2002-03-29 Martin Baulig <martin@gnome.org>
17784 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17785 current location is not Null.
17787 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17788 a separate method so we can profile it.
17790 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17791 `span.Seconds' are just seconds, but no minutes or hours.
17792 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17794 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17796 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17797 Remove the gratuitous set of Final:
17799 // If an interface implementation, then we can set Final.
17800 if (((flags & MethodAttributes.Abstract) == 0) &&
17801 implementing.DeclaringType.IsInterface)
17802 flags |= MethodAttributes.Final;
17804 I do not know what I was smoking when I used that.
17807 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17808 step into fixing the name resolution issues for delegates and
17809 unifying the toplevel name resolution.
17811 2002-03-28 Martin Baulig <martin@gnome.org>
17813 * class.cs (Method.Emit): If we have a symbol writer, call its
17814 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17815 tell it about the current method.
17817 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17818 writer that we're going to emit the first byte of IL code for a new
17819 statement (a new source line).
17820 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17821 EmitContext.Mark() before emitting any code.
17823 * location.cs (SymbolDocument): Return null when we're Null.
17825 * statement.cs (Statement): Moved the `Location loc' variable here.
17826 (Statement.EmitBoolExpression): If we have a symbol writer, call
17827 ec.Mark() before emitting any code to tell it that we're at the
17828 beginning of a new statement.
17829 (StatementExpression): Added `Location' argument to the constructor.
17830 (Block): Added public readonly variable `StartLocation' and public
17831 variable `EndLocation'. The latter is to be set using SetEndLocation().
17832 (Block): Added constructor which takes a start and end location.
17833 (Block.SetEndLocation): New method. This sets the end location.
17834 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17835 local variables we create.
17836 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17837 each statement and do also mark the begin and end of the block.
17839 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17840 tell it the current lexer.Location, use Location.Null for the end of the
17842 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17843 current block, set its end location using SetEndLocation().
17844 (statement_expression): StatementExpression constructor now takes the
17845 lexer.Location as additional argument.
17846 (for_statement, declare_local_variables): Likewise.
17847 (declare_local_variables): When creating a new implicit block, use the
17848 new Block constructor and pass it the lexer.Location.
17850 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17852 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17853 members also on the parent interfaces recursively.
17855 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17857 * report.cs: Use new formats, since Gonzalo finished the missing
17860 * expression.cs (Binary.ResolveOperator): added missing operator|
17861 operator& and operator^ for bool/bool.
17863 * cs-parser.jay: CheckDef now takes a Location argument that is
17864 used to report errors more precisly (instead of reporting the end
17865 of a definition, we try to track something which is a lot closer
17866 to the source of the problem).
17868 * cs-tokenizer.cs: Track global token use, so we can properly flag
17869 the use of #define/#undef after the first token has been seen.
17871 Also, rename the reportXXXX to Error_DescriptiveName
17873 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17874 TypeContainer, so that Enum and Interface can use this too.
17876 * class.cs (TypeContainer.LookupInterfaceOrClass,
17877 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17878 `builder' argument. Typically this was used to pass the parent
17879 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17882 The problem is that a nested class could trigger the definition of
17883 a toplevel class, and the builder would be obviously wrong in that
17886 So we drop this argument, and we compute dynamically the
17887 TypeBuilder/ModuleBuilder (the correct information was available
17888 to us anyways from DeclSpace.Parent)
17890 * interface.cs (Interface.DefineInterface): Drop builder
17891 parameter cleanup like class.cs
17893 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
17896 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17899 (Try.Emit): Propagate the returns value from the statement.
17901 (Return.Emit): Even if we are leavning
17903 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17905 * modifiers.cs: Fix the computation of MethodAttributes flags.
17907 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17909 * driver.cs: allow compilation of files that start with '/'.
17910 Add a default case when checking the argument of --target.
17912 2002-03-25 Miguel de Icaza <miguel@ximian.com>
17914 * interface.cs: Implement the same search algorithm for types in
17915 the interface code.
17917 * delegate.cs: Do not allow multiple definition.
17919 * Recovered ChangeLog that got accidentally amputated
17921 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17923 * rootcontext.cs: Load manually enum to allow core classes to
17924 contain enumerations.
17926 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17927 Update to new static methods in TypeManager.
17929 * typemanager.cs (GetMethod, GetConstructor): Use our
17930 implementation of FindMembers to find the members, since during
17931 corlib compilation, the types are TypeBuilders and GetMethod and
17932 GetConstructor do not work.
17934 Make all methods in TypeManager static.
17936 (InitCodeHelpers): Split the functionality from
17937 the InitCodeTypes function.
17939 * driver.cs: Call InitCodeHelpers after we have populated the
17942 * cs-parser.jay (delegate_declaration): we did not used to compute
17943 the delegate name correctly for void delegates.
17945 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17947 * rootcontext.cs (RootContext): Init the interface_resolve_order
17948 and type_container_resolve_order always.
17950 (ResolveCore, BootstrapCorlib_ResolveClass,
17951 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17952 compiler when compiling with --nostdlib
17954 * class.cs (TypeContainer.DefineType): Check that our parent is
17955 not null. This test is most important when we are bootstraping
17958 * codegen.cs: Split out the symbol writing code.
17960 2002-03-25 Martin Baulig <martin@gnome.org>
17962 * driver.cs (-g): Made -g an alias for --debug.
17964 2002-03-24 Martin Baulig <martin@gnome.org>
17966 * codegen.cs (SymbolWriter): New public variable. Returns the
17967 current symbol writer.
17968 (CodeGen): Added `bool want_debugging_support' argument to the
17969 constructor. If true, tell the ModuleBuild that we want debugging
17970 support and ask it for the ISymbolWriter.
17971 (Save): If we have a symbol writer, call it's Close() method after
17972 saving the assembly.
17974 * driver.c (--debug): New command line argument to create a
17975 debugger information file.
17977 * location.cs (SymbolDocument): New public property. Returns an
17978 ISymbolDocumentWriter object for the current source file or null
17979 if we don't have a symbol writer.
17981 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17983 * driver.cs (LoadAssembly): Correctly return when all the paths
17984 have been tried and not before.
17986 * statement.cs (Switch.Emit): return the actual coverage for this
17987 statement (returns/not-returns)
17989 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17990 switch of the statement if we are the last switch section. That
17991 kills two problems: try/catch problems (we used to emit an empty
17992 nop at the end) and switch statements where all branches would
17995 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17997 * driver.cs: Add default assemblies (the equivalent to the
17998 Microsoft CSC.RSP file)
18000 * cs-tokenizer.cs: When updating `cols and setting it to zero,
18001 also update tokens_seen and set it to false.
18003 * driver.cs: Implement --recurse for Mike.
18005 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18006 correctly splitting out the paths.
18008 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18010 * interface.cs (Interface.PopulateProperty): Instead of using
18011 `parent' as the declaration space for the set parameters, use
18014 * support.cs (InternalParameters): InternalParameters constructor
18015 takes a DeclSpace instead of a TypeContainer.
18017 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18018 types are being initialized, load the address of it before calling
18021 (New): Provide a mechanism to disable the generation of local
18022 value type temporaries when the caller will be providing us with
18023 an address to store it.
18025 (ArrayCreation.EmitDynamicInitializers): Use it.
18027 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18029 * expression.cs (Invocation.EmitArguments): Only probe for array
18030 property if there is more than one argument. Sorry about that.
18032 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18033 empty param arrays.
18035 * class.cs (Method.LabelParameters): Fix incorrect code path that
18036 prevented the `ParamArrayAttribute' from being applied to the
18039 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18041 * support.cs (ReflectionParameters): Correctly compute whether the
18042 last argument is a params array. Fixes the problem with
18045 * typemanager.cs: Make the assemblies array always be non-null
18046 (empty, but non-null)
18048 * tree.cs (RecordDecl): New function that abstracts the recording
18049 of names. This reports error 101, and provides a pointer to the
18050 previous declaration. Fixes a crash in the compiler.
18052 * cs-parser.jay (constructor_declaration): Update to new grammar,
18053 and provide a constructor_body that can be empty.
18055 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18057 * driver.cs: Add support for --resources.
18059 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18060 Make all types for the various array helper methods be integer.
18062 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18063 CheckState to ConvCast.
18065 (ConvCast): Now it takes a `checked' state argument, to avoid
18066 depending on the emit context for the conversion, and just using
18067 the resolve time setting.
18069 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18070 instead of Invocation.EmitArguments. We do not emit the original
18071 arguments, instead we emit those which have been converted to
18072 unsigned int expressions.
18074 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18076 * codegen.cs: ditto.
18078 * expression.cs (LocalVariableReference): Drop the use of the
18079 Store function that depended on the variable index.
18081 * statement.cs (VariableInfo): Drop the `Idx' property from this
18082 class, as this is not taking into account the indexes for
18083 temporaries tat we generate during the execution, getting the
18086 * class.cs: First emit class initializers, then call the parent
18089 * expression.cs (Binary): Fix opcode emision.
18090 (UnaryMutator.EmitCode): Support checked code generation
18092 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18093 matches for events for both the Static and Instance scans,
18094 pointing to the same element. Fix that.
18096 2002-03-14 Miguel de Icaza <miguel@ximian.com>
18098 * rootcontext.cs (ResolveTree): Always set the
18099 interface_resolve_order, because nested interfaces will be calling
18102 * class.cs (GetInterfaceOrClass): Track the same resolution
18103 process used by TypeManager.LookupType. This fixes the nested
18104 type lookups in class declarations (separate path from
18107 (TypeContainer.DefineType): Also define nested interfaces.
18108 (TypeContainer.RegisterOrder): New public function used to
18109 register the order in which child interfaces need to be closed.
18111 Nested interfaces need to be closed after their parents have been
18114 * interface.cs (InterfaceAttr): Put all the logic for computing
18115 the interface attribute here.
18117 (DefineInterface): Register our interface order with the
18118 RootContext or with the TypeContainer depending on the case.
18120 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18122 * cs-parser.jay: rework foreach statement to work with the new
18123 changes to the policy on SimpleNames.
18125 * report.cs: support Stacktrace on warnings as well.
18127 * makefile: drop --unsafe and /unsafe from the compile.
18129 2002-03-13 Ravi Pratap <ravi@ximian.com>
18131 * ecore.cs (StandardConversionExists): Modify to take an Expression
18132 as the first parameter. Ensure we do null -> reference type conversion
18135 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18136 temporary Expression objects.
18138 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18140 * interface.cs: workaround bug in method overloading resolution
18141 (there is already a bugzilla bug for it).
18143 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18145 We could also solve this problem by having a separate path for
18146 performing type lookups, instead of DoResolve, we could have a
18147 ResolveType entry point, and only participating pieces of the
18148 production (simplename, deref, array) would implement this.
18150 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18151 signal SimpleName to only resolve type names and not attempt to
18152 resolve anything else.
18154 * expression.cs (Cast): Set the flag.
18156 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18158 * class.cs: Only report 108 if there is no `new' modifier.
18160 * cs-parser.jay: rework foreach statement to work with the new
18161 changes to the policy on SimpleNames.
18163 * report.cs: support Stacktrace on warnings as well.
18165 * makefile: drop --unsafe and /unsafe from the compile.
18167 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18169 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18170 lookups here, instead of doing that at parse time. This means
18171 that our grammar will not introduce `LocalVariableReferences' as
18172 expressions at this point. That solves the problem of code like
18176 static void Main ()
18180 This is only half the fix. The full fix requires parameters to
18181 also be handled in this way.
18183 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18184 makes the use more obvious of the DeclSpace. The
18185 ec.TypeContainer.TypeBuilder is now only used to pull the
18186 TypeBuilder for it.
18188 My theory is that I can get rid of the TypeBuilder completely from
18189 the EmitContext, and have typecasts where it is used (from
18190 DeclSpace to where it matters).
18192 The only pending problem is that the code that implements Aliases
18193 is on TypeContainer, and probably should go in DeclSpace.
18195 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18196 lookups here, instead of doing that at parse time. This means
18197 that our grammar will not introduce `LocalVariableReferences' as
18198 expressions at this point. That solves the problem of code like
18202 static void Main ()
18206 This is only half the fix. The full fix requires parameters to
18207 also be handled in this way.
18209 * class.cs (Property.DefineMethod): When implementing an interface
18210 method, set newslot, when implementing an abstract method, do not
18211 set the flag (before we tried never setting it, or always setting
18212 it, which is the difference).
18213 (Indexer.DefineMethod): same.
18214 (Method.DefineMethod): same.
18216 * ecore.cs: Only set the status used flag if we get back a Field.
18218 * attribute.cs: Temporary hack, so Paolo can keep working.
18220 2002-03-08 Ravi Pratap <ravi@ximian.com>
18222 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18223 the unmanaged type in the case we have a MarshalAs attribute.
18225 (Resolve): Handle the case when we are parsing the special MarshalAs
18226 attribute [we need to store the unmanaged type to use later]
18228 * typemanager.cs (marshal_as_attr_type): Built in type for the
18229 MarshalAs Attribute.
18231 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18232 on parameters and accordingly set the marshalling info.
18234 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18236 * class.cs: Optimizing slightly by removing redundant code after
18237 we switched to the `NoTypes' return value.
18238 (Property.DefineMethod): use NoTypes here too.
18240 This fixes the bug I introduced in my last batch of changes.
18242 2002-03-05 Ravi Pratap <ravi@ximian.com>
18244 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18246 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18247 Enums since those are types too.
18249 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18251 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18252 thanks to a call during the lookup process.
18254 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18256 * statement.cs (Foreach): Lots of work to accomodate a particular
18257 kind of foreach statement that I had not kept in mind. It is
18258 possible to have foreachs on classes that provide a GetEnumerator
18259 method that return objects that implement the "pattern" for using
18260 a foreach, there is no need to support GetEnumerator
18263 This is needed to compile nant.
18265 * decl.cs: Only report 114 if the member is not `Finalize' and if
18266 the warning level is at least 2.
18268 * class.cs: Moved the compare function from Method to
18271 (MethodSignature.InheritableMemberSignatureCompare): Add new
18272 filter function that is used to extract inheritable methods from a
18275 (Method.Define): Use the new `inheritable_method_signature_filter'
18278 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18281 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18283 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18285 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18287 * expression.cs: Pass location information to
18288 ConvertImplicitStandard.
18290 * class.cs: Added debugging code to track return values from
18293 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18295 * expression.cs (Is.DoResolve): If either side of the `is' is an
18296 interface, do not flag the warning.
18298 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18301 * report.cs: Allow for --fatal to be used with --probe.
18303 * typemanager.cs (NoTypes): Move the definition for the empty Type
18306 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18308 (TypeContainer.DefineProxy): New function used to proxy to parent
18309 implementations when implementing interfaces.
18310 (TypeContainer.ParentImplements): used to lookup if our parent
18311 implements a public function that is required by an interface.
18312 (TypeContainer.VerifyPendingMethods): Hook this up.
18314 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18315 `modules' and `assemblies' arraylists into arrays. We only grow
18316 these are the very early start up of the program, so this improves
18317 the speedof LookupType (nicely measured).
18319 * expression.cs (MakeByteBlob): Replaced unsafe code with
18320 BitConverter, as suggested by Paolo.
18322 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18323 folding of string concatenation, but if either side is a string,
18324 and the other is not, then return null, and let the runtime use
18325 the concatenation on the string plus the object (using
18326 `Object.ToString').
18328 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18330 Constant Folding has been implemented now.
18332 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18333 the error instead on types that are not supported in one's
18336 * constant.cs (Constant and all children): New set of functions to
18337 perform implict and explicit conversions.
18339 * ecore.cs (EnumConstant): Implement the new functions to perform
18340 conversion by proxying to the child expression.
18342 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18343 own separate setting that can not be turned off from the command
18344 line using --unchecked or --checked and is only controlled using
18345 the checked/unchecked statements and expressions. This setting is
18346 used by the constant folder to flag errors.
18348 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18349 ConstantCheckState as well.
18351 During Resolve, they also have to flag the state, because the
18352 constant folder runs completely in the Resolve phase.
18354 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18357 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18359 * cfold.cs: New file, this file contains the constant folder.
18361 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18362 argument to track whether we are using the resulting address to
18363 load or store a value and provide better error messages.
18365 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18366 new AddressOf arguments.
18368 * statement.cs (Foreach.EmitCollectionForeach): Update
18370 * expression.cs (Argument.Emit): Call AddressOf with proper
18371 arguments to track usage.
18373 (New.DoEmit): Call AddressOf with new arguments.
18375 (Unary.Emit): Adjust AddressOf call.
18377 2002-03-01 Ravi Pratap <ravi@ximian.com>
18379 * cs-parser.jay (member_access): Change the case for pre-defined types
18380 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18383 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18386 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18387 essentially like methods and apply attributes like MethodImplOptions to them too.
18389 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18392 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18393 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18396 * Update code everywhere accordingly.
18398 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18400 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18402 2002-02-28 Ravi Pratap <ravi@ximian.com>
18404 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18405 try performing lookups against those instead of jumping straight into using
18406 the 'using' clauses.
18408 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18410 (LookupType): Perform lookups in implicit parents too.
18412 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18413 sequence as RootContext.LookupType.
18415 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18416 the various cases of namespace lookups into this method.
18418 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18420 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18421 in positional arguments)
18423 * class.cs (Operator): Update the AllowedModifiers to contain
18426 * cs-parser.jay: Update operator declaration to allow for the
18427 operator body to be empty.
18429 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18432 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18434 * class.cs (Method.Emit): Label parameters.
18436 * driver.cs: Return 1 or 0 as the program exit code.
18438 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18440 * expression.cs: Special case the `null' object when trying to
18441 auto-compute the type, as anything can be explicitly converted to
18444 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18445 spotting this Paolo.
18447 (Expression.ImplicitNumericConversion): Perform comparissions of
18448 the type using the underlying type in the case of an enumeration
18449 rather than using the enumeration type for the compare.
18451 Cope with the underlying == type case, which is not possible to
18454 (Expression.ConvertNumericExplicit): Perform comparissions of
18455 the type using the underlying type in the case of an enumeration
18456 rather than using the enumeration type for the compare.
18458 * driver.cs: If the user does not supply an extension, assume .exe
18460 * cs-parser.jay (if_statement): Rewrote so that we can track the
18461 location for the if statement.
18463 * expression.cs (Binary.ConstantFold): Only concat strings when
18464 the operation is "+", not everything ;-)
18466 * statement.cs (Statement.EmitBoolExpression): Take a location
18468 (If, While, Do): Track location.
18470 * expression.cs (Binary.ResolveOperator): In the object + string
18471 case, I was missing a call to ConvertImplicit
18473 2002-02-25 Ravi Pratap <ravi@ximian.com>
18475 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18476 Location arguments. Ensure we use RootContext.LookupType to do our work
18477 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18479 * interface.cs (PopulateMethod): Handle the type of the parameter being
18482 * expression.cs (Invocation.BetterFunction): Handle the case when we
18483 have a params method with no fixed arguments and a call is made with no
18486 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18488 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18489 the verbatim-string-literal
18491 * support.cs (InternalParameters.ParameterModifier): handle null
18493 (InternalParameters.ParameterType): ditto.
18495 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18496 duplicating the name of the variable parameter.
18497 (GetParameterByName): Fix bug where we were not looking up array
18498 paramters if they were the only present (thanks Paolo!).
18499 (GetParameterInfo): We only have an empty set of types if both
18500 fixed and array are set to null.
18501 (GetParameterInfo-idx): Handle FixedParameter == null
18503 * cs-parser.jay: Handle the case where there is no catch
18504 statements (missing null test).
18506 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18508 * driver.cs (MainDriver): Be conservative on our command line
18511 Catch DirectoryNotFoundException when calling GetFiles.
18513 (SplitPathAndPattern): Used to split the input specification into
18514 a path and a pattern that we can feed to Directory.GetFiles.
18516 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18518 * statement.cs (Fixed): Implement the last case of the Fixed
18519 statement (string handling).
18521 * expression.cs (StringPtr): New class used to return a char * to
18522 a string; Used by the Fixed statement.
18524 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18526 * expression.cs (Binary.ResolveOperator): Remove redundant
18527 MemberLookup pn parent type.
18528 Optimize union call, we do not need a union if the types are the same.
18529 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18532 Specialize the use of MemberLookup everywhere, instead of using
18533 the default settings.
18535 (StackAlloc): Implement stackalloc keyword.
18537 * cs-parser.jay: Add rule to parse stackalloc.
18539 * driver.cs: Handle /h, /help, /?
18541 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18542 before we supported unsafe code.
18544 * makefile: add --unsafe to the self compilation of mcs.
18546 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18548 * expression.cs (PointerArithmetic): New class that is used to
18549 perform pointer arithmetic.
18550 (Binary.Resolve): Handle pointer arithmetic
18551 Handle pointer comparission.
18552 (ArrayPtr): Utility expression class that is used to take the
18553 address of an array.
18555 (ElementAccess): Implement array access for pointers
18557 * statement.cs (Fixed): Implement fixed statement for arrays, we
18558 are missing one more case before we are done.
18560 * expression.cs (Indirection): Implement EmitAssign and set the
18561 ExprClass to Variable. This allows pointer dereferences to be
18562 treated as variables, and to have values assigned to them.
18564 * ecore.cs (Expression.StoreFromPtr): New utility function to
18565 store values dereferencing.
18567 2002-02-20 Ravi Pratap <ravi@ximian.com>
18569 * expression.cs (Binary.ResolveOperator): Ensure that we are
18570 not trying to operate on a void type - this fixes the reported
18573 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18574 the parent implementation is sealed.
18576 * ../errors/cs0239.cs : Add.
18578 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18580 * typemanager.cs (unverifiable_code_type): Corresponds to
18581 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18582 which have unsafe code in them.
18584 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18587 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18589 * cs-tokenizer.cs: Add support for @"litreal strings"
18591 Make tokenizer accept pre-processor directives
18592 on any column (remove the old C-like limitation).
18594 * rootcontext.cs (EmitCode): Emit any global attributes.
18595 (AddGlobalAttributes): Used to keep track of assembly attributes.
18597 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18599 * cs-parser.jay: Add support for global attributes.
18601 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18603 * expression.cs (Indirection): New helper class. Unary will
18604 create Indirection classes to be able to implement the
18605 IMemoryLocation interface on it.
18607 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18609 * cs-parser.jay (fixed_statement): reference the right statement.
18611 * statement.cs (Fixed.Emit): Finish implementing the fixed
18612 statement for the &x case.
18614 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18616 * class.cs (Property.Define, Method.Define): Remove newslot when
18619 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18620 wrong. NewSlot should only be used if the `new' keyword is present.
18622 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18623 locating our system dir. Sorry about this.
18625 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18627 * driver.cs (GetSystemDir): Compute correctly the location of our
18628 system assemblies. I was using the compiler directory instead of
18629 the library directory.
18631 2002-02-13 Ravi Pratap <ravi@ximian.com>
18633 * expression.cs (BetterFunction): Put back in what Miguel commented out
18634 since it is the correct fix. The problem is elsewhere ;-)
18636 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18637 parameters of the parms method are themselves compatible or not !
18639 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18640 to check that a class implements an interface before saying that an implicit
18641 conversion was allowed. Use ImplementsInterface to do the checking.
18643 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18645 * class.cs (Method.Define): Track whether we are an explicit
18646 implementation or not. And only call DefineMethodOverride if we
18647 are an explicit implementation.
18649 (Property.DefineMethod): Ditto.
18651 2002-02-11 Ravi Pratap <ravi@ximian.com>
18653 * expression.cs (BetterFunction): Catch hideous bug which was
18654 preventing us from detecting ambiguous calls due to implicit casts i.e
18657 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18659 * support.cs (Pair): Remove un-needed method. I figured why I was
18660 getting the error in cs-parser.jay, the variable in a foreach loop
18661 is readonly, and the compiler does not really treat this as a variable.
18663 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18664 instead of EQUALS in grammar.
18666 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18668 * expression.cs (Unary.DoResolve): Check whether the argument is
18671 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18673 * support.cs: Api for Pair to set a value. Despite the fact that
18674 the variables are public the MS C# compiler refuses to compile
18675 code that accesses the field if the variable is part of a foreach
18678 * statement.cs (Fixed): Begin implementation of the fixed
18681 (Block.AddVariable): Return the VariableInfo on success and null
18682 on failure instead of true/false.
18684 * cs-parser.jay (foreach): Catch errors on variables already
18685 defined (we were ignoring this value before) and properly unwind
18686 the block hierarchy
18688 (fixed_statement): grammar for the fixed statement.
18690 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18692 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18693 pointer types to be incretemented.
18695 (SizeOf): Implement.
18697 * cs-parser.jay (pointer_member_access): Implement
18698 expr->IDENTIFIER production.
18700 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18701 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18704 (Unary): Implement indirection.
18706 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18707 use in non-unsafe context).
18709 (SimpleName.DoResolve): Check for pointers in field access on safe
18712 (Expression.LoadFromPtr): Factor the load-indirect code in this
18713 function. This was duplicated in UnboxCast and ParameterReference
18715 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18717 * expression.cs (ComposedCast): report an error if a pointer cast
18718 is used in a safe region.
18720 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18721 pointer type casts in unsafe context.
18723 * codegen.cs (EmitContext): Set up IsUnsafe.
18725 * cs-parser.jay (non_expression_type): Add productions for pointer
18728 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18729 code. We should not use force into static mode if the method is
18730 not virtual. Fixes bug in MIS
18732 * statement.cs (Do.Emit, While.Emit, For.Emit,
18733 Statement.EmitBoolExpression): Add support to Do and While to
18734 propagate infinite loop as `I do return' semantics.
18736 Improve the For case to also test for boolean constants.
18738 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18739 to the list of attributes we can add.
18741 Remove `EmitContext' argument.
18743 * class.cs (Method.Define): Apply parameter attributes.
18744 (Constructor.Define): Apply parameter attributes.
18745 (MethodCore.LabelParameters): Move here the core of labeling
18748 * support.cs (ReflectionParameters.ParameterModifier,
18749 InternalParameters.ParameterModifier): Use IsByRef on the type and
18750 only return the OUT bit for these parameters instead of in/out/ref
18753 This is because I miss-understood things. The ParameterInfo.IsIn
18754 and IsOut represent whether the parameter has the [In] and [Out]
18757 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18759 * ecore.cs (FieldExpr.Emit): Release temporaries.
18761 * assign.cs (LocalTemporary.Release): new function.
18763 * codegen.cs (EmitContext.GetTemporaryStorage,
18764 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18765 temporary storage. Now we can "put back" localbuilders when we
18768 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18770 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18771 need to make a copy of the variable to generate verifiable code.
18773 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18775 * driver.cs: Compute dynamically the system directory.
18777 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18778 Slower, but more generally useful. Used by the abstract
18779 registering implementation.
18781 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18782 the rules for the special rule on Type/instances. First check if
18783 we have the same name, and if so, try that special static path
18784 rather than the instance path.
18786 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18788 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18791 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18792 Enum, ValueType, Delegate or Array for non-corlib compiles.
18794 * cs-tokenizer.cs: Catch long identifiers (645)
18796 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18799 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18800 fix, we were returning too early, so we were not registering
18801 pending methods from abstract classes.
18803 Do not register pending methods if the class is abstract.
18805 * expression.cs (Conditional.DoResolve): Report circular implicit
18806 conversions when we neecd to compute it for conditional
18809 (Is.DoResolve): If the expression is always of the provided type,
18810 flag warning 183. If the expression can not ever be of the
18811 provided type flag warning 184.
18813 * class.cs: Catch 169 as well.
18815 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18818 2002-01-18 Nick Drochak <ndrochak@gol.com>
18820 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18822 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18824 * interface.cs: (PopulateMethod): Check for pointers being defined
18825 only if the unsafe context is active.
18826 (PopulateProperty): ditto.
18827 (PopulateIndexer): ditto.
18829 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18830 specified. If pointers are present, make sure that they are
18831 present in an unsafe context.
18832 (Constructor, Constructor.Define): ditto.
18833 (Field, Field.Define): ditto.
18834 (Property, Property.Define): ditto.
18835 (Event, Event.Define): ditto.
18837 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18838 hashtable if there are classes or structs defined.
18840 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18841 code, as the constant resolution moved.
18843 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18844 the metadata, so we can flag error 133.
18846 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18847 pointer is being declared in an unsafe context.
18849 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18851 * modifiers.cs (Modifiers.Check): Require a Location argument.
18852 Report error 227 for Unsafe use.
18854 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18856 * statement.cs (For.Emit): If the test is null, then report that
18857 we do `return', as we wont reach anything afterwards.
18859 (Switch.SwitchGoverningType): Track the expression that matched
18862 * driver.cs: Allow negative numbers as an error code to flag.
18864 * cs-parser.jay: Handle 1551.
18866 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18868 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18870 * cs-parser.jay: Report 1518 (type declaration can only contain
18871 class, struct, interface, enum or delegate)
18873 (switch_label): Report 1523 (keywords `case' or `default' must
18876 (opt_switch_sections): Report 1522 (empty switch)
18878 * driver.cs: Report 1515 (response file specified multiple times)
18879 Report 1516 (Source file specified multiple times).
18881 * expression.cs (Argument.Resolve): Signal 1510
18883 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18884 access not allowed in static code)
18886 2002-01-11 Ravi Pratap <ravi@ximian.com>
18888 * typemanager.cs (IsPointerType): Utility method which we are going
18891 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18892 the object type, so we take care of that.
18894 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18896 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18897 added to non-params parameters :-)
18899 * typemanager.cs (CSharpName): Include 'void' type too.
18901 (void_ptr_type): Include in the set of core types.
18903 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
18906 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
18909 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
18910 completely forgotten about it.
18912 2002-01-10 Ravi Pratap <ravi@ximian.com>
18914 * cs-parser.jay (pointer_type): Add. This begins our implementation
18915 of parsing rules for unsafe code.
18917 (unsafe_statement): Implement.
18919 (embedded_statement): Modify to include the above.
18921 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18923 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18924 if the current context is an unsafe one.
18926 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18927 are handled differently, we need separate rules for them.
18929 (local_variable_declaration): Update to use local_variable_pointer_type
18930 to allow variable declarations of unmanaged pointer types.
18932 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18933 in unsafe contexts.
18935 * ../errors/cs0214.cs : Add.
18937 2002-01-16 Nick Drochak <ndrochak@gol.com>
18939 * makefile: remove 'response' file when cleaning.
18941 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18943 * cs-parser.jay: Report 1524.
18945 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18947 * typemanager.cs (RegisterMethod): drop checking if we have
18948 registered this from here
18950 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18952 * class.cs (Method.EmitDestructor): Implement calling our base
18955 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18956 value of InFinally.
18958 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18959 this routine and will wrap the call in a try/catch block. Deal
18962 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18964 * ecore.cs (Expression.MemberLookup): instead of taking a
18965 parameter `same_type' that was used to tell whether we could
18966 access private members we compute our containing type from the
18969 (FieldExpr): Added partial support for volatile fields. This does
18970 not work for volatile fields exposed from assemblies, as I can not
18971 figure out how to extract the modreq from it.
18973 Updated all the source files to use this.
18975 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18976 because it is referenced by MemberLookup very often.
18978 2002-01-09 Ravi Pratap <ravi@ximian.com>
18980 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18981 TypeBuilder.GetCustomAttributes to retrieve what we need.
18983 Get rid of redundant default_member_attr_type as this is the same as
18984 default_member_type which already exists.
18986 * interface.cs, attribute.cs : Update accordingly.
18988 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18990 * typemanager.cs: Enable IndexerPropertyName again. It does not
18991 work for TYpeBuilders though. Ravi, can you please fix this?
18993 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18995 * expression.cs (Argument.Emit): Handle the case of ref objects
18996 being passed to ref functions;
18998 (ParameterReference.EmitLoad): Loads the content of the pointer
18999 without dereferencing.
19001 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19003 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19005 2002-01-08 Ravi Pratap <ravi@ximian.com>
19007 * class.cs (Indexer.DefineMethod): Incorporate the interface
19008 type in the name of the method if we are doing explicit interface
19011 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19013 (BetterConversion): Fix extremely trivial bug where we were referring to
19014 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19017 * ../errors/bug16.cs : Add although we have fixed it.
19019 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19021 * expression.cs (BaseIndexer): Begin implementation.
19023 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19025 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19026 production directly to remove a shift/reduce, and implement
19027 explicit interface implementation.
19029 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19030 after a floating point suffix.
19032 * expression.cs (DoNumericPromotions): Improved the conversion for
19033 uint/uint. If we have a constant, we avoid doing a typecast to a
19036 * class.cs (Indexer): Implement explicit interface implementation
19039 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19041 * class.cs: make the default instance constructor public and hidebysig.
19043 2001-01-03 Ravi Pratap <ravi@ximian.com>
19045 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19046 so we can call it from elsewhere.
19048 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19049 we emit it internally if the class has a defined indexer; otherwise the user
19050 emits it by decorating the class definition with the DefaultMemberAttribute.
19052 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19053 attribute is not used on a type which defines an indexer.
19055 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19056 character when we skip whitespace.
19058 * ../errors/cs0646.cs : Add.
19060 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19062 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19065 * makefile: Add practical target `mcs3.exe' which builds the third
19066 generation compiler.
19068 * expression.cs (New): Fix structures constructor calling.
19070 * class.cs (Property, Method, Indexer): Emit Final flag on the
19071 method if we are an interface implementation and we are not
19074 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19075 whether this property is referencing a `base' method.
19077 * expression.cs (Invocation.EmitCall): take an extra argument:
19078 is_base, this is used to determine whether the `call' or
19079 `callvirt' opcode should be used.
19082 * delegate.cs: update EmitCall.
19084 * class.cs (Method.Define): Set NewSlot for the cases where we are
19085 not implementing an interface method.
19087 (Property.Define): ditto.
19089 2002-01-02 Miguel de Icaza <miguel@ximian.com>
19091 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19092 'r'. Allows mcs to parse itself fully.
19094 2002-01-02 Ravi Pratap <ravi@ximian.com>
19096 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19097 of the number of initializers that require the InitializeArray method.
19099 (CheckIndices): Store the Expression in all cases - not the plain value. Also
19100 update the above field where necessary.
19102 (MakeByteBlob): Update accordingly.
19104 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
19107 (EmitDynamicInitializers): Update in accordance with the new optimization.
19109 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19110 same OpCode applies.
19112 * cs-parser.jay : Fix some glaring errors I introduced.
19114 2002-01-01 Ravi Pratap <ravi@ximian.com>
19116 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19117 so that we can check for name clashes there too.
19119 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19120 for interface indexers.
19122 * interfaces.cs (Define): Emit the default member attribute.
19124 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19125 variable was being referred to while setting the value ;-)
19127 2002-01-01 Miguel de Icaza <miguel@ximian.com>
19129 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19130 byte-by-byte information when we know the data is zero.
19132 Make the block always a multiple of 4, because
19133 DefineInitializedData has a bug.
19135 * assign.cs: Fix, we should assign from the temporary, not from
19138 * expression.cs (MakeByteBlob): Fix my incorrect code.
19140 2001-12-31 Miguel de Icaza <miguel@ximian.com>
19142 * typemanager.cs (EnumToUnderlying): This function is used to get
19143 the underlying type from an enumeration, because it does not
19146 * constant.cs: Use the I4_S form for values between -128 and 127.
19148 * statement.cs (Block.LookupLabel): Looks up a label.
19149 (Block): Drop support for labeled blocks.
19151 (LabeledStatement): New kind of statement that represents a label
19154 (Goto): Finally implement this bad boy.
19156 * cs-parser.jay: Update to reflect new mechanism to implement
19159 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19161 * codegen.cs (EmitContext.This): a codegen property that keeps the
19162 a single instance of this instead of creating many different this
19165 * delegate.cs (Delegate.DoResolve): Update to use the property;
19167 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19169 * expression.cs (BaseAccess.DoResolve): Ditto.
19171 2001-12-29 Ravi Pratap <ravi@ximian.com>
19173 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19174 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19176 (InitCoreTypes): Update accordingly.
19178 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19179 so we can quickly store the state.
19181 (ApplyAttributes): Set the correct implementation flags
19182 for InternalCall methods.
19184 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19186 * expression.cs (EmitCall): if a method is not virtual, then do
19187 not use callvirt on it.
19189 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19190 user defined stuff) requires the use of stobj, which takes an
19191 address on the stack instead of an array and an index. So emit
19192 the Ldelema operation for it.
19194 (EmitStoreOpcode): Use stobj for valuetypes.
19196 (UnaryMutator.EmitCode): Use the right 1 value depending on
19197 whether we are dealing with int64/uint64, float or doubles.
19199 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19200 constructors that I implemented last night.
19202 (Constructor.IsDefault): Fix to work properly for static
19205 * cs-parser.jay (CheckDef): report method signature errors.
19206 Update error number 103 to be 132.
19208 * decl.cs: New AdditionResult enumeration value: MethodExists.
19209 Although we do this check for methods later on in the semantic
19210 analysis, catching repeated default constructors is so easy that
19211 we catch these here.
19213 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19216 (ParameterReference.EmitAssign, Emit): handle
19219 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19220 (ArrayAccess.EmitStoreOpcode): ditto.
19222 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19224 * expression.cs (MakeByteBlob): Complete all the missing types
19225 (uint, short, ushort, byte, sbyte)
19227 * class.cs: Only init instance field initializers on instance
19230 Rename `constructors' to instance_constructors.
19232 (TypeContainer.AddConstructor): Only add constructors to the list
19233 if it is not static.
19235 Make sure that we handle default_static_constructor independently
19236 everywhere where we handle instance_constructors
19238 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19240 * class.cs: Do not lookup or create a base initializer for a
19241 static constructor.
19243 (ConstructorInitializer.Resolve): use the proper type to lookup
19246 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19248 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19251 * decl.cs: CloseType is now an virtual method, the default
19252 implementation just closes this type.
19254 2001-12-28 Ravi Pratap <ravi@ximian.com>
19256 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19257 to PreserveSig by default. Also emit HideBySig on such methods.
19259 Basically, set the defaults to standard values.
19261 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19262 argument, if candidate is better, it can't be worse than the best !
19264 (Invocation): Re-write bits to differentiate between methods being
19265 applicable in their expanded form and their normal form - for params
19268 Get rid of use_standard everywhere as only standard conversions are allowed
19269 in overload resolution.
19271 More spec conformance.
19273 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19275 * driver.cs: Add --timestamp, to see where the compiler spends
19278 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19279 `this' in static code.
19281 (SimpleName.DoResolve): Implement in terms of a helper function
19282 that allows static-references to be passed upstream to
19285 (Expression.ResolveWithSimpleName): Resolve specially simple
19286 names when called by MemberAccess to implement the special
19289 (Expression.ImplicitReferenceConversion): Handle conversions from
19290 Null to reference types before others, as Null's type is
19293 * expression.cs (Invocation.EmitCall): Handle the special case of
19294 calling methods declared on a reference type from a ValueType
19295 (Base classes System.Object and System.Enum)
19297 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19298 the left hand side is a TypeExpr, not on every enumeration.
19300 (Binary.Resolve): If types are reference types, then do a cast to
19301 object on operators != and == of both arguments.
19303 * typemanager.cs (FindMembers): Extract instance and static
19304 members if requested.
19306 * interface.cs (PopulateProperty): Use void_type instead of null
19307 as the return type for the setter method.
19309 (PopulateIndexer): ditto.
19311 2001-12-27 Ravi Pratap <ravi@ximian.com>
19313 * support.cs (ReflectionParameters): Fix minor bug where we
19314 were examining the wrong parameter for the ParamArray attribute.
19316 Cope with requests for the type of the parameter at position
19317 greater than the params parameter's. We now return the element
19318 type of the params array as that makes more sense.
19320 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19321 accordingly as we no longer have to extract the element type
19324 (Invocation.OverloadResolve): Update.
19326 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19328 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19329 against IEnumerator, test whether the return value is a descendant
19330 of the IEnumerator interface.
19332 * class.cs (Indexer.Define): Use an auxiliary method to implement
19333 the other bits of the method definition. Begin support for
19334 explicit interface implementation.
19336 (Property.DefineMethod): Use TypeManager.void_type instead of null
19337 for an empty return value.
19339 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19341 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19342 dealing with a FieldExpr which is composed of a FieldBuilder, in
19343 the code path we did extract the constant, but we should have
19344 obtained the underlying value to be able to cast it (otherwise we
19345 end up in an infinite loop, this is what Ravi was running into).
19347 (ArrayCreation.UpdateIndices): Arrays might be empty.
19349 (MemberAccess.ResolveMemberAccess): Add support for section
19350 14.5.4.1 that deals with the special case of E.I when E is a type
19351 and something else, that I can be a reference to a static member.
19353 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19354 handle a particular array type to create byte blobs, it is just
19355 something we dont generate byteblobs for.
19357 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19360 * location.cs (Push): remove the key from the hashtable that we
19361 are about to add. This happens for empty files.
19363 * driver.cs: Dispose files after we have parsed them.
19365 (tokenize): new function that only runs the tokenizer on its
19366 input, for speed testing.
19368 2001-12-26 Ravi Pratap <ravi@ximian.com>
19370 * class.cs (Event.Define): Define the private field only if there
19371 are no accessors defined.
19373 * expression.cs (ResolveMemberAccess): If there is no associated
19374 field with the event, that means we have an event defined with its
19375 own accessors and we should flag error cs0070 since transforming
19376 ourselves into a field is not valid in that case.
19378 * ecore.cs (SimpleName.DoResolve): Same as above.
19380 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19381 and charset to sane values.
19383 2001-12-25 Ravi Pratap <ravi@ximian.com>
19385 * assign.cs (DoResolve): Perform check on events only if they
19386 are being accessed outside the declaring type.
19388 * cs-parser.jay (event_declarations): Update rules to correctly
19389 set the type of the implicit parameter etc.
19391 (add_accessor, remove_accessor): Set current local parameters.
19393 * expression.cs (Binary): For delegate addition and subtraction,
19394 cast the return value from the method into the appropriate delegate
19397 2001-12-24 Ravi Pratap <ravi@ximian.com>
19399 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19400 of these as the workaround is unnecessary.
19402 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19403 delegate data - none of that is needed at all.
19405 Re-write bits to extract the instance expression and the delegate method
19408 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19411 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19412 of attaching attributes instead of duplicating code everywhere.
19414 * everywhere : Update code to do attribute emission using the above method.
19416 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19418 * expression.cs (IsParamsMethodApplicable): if there are not
19419 parameters, return immediately.
19421 * ecore.cs: The 0 literal can be implicity converted to an enum
19424 (SimpleName.DoResolve): First lookup the type, then lookup the
19427 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19428 want to get its address. If the InstanceExpression is not
19429 addressable, store the result in a temporary variable, then get
19432 * codegen.cs: Only display 219 errors on warning level or above.
19434 * expression.cs (ArrayAccess): Make it implement the
19435 IMemoryLocation interface.
19437 (Binary.DoResolve): handle the operator == (object a, object b)
19438 and operator != (object a, object b) without incurring into a
19439 BoxedCast (because 5 != o should never be performed).
19441 Handle binary enumerator operators.
19443 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19444 value type, otherwise use Ldelem_ref.
19446 Use precomputed names;
19448 (AddressOf): Implement address of
19450 * cs-parser.jay (labeled_statement): Fix recursive block
19451 addition by reworking the production.
19453 * expression.cs (New.DoEmit): New has a special case:
19455 If we are dealing with a ValueType, we have a few
19456 situations to deal with:
19458 * The target of New is a ValueType variable, that is
19459 easy, we just pass this as the variable reference
19461 * The target of New is being passed as an argument,
19462 to a boxing operation or a function that takes a
19465 In this case, we need to create a temporary variable
19466 that is the argument of New.
19469 2001-12-23 Ravi Pratap <ravi@ximian.com>
19471 * rootcontext.cs (LookupType): Check that current_type is not null before
19472 going about looking at nested types.
19474 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19475 not implement the IAssignMethod interface any more.
19477 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19478 where we tranform them into FieldExprs if they are being resolved from within
19479 the declaring type.
19481 * ecore.cs (SimpleName.DoResolve): Do the same here.
19483 * assign.cs (DoResolve, Emit): Clean up code considerably.
19485 * ../errors/bug10.cs : Add.
19487 * ../errors/cs0070.cs : Add.
19489 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19491 * assign.cs : Get rid of EventIsLocal everywhere.
19493 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19495 * ecore.cs (ConvertIntLiteral): finished the implementation.
19497 * statement.cs (SwitchLabel): Convert the value we are using as a
19498 key before looking up the table.
19500 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19502 * codegen.cs (EmitTopBlock): Require a Location argument now.
19504 * cs-parser.jay (constructor_declarator): We need to setup
19505 current_local_parameters before we parse the
19506 opt_constructor_initializer, to allow the variables to be bound
19507 to the constructor arguments.
19509 * rootcontext.cs (LookupType): First lookup nested classes in our
19510 class and our parents before we go looking outside our class.
19512 * expression.cs (ConstantFold): Extract/debox the values at the
19515 * rootcontext.cs (EmitCode): Resolve the constants first before we
19516 resolve the types. This is not really needed, but it helps debugging.
19518 * statement.cs: report location.
19520 * cs-parser.jay: pass location to throw statement.
19522 * driver.cs: Small bug fix.
19524 * report.cs: Updated format to be 4-zero filled digits.
19526 2001-12-22 Ravi Pratap <ravi@ximian.com>
19528 * expression.cs (CheckIndices): Fix minor bug where the wrong
19529 variable was being referred to ;-)
19531 (DoEmit): Do not call EmitStaticInitializers when the
19532 underlying type is System.Object.
19534 2001-12-21 Ravi Pratap <ravi@ximian.com>
19536 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19537 and do the usual workaround for SRE.
19539 * class.cs (MyEventBuilder.EventType): New member to get at the type
19540 of the event, quickly.
19542 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19544 * assign.cs (Assign.DoResolve): Handle the case when the target
19545 is an EventExpr and perform the necessary checks.
19547 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19550 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19552 (EventExpr): Set the type in the constructor itself since we
19553 are meant to be born fully resolved.
19555 (EventExpr.Define): Revert code I wrote earlier.
19557 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19558 instance expression is null. The instance expression is a This in that case
19559 or a null, depending on whether it is a static method or not.
19561 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19562 refers to more than one method.
19564 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19565 and accordingly flag errors.
19567 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19569 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19571 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19573 * location.cs (ToString): Provide useful rutine.
19575 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19577 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19578 objects, return the actual integral boxed.
19580 * statement.cs (SwitchLabel): define an ILLabel for each
19583 (Switch.CheckSwitch): If the value is a Literal, extract
19584 the underlying literal.
19586 Also in the unused hashtable we had, add the SwitchLabel so we can
19587 quickly look this value up.
19589 * constant.cs: Implement a bunch of new constants. Rewrite
19590 Literal based on this. Made changes everywhere to adapt to this.
19592 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19593 dereferencing array only once, and also copes with enumrations.
19595 bytes are two bytes wide, not one.
19597 (Cast): Perform constant conversions.
19599 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19600 wrappers to the literals here.
19602 * expression.cs (DoNumericPromotions): long literals can converted
19603 to ulong implicity (this is taken care of elsewhere, but I was
19604 missing this spot).
19606 * ecore.cs (Expression.Literalize): Make the return type Literal,
19607 to improve type checking.
19609 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19611 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19613 * literal.cs: Revert code from ravi that checked the bounds. The
19614 bounds are sane by the definition of the type itself.
19616 * typemanager.cs: Fix implementation of ImplementsInterface. We
19617 need to actually look up in our parent hierarchy for interfaces
19620 * const.cs: Use the underlying type for enumerations
19622 * delegate.cs: Compute the basename for the delegate creation,
19623 that should fix the delegate test case, and restore the correct
19624 Type Lookup semantics in rootcontext
19626 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19627 referencing a nested type with the Reflection API is using the "+"
19630 * cs-parser.jay: Do not require EOF token at the end.
19632 2001-12-20 Ravi Pratap <ravi@ximian.com>
19634 * rootcontext.cs (LookupType): Concatenate type names with
19635 a '.' instead of a '+' The test suite passes again.
19637 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19638 field of the enumeration.
19640 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19641 the case when the member is an EventExpr.
19643 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19644 static has an associated instance expression.
19646 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19648 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19650 * class.cs (Event.Define): Register event and perform appropriate checks
19653 We define the Add and Remove methods even if the use provides none because
19654 in that case, we provide default implementations ourselves.
19656 Define a private field of the type of the event. This is done by the CSC compiler
19657 and we should be doing it too ;-)
19659 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19660 More methods we use in code we generate.
19662 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19665 (InitCoreTypes): Update accordingly for the above.
19667 * class.cs (Event.Emit): Generate code for default accessors that we provide
19669 (EmitDefaultMethod): Do the job in the above.
19671 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19674 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19676 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19677 builders even if we were missing one.
19679 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19680 pass the Basename as our class name instead of the Name. The
19681 basename will be correctly composed for us.
19683 * parameter.cs (Paramters): Now takes a Location argument.
19685 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19686 make all the code call directly LookupType in RootContext and take
19687 this chance to pass the Location information everywhere.
19689 * Everywhere: pass Location information.
19691 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19693 * class.cs (Constructor.Define): Updated way of detecting the
19694 length of the parameters.
19696 (TypeContainer.DefineType): Use basename as the type name for
19699 (TypeContainer.Define): Do not recursively define types here, as
19700 definition is taken care in order by the RootContext.
19702 * tree.cs: Keep track of namespaces in a per-file basis.
19704 * parameter.cs (Parameter.ComputeSignature): Update to use
19707 (Parameters.GetSignature): ditto.
19709 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19710 instead of a TypeContainer.
19712 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19713 resolve names. Because we need to be resolve in our context, not
19716 * driver.cs: Implement response files.
19718 * class.cs (TypeContainer.DefineType): If we are defined, do not
19719 redefine ourselves.
19721 (Event.Emit): Emit the code for add/remove handlers.
19722 (Event.Define): Save the MethodBuilders for add/remove.
19724 * typemanager.cs: Use pair here too.
19726 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19727 DictionaryEntry requires the first argument to be non-null.
19729 (enum_declaration): Compute full name for registering the
19732 (delegate_declaration): Instead of using
19733 formal_parameter_list, use opt_formal_parameter_list as the list
19736 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19737 (EventParsing): New property that controls whether `add' and
19738 `remove' are returned as tokens or identifiers (for events);
19740 2001-12-19 Ravi Pratap <ravi@ximian.com>
19742 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19743 use MyEventBuilder only and let it wrap the real builder for us.
19745 (MyEventBuilder): Revamp constructor etc.
19747 Implement all operations that we perform on EventBuilder in precisely the same
19750 (FindMembers): Update to use the EventBuilder member.
19752 (Event.Emit): Update accordingly.
19754 2001-12-18 Ravi Pratap <ravi@ximian.com>
19756 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19757 by calling the appropriate methods.
19759 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19762 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19764 2001-12-17 Ravi Pratap <ravi@ximian.com>
19766 * delegate.cs (Delegate.Populate): Check that the return type
19767 and various parameters types are indeed accessible.
19769 * class.cs (Constructor.Define): Same here.
19771 (Field.Define): Ditto.
19773 (Event.Define): Ditto.
19775 (Operator.Define): Check that the underlying Method defined itself
19776 correctly - so it's MethodBuilder should not be null.
19778 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19779 expression happens to be null.
19781 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19782 members but as of now we don't seem to be able to do anything really useful with it.
19784 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19785 not the EventBuilder.
19787 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19789 * cs-tokenizer.cs: Add support for defines.
19790 Add support for #if, #elif, #else, #endif
19792 (eval_var): evaluates a variable.
19793 (eval): stubbed for evaluating functions.
19795 * cs-parser.jay: Pass the defines information
19797 * driver.cs: Add --define command line option.
19799 * decl.cs: Move MemberCore here.
19801 Make it the base class for DeclSpace. This allows us to catch and
19802 report 108 and 109 for everything now.
19804 * class.cs (TypeContainer.Define): Extract all the members
19805 before populating and emit the warning 108 (new keyword required
19806 to override) instead of having each member implement this.
19808 (MemberCore.Define): New abstract method, we will be using this in
19809 the warning reporting engine in Populate.
19811 (Operator.Define): Adjust to new MemberCore protocol.
19813 * const.cs (Const): This does not derive from Expression, it is a
19814 temporary object we use to create fields, it is a MemberCore.
19816 * class.cs (Method.Define): Allow the entry point to be in a
19819 * driver.cs: Rewrite the argument handler to clean it up a bit.
19821 * rootcontext.cs: Made it just an auxiliary namespace feature by
19822 making everything static.
19824 * driver.cs: Adapt code to use RootContext type name instead of
19827 * delegate.cs: Remove RootContext argument.
19829 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19832 * class.cs (Event.Define): The lookup can fail.
19834 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19836 * expression.cs: Resolve the this instance before invoking the code.
19838 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19840 * cs-parser.jay: Add a production in element_access that allows
19841 the thing to become a "type" reference. This way we can parse
19842 things like "(string [])" as a type.
19844 Note that this still does not handle the more complex rules of
19848 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19850 * ecore.cs: (CopyNewMethods): new utility function used to
19851 assemble the list of methods from running FindMembers.
19853 (MemberLookup): Rework FindMembers so that
19855 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19857 * class.cs (TypeContainer): Remove Delegates who fail to be
19860 * delegate.cs (Populate): Verify that we dont get null return
19861 values. TODO: Check for AsAccessible.
19863 * cs-parser.jay: Use basename to emit error 574 (destructor should
19864 have the same name as container class), not the full name.
19866 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19867 possible representation.
19869 Also implements integer type suffixes U and L.
19871 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19873 * expression.cs (ArrayCreation.DoResolve): We need to do the
19874 argument resolution *always*.
19876 * decl.cs: Make this hold the namespace. Hold the root context as
19878 (LookupType): Move here.
19880 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19882 * location.cs (Row, Name): Fixed the code, it was always returning
19883 references to the first file.
19885 * interface.cs: Register properties defined through interfaces.
19887 * driver.cs: Add support for globbing on the command line
19889 * class.cs (Field): Make it derive from MemberCore as well.
19892 2001-12-15 Ravi Pratap <ravi@ximian.com>
19894 * class.cs (Event::Define): Check that the type of the event is a delegate
19895 type else flag error #66.
19897 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19900 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19901 values of EntryPoint, CharSet etc etc.
19903 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19905 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19906 be null and we should ignore this. I am not sure if this is really clean. Apparently,
19907 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19908 which needs this to do its work.
19910 * ../errors/cs0066.cs : Add.
19912 2001-12-14 Miguel de Icaza <miguel@ximian.com>
19914 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19917 * class.cs: (MethodSignature.MethodSignature): Removed hack that
19918 clears out the parameters field.
19919 (MemberSignatureCompare): Cleanup
19921 (MemberCore): New base class used to share code between MethodCore
19924 (RegisterRequiredImplementations) BindingFlags.Public requires
19925 either BindingFlags.Instace or Static. Use instance here.
19927 (Property): Refactored code to cope better with the full spec.
19929 * parameter.cs (GetParameterInfo): Return an empty array instead
19932 * class.cs (Property): Abstract or extern properties have no bodies.
19934 * parameter.cs (GetParameterInfo): return a zero-sized array.
19936 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19937 method modifier validation to the typecontainer so we can reuse
19938 this on properties.
19940 (MethodCore.ParameterTypes): return an empty sized array of types.
19942 (Property.Define): Test property modifier validity.
19944 Add tests for sealed/override too.
19946 (Method.Emit): abstract or extern methods have no bodies.
19948 2001-12-14 Ravi Pratap <ravi@ximian.com>
19950 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19953 (Method::Define, ::Emit): Modify accordingly.
19955 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19957 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19959 * makefile: Pass in /unsafe.
19961 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19963 * class.cs (MakeKey): Kill routine.
19965 * class.cs (TypeContainer.Define): Correctly define explicit
19966 method implementations (they require the full interface name plus
19969 * typemanager.cs: Deply the PtrHashtable here and stop using the
19970 lame keys. Things work so much better.
19972 This of course broke everyone who depended on `RegisterMethod' to
19973 do the `test for existance' test. This has to be done elsewhere.
19975 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19976 the object stupid Equals method (because, that like fails all over
19977 the place). We still do not use it.
19979 * class.cs (TypeContainer.SetRequiredInterface,
19980 TypeContainer.RequireMethods): Killed these two routines and moved
19981 all the functionality to RegisterRequiredImplementations.
19983 (TypeContainer.RegisterRequiredImplementations): This routine now
19984 registers all the implementations required in an array for the
19985 interfaces and abstract methods. We use an array of structures
19986 which can be computed ahead of time to reduce memory usage and we
19987 also assume that lookups are cheap as most classes will not
19988 implement too many interfaces.
19990 We also avoid creating too many MethodSignatures.
19992 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19993 clear the "pending" bit if we find that there are problems with
19996 (TypeContainer.VerifyPendingMethods): Update to report errors of
19997 methods that look like implementations but are not.
19999 (TypeContainer.Define): Add support for explicit interface method
20002 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20004 * typemanager.cs: Keep track of the parameters here instead of
20005 being a feature of the TypeContainer.
20007 * class.cs: Drop the registration of parameters here, as
20008 InterfaceMethods are also interface declarations.
20010 * delegate.cs: Register methods with the TypeManager not only with
20011 the TypeContainer. This code was buggy.
20013 * interface.cs: Full registation here.
20015 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20017 * expression.cs: Remove reducer for binary expressions, it can not
20020 * const.cs: Put here the code that used to go into constant.cs
20022 * constant.cs: Put here the code for constants, this is a new base
20023 class for Literals.
20025 * literal.cs: Make Literal derive from Constant.
20027 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20029 * statement.cs (Return.Emit): Report error 157 if the user
20030 attempts to return from a finally block.
20032 (Return.Emit): Instead of emitting a return, jump to the end of
20035 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20036 LocalBuilder to store the result of the function. ReturnLabel is
20037 the target where we jump.
20040 2001-12-09 Radek Doulik <rodo@ximian.com>
20042 * cs-parser.jay: remember alias in current namespace
20044 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20047 * class.cs (LookupAlias): lookup alias in my_namespace
20049 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20051 (LookupAlias): lookup alias in this and if needed in parent
20054 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20058 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20059 making things static. I need this to avoid passing the
20060 TypeContainer when calling ParameterType.
20062 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20063 that did string manipulation to compute the type and then call
20064 GetType. Use Parameter.ParameterType instead.
20066 * cs-tokenizer.cs: Consume the suffix for floating values.
20068 * expression.cs (ParameterReference): figure out whether this is a
20069 reference parameter or not. Kill an extra variable by computing
20070 the arg_idx during emission.
20072 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20073 function that returns whether a parameter is an out/ref value or not.
20075 (Parameter.ParameterType): The type of the parameter (base,
20076 without ref/out applied).
20078 (Parameter.Resolve): Perform resolution here.
20079 (Parameter.ExternalType): The full type (with ref/out applied).
20081 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20082 support for expressions on the using statement.
20084 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20086 * statement.cs (Using.EmitLocalVariableDecls): Split the
20087 localvariable handling of the using statement.
20089 (Block.EmitMeta): Keep track of variable count across blocks. We
20090 were reusing slots on separate branches of blocks.
20092 (Try.Emit): Emit the general code block, we were not emitting it.
20094 Check the type of the declaration to be an IDisposable or
20095 something that can be implicity converted to it.
20097 Emit conversions if required.
20099 * ecore.cs (EmptyExpression): New utility class.
20100 (Expression.ImplicitConversionExists): New utility function.
20102 2001-12-06 Miguel de Icaza <miguel@ximian.com>
20104 * statement.cs (Using): Implement.
20106 * expression.cs (LocalVariableReference): Support read only variables.
20108 * statement.cs: Remove the explicit emit for the Leave opcode.
20109 (VariableInfo): Add a readonly field.
20111 2001-12-05 Miguel de Icaza <miguel@ximian.com>
20113 * ecore.cs (ConvCast): new class used to encapsulate the various
20114 explicit integer conversions that works in both checked and
20115 unchecked contexts.
20117 (Expression.ConvertNumericExplicit): Use new ConvCast class to
20118 properly generate the overflow opcodes.
20120 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20122 * statement.cs: The correct type for the EmptyExpression is the
20123 element_type, not the variable type. Ravi pointed this out.
20125 2001-12-04 Ravi Pratap <ravi@ximian.com>
20127 * class.cs (Method::Define): Handle PInvoke methods specially
20128 by using DefinePInvokeMethod instead of the usual one.
20130 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20131 above to do the task of extracting information and defining the method.
20133 2001-12-04 Ravi Pratap <ravi@ximian.com>
20135 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20136 of the condition for string type.
20138 (Emit): Move that here.
20140 (ArrayCreation::CheckIndices): Keep string literals in their expression
20143 (EmitDynamicInitializers): Handle strings appropriately.
20145 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20147 * codegen.cs (EmitContext): Replace multiple variables with a
20148 single pointer to the current Switch statement.
20150 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20153 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20157 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20160 (Foreach.Emit): Foreach on arrays was not setting
20161 up the loop variables (for break/continue).
20163 (GotoCase): Semi-implented.
20165 2001-12-03 Ravi Pratap <ravi@ximian.com>
20167 * attribute.cs (CheckAttribute): Handle system attributes by using
20168 Attribute.GetAttributes to examine information we need.
20170 (GetValidPlaces): Same here.
20172 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20174 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20176 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20178 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20180 (Method::Emit): Handle the case when we are a PInvoke method.
20182 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20184 * expression.cs: Use ResolveWithSimpleName on compound names.
20186 2001-12-02 Ravi Pratap <ravi@ximian.com>
20188 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20189 before trying to reduce it.
20191 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20193 * constant.cs (LookupConstantValue): Implement.
20195 (EmitConstant): Use the above in emitting the constant.
20197 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20198 that are user-defined by doing a LookupConstantValue on them.
20200 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20203 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20205 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20207 (BaseAccess.DoResolve): Implement.
20209 (MemberAccess.DoResolve): Split this routine into a
20210 ResolveMemberAccess routine that can be used independently
20212 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20214 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20215 As that share bits of the implementation. Is returns a boolean,
20216 while As returns the Type that is being probed.
20218 2001-12-01 Ravi Pratap <ravi@ximian.com>
20220 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20221 instead of a Literal - much easier.
20223 (EnumInTransit): Remove - utterly useless :-)
20225 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20227 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20229 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20230 chain when we have no associated expression.
20232 2001-11-30 Ravi Pratap <ravi@ximian.com>
20234 * constant.cs (Define): Use Location while reporting the errror.
20236 Also emit a warning when 'new' is used and there is no inherited
20239 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20242 (LookupEnumValue): Implement to lookup an enum member's value and define it
20245 (Populate): Re-write accordingly to use the above routine.
20247 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20249 * expression.cs (This): Fix prototype for DoResolveLValue to
20250 override the base class DoResolveLValue.
20252 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20255 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20256 (we need to load the address of the field here). This fixes
20259 (FieldExpr.DoResolveLValue): Call the DoResolve
20260 function to initialize the Instance expression.
20262 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20263 correctly the GetEnumerator operation on a value type.
20265 * cs-parser.jay: Add more simple parsing error catches.
20267 * statement.cs (Switch): Add support for string switches.
20268 Handle null specially.
20270 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20272 2001-11-28 Ravi Pratap <ravi@ximian.com>
20274 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20276 (declare_local_constant): New helper function.
20278 * statement.cs (AddConstant): Keep a separate record of constants
20280 (IsConstant): Implement to determine if a variable is a constant.
20282 (GetConstantExpression): Implement.
20284 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20286 * statement.cs (IsVariableDefined): Re-write.
20288 2001-11-27 Ravi Pratap <ravi@ximian.com>
20290 * class.cs (TypeContainer::FindMembers): Look for constants
20291 in the case when we are looking for MemberTypes.Field
20293 * expression.cs (MemberAccess::DoResolve): Check that in the
20294 case we are a FieldExpr and a Literal, we are not being accessed
20295 by an instance reference.
20297 * cs-parser.jay (local_constant_declaration): Implement.
20299 (declaration_statement): Implement for constant declarations.
20301 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20303 * statement.cs (Switch): Catch double defaults.
20305 (Switch): More work on the switch() statement
20306 implementation. It works for integral values now, need to finish
20310 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20312 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20313 integer literals into other integer literals. To be used by
20316 2001-11-24 Ravi Pratap <ravi@ximian.com>
20318 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20321 (EmitDynamicInitializers): Cope with the above since we extract data
20322 directly from ArrayData now.
20324 (ExpectInitializers): Keep track of whether initializers are mandatory
20327 (Bounds): Make it a hashtable to prevent the same dimension being
20328 recorded for every element in that dimension.
20330 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20333 Also fix bug which was causing the indices to be emitted in the reverse
20336 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20338 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20339 unfinished. They do not work, because the underlying code is
20342 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20344 * cs-parser.jay: Remove bogus fixme.
20346 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20347 on Switch statement.
20349 2001-11-23 Ravi Pratap <ravi@ximian.com>
20351 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20354 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20355 parameter. Apparently, any expression is allowed.
20357 (ValidateInitializers): Update accordingly.
20359 (CheckIndices): Fix some tricky bugs thanks to recursion.
20361 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20362 I was being completely brain-dead.
20364 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20365 and re-write acordingly.
20367 (DelegateInvocation): Re-write accordingly.
20369 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20371 (MakeByteBlob): Handle types more correctly.
20373 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20374 initialization from expressions but it is incomplete because I am a complete
20377 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20379 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20380 on If. Basically, we have to return `true' (ie, we do return to
20381 our caller) only if both branches of the if return.
20383 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20384 short-circuit operators, handle them as short circuit operators.
20386 (Cast.DoResolve): Resolve type.
20387 (Cast.Cast): Take an expression as the target type.
20389 * cs-parser.jay (cast_expression): Remove old hack that only
20390 allowed a limited set of types to be handled. Now we take a
20391 unary_expression and we resolve to a type during semantic
20394 Use the grammar productions from Rhys to handle casts (this is
20395 not complete like Rhys syntax yet, we fail to handle that corner
20396 case that C# has regarding (-x), but we will get there.
20398 2001-11-22 Ravi Pratap <ravi@ximian.com>
20400 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20401 field which is an array type.
20403 * cs-parser.jay (declare_local_variables): Support array initialization too.
20405 * typemanager.cs (MakeKey): Implement.
20407 (everywhere): Use the above appropriately.
20409 * cs-parser.jay (for_statement): Update for array initialization while
20410 declaring variables.
20412 * ecore.cs : The error message was correct, it's the variable's names that
20413 were misleading ;-) Make the code more readable.
20415 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20416 the correct type etc.
20418 (ConvertExplicit): Handle Enum types by examining the underlying type.
20420 2001-11-21 Ravi Pratap <ravi@ximian.com>
20422 * parameter.cs (GetCallingConvention): Always return
20423 CallingConventions.Standard for now.
20425 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20427 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20428 and `r' after calling DoNumericPromotions.
20430 * ecore.cs: Fix error message (the types were in the wrong order).
20432 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20433 BindingFlags.Instance as well
20435 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20436 implicit int literal conversion in an empty cast so that we
20437 propagate the right type upstream.
20439 (UnboxCast): new class used to unbox value types.
20440 (Expression.ConvertExplicit): Add explicit type conversions done
20443 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20444 the target type before applying the implicit LongLiterals to ULong
20447 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20449 * cs-parser.jay (for_statement): Reworked the way For works: now
20450 we declare manually any variables that are introduced in
20451 for_initializer to solve the problem of having out-of-band code
20452 emition (that is what got for broken).
20454 (declaration_statement): Perform the actual variable declaration
20455 that used to be done in local_variable_declaration here.
20457 (local_variable_declaration): Do not declare anything, just pass
20458 the information on a DictionaryEntry
20460 2001-11-20 Ravi Pratap <ravi@ximian.com>
20462 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20463 re-write of the logic to now make it recursive.
20465 (UpdateIndices): Re-write accordingly.
20467 Store element data in a separate ArrayData list in the above methods.
20469 (MakeByteBlob): Implement to dump the array data into a byte array.
20471 2001-11-19 Ravi Pratap <ravi@ximian.com>
20473 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20476 * constant.cs (Define): Implement.
20478 (EmitConstant): Re-write fully.
20480 Pass in location info.
20482 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20485 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20486 DictionaryEntry since we need location info too.
20488 (constant_declaration): Update accordingly.
20490 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20491 code into another method : UpdateIndices.
20493 2001-11-18 Ravi Pratap <ravi@ximian.com>
20495 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20496 some type checking etc.
20498 2001-11-17 Ravi Pratap <ravi@ximian.com>
20500 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20501 bits to provide dimension info if the user skips doing that.
20503 Update second constructor to store the rank correctly.
20505 2001-11-16 Ravi Pratap <ravi@ximian.com>
20507 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20508 and try to implement.
20510 * ../errors/cs0150.cs : Add.
20512 * ../errors/cs0178.cs : Add.
20514 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20516 * statement.cs: Implement foreach on multi-dimensional arrays.
20518 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20519 name of the params argument.
20521 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20522 initializing the array.
20524 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20525 we can use this elsewhere.
20527 * statement.cs: Finish implementation of foreach for single
20530 * cs-parser.jay: Use an out-of-band stack to pass information
20531 around, I wonder why I need this.
20533 foreach_block: Make the new foreach_block the current_block.
20535 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20536 function used to return a static Parameters structure. Used for
20537 empty parameters, as those are created very frequently.
20539 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20541 2001-11-15 Ravi Pratap <ravi@ximian.com>
20543 * interface.cs : Default modifier is private, not public. The
20544 make verify test passes again.
20546 2001-11-15 Ravi Pratap <ravi@ximian.com>
20548 * support.cs (ReflectionParameters): Fix logic to determine
20549 whether the last parameter is a params one. Test 9 passes again.
20551 * delegate.cs (Populate): Register the builders we define with
20552 RegisterParameterForBuilder. Test 19 passes again.
20554 * cs-parser.jay (property_declaration): Reference $6 instead
20555 of $$ to get at the location.
20557 (indexer_declaration): Similar stuff.
20559 (attribute): Ditto.
20561 * class.cs (Property): Register parameters for the Get and Set methods
20562 if they exist. Test 23 passes again.
20564 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20565 call to EmitArguments as we are sure there aren't any params arguments.
20566 Test 32 passes again.
20568 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20569 IndexOutOfRangeException.
20571 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20572 Test 33 now passes again.
20574 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20576 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20577 broke a bunch of things. Will have to come up with a better way
20578 of tracking locations.
20580 * statement.cs: Implemented foreach for single dimension arrays.
20582 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20584 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20585 an error. This removes the lookup from the critical path.
20587 * cs-parser.jay: Removed use of temporary_loc, which is completely
20590 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20592 * support.cs (ReflectionParameters.ParameterModifier): Report
20593 whether the argument is a PARAMS argument or not.
20595 * class.cs: Set the attribute `ParamArrayAttribute' on the
20596 parameter argument.
20598 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20599 and cons_param_array_attribute (ConstructorInfo for
20600 ParamArrayAttribute).,
20602 * codegen.cs: Emit the return using the `Return' statement, that
20603 way we can report the error correctly for missing return values.
20605 * class.cs (Method.Emit): Clean up.
20607 * expression.cs (Argument.Resolve): Take another argument: the
20608 location where this argument is used. Notice that this is not
20609 part of the "Argument" class as to reduce the size of the
20610 structure (we know the approximate location anyways).
20612 Test if the argument is a variable-reference, if not, then
20613 complain with a 206.
20615 (Argument.Emit): Emit addresses of variables.
20617 (Argument.FullDesc): Simplify.
20619 (Invocation.DoResolve): Update for Argument.Resolve.
20621 (ElementAccess.DoResolve): ditto.
20623 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20624 method should be virtual, as this method is always virtual.
20626 (NewDelegate.DoResolve): Update for Argument.Resolve.
20628 * class.cs (ConstructorInitializer.DoResolve): ditto.
20630 * attribute.cs (Attribute.Resolve): ditto.
20632 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20634 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20636 * expression.cs (ParameterReference): Drop IStackStorage and implement
20637 IAssignMethod instead.
20639 (LocalVariableReference): ditto.
20641 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20642 IAssignMethod instead.
20644 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20646 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20647 enumerations that are used in heavily used structures derive from
20648 byte in a laughable and pathetic attempt to reduce memory usage.
20649 This is the kind of pre-optimzations that you should not do at
20650 home without adult supervision.
20652 * expression.cs (UnaryMutator): New class, used to handle ++ and
20653 -- separatedly from the other unary operators. Cleans up the
20654 code, and kills the ExpressionStatement dependency in Unary.
20656 (Unary): Removed `method' and `Arguments' from this class, making
20657 it smaller, and moving it all to SimpleCall, so I can reuse this
20658 code in other locations and avoid creating a lot of transient data
20659 strucutres when not required.
20661 * cs-parser.jay: Adjust for new changes.
20663 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20665 * enum.cs (Enum.Populate): If there is a failure during
20668 * cs-parser.jay (opt_enum_base): we used to catch type errors
20669 here, but this is really incorrect. The type error should be
20670 catched during semantic analysis.
20672 2001-12-11 Ravi Pratap <ravi@ximian.com>
20674 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20675 current_local_parameters as expected since I, in my stupidity, had forgotten
20678 * attribute.cs (GetValidPlaces): Fix stupid bug.
20680 * class.cs (Method::Emit): Perform check on applicability of attributes.
20682 (Constructor::Emit): Ditto.
20684 (Field::Emit): Ditto.
20686 (Field.Location): Store location information.
20688 (Property, Event, Indexer, Operator): Ditto.
20690 * cs-parser.jay (field_declaration): Pass in location for each field.
20692 * ../errors/cs0592.cs : Add.
20694 2001-11-12 Ravi Pratap <ravi@ximian.com>
20696 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20698 (InitCoreTypes): Update accordingly.
20700 (RegisterAttrType, LookupAttr): Implement.
20702 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20703 info about the same.
20705 (Resolve): Update to populate the above as necessary.
20707 (Error592): Helper.
20709 (GetValidPlaces): Helper to the above.
20711 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20713 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20715 2001-11-12 Ravi Pratap <ravi@ximian.com>
20717 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20719 * ../errors/cs0617.cs : Add.
20721 2001-11-11 Ravi Pratap <ravi@ximian.com>
20723 * enum.cs (Emit): Rename to Populate to be more consistent with what
20724 we expect it to do and when exactly it is called.
20726 * class.cs, rootcontext.cs : Update accordingly.
20728 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20729 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20731 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20733 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20734 of a fieldinfo using the above, when dealing with a FieldBuilder.
20736 2001-11-10 Ravi Pratap <ravi@ximian.com>
20738 * ../errors/cs0031.cs : Add.
20740 * ../errors/cs1008.cs : Add.
20742 * ../errrors/cs0543.cs : Add.
20744 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20747 (FindMembers): Implement.
20749 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20750 enums and delegates too.
20752 (enum_types): Rename to builder_to_enum.
20754 (delegate_types): Rename to builder_to_delegate.
20756 * delegate.cs (FindMembers): Implement.
20758 2001-11-09 Ravi Pratap <ravi@ximian.com>
20760 * typemanager.cs (IsEnumType): Implement.
20762 * enum.cs (Emit): Re-write parts to account for the underlying type
20763 better and perform checking etc.
20765 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20766 of the underlying type.
20768 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20771 * enum.cs (error31): Helper to report error #31.
20773 * cs-parser.jay (enum_declaration): Store location of each member too.
20775 * enum.cs (member_to_location): New hashtable.
20777 (AddEnumMember): Update location hashtable.
20779 (Emit): Use the location of each member while reporting errors.
20781 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20783 * cs-parser.jay: A for_initializer if is a
20784 local_variable_declaration really ammount to have an implicit
20785 block with the variable declaration and no initializer for for.
20787 * statement.cs (For.Emit): Cope with null initializers.
20789 This fixes the infinite loop on for initializers.
20791 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20793 * enum.cs: More cleanup.
20795 * ecore.cs: Remove dead code.
20797 * class.cs (Property.Emit): More simplification.
20798 (Event.Emit): ditto.
20800 Reworked to have less levels of indentation.
20802 2001-11-08 Ravi Pratap <ravi@ximian.com>
20804 * class.cs (Property): Emit attributes.
20814 * enum.cs (Emit): Ditto.
20816 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20819 * class.cs (Field, Event, etc.): Move attribute generation into the
20820 Emit method everywhere.
20822 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20823 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20824 as we had no way of defining nested enums !
20826 * rootcontext.cs : Adjust code accordingly.
20828 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20830 2001-11-07 Ravi Pratap <ravi@ximian.com>
20832 * expression.cs (EvalConstantExpression): Move into ecore.cs
20834 * enum.cs (Enum): Rename some members and make them public and readonly
20835 according to our convention.
20837 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20840 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20842 (Enum::Emit): Write a simple version for now which doesn't try to compute
20843 expressions. I shall modify this to be more robust in just a while.
20845 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20847 (TypeContainer::CloseType): Create the Enum types too.
20849 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20851 * expression.cs (EvalConstantExpression): Get rid of completely.
20853 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20854 user-defined values and other cases.
20856 (IsValidEnumLiteral): Helper function.
20858 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20859 out there in the case we had a literal FieldExpr.
20861 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20863 (Literalize): Revamp a bit to take two arguments.
20865 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20867 2001-11-06 Ravi Pratap <ravi@ximian.com>
20869 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20871 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20873 (Resolve): Use the above to ensure we have proper initializers.
20875 2001-11-05 Ravi Pratap <ravi@ximian.com>
20877 * expression.cs (Expression::EvalConstantExpression): New method to
20878 evaluate constant expressions.
20880 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20882 2001-11-07 Miguel de Icaza <miguel@ximian.com>
20884 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20887 (Binary.ResolveOperator): Handle operator != (object a, object b)
20888 and operator == (object a, object b);
20890 (Binary.DoNumericPromotions): Indicate whether the numeric
20891 promotion was possible.
20893 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20896 Made the ArrayAccess implement interface IAssignMethod instead of
20897 IStackStore as the order in which arguments are passed reflects
20900 * assign.cs: Instead of using expr.ExprClass to select the way of
20901 assinging, probe for the IStackStore/IAssignMethod interfaces.
20903 * typemanager.cs: Load InitializeArray definition.
20905 * rootcontext.cs (RootContext.MakeStaticData): Used to define
20906 static data that can be used to initialize arrays.
20908 2001-11-05 Miguel de Icaza <miguel@ximian.com>
20910 * expression.cs: Handle operator== and operator!= for booleans.
20912 (Conditioal.Reduce): Implement reducer for the ?: operator.
20914 (Conditional.Resolve): Implement dead code elimination.
20916 (Binary.Resolve): Catch string literals and return a new
20917 concatenated string.
20919 (Unary.Reduce): Implement reduction of unary expressions.
20921 * ecore.cs: Split out the expression core handling here.
20923 (Expression.Reduce): New method used to perform constant folding
20924 and CSE. This is needed to support constant-expressions.
20926 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20927 targets, and optimize for !x.
20929 2001-11-04 Ravi Pratap <ravi@ximian.com>
20931 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20932 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20933 set custom atttributes.
20935 * literal.cs (Literal::GetValue): New abstract method to return the actual
20936 value of the literal, cast as an object.
20938 (*Literal): Implement GetValue method.
20940 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20941 expressions to the arraylist but objects of type Argument.
20943 * class.cs (TypeContainer::Emit): Emit our attributes too.
20945 (Method::Emit, Constructor::Emit): Ditto.
20947 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20948 to be ignoring earlier.
20950 2001-11-03 Ravi Pratap <ravi@ximian.com>
20952 * attribute.cs (AttributeSection::Define): Implement to do the business
20953 of constructing a CustomAttributeBuilder.
20955 (Attribute): New trivial class. Increases readability of code.
20957 * cs-parser.jay : Update accordingly.
20959 (positional_argument_list, named_argument_list, named_argument): New rules
20961 (attribute_arguments): Use the above so that we are more correct.
20963 2001-11-02 Ravi Pratap <ravi@ximian.com>
20965 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20966 to perform all checks for a method with a params parameter.
20968 (Invocation::OverloadResolve): Update to use the above method and therefore
20969 cope correctly with params method invocations.
20971 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20974 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20975 constructors in our parent too because we can't afford to miss out on
20978 * attribute.cs (AttributeSection): New name for the class Attribute
20980 Other trivial changes to improve readability.
20982 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20983 use the new class names.
20985 2001-11-01 Ravi Pratap <ravi@ximian.com>
20987 * class.cs (Method::Define): Complete definition for params types too
20989 (Indexer::Define): Ditto.
20991 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20992 Cope everywhere with a request for info about the array parameter.
20994 2001-11-01 Ravi Pratap <ravi@ximian.com>
20996 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20998 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20999 local_variable_type to extract the string corresponding to the type.
21001 (local_variable_type): Fixup the action to use the new helper method.
21003 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21006 * expression.cs : Clean out code which uses the above.
21008 2001-10-31 Ravi Pratap <ravi@ximian.com>
21010 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21011 and bale out if necessary by returning a false.
21013 (RegisterProperty): Ditto.
21015 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21016 and print out appropriate error messages.
21018 * interface.cs (everywhere): Ditto.
21020 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21021 location to constructor.
21023 * class.cs (Property, Event, Indexer): Update accordingly.
21025 * ../errors/cs111.cs : Added.
21027 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21028 of a method, as laid down by the spec.
21030 (Invocation::OverloadResolve): Use the above method.
21032 2001-10-31 Ravi Pratap <ravi@ximian.com>
21034 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21035 now take a TypeContainer and a Parameters object.
21037 (ParameterData): Modify return type of ParameterModifier method to be
21038 Parameter.Modifier and not a string.
21040 (ReflectionParameters, InternalParameters): Update accordingly.
21042 * expression.cs (Argument::GetParameterModifier): Same here.
21044 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21045 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21046 symbol in it at all so maybe this is only for now.
21048 2001-10-30 Ravi Pratap <ravi@ximian.com>
21050 * support.cs (InternalParameters): Constructor now takes an extra argument
21051 which is the actual Parameters class.
21053 (ParameterDesc): Update to provide info on ref/out modifiers.
21055 * class.cs (everywhere): Update call to InternalParameters to pass in
21056 the second argument too.
21058 * support.cs (ParameterData): Add ParameterModifier, which is a method
21059 to return the modifier info [ref/out etc]
21061 (InternalParameters, ReflectionParameters): Implement the above.
21063 * expression.cs (Argument::ParameterModifier): Similar function to return
21064 info about the argument's modifiers.
21066 (Invocation::OverloadResolve): Update to take into account matching modifiers
21069 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21070 a new SetFormalParameters object which we pass to InternalParameters.
21072 2001-10-30 Ravi Pratap <ravi@ximian.com>
21074 * expression.cs (NewArray): Merge into the ArrayCreation class.
21076 2001-10-29 Ravi Pratap <ravi@ximian.com>
21078 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21079 NewUserdefinedArray into one as there wasn't much of a use in having
21082 * expression.cs (Argument): Change field's name to ArgType from Type.
21084 (Type): New readonly property which returns the proper type, taking into
21085 account ref/out modifiers.
21087 (everywhere): Adjust code accordingly for the above.
21089 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21090 whether we are emitting for a ref or out parameter.
21092 * expression.cs (Argument::Emit): Use the above field to set the state.
21094 (LocalVariableReference::Emit): Update to honour the flag and emit the
21097 * parameter.cs (Attributes): Set the correct flags for ref parameters.
21099 * expression.cs (Argument::FullDesc): New function to provide a full desc.
21101 * support.cs (ParameterData): Add method ParameterDesc to the interface.
21103 (ReflectionParameters, InternalParameters): Implement the above method.
21105 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21108 (Invocation::FullMethodDesc): Ditto.
21110 2001-10-29 Miguel de Icaza <miguel@ximian.com>
21112 * cs-parser.jay: Add extra production for the second form of array
21115 * expression.cs (ArrayCreation): Update to reflect the above
21118 * Small changes to prepare for Array initialization.
21120 2001-10-28 Miguel de Icaza <miguel@ximian.com>
21122 * typemanager.cs (ImplementsInterface): interface might be null;
21123 Deal with this problem;
21125 Also, we do store negative hits on the cache (null values), so use
21126 this instead of calling t.GetInterfaces on the type everytime.
21128 2001-10-28 Ravi Pratap <ravi@ximian.com>
21130 * typemanager.cs (IsBuiltinType): New method to help determine the same.
21132 * expression.cs (New::DoResolve): Get rid of array creation code and instead
21133 split functionality out into different classes.
21135 (New::FormArrayType): Move into NewBuiltinArray.
21137 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21140 (NewBuiltinArray): New class to handle creation of built-in arrays.
21142 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21143 account creation of one-dimensional arrays.
21145 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21147 (NewUserdefinedArray::DoResolve): Implement.
21149 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21151 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21152 we maintain inside the TypeManager. This is necessary to perform lookups on the
21155 (LookupType): Update to perform GetType on the module builders too.
21157 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21159 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21161 2001-10-23 Ravi Pratap <ravi@ximian.com>
21163 * expression.cs (New::DoResolve): Implement guts of array creation.
21165 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21167 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21169 * expression.cs: Fix bug I introduced lsat night that broke
21172 (Expression.Resolve): Report a 246 error (can not resolve name)
21173 if we find a SimpleName in the stream.
21175 (Expression.ResolveLValue): Ditto.
21177 (Expression.ResolveWithSimpleName): This function is a variant of
21178 ResolveName, this one allows SimpleNames to be returned without a
21179 warning. The only consumer of SimpleNames is MemberAccess
21181 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21183 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21184 might arrive here. I have my doubts that this is correct.
21186 * statement.cs (Lock): Implement lock statement.
21188 * cs-parser.jay: Small fixes to support `lock' and `using'
21190 * cs-tokenizer.cs: Remove extra space
21192 * driver.cs: New flag --checked, allows to turn on integer math
21195 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21196 Threading.Monitor.Exit
21198 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21200 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21201 Expression Class to be IndexerAccess.
21203 Notice that Indexer::DoResolve sets the eclass to Value.
21205 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21207 * class.cs (TypeContainer::Emit): Emit code for indexers.
21209 * assign.cs (IAssignMethod): New interface implemented by Indexers
21210 and Properties for handling assignment.
21212 (Assign::Emit): Simplify and reuse code.
21214 * expression.cs (IndexerAccess, PropertyExpr): Implement
21215 IAssignMethod, clean up old code.
21217 2001-10-22 Ravi Pratap <ravi@ximian.com>
21219 * typemanager.cs (ImplementsInterface): New method to determine if a type
21220 implements a given interface. Provides a nice cache too.
21222 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21225 (ConvertReferenceExplicit): Ditto.
21227 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21228 various methods, with correct names etc.
21230 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21231 Operator.UnaryNegation.
21233 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21234 we have a unary plus or minus operator.
21236 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21239 * everywhere : update accordingly.
21241 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21244 * class.cs (Method::Define): For the case where we are implementing a method
21245 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21246 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21248 2001-10-21 Ravi Pratap <ravi@ximian.com>
21250 * interface.cs (FindMembers): Implement to work around S.R.E
21253 * typemanager.cs (IsInterfaceType): Implement.
21255 (FindMembers): Update to handle interface types too.
21257 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21258 use IsAssignableFrom as that is not correct - it doesn't work.
21260 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21261 and accordingly override EmitStatement.
21263 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21264 using the correct logic :-)
21266 2001-10-19 Ravi Pratap <ravi@ximian.com>
21268 * ../errors/cs-11.cs : Add to demonstrate error -11
21270 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21272 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21273 then pass this as a hint to ResolveLValue.
21275 * expression.cs (FieldExpr): Add Location information
21277 (FieldExpr::LValueResolve): Report assignment to readonly
21280 (Expression::ExprClassFromMemberInfo): Pass location information.
21282 (Expression::ResolveLValue): Add new method that resolves an
21285 (Expression::DoResolveLValue): Default invocation calls
21288 (Indexers): New class used to keep track of indexers in a given
21291 (IStackStore): Renamed from LValue, as it did not really describe
21292 what this did. Also ResolveLValue is gone from this interface and
21293 now is part of Expression.
21295 (ElementAccess): Depending on the element access type
21297 * typemanager.cs: Add `indexer_name_type' as a Core type
21298 (System.Runtime.CompilerServices.IndexerNameAttribute)
21300 * statement.cs (Goto): Take a location.
21302 2001-10-18 Ravi Pratap <ravi@ximian.com>
21304 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21305 if two delegates are compatible.
21307 (NewDelegate::DoResolve): Update to take care of the case when
21308 we instantiate a delegate from another delegate.
21310 * typemanager.cs (FindMembers): Don't even try to look up members
21311 of Delegate types for now.
21313 2001-10-18 Ravi Pratap <ravi@ximian.com>
21315 * delegate.cs (NewDelegate): New class to take care of delegate
21318 * expression.cs (New): Split the delegate related code out into
21319 the NewDelegate class.
21321 * delegate.cs (DelegateInvocation): New class to handle delegate
21324 * expression.cs (Invocation): Split out delegate related code into
21325 the DelegateInvocation class.
21327 2001-10-17 Ravi Pratap <ravi@ximian.com>
21329 * expression.cs (New::DoResolve): Implement delegate creation fully
21330 and according to the spec.
21332 (New::DoEmit): Update to handle delegates differently.
21334 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21335 because of which we were printing out arguments in reverse order !
21337 * delegate.cs (VerifyMethod): Implement to check if the given method
21338 matches the delegate.
21340 (FullDelegateDesc): Implement.
21342 (VerifyApplicability): Implement.
21344 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21345 delegate invocations too.
21347 (Invocation::Emit): Ditto.
21349 * ../errors/cs1593.cs : Added.
21351 * ../errors/cs1594.cs : Added.
21353 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21355 2001-10-16 Ravi Pratap <ravi@ximian.com>
21357 * typemanager.cs (intptr_type): Core type for System.IntPtr
21359 (InitCoreTypes): Update for the same.
21361 (iasyncresult_type, asynccallback_type): Ditto.
21363 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21366 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21369 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21370 the builders for the 4 members of a delegate type :-)
21372 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21375 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21377 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21379 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21381 * statement.cs (Break::Emit): Implement.
21382 (Continue::Emit): Implement.
21384 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21385 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21386 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21387 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21390 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21391 properties that track the label for the current loop (begin of the
21392 loop and end of the loop).
21394 2001-10-15 Ravi Pratap <ravi@ximian.com>
21396 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21397 use of emitting anything at all.
21399 * class.cs, rootcontext.cs : Get rid of calls to the same.
21401 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21403 (Populate): Define the constructor correctly and set the implementation
21406 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21409 (AddDelegateType): Implement.
21411 (IsDelegateType): Implement helper method.
21413 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21415 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21416 and accordingly handle it.
21418 * delegate.cs (Populate): Take TypeContainer argument.
21419 Implement bits to define the Invoke method. However, I still haven't figured out
21420 how to take care of the native int bit :-(
21422 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21423 Qualify the name of the delegate, not its return type !
21425 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21428 (StandardConversionExists): Checking for array types turns out to be recursive.
21430 (ConvertReferenceExplicit): Implement array conversion.
21432 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21434 2001-10-12 Ravi Pratap <ravi@ximian.com>
21436 * cs-parser.jay (delegate_declaration): Store the fully qualified
21437 name as it is a type declaration.
21439 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21442 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21443 as TypeContainer::DefineType.
21445 (Populate): Method in which all the definition of the various methods (Invoke)
21448 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21451 (CloseDelegate): Finally creates the delegate.
21453 * class.cs (TypeContainer::DefineType): Update to define delegates.
21454 (Populate, Emit and CloseType): Do the same thing here too.
21456 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21457 delegates in all these operations.
21459 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21461 * expression.cs: LocalTemporary: a new expression used to
21462 reference a temporary that has been created.
21464 * assign.cs: Handle PropertyAccess back here, so that we can
21465 provide the proper semantic access to properties.
21467 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21468 a few more explicit conversions.
21470 * modifiers.cs: `NEW' modifier maps to HideBySig.
21472 * expression.cs (PropertyExpr): Make this into an
21473 ExpressionStatement, and support the EmitStatement code path.
21475 Perform get/set error checking, clean up the interface.
21477 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21478 them into toplevel access objects.
21480 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21482 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21485 * typemanager.cs: Keep track here of our PropertyBuilders again to
21486 work around lameness in SRE.
21488 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21490 * expression.cs (LValue::LValueResolve): New method in the
21491 interface, used to perform a second resolution pass for LValues.
21493 (This::DoResolve): Catch the use of this in static methods.
21495 (This::LValueResolve): Implement.
21497 (This::Store): Remove warning, assigning to `this' in structures
21500 (Invocation::Emit): Deal with invocation of
21501 methods on value types. We need to pass the address to structure
21502 methods rather than the object itself. (The equivalent code to
21503 emit "this" for structures leaves the entire structure on the
21504 stack instead of a pointer to it).
21506 (ParameterReference::DoResolve): Compute the real index for the
21507 argument based on whether the method takes or not a `this' pointer
21508 (ie, the method is static).
21510 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21511 value types returned from functions when we need to invoke a
21512 method on the sturcture.
21515 2001-10-11 Ravi Pratap <ravi@ximian.com>
21517 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21518 defining the type in the Modulebuilder or Typebuilder. This is to take
21519 care of nested types which need to be defined on the TypeBuilder using
21520 DefineNestedMethod.
21522 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21523 methods in RootContext, only ported to be part of TypeContainer.
21525 (TypeContainer::GetInterfaceOrClass): Ditto.
21527 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21529 * interface.cs (Interface::DefineInterface): New method. Does exactly
21530 what RootContext.CreateInterface did earlier, only it takes care of nested types
21533 (Interface::GetInterfaces): Move from RootContext here and port.
21535 (Interface::GetInterfaceByName): Same here.
21537 * rootcontext.cs (ResolveTree): Re-write.
21539 (PopulateTypes): Re-write.
21541 * class.cs (TypeContainer::Populate): Populate nested types too.
21542 (TypeContainer::Emit): Emit nested members too.
21544 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21545 instead just use the name argument passed in as it is already fully
21548 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21549 to TypeContainer mapping to see if a type is user-defined.
21551 * class.cs (TypeContainer::CloseType): Implement.
21553 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21554 the default constructor.
21556 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21559 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21561 * interface.cs (CloseType): Create the type here.
21563 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21566 Remove all the methods which are now in TypeContainer.
21568 2001-10-10 Ravi Pratap <ravi@ximian.com>
21570 * delegate.cs (Define): Re-write bits to define the delegate
21573 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21575 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21577 * expression.cs (ImplicitReferenceConversion): handle null as well
21578 as a source to convert to any reference type.
21580 * statement.cs (Return): Perform any implicit conversions to
21581 expected return type.
21583 Validate use of return statement.
21585 * codegen.cs (EmitContext): Pass the expected return type here.
21587 * class.cs (Method, Constructor, Property): Pass expected return
21588 type to EmitContext.
21590 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21592 * expression.cs: Make DoResolve take an EmitContext instead of a
21595 Replaced `l' and `location' for `loc', for consistency.
21597 (Error, Warning): Remove unneeded Tc argument.
21599 * assign.cs, literal.cs, constant.cs: Update to new calling
21602 * codegen.cs: EmitContext now contains a flag indicating whether
21603 code is being generated in a static method or not.
21605 * cs-parser.jay: DecomposeQI, new function that replaces the old
21606 QualifiedIdentifier. Now we always decompose the assembled
21607 strings from qualified_identifier productions into a group of
21610 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21612 * rootcontext.cs: Deal with field-less struct types correctly now
21613 by passing the size option to Define Type.
21615 * class.cs: Removed hack that created one static field.
21617 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21619 * statement.cs: Moved most of the code generation here.
21621 2001-10-09 Ravi Pratap <ravi@ximian.com>
21623 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21626 (ElementAccess): Remove useless bits for now - keep checks as the spec
21629 2001-10-08 Ravi Pratap <ravi@ximian.com>
21631 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21632 and start performing checks according to the spec.
21634 2001-10-07 Ravi Pratap <ravi@ximian.com>
21636 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21637 rank_specifiers instead.
21639 (rank_specifiers): Change the order in which the rank specifiers are stored
21641 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21643 * expression.cs (ElementAccess): Implement the LValue interface too.
21645 2001-10-06 Ravi Pratap <ravi@ximian.com>
21647 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21648 except that user defined conversions are not included.
21650 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21651 perform the conversion of the return type, if necessary.
21653 (New::DoResolve): Check whether we are creating an array or an object
21654 and accordingly do the needful.
21656 (New::Emit): Same here.
21658 (New::DoResolve): Implement guts of array creation.
21660 (New::FormLookupType): Helper function.
21662 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21664 * codegen.cs: Removed most of the code generation here, and move the
21665 corresponding code generation bits to the statement classes.
21667 Added support for try/catch/finalize and throw.
21669 * cs-parser.jay: Added support for try/catch/finalize.
21671 * class.cs: Catch static methods having the flags override,
21672 virtual or abstract.
21674 * expression.cs (UserCast): This user cast was not really doing
21675 what it was supposed to do. Which is to be born in fully resolved
21676 state. Parts of the resolution were being performed at Emit time!
21680 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21682 * expression.cs: Implicity convert the result from UserCast.
21684 2001-10-05 Ravi Pratap <ravi@ximian.com>
21686 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21687 prevented it from working correctly.
21689 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21690 merely ConvertImplicit.
21692 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21694 * typemanager.cs: Make the LookupTypeContainer function static,
21695 and not per-instance.
21697 * class.cs: Make static FindMembers (the one that takes a Type
21700 * codegen.cs: Add EmitForeach here.
21702 * cs-parser.jay: Make foreach a toplevel object instead of the
21703 inline expansion, as we need to perform semantic analysis on it.
21705 2001-10-05 Ravi Pratap <ravi@ximian.com>
21707 * expression.cs (Expression::ImplicitUserConversion): Rename to
21708 UserDefinedConversion.
21710 (Expression::UserDefinedConversion): Take an extra argument specifying
21711 whether we look for explicit user conversions too.
21713 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21715 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21717 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21718 with the appropriate arguments.
21720 * cs-parser.jay (cast_expression): Record location too.
21722 * expression.cs (Cast): Record location info.
21724 (Expression::ConvertExplicit): Take location argument.
21726 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21727 to determine if we are doing explicit conversions.
21729 (UserCast::Emit): Update accordingly.
21731 (Expression::ConvertExplicit): Report an error if everything fails.
21733 * ../errors/cs0030.cs : Add.
21735 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21737 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21738 virtual and newslot bits.
21740 * class.cs (TypeContainer::RegisterRequiredImplementations):
21741 Record methods we need.
21743 (TypeContainer::MakeKey): Helper function to make keys for
21744 MethodBases, since the Methodbase key is useless.
21746 (TypeContainer::Populate): Call RegisterRequiredImplementations
21747 before defining the methods.
21749 Create a mapping for method_builders_to_methods ahead of time
21750 instead of inside a tight loop.
21752 (::RequireMethods): Accept an object as the data to set into the
21753 hashtable so we can report interface vs abstract method mismatch.
21755 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21757 * report.cs: Make all of it static.
21759 * rootcontext.cs: Drop object_type and value_type computations, as
21760 we have those in the TypeManager anyways.
21762 Drop report instance variable too, now it is a global.
21764 * driver.cs: Use try/catch on command line handling.
21766 Add --probe option to debug the error reporting system with a test
21769 * report.cs: Add support for exiting program when a probe
21770 condition is reached.
21772 2001-10-03 Ravi Pratap <ravi@ximian.com>
21774 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21775 we do a forcible conversion regardless of type, to check if
21776 ForceConversion returns a null.
21778 (Binary::error19): Use location to report error.
21780 (Unary::error23): Use location here too.
21782 * ../errors/cs0019.cs : Check in.
21784 * ../errors/cs0023.cs : Check in.
21786 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21787 case of a non-null MethodInfo object with a length of 0 !
21789 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21790 an applicable member - according to the spec :-)
21791 Also fix logic to find members in base types.
21793 (Unary::ResolveOperator): Same here.
21795 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21796 as I was getting thoroughly confused between this and error19 :-)
21798 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21799 (::FindMostEncompassedType): Implement.
21800 (::FindMostEncompassingType): Implement.
21801 (::StandardConversionExists): Implement.
21803 (UserImplicitCast): Re-vamp. We now need info about most specific
21804 source and target types so that we can do the necessary conversions.
21806 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21807 mathematical union with no duplicates.
21809 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21811 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21812 in order from base classes to child classes, so that we can in
21813 child classes look up in our parent for method names and
21814 attributes (required for handling abstract, virtual, new, override
21815 constructs: we need to instrospect our base class, and if we dont
21816 populate the classes in order, the introspection might be
21817 incorrect. For example, a method could query its parent before
21818 the parent has any methods and would determine that the parent has
21819 no abstract methods (while it could have had them)).
21821 (RootContext::CreateType): Record the order in which we define the
21824 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21826 * class.cs (TypeContainer::Populate): Also method definitions can
21827 fail now, keep track of this.
21829 (TypeContainer::FindMembers): Implement support for
21830 DeclaredOnly/noDeclaredOnly flag.
21832 (Constructor::Emit) Return the ConstructorBuilder.
21834 (Method::Emit) Return the MethodBuilder.
21835 Check for abstract or virtual methods to be public.
21837 * rootcontext.cs (RootContext::CreateType): Register all the
21838 abstract methods required for the class to be complete and the
21839 interface methods that must be implemented.
21841 * cs-parser.jay: Report error 501 (method requires body if it is
21842 not marked abstract or extern).
21844 * expression.cs (TypeOf::Emit): Implement.
21846 * typemanager.cs: runtime_handle_type, new global type.
21848 * class.cs (Property::Emit): Generate code for properties.
21850 2001-10-02 Ravi Pratap <ravi@ximian.com>
21852 * expression.cs (Unary::ResolveOperator): Find operators on base type
21853 too - we now conform exactly to the spec.
21855 (Binary::ResolveOperator): Same here.
21857 * class.cs (Operator::Define): Fix minor quirk in the tests.
21859 * ../errors/cs0215.cs : Added.
21861 * ../errors/cs0556.cs : Added.
21863 * ../errors/cs0555.cs : Added.
21865 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21867 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21868 single integer which is really efficient
21870 2001-10-01 Ravi Pratap <ravi@ximian.com>
21872 * expression.cs (Expression::ImplicitUserConversion): Use location
21873 even in the case when we are examining True operators.
21875 * class.cs (Operator::Define): Perform extensive checks to conform
21876 with the rules for operator overloading in the spec.
21878 * expression.cs (Expression::ImplicitReferenceConversion): Implement
21879 some of the other conversions mentioned in the spec.
21881 * typemanager.cs (array_type): New static member for the System.Array built-in
21884 (cloneable_interface): For System.ICloneable interface.
21886 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21887 we start resolving the tree and populating types.
21889 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21891 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21893 * expression.cs (Expression::ExprClassFromMemberInfo,
21894 Expression::Literalize): Create literal expressions from
21895 FieldInfos which are literals.
21897 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21898 type casts, because they were wrong. The test suite in tests
21901 (ImplicitNumericConversion): ushort to ulong requires a widening
21904 Int32 constant to long requires widening cast as well.
21906 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21907 for integers because the type on the stack is not i4.
21909 2001-09-30 Miguel de Icaza <miguel@ximian.com>
21911 * expression.cs (report118): require location argument.
21913 * parameter.cs: Do not dereference potential null value.
21915 * class.cs: Catch methods that lack the `new' keyword when
21916 overriding a name. Report warnings when `new' is used without
21917 anything being there to override.
21919 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21921 * class.cs: Only add constructor to hashtable if it is non-null
21922 (as now constructors can fail on define).
21924 (TypeManager, Class, Struct): Take location arguments.
21926 Catch field instance initialization in structs as errors.
21928 accepting_filter: a new filter for FindMembers that is static so
21929 that we dont create an instance per invocation.
21931 (Constructor::Define): Catch errors where a struct constructor is
21934 * cs-parser.jay: Pass location information for various new
21937 * delegate.cs (Delegate): take a location argument.
21939 * driver.cs: Do not call EmitCode if there were problesm in the
21940 Definition of the types, as many Builders wont be there.
21942 * decl.cs (Decl::Decl): Require a location argument.
21944 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21945 into integers, and find the most appropiate integer for it.
21947 * literal.cs: Implement ULongLiteral.
21949 * rootcontext.cs: Provide better information about the location of
21950 failure when CreateType fails.
21952 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21954 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21957 * expression.cs (Binary::CheckShiftArguments): Add missing type
21959 (Binary::ResolveOperator): Add type to the logical and and logical
21960 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21963 (Binary::DoNumericPromotions): In the case where either argument
21964 is ulong (and most signed types combined with ulong cause an
21965 error) perform implicit integer constant conversions as well.
21967 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21969 * expression.cs (UserImplicitCast): Method should always be
21971 (Invocation::BetterConversion): Simplified test for IntLiteral.
21973 (Expression::ImplicitNumericConversion): Split this routine out.
21974 Put the code that performs implicit constant integer conversions
21977 (Expression::Resolve): Become a wrapper around DoResolve so we can
21978 check eclass and type being set after resolve.
21980 (Invocation::Badness): Remove this dead function
21982 (Binary::ResolveOperator): Do not compute the expensive argumnets
21983 unless we have a union for it.
21985 (Probe::Emit): Is needs to do an isinst and then
21986 compare against null.
21988 (::CanConvert): Added Location argument. If the Location argument
21989 is null (Location.Null), then we do not report errors. This is
21990 used by the `probe' mechanism of the Explicit conversion. We do
21991 not want to generate an error for something that the user
21992 explicitly requested to be casted. But the pipeline for an
21993 explicit cast first tests for potential implicit casts.
21995 So for now, if the Location is null, it means `Probe only' to
21996 avoid adding another argument. Might have to revise this
21999 (ClassCast): New class used to type cast objects into arbitrary
22000 classes (used in Explicit Reference Conversions).
22002 Implement `as' as well.
22004 Reverted all the patches from Ravi below: they were broken:
22006 * The use of `level' as a mechanism to stop recursive
22007 invocations is wrong. That was there just to catch the
22008 bug with a strack trace but not as a way of addressing
22011 To fix the problem we have to *understand* what is going
22012 on and the interactions and come up with a plan, not
22013 just get things going.
22015 * The use of the type conversion cache that I proposed
22016 last night had an open topic: How does this work across
22017 protection domains. A user defined conversion might not
22018 be public in the location where we are applying the
22019 conversion, a different conversion might be selected
22020 (ie, private A->B (better) but public B->A (worse),
22021 inside A, A->B applies, but outside it, B->A will
22024 * On top of that (ie, even if the above is solved),
22025 conversions in a cache need to be abstract. Ie, `To
22026 convert from an Int to a Short use an OpcodeCast', not
22027 `To convert from an Int to a Short use the OpcodeCast on
22028 the variable 5' (which is what this patch was doing).
22030 2001-09-28 Ravi Pratap <ravi@ximian.com>
22032 * expression.cs (Invocation::ConversionExists): Re-write to use
22033 the conversion cache
22035 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22036 cache all conversions done, not just user-defined ones.
22038 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22039 to determine if a conversion exists instead of acutually trying to
22040 perform the conversion. It's faster too.
22042 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22043 and only then attempt the implicit conversion.
22045 2001-09-28 Ravi Pratap <ravi@ximian.com>
22047 * expression.cs (ConvertImplicit): Use a cache for conversions
22048 already found. Check level of recursion and bail out if necessary.
22050 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22052 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22053 Export standard methods that we expect for string operations.
22055 * statement.cs (Block::UsageWarning): Track usage of variables and
22056 report the errors for not used variables.
22058 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22061 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22063 * codegen.cs: remove unnneded code
22065 * expression.cs: Removed BuiltinTypeAccess class
22067 Fix the order in which implicit conversions are
22070 The previous fixed dropped support for boxed conversions (adding a
22071 test to the test suite now)
22073 (UserImplicitCast::CanConvert): Remove test for source being null,
22074 that code is broken. We should not feed a null to begin with, if
22075 we do, then we should track the bug where the problem originates
22076 and not try to cover it up here.
22078 Return a resolved expression of type UserImplicitCast on success
22079 rather than true/false. Ravi: this is what I was talking about,
22080 the pattern is to use a static method as a "constructor" for
22083 Also, do not create arguments until the very last minute,
22084 otherwise we always create the arguments even for lookups that
22085 will never be performed.
22087 (UserImplicitCast::Resolve): Eliminate, objects of type
22088 UserImplicitCast are born in a fully resolved state.
22090 * typemanager.cs (InitCoreTypes): Init also value_type
22091 (System.ValueType).
22093 * expression.cs (Cast::Resolve): First resolve the child expression.
22095 (LValue): Add new method AddressOf to be used by
22098 Change the argument of Store to take an EmitContext instead of an
22099 ILGenerator, because things like FieldExpr need to be able to call
22100 their children expression to generate the instance code.
22102 (Expression::Error, Expression::Warning): Sugar functions for
22105 (Expression::MemberLookup): Accept a TypeContainer instead of a
22106 Report as the first argument.
22108 (Expression::ResolvePrimary): Killed. I still want to improve
22109 this as currently the code is just not right.
22111 (Expression::ResolveMemberAccess): Simplify, but it is still
22114 (Unary::Resolve): Catch errors in AddressOf operators.
22116 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22117 index to a byte for the short-version, or the compiler will choose
22118 the wrong Emit call, which generates the wrong data.
22120 (ParameterReference::Emit, ::Store): same.
22122 (FieldExpr::AddressOf): Implement.
22124 * typemanager.cs: TypeManager: made public variable instead of
22127 * driver.cs: document --fatal.
22129 * report.cs (ErrorMessage, WarningMessage): new names for the old
22130 Error and Warning classes.
22132 * cs-parser.jay (member_access): Turn built-in access to types
22133 into a normal simplename
22135 2001-09-27 Ravi Pratap <ravi@ximian.com>
22137 * expression.cs (Invocation::BetterConversion): Fix to cope
22138 with q being null, since this was introducing a bug.
22140 * expression.cs (ConvertImplicit): Do built-in conversions first.
22142 2001-09-27 Ravi Pratap <ravi@ximian.com>
22144 * expression.cs (UserImplicitCast::Resolve): Fix bug.
22146 2001-09-27 Ravi Pratap <ravi@ximian.com>
22148 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22149 I had introduced long ago (what's new ?).
22151 * expression.cs (UserImplicitCast::CanConvert): Static method to do
22152 the work of all the checking.
22153 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22154 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22156 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22157 that is the right way.
22159 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22160 overloading resolution. Use everywhere instead of cutting and pasting code.
22162 (Binary::ResolveOperator): Use MakeUnionSet.
22164 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22165 we have to convert to bool types. Not complete yet.
22167 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22169 * typemanager.cs (TypeManager::CSharpName): support ushort.
22171 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22172 to provide an expression that performsn an implicit constant int
22173 conversion (section 6.1.6).
22174 (Expression::ConvertImplicitRequired): Reworked to include
22175 implicit constant expression conversions.
22177 (Expression::ConvertNumericExplicit): Finished.
22179 (Invocation::Emit): If InstanceExpression is null, then it means
22180 that we perform a call on this.
22182 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22184 * expression.cs (Unary::Emit): Remove some dead code.
22185 (Probe): Implement Resolve and Emit for `is'.
22186 (Expression::ConvertImplicitRequired): Attempt to do constant
22187 expression conversions here. Maybe should be moved to
22188 ConvertImplicit, but I am not sure.
22189 (Expression::ImplicitLongConstantConversionPossible,
22190 Expression::ImplicitIntConstantConversionPossible): New functions
22191 that tell whether is it possible to apply an implicit constant
22192 expression conversion.
22194 (ConvertNumericExplicit): Started work on explicit numeric
22197 * cs-parser.jay: Update operator constants.
22199 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22200 (Parameters::GetSignature): Hook up VerifyArgs here.
22201 (Parameters::VerifyArgs): Verifies that no two arguments have the
22204 * class.cs (Operator): Update the operator names to reflect the
22205 ones that the spec expects (as we are just stringizing the
22208 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22209 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22210 previous usage did only work for our methods.
22211 (Expression::ConvertImplicit): Handle decimal implicit numeric
22212 conversions as well.
22213 (Expression::InternalTypeConstructor): Used to invoke constructors
22214 on internal types for default promotions.
22216 (Unary::Emit): Implement special handling for the pre/post
22217 increment/decrement for overloaded operators, as they need to have
22218 the same semantics as the other operators.
22220 (Binary::ResolveOperator): ditto.
22221 (Invocation::ConversionExists): ditto.
22222 (UserImplicitCast::Resolve): ditto.
22224 2001-09-26 Ravi Pratap <ravi@ximian.com>
22226 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22227 operator, return after emitting body. Regression tests pass again !
22229 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22230 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22231 (Invocation::OverloadResolve): Ditto.
22232 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22234 * everywhere : update calls to the above methods accordingly.
22236 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22238 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22240 * expression.cs (ExpressionStatement): New base class used for
22241 expressions that can appear in statements, so that we can provide
22242 an alternate path to generate expression that do not leave a value
22245 (Expression::Emit, and all the derivatives): We no longer return
22246 whether a value is left on the stack or not. Every expression
22247 after being emitted leaves a single value on the stack.
22249 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22250 facilties of ExpressionStatement if possible.
22252 * cs-parser.jay: Update statement_expression.
22254 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22256 * driver.cs: Change the wording of message
22258 2001-09-25 Ravi Pratap <ravi@ximian.com>
22260 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22261 the type of the expression to the return type of the method if
22262 we have an overloaded operator match ! The regression tests pass again !
22263 (Unary::ResolveOperator): Ditto.
22265 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22266 to find "op_Implicit", not "implicit" ;-)
22267 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22268 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22270 * everywhere : Correct calls to the above accordingly.
22272 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22273 (ConvertImplicit): Do user-defined conversion if it exists.
22275 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22277 * assign.cs: track location.
22278 (Resolve): Use implicit conversions on assignment.
22280 * literal.cs: Oops. Not good, Emit of short access values should
22281 pass (Bytes) or the wrong argument will be selected.
22283 * expression.cs (Unary::Emit): Emit code for -expr.
22285 (Unary::ResolveOperator): Handle `Substract' for non-constants
22286 (substract from zero from the non-constants).
22287 Deal with Doubles as well.
22289 (Expression::ConvertImplicitRequired): New routine that reports an
22290 error if no implicit conversion exists.
22292 (Invocation::OverloadResolve): Store the converted implicit
22293 expressions if we make them
22295 2001-09-24 Ravi Pratap <ravi@ximian.com>
22297 * class.cs (ConstructorInitializer): Take a Location argument.
22298 (ConstructorBaseInitializer): Same here.
22299 (ConstructorThisInitializer): Same here.
22301 * cs-parser.jay : Update all calls accordingly.
22303 * expression.cs (Unary, Binary, New): Take location argument.
22304 Update accordingly everywhere.
22306 * cs-parser.jay : Update all calls to the above to take a location
22309 * class.cs : Ditto.
22311 2001-09-24 Ravi Pratap <ravi@ximian.com>
22313 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22314 (Invocation::BetterConversion): Same here
22315 (Invocation::ConversionExists): Ditto.
22317 (Invocation::ConversionExists): Implement.
22319 2001-09-22 Ravi Pratap <ravi@ximian.com>
22321 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22322 Also take an additional TypeContainer argument.
22324 * All over : Pass in TypeContainer as argument to OverloadResolve.
22326 * typemanager.cs (CSharpName): Update to check for the string type and return
22329 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22332 2001-09-21 Ravi Pratap <ravi@ximian.com>
22334 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22335 (Invocation::BetterFunction): Implement.
22336 (Invocation::BetterConversion): Implement.
22337 (Invocation::ConversionExists): Skeleton, no implementation yet.
22339 Okay, things work fine !
22341 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22343 * typemanager.cs: declare and load enum_type, delegate_type and
22346 * expression.cs (Expression::Emit): Now emit returns a value that
22347 tells whether a value is left on the stack or not. This strategy
22348 might be reveted tomorrow with a mechanism that would address
22349 multiple assignments.
22350 (Expression::report118): Utility routine to report mismatches on
22353 (Unary::Report23): Report impossible type/operator combination
22356 (Unary::IsIncrementableNumber): Whether the type can be
22357 incremented or decremented with add.
22358 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22360 (Unary::ResolveOperator): Implement ++, !, ~,
22362 (Invocation::Emit): Deal with new Emit convetion.
22364 * All Expression derivatives: Updated their Emit method to return
22365 whether they leave values on the stack or not.
22367 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22368 stack for expressions that are statements.
22370 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22372 * expression.cs (LValue): New interface. Must be implemented by
22374 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22377 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22378 interface for generating code, simplifies the code.
22380 2001-09-20 Ravi Pratap <ravi@ximian.com>
22382 * expression.cs (everywhere): Comment out return statements in ::Resolve
22383 methods to avoid the warnings.
22385 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22387 * driver.cs (parse): Report error 2001 if we can not open the
22390 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22393 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22396 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22397 otherwise nested blocks end up with the same index.
22399 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22401 * expression.cs: Instead of having FIXMEs in the Resolve
22402 functions, throw exceptions so it is obvious that we are facing a
22405 * cs-parser.jay (invocation_expression): Pass Location information.
22407 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22408 Use a basename for those routines because .NET does not like paths
22411 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22414 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22416 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22417 are loading the correct data types (throws an exception if not).
22418 (TypeManager::InitCoreTypes): Use CoreLookupType
22420 * expression.cs (Unary::ResolveOperator): return the child
22421 expression for expressions which are just +expr.
22422 (Unary::ResolveOperator): Return negative literals for -LITERAL
22423 expressions (otherwise they are Unary {Literal}).
22424 (Invocation::Badness): Take into account `Implicit constant
22425 expression conversions'.
22427 * literal.cs (LongLiteral): Implement long literal class.
22428 (IntLiteral): export the `Value' of the intliteral.
22430 2001-09-19 Ravi Pratap <ravi@ximian.com>
22432 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22434 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22435 instead of 'Operator'
22437 * expression.cs (Binary::ResolveOperator): Update accordingly.
22438 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22441 * cs-parser.jay (unary_expression): Update to use the new names.
22443 * gen-treedump.cs (GetUnary): Same here.
22445 * expression.cs (Unary::Resolve): Implement.
22446 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22447 operators are found instead of making noise ;-)
22448 (Unary::ResolveOperator): New method to do precisely the same thing which
22449 Binary::ResolveOperator does for Binary expressions.
22450 (Unary.method, .Arguments): Add.
22451 (Unary::OperName): Implement.
22452 (Unary::ForceConversion): Copy and Paste !
22454 * class.cs (Operator::Define): Fix a small bug for the case when we have
22457 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22458 for the inbuilt operators. Only overloading works for now ;-)
22460 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22462 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22463 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22465 * expression.cs (This::Emit): Implement.
22466 (This::Resolve): Implement.
22467 (TypeOf:Resolve): Implement.
22468 (Expression::ResolveSimpleName): Add an implicit this to instance
22470 (MemberAccess::Resolve): Deal with Parameters and Fields.
22471 Bind instance variable to Field expressions.
22472 (FieldExpr::Instance): New field used to track the expression that
22473 represents the object instance.
22474 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22476 (FieldExpr::Emit): Implement.
22478 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22479 the last instruction contains a return opcode to avoid generating
22480 the last `ret' instruction (this generates correct code, and it is
22481 nice to pass the peverify output).
22483 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22484 initializer for static and instance variables.
22485 (Constructor::Emit): Allow initializer to be null in the case of
22486 static constructors. Only emit initializer for instance
22489 (TypeContainer::FindMembers): Return a null array if there are no
22492 Also fix the code for the MemberTypes.Method branch, as it was not
22493 scanning that for operators (or tried to access null variables before).
22495 * assign.cs (Assign::Emit): Handle instance and static fields.
22499 * driver.cs: Stop compilation if there are parse errors.
22501 * cs-parser.jay (constructor_declaration): Provide default base
22502 initializer for non-static constructors.
22503 (constructor_declarator): Do not provide a default base
22504 initializers if none was specified.
22505 Catch the fact that constructors should not have parameters.
22507 * class.cs: Do not emit parent class initializers for static
22508 constructors, that should be flagged as an error.
22510 2001-09-18 Ravi Pratap <ravi@ximian.com>
22512 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22513 Move back code into TypeContainer::Populate.
22515 2001-09-18 Ravi Pratap <ravi@ximian.com>
22517 * class.cs (TypeContainer::AddConstructor): Fix the check to
22518 compare against Name, not Basename.
22519 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22521 * cs-parser.jay : Update accordingly.
22523 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22524 for methods, don't forget to look into the operators too.
22525 (RegisterMethodBuilder): Helper method to take care of this for
22526 methods, constructors and operators.
22527 (Operator::Define): Completely revamp.
22528 (Operator.OperatorMethod, MethodName): New fields.
22529 (TypeContainer::Populate): Move the registering of builders into
22530 RegisterMethodBuilder.
22531 (Operator::Emit): Re-write.
22533 * expression.cs (Binary::Emit): Comment out code path to emit method
22534 invocation stuff for the case when we have a user defined operator. I am
22535 just not able to get it right !
22537 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22539 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22542 (Expression::MemberLookup): Provide a version that allows to
22543 specify the MemberTypes and BindingFlags.
22545 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22546 so it was not fetching variable information from outer blocks.
22548 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22549 Beforefieldinit as it was buggy.
22551 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22552 that Ravi put here.
22554 * class.cs (Constructor::Emit): Only emit if block is not null.
22555 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22556 deal with this by semantically definining it as if the user had
22559 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22560 constructors as we now "emit" them at a higher level.
22562 (TypeContainer::DefineDefaultConstructor): Used to define the
22563 default constructors if none was provided.
22565 (ConstructorInitializer): Add methods Resolve and Emit.
22567 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22569 2001-09-17 Ravi Pratap <ravi@ximian.com>
22571 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22572 the default constructor builder with our hashtable for methodbuilders
22575 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22576 and argument_count is 0 in which case we have a match.
22577 (Binary::ResolveOperator): More null checking and miscellaneous coding
22580 2001-09-17 Ravi Pratap <ravi@ximian.com>
22582 * rootcontext.cs (IsNameSpace): Compare against null.
22584 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22586 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22587 and Unary::Operator.
22589 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22592 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22593 we have overloaded operators.
22594 (Binary::ResolveOperator): Implement the part which does the operator overload
22597 * class.cs (Operator::Emit): Implement.
22598 (TypeContainer::Emit): Emit the operators we have too.
22600 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22601 the case when we have a user-defined operator.
22603 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22605 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22607 2001-09-16 Ravi Pratap <ravi@ximian.com>
22609 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22610 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22611 (Constructor::Emit): Implement.
22612 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22613 if we have no work to do.
22614 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22617 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22618 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22620 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22623 2001-09-15 Ravi Pratap <ravi@ximian.com>
22625 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22627 (Tree::RecordNamespace): Method to do what the name says ;-)
22628 (Tree::Namespaces): Property to get at the namespaces hashtable.
22630 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22633 * rootcontext.cs (IsNamespace): Fixed it :-)
22635 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22637 * class.cs (TypeContainer::FindMembers): Add support for
22639 (MethodCore): New class that encapsulates both the shared aspects
22640 of a Constructor and a Method.
22641 (Method, Constructor): Factored pieces into MethodCore.
22643 * driver.cs: Added --fatal which makes errors throw exceptions.
22644 Load System assembly as well as part of the standard library.
22646 * report.cs: Allow throwing exceptions on errors for debugging.
22648 * modifiers.cs: Do not use `parent', instead use the real type
22649 container to evaluate permission settings.
22651 * class.cs: Put Ravi's patch back in. He is right, and we will
22652 have to cope with the
22654 2001-09-14 Ravi Pratap <ravi@ximian.com>
22656 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22657 FamORAssem, not FamANDAssem.
22659 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22661 * driver.cs: Added --parse option that only parses its input files
22664 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22665 incorrect. IsTopLevel is not used to tell whether an object is
22666 root_types or not (that can be achieved by testing this ==
22667 root_types). But to see if this is a top-level *class* (not
22668 necessarly our "toplevel" container).
22670 2001-09-14 Ravi Pratap <ravi@ximian.com>
22672 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22673 parent instead of a direct call to GetType.
22675 2001-09-14 Ravi Pratap <ravi@ximian.com>
22677 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22678 Modifiers.TypeAttr. This should just be a call to that method.
22680 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22681 object so that we can determine if we are top-level or not.
22683 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22686 * enum.cs (Enum::Define): Ditto.
22688 * modifiers.cs (FieldAttr): Re-write.
22690 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22691 (TypeContainer::HaveStaticConstructor): New property to provide access
22692 to precisely that info.
22694 * modifiers.cs (MethodAttr): Re-write.
22695 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22697 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22698 of top-level types as claimed.
22700 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22702 * expression.cs (MemberLookup): Fruitless attempt to lookup
22703 constructors. Maybe I need to emit default constructors? That
22704 might be it (currently .NET emits this for me automatically).
22705 (Invocation::OverloadResolve): Cope with Arguments == null.
22706 (Invocation::EmitArguments): new function, shared by the new
22707 constructor and us.
22708 (Invocation::Emit): Handle static and instance methods. Emit
22709 proper call instruction for virtual or non-virtual invocations.
22710 (New::Emit): Implement.
22711 (New::Resolve): Implement.
22712 (MemberAccess:Resolve): Implement.
22713 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22714 to track instances.
22715 (FieldExpr::Resolve): Set type.
22717 * support.cs: Handle empty arguments.
22719 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22720 SimpleLookup): Auxiliary routines to help parse a qualifier
22723 Update qualifier_identifier rule.
22725 * codegen.cs: Removed debugging messages.
22727 * class.cs: Make this a global thing, this acts just as a "key" to
22728 objects that we might have around.
22730 (Populate): Only initialize method_builders_to_methods once.
22732 * expression.cs (PropertyExpr): Initialize type from the
22735 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22736 Resolve pattern. Attempt to implicitly convert value to boolean.
22739 * expression.cs: Set the type for the int32/int32 argument case.
22740 (Binary::ResolveOperator): Set the return type to boolean for
22741 comparission operators
22743 * typemanager.cs: Remove debugging print code.
22745 (Invocation::Resolve): resolve type.
22747 * class.cs: Allocate a MemberInfo of the correct size, as the code
22748 elsewhere depends on the test to reflect the correct contents.
22750 (Method::) Keep track of parameters, due to System.Reflection holes
22752 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22755 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22756 of the exact size and return that.
22758 (Class::LookupMethodByBuilder): New function that maps
22759 MethodBuilders to its methods. Required to locate the information
22760 on methods because System.Reflection bit us again.
22762 * support.cs: New file, contains an interface ParameterData and
22763 two implementations: ReflectionParameters and InternalParameters
22764 used to access Parameter information. We will need to grow this
22767 * expression.cs (Invocation::GetParameterData): implement a cache
22768 and a wrapper around the ParameterData creation for methods.
22769 (Invocation::OverloadResolve): Use new code.
22771 2001-09-13 Ravi Pratap <ravi@ximian.com>
22773 * class.cs (TypeContainer::EmitField): Remove and move into
22774 (Field::Define): here and modify accordingly.
22775 (Field.FieldBuilder): New member.
22776 (TypeContainer::Populate): Update accordingly.
22777 (TypeContainer::FindMembers): Implement.
22779 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22781 * statement.cs: (VariableInfo::VariableType): New field to be
22782 initialized with the full type once it is resolved.
22784 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22786 * parameter.cs (GetParameterInfo): Use a type cache to compute
22787 things only once, and to reuse this information
22789 * expression.cs (LocalVariableReference::Emit): Implement.
22790 (OpcodeCast::Emit): fix.
22792 (ParameterReference::Resolve): Implement.
22793 (ParameterReference::Emit): Implement.
22795 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22796 that are expressions need to stay as Expressions.
22798 * typemanager.cs (CSharpName): Returns the C# name of a type if
22801 * expression.cs (Expression::ConvertImplicit): New function that
22802 implements implicit type conversions.
22804 (Expression::ImplicitReferenceConversion): Implements implicit
22805 reference conversions.
22807 (EmptyCast): New type for transparent casts.
22809 (OpcodeCast): New type for casts of types that are performed with
22810 a sequence of bytecodes.
22812 (BoxedCast): New type used for casting value types into reference
22813 types. Emits a box opcode.
22815 (Binary::DoNumericPromotions): Implements numeric promotions of
22816 and computation of the Binary::Type.
22818 (Binary::EmitBranchable): Optimization.
22820 (Binary::Emit): Implement code emission for expressions.
22822 * typemanager.cs (TypeManager): Added two new core types: sbyte
22825 2001-09-12 Ravi Pratap <ravi@ximian.com>
22827 * class.cs (TypeContainer::FindMembers): Method which does exactly
22828 what Type.FindMembers does, only we don't have to use reflection. No
22829 implementation yet.
22831 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22832 typecontainer objects as we need to get at them.
22833 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22835 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22836 typecontainer object.
22838 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22839 of just a Report object.
22841 2001-09-11 Ravi Pratap <ravi@ximian.com>
22843 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22845 (TypeContainer::Populate): Now define the delegates of the type too.
22846 (TypeContainer.Delegates): Property to access the list of delegates defined
22849 * delegates.cs (Delegate::Define): Implement partially.
22851 * modifiers.cs (TypeAttr): Handle more flags.
22853 2001-09-11 Ravi Pratap <ravi@ximian.com>
22855 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22857 (Operator::Define): Re-write logic to get types by using the LookupType method
22858 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22859 (Indexer::Define): Ditto.
22860 (Event::Define): Ditto.
22861 (Property::Define): Ditto.
22863 2001-09-10 Ravi Pratap <ravi@ximian.com>
22865 * class.cs (TypeContainer::Populate): Now define operators too.
22866 (TypeContainer.Operators): New property to access the list of operators
22868 (Operator.OperatorMethodBuilder): New member to hold the method builder
22869 for the operator we are defining.
22870 (Operator::Define): Implement.
22872 2001-09-10 Ravi Pratap <ravi@ximian.com>
22874 * class.cs (Event::Define): Make the prefixes of the accessor methods
22875 addOn_ and removeOn_
22877 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22878 of the location being passed in too. Ideally, this should go later since all
22879 error reporting should be done through the Report object.
22881 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22882 (Populate): Iterate thru the indexers we have and define them too.
22883 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22884 for the get and set accessors.
22885 (Indexer::Define): Implement.
22887 2001-09-09 Miguel de Icaza <miguel@ximian.com>
22889 * expression.cs (Binary::Resolve): Beginning of it. I scratched
22890 my previous implementation, did not work.
22892 * typemanager.cs: Add a couple of missing types (the longs).
22894 * literal.cs: Use TypeManager.bool_type instead of getting it.
22896 * expression.cs (EventExpr): New kind of expressions.
22897 (Expressio::ExprClassFromMemberInfo): finish
22899 2001-09-08 Miguel de Icaza <miguel@ximian.com>
22901 * assign.cs: Emit stores to static fields differently.
22903 2001-09-08 Ravi Pratap <ravi@ximian.com>
22905 * Merge in changes and adjust code to tackle conflicts. Backed out my
22906 code in Assign::Resolve ;-)
22908 2001-09-08 Ravi Pratap <ravi@ximian.com>
22910 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22911 instead Report.Error and also pass in the location.
22912 (CSharpParser::Lexer): New readonly property to return the reference
22913 to the Tokenizer object.
22914 (declare_local_variables): Use Report.Error with location instead of plain
22918 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22919 (Operator.CheckBinaryOperator): Ditto.
22921 * cs-parser.jay (operator_declarator): Update accordingly.
22923 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22924 (CheckBinaryOperator): Same here.
22926 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22927 on the name without any prefixes of namespace names etc. This is because we
22928 already might have something already fully qualified like
22929 'System.Console.WriteLine'
22931 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22933 2001-09-07 Ravi Pratap <ravi@ximian.com>
22935 * cs-tokenizer.cs (location): Return a string which also contains
22938 * expression.cs (ElementAccess): New class for expressions of the
22939 type 'element access.'
22940 (BaseAccess): New class for expressions of the type 'base access.'
22941 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22944 * cs-parser.jay (element_access): Implement action.
22945 (base_access): Implement actions.
22946 (checked_expression, unchecked_expression): Implement.
22948 * cs-parser.jay (local_variable_type): Correct and implement.
22949 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22951 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22953 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22954 name and the specifiers.
22956 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22958 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22959 making them all public ;-)
22961 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22964 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22966 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22968 (FieldExpr, PropertyExprs): New resolved expressions.
22969 (SimpleName::MemberStaticCheck): Perform static checks for access
22970 to non-static fields on static methods. Maybe this should be
22971 generalized for MemberAccesses.
22972 (SimpleName::ResolveSimpleName): More work on simple name
22975 * cs-parser.jay (primary_expression/qualified_identifier): track
22976 the parameter index.
22978 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22979 (EmitContext::EmitBoolExpression): Chain to expression generation
22980 instead of temporary hack.
22981 (::EmitStatementExpression): Put generic expression code generation.
22983 * assign.cs (Assign::Emit): Implement variable assignments to
22984 local variables, parameters and fields.
22986 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22988 * statement.cs (Block::GetVariableInfo): New method, returns the
22989 VariableInfo for a variable name in a block.
22990 (Block::GetVariableType): Implement in terms of GetVariableInfo
22992 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22993 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22995 2001-09-06 Ravi Pratap <ravi@ximian.com>
22997 * cs-parser.jay (operator_declaration): Continue on my quest : update
22998 to take attributes argument.
22999 (event_declaration): Ditto.
23000 (enum_declaration): Ditto.
23001 (indexer_declaration): Ditto.
23003 * class.cs (Operator::Operator): Update constructor accordingly.
23004 (Event::Event): Ditto.
23006 * delegate.cs (Delegate::Delegate): Same here.
23008 * enum.cs (Enum::Enum): Same here.
23010 2001-09-05 Ravi Pratap <ravi@ximian.com>
23012 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23014 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23016 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23017 being passed around as an arraylist.
23018 (Attributes::AddAttribute): Method to add attribute sections.
23020 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23021 (struct_declaration): Update accordingly.
23022 (constant_declaration): Update.
23023 (field_declaration): Update.
23024 (method_header): Update.
23025 (fixed_parameter): Update.
23026 (parameter_array): Ditto.
23027 (property_declaration): Ditto.
23028 (destructor_declaration): Ditto.
23030 * class.cs (Struct::Struct): Update constructors accordingly.
23031 (Class::Class): Ditto.
23032 (Field::Field): Ditto.
23033 (Method::Method): Ditto.
23034 (Property::Property): Ditto.
23035 (TypeContainer::OptAttribute): update property's return type.
23037 * interface.cs (Interface.opt_attributes): New member.
23038 (Interface::Interface): Update to take the extra Attributes argument.
23040 * parameter.cs (Parameter::Parameter): Ditto.
23042 * constant.cs (Constant::Constant): Ditto.
23044 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23045 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23046 the attributes as a parameter.
23047 (InterfaceProperty): Update constructor call.
23048 (InterfaceEvent): Ditto.
23049 (InterfaceMethod): Ditto.
23050 (InterfaceIndexer): Ditto.
23052 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23053 pass the attributes too.
23054 (interface_event_declaration): Ditto.
23055 (interface_property_declaration): Ditto.
23056 (interface_method_declaration): Ditto.
23057 (interface_declaration): Ditto.
23059 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23061 * class.cs (Method::Define): Track the "static Main" definition to
23062 create an entry point.
23064 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23065 EntryPoint if we find it.
23067 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23068 (EmitContext::ig): Make this variable public.
23070 * driver.cs: Make the default output file be the first file name
23071 with the .exe extension.
23073 Detect empty compilations
23075 Handle various kinds of output targets. Handle --target and
23076 rename -t to --dumper.
23078 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23079 methods inherited from Expression return now an Expression. This
23080 will is used during the tree rewriting as we resolve them during
23083 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23084 the spec. Missing entirely is the information about
23085 accessability of elements of it.
23087 (Expression::ExprClassFromMemberInfo): New constructor for
23088 Expressions that creates a fully initialized Expression based on
23089 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23092 (Invocation::Resolve): Begin implementing resolution of invocations.
23094 * literal.cs (StringLiteral): Implement Emit.
23096 2001-09-05 Ravi Pratap <ravi@ximian.com>
23098 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23101 2001-09-04 Ravi Pratap <ravi@ximian.com>
23103 * cs-parser.jay (attribute_arguments): Implement actions.
23104 (attribute): Fix bug in production. Implement action.
23105 (attribute_list): Implement.
23106 (attribute_target): Implement.
23107 (attribute_target_specifier, opt_target_specifier): Implement
23108 (CheckAttributeTarget): New method to check if the attribute target
23110 (attribute_section): Implement.
23111 (opt_attributes): Implement.
23113 * attribute.cs : New file to handle attributes.
23114 (Attribute): Class to hold attribute info.
23116 * cs-parser.jay (opt_attribute_target_specifier): Remove production
23117 (attribute_section): Modify production to use 2 different rules to
23118 achieve the same thing. 1 s/r conflict down !
23119 Clean out commented, useless, non-reducing dimension_separator rules.
23121 * class.cs (TypeContainer.attributes): New member to hold list
23122 of attributes for a type.
23123 (Struct::Struct): Modify to take one more argument, the attribute list.
23124 (Class::Class): Ditto.
23125 (Field::Field): Ditto.
23126 (Method::Method): Ditto.
23127 (Property::Property): Ditto.
23129 * cs-parser.jay (struct_declaration): Update constructor call to
23130 pass in the attributes too.
23131 (class_declaration): Ditto.
23132 (constant_declaration): Ditto.
23133 (field_declaration): Ditto.
23134 (method_header): Ditto.
23135 (fixed_parameter): Ditto.
23136 (parameter_array): Ditto.
23137 (property_declaration): Ditto.
23139 * constant.cs (Constant::Constant): Update constructor similarly.
23140 Use System.Collections.
23142 * parameter.cs (Parameter::Parameter): Update as above.
23144 2001-09-02 Ravi Pratap <ravi@ximian.com>
23146 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23147 (TypeContainer.delegates): New member to hold list of delegates.
23149 * cs-parser.jay (delegate_declaration): Implement the action correctly
23150 this time as I seem to be on crack ;-)
23152 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23154 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23155 tell whether an identifier represents a namespace.
23157 * expression.cs (NamespaceExpr): A namespace expression, used only
23158 temporarly during expression resolution.
23159 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23160 utility functions to resolve names on expressions.
23162 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23164 * codegen.cs: Add hook for StatementExpressions.
23166 * class.cs: Fix inverted test for static flag in methods.
23168 2001-09-02 Ravi Pratap <ravi@ximian.com>
23170 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23171 to make it coincide with MS' number.
23172 (Operator::CheckBinaryOperator): Ditto.
23174 * ../errors/errors.txt : Remove error numbers added earlier.
23176 * ../errors/cs1019.cs : Test case for error # 1019
23178 * ../errros/cs1020.cs : Test case for error # 1020
23180 * cs-parser.jay : Clean out commented cruft.
23181 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23182 used anywhere - non-reducing rule.
23183 (namespace_declarations): Non-reducing rule - comment out.
23185 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23186 with TypeContainer::AddEnum.
23188 * delegate.cs : New file for delegate handling classes.
23189 (Delegate): Class for declaring delegates.
23191 * makefile : Update.
23193 * cs-parser.jay (delegate_declaration): Implement.
23195 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23197 * class.cs (Event::Define): Implement.
23198 (Event.EventBuilder): New member.
23200 * class.cs (TypeContainer::Populate): Update to define all enums and events
23202 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23203 readonly fields for all these cases ?
23205 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23207 * class.cs (Property): Revamp to use the convention of making fields readonly.
23208 Accordingly modify code elsewhere.
23210 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23211 the Define method of the Property class.
23213 * class.cs : Clean up applied patch and update references to variables etc. Fix
23215 (TypeContainer::Populate): Update to define all the properties we have. Also
23216 define all enumerations.
23218 * enum.cs (Define): Implement.
23220 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23222 * cs-parser.jay (overloadable_operator): The semantic value is an
23223 enum of the Operator class.
23224 (operator_declarator): Implement actions.
23225 (operator_declaration): Implement.
23227 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23228 validity of definitions.
23229 (Operator::CheckBinaryOperator): Static method to check for binary operators
23230 (TypeContainer::AddOperator): New method to add an operator to a type.
23232 * cs-parser.jay (indexer_declaration): Added line to actually call the
23233 AddIndexer method so it gets added ;-)
23235 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23236 already taken care of by the MS compiler ?
23238 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23240 * class.cs (Operator): New class for operator declarations.
23241 (Operator::OpType): Enum for the various operators.
23243 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23245 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23246 ostensibly handle this in semantic analysis.
23248 * cs-parser.jay (general_catch_clause): Comment out
23249 (specific_catch_clauses, specific_catch_clause): Ditto.
23250 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23251 (catch_args, opt_catch_args): New productions.
23252 (catch_clause): Rewrite to use the new productions above
23253 (catch_clauses): Modify accordingly.
23254 (opt_catch_clauses): New production to use in try_statement
23255 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23256 and re-write the code in the actions to extract the specific and
23257 general catch clauses by being a little smart ;-)
23259 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23260 Hooray, try and catch statements parse fine !
23262 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23264 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23265 string from the hashtable of variables.
23267 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23268 I end up making that mistake ;-)
23269 (catch_clauses): Fixed gross error which made Key and Value of the
23270 DictionaryEntry the same : $1 !!
23272 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23274 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23276 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23277 when the add and remove accessors are specified.
23279 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23281 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23282 information about indexer_declarator.
23283 (indexer_declarator): Implement actions.
23284 (parsing_indexer): New local boolean used to keep track of whether
23285 we are parsing indexers or properties. This is necessary because
23286 implicit_parameters come into picture even for the get accessor in the
23287 case of an indexer.
23288 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23290 * class.cs (Indexer): New class for indexer declarations.
23291 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23292 (TypeContainer::indexers): New member to hold list of indexers for the
23295 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23297 * cs-parser.jay (add_accessor_declaration): Implement action.
23298 (remove_accessor_declaration): Implement action.
23299 (event_accessors_declaration): Implement
23300 (variable_declarators): swap statements for first rule - trivial.
23302 * class.cs (Event): New class to hold information about event
23304 (TypeContainer::AddEvent): New method to add an event to a type
23305 (TypeContainer::events): New member to hold list of events.
23307 * cs-parser.jay (event_declaration): Implement actions.
23309 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23311 * cs-parser.jay (dim_separators): Implement. Make it a string
23312 concatenating all the commas together, just as they appear.
23313 (opt_dim_separators): Modify accordingly
23314 (rank_specifiers): Update accordingly. Basically do the same
23315 thing - instead, collect the brackets here.
23316 (opt_rank_sepcifiers): Modify accordingly.
23317 (array_type): Modify to actually return the complete type string
23318 instead of ignoring the rank_specifiers.
23319 (expression_list): Implement to collect the expressions
23320 (variable_initializer): Implement. We make it a list of expressions
23321 essentially so that we can handle the array_initializer case neatly too.
23322 (variable_initializer_list): Implement.
23323 (array_initializer): Make it a list of variable_initializers
23324 (opt_array_initializer): Modify accordingly.
23326 * expression.cs (New::NType): Add enumeration to help us
23327 keep track of whether we have an object/delegate creation
23328 or an array creation.
23329 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23330 members to hold data about array creation.
23331 (New:New): Modify to update NewType
23332 (New:New): New Overloaded contructor for the array creation
23335 * cs-parser.jay (array_creation_expression): Implement to call
23336 the overloaded New constructor.
23338 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23340 * class.cs (TypeContainer::Constructors): Return member
23341 constructors instead of returning null.
23343 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23345 * typemanager.cs (InitCoreTypes): Initialize the various core
23346 types after we have populated the type manager with the user
23347 defined types (this distinction will be important later while
23348 compiling corlib.dll)
23350 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23351 on Expression Classification. Now all expressions have a method
23352 `Resolve' and a method `Emit'.
23354 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23355 generation from working. Also add some temporary debugging
23358 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23360 * codegen.cs: Lots of code generation pieces. This is only the
23361 beginning, will continue tomorrow with more touches of polish. We
23362 handle the fundamentals of if, while, do, for, return. Others are
23363 trickier and I need to start working on invocations soon.
23365 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23368 * codegen.cs (EmitContext): New struct, used during code
23369 emission to keep a context. Most of the code generation will be
23372 * cs-parser.jay: Add embedded blocks to the list of statements of
23373 this block. So code generation proceeds in a top down fashion.
23375 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23377 * statement.cs: Add support for multiple child blocks.
23379 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23381 * codegen.cs (EmitCode): New function, will emit the code for a
23382 Block of code given a TypeContainer and its ILGenerator.
23384 * statement.cs (Block): Standard public readonly optimization.
23385 (Block::Block constructors): Link children.
23386 (Block::Child): Child Linker.
23387 (Block::EmitVariables): Emits IL variable declarations.
23389 * class.cs: Drop support for MethodGroups here, delay until
23391 (Method::): Applied the same simplification that I did before, and
23392 move from Properties to public readonly fields.
23393 (Method::ParameterTypes): Returns the parameter types for the
23394 function, and implements a cache that will be useful later when I
23395 do error checking and the semantic analysis on the methods is
23397 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23398 and made a method, optional argument tells whether this is a class
23399 or a structure to apply the `has-this' bit.
23400 (Method::GetCallingConvention): Implement, returns the calling
23402 (Method::Define): Defines the type, a second pass is performed
23403 later to populate the methods.
23405 (Constructor::ParameterTypes): implement a cache similar to the
23406 one on Method::ParameterTypes, useful later when we do semantic
23409 (TypeContainer::EmitMethod): New method. Emits methods.
23411 * expression.cs: Removed MethodGroup class from here.
23413 * parameter.cs (Parameters::GetCallingConvention): new method.
23415 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23417 * class.cs (TypeContainer::Populate): Drop RootContext from the
23420 (Constructor::CallingConvention): Returns the calling convention.
23421 (Constructor::ParameterTypes): Returns the constructor parameter
23424 (TypeContainer::AddConstructor): Keep track of default constructor
23425 and the default static constructor.
23427 (Constructor::) Another class that starts using `public readonly'
23428 instead of properties.
23430 (Constructor::IsDefault): Whether this is a default constructor.
23432 (Field::) use readonly public fields instead of properties also.
23434 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23435 track of static constructors; If none is used, turn on
23436 BeforeFieldInit in the TypeAttributes.
23438 * cs-parser.jay (opt_argument_list): now the return can be null
23439 for the cases where there are no arguments.
23441 (constructor_declarator): If there is no implicit `base' or
23442 `this', then invoke the default parent constructor.
23444 * modifiers.cs (MethodAttr): New static function maps a set of
23445 modifiers flags into a MethodAttributes enum
23446 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23447 MethodAttr, TypeAttr to represent the various mappings where the
23448 modifiers are used.
23449 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23451 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23453 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23456 * interface.cs (PopulateIndexer): Implemented the code generator
23457 for interface indexers.
23459 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23461 * interface.cs (InterfaceMemberBase): Now we track the new status
23464 (PopulateProperty): Implement property population. Woohoo! Got
23465 Methods and Properties going today.
23467 Removed all the properties for interfaces, and replaced them with
23468 `public readonly' fields.
23470 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23472 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23473 initialize their hashtables/arraylists only when they are needed
23474 instead of doing this always.
23476 * parameter.cs: Handle refs and out parameters.
23478 * cs-parser.jay: Use an ArrayList to construct the arguments
23479 instead of the ParameterCollection, and then cast that to a
23482 * parameter.cs: Drop the use of ParameterCollection and use
23483 instead arrays of Parameters.
23485 (GetParameterInfo): Use the Type, not the Name when resolving
23488 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23490 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23491 and instead use public readonly fields.
23493 * class.cs: Put back walking code for type containers.
23495 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23497 * class.cs (MakeConstant): Code to define constants.
23499 * rootcontext.cs (LookupType): New function. Used to locate types
23502 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23504 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23505 this System.Reflection code is. Kudos to Microsoft
23507 * typemanager.cs: Implement a type cache and avoid loading all
23508 types at boot time. Wrap in LookupType the internals. This made
23509 the compiler so much faster. Wow. I rule!
23511 * driver.cs: Make sure we always load mscorlib first (for
23512 debugging purposes, nothing really important).
23514 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23515 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23517 * rootcontext.cs: Lookup types on their namespace; Lookup types
23518 on namespaces that have been imported using the `using' keyword.
23520 * class.cs (TypeContainer::TypeAttr): Virtualize.
23521 (Class::TypeAttr): Return attributes suitable for this bad boy.
23522 (Struct::TypeAttr): ditto.
23523 Handle nested classes.
23524 (TypeContainer::) Remove all the type visiting code, it is now
23525 replaced with the rootcontext.cs code
23527 * rootcontext.cs (GetClassBases): Added support for structs.
23529 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23531 * interface.cs, statement.cs, class.cs, parameter.cs,
23532 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23533 Drop use of TypeRefs, and use strings instead.
23535 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23539 * class.cs (Struct::Struct): set the SEALED flags after
23540 checking the modifiers.
23541 (TypeContainer::TypeAttr): new property, returns the
23542 TypeAttributes for a class.
23544 * cs-parser.jay (type_list): Oops, list production was creating a
23545 new list of base types.
23547 * rootcontext.cs (StdLib): New property.
23548 (GetInterfaceTypeByName): returns an interface by type name, and
23549 encapsulates error handling here.
23550 (GetInterfaces): simplified.
23551 (ResolveTree): Encapsulated all the tree resolution here.
23552 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23555 * driver.cs: Add support for --nostdlib, to avoid loading the
23556 default assemblies.
23557 (Main): Do not put tree resolution here.
23559 * rootcontext.cs: Beginning of the class resolution.
23561 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23563 * rootcontext.cs: Provide better error reporting.
23565 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23567 * rootcontext.cs (CreateInterface): Handle the case where there
23568 are no parent interfaces.
23570 (CloseTypes): Routine to flush types at the end.
23571 (CreateInterface): Track types.
23572 (GetInterfaces): Returns an array of Types from the list of
23573 defined interfaces.
23575 * typemanager.c (AddUserType): Mechanism to track user types (puts
23576 the type on the global type hash, and allows us to close it at the
23579 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23581 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23582 RecordInterface instead.
23584 * cs-parser.jay: Updated to reflect changes above.
23586 * decl.cs (Definition): Keep track of the TypeBuilder type that
23587 represents this type here. Not sure we will use it in the long
23588 run, but wont hurt for now.
23590 * driver.cs: Smaller changes to accomodate the new code.
23592 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23595 * rootcontext.cs (CreateInterface): New method, used to create
23596 the System.TypeBuilder type for interfaces.
23597 (ResolveInterfaces): new entry point to resolve the interface
23599 (CodeGen): Property, used to keep track of the code generator.
23601 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23603 * cs-parser.jay: Add a second production for delegate_declaration
23606 (enum_body): Put an opt_comma here instead of putting it on
23607 enum_body or enum_member_declarations so we can handle trailing
23608 commas on enumeration members. Gets rid of a shift/reduce.
23610 (type_list): Need a COMMA in the middle.
23612 (indexer_declaration): Tell tokenizer to recognize get/set
23614 * Remove old targets.
23616 * Re-add the parser target.
23618 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23620 * cs-parser.jay: Add precendence rules for a number of operators
23621 ot reduce the number of shift/reduce conflicts in the grammar.
23623 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23625 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23628 Get rid of old crufty code.
23630 * rootcontext.cs: Use this to keep track of the parsed
23631 representation and the defined types available to the program.
23633 * gen-treedump.cs: adjust for new convention.
23635 * type.cs: Split out the type manager, and the assembly builder
23638 * typemanager.cs: the type manager will live here now.
23640 * cil-codegen.cs: And the code generator here.
23642 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23644 * makefile: Fixed up for easy making.
23646 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23648 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23651 (unary_expression): Expand pre_increment_expression and
23652 post_decrement_expression to reduce a shift/reduce.
23654 2001-07-11 Simon Cozens
23656 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23658 Improve allow_keyword_as_indent name.
23660 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23662 * Adjustments for Beta2.
23664 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23666 * decl.cs: Added `Define' abstract method.
23667 (InTransit): new property, used to catch recursive definitions.
23669 * interface.cs: Implement `Define'.
23671 * modifiers.cs: Map Modifiers.constants to
23672 System.Reflection.TypeAttribute flags.
23674 * class.cs: Keep track of types and user-defined types.
23675 (BuilderInit): New method for creating an assembly
23676 (ResolveType): New function to launch the resolution process, only
23677 used by interfaces for now.
23679 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23680 that are inserted into the name space.
23682 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23684 * ARGH. I have screwed up my tree so many times due to the use of
23685 rsync rather than using CVS. Going to fix this at once.
23687 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23690 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23692 * Experiment successful: Use System.Type rather that our own
23695 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23697 * cs-parser.jay: Removed nsAliases from here.
23699 Use new namespaces, handle `using XXX;'
23701 * namespace.cs: Reimplemented namespace handling, use a recursive
23702 definition of the class. Now we can keep track of using clauses
23703 and catch invalid using clauses.
23705 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23707 * gen-treedump.cs: Adapted for all the renaming.
23709 * expression.cs (Expression): this class now has a Type property
23710 which returns an expression Type.
23712 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23713 `Type', as this has a different meaning now in the base
23715 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23717 * interface.cs, class.cs: Removed from all the sources the
23718 references to signature computation, as we can not do method
23719 signature computation during the parsing time, as we are not
23720 trying to solve at that point distinguishing:
23724 void a (NS.Blah x) {}
23727 Which depending on the context might be valid or not, as we do not
23728 know if Blah is the same thing as NS.Blah at that point.
23730 * Redid everything so the code uses TypeRefs now instead of
23731 Types. TypeRefs are just temporary type placeholders, that need
23732 to be resolved. They initially have a pointer to a string and the
23733 current scope in which they are used. This is used later by the
23734 compiler to resolve the reference to an actual Type.
23736 * DeclSpace is no longer a CIR.Type, and neither are
23737 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23738 are all DeclSpaces, but no Types.
23740 * type.cs (TypeRefManager): This implements the TypeRef manager,
23741 which keeps track of all the types that need to be resolved after
23742 the parsing has finished.
23744 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23746 * ARGH. We are going to have to store `foreach' as a class rather
23747 than resolving it, as we need to verify error 1579 after name
23748 resolution. *OR* we could keep a flag that says `This request to
23749 IEnumerator comes from a foreach statement' which we can then use
23750 to generate the error.
23752 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23754 * class.cs (TypeContainer.AddMethod): we now add methods to the
23755 MethodGroup instead of the method hashtable.
23757 * expression.cs: Add MethodGroup abstraction, which gets us one
23758 step closer to the specification in the way we handle method
23761 * cs-parser.jay (primary_expression): qualified_identifier now
23762 tried to match up an identifier to a local variable reference or
23763 to a parameter reference.
23765 current_local_parameters is now a parser global variable that
23766 points to the current parameters for the block, used during name
23769 (property_declaration): Now creates an implicit `value' argument to
23772 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23774 * parameter.cs: Do not use `param' arguments as part of the
23775 signature, per the spec.
23777 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23779 * decl.cs: Base class for classes, structs and interfaces. This
23780 is the "Declaration Space"
23782 * cs-parser.jay: Use CheckDef for checking declaration errors
23783 instead of having one on each function.
23785 * class.cs: Factor out some code for handling error handling in
23786 accordance to the "Declarations" section in the "Basic Concepts"
23787 chapter in the ECMA C# spec.
23789 * interface.cs: Make all interface member classes derive from
23790 InterfaceMemberBase.
23792 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23794 * Many things: all interfaces are parsed and generated in
23795 gen-treedump. Support for member variables, constructors,
23796 destructors, properties, constants is there.
23798 Beginning of the IL backend, but very little done, just there for
23801 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23803 * cs-parser.jay: Fix labeled statement.
23805 * cs-tokenizer.cs (escape): Escape " and ' always.
23806 ref_line, ref_name: keep track of the line/filename as instructed
23807 by #line by the compiler.
23810 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23812 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23813 to match the values in System.CodeDOM.
23815 Divid renamed to Divide.
23817 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23819 (Statements.set): remove.
23821 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23824 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23825 falseStatements always have valid values.
23827 * cs-parser.jay: Use System.CodeDOM now.