1 2006-08-29 Miguel de Icaza <miguel@novell.com>
3 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5 2006-08-17 Miguel de Icaza <miguel@novell.com>
7 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8 #52019 and #79064, the use of the \uXXXX sequence in source code
9 to represent unicode characters.
11 2006-08-15 Marek Safar <marek.safar@seznam.cz>
13 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
15 * class.cs, ecore.cs, statement.cs: Merged to one error message.
17 2006-08-13 Miguel de Icaza <miguel@novell.com>
19 * assign.cs: Catch attempts to assign to a method groups in += and
22 2006-08-13 Marek Safar <marek.safar@seznam.cz>
25 * cs-parser.jay: Don't destroy current array type by typeof of array's.
27 2006-08-12 Marek Safar <marek.safar@seznam.cz>
29 * class.cs (Method.Define): Issue a warning when generic method looks like
31 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
34 2006-08-09 Marek Safar <marek.safar@seznam.cz>
36 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
38 * decl.cs (MemberCache.FindMembers): When container is interface we need to
39 search all base interfaces as a member can be ambiguous.
40 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
41 Constructor member type filter.
42 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
43 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
44 reporting for returned memberinfos.
46 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
47 version to work on all runtimes.
48 (TypeManager.RealMemberLookup): Removed members filtering.
50 2006-08-08 Raja R Harinath <rharinath@novell.com>
52 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
53 (PropertyExpr.EmitAssign): Likewise.
54 * expression.cs (Indirection.EmitAssign): Likewise.
55 (LocalVariableReference.EmitAssign): Likewise.
56 (ParameterReference.EmitAssign): Likewise.
57 (Invocation.EmitArguments): Likewise.
58 (ArrayAccess.EmitAssign): Likewise.
59 (IndexerAccess.EmitAssign): Likewise.
60 (This.EmitAssign): Likewise.
61 (ConditionalLogicalOperator.Emit): Likewise.
64 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
65 instead of ArrayList. If the hashtable has a LocalBuilder, don't
66 leave it in after returning it.
67 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
69 2006-08-06 Marek Safar <marek.safar@seznam.cz>
71 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
74 2006-08-03 Raja R Harinath <rharinath@novell.com>
76 Fix cs0146-3.cs and cs0146-4.cs.
77 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
78 enclosing types don't depend on the current type.
80 2006-08-02 Raja R Harinath <rharinath@novell.com>
83 * class.cs (TypeContainer.DoDefineMembers): Use
84 FindBaseMemberWithSameName on Parent, since we're interested in
85 whether we hide inherited members or not.
86 (FindBaseMemberWithSameName): Make slightly more robust.
88 Fix the non-generic testcase from #77396
89 * decl.cs (DeclSpace.DeclContainer): Remove override.
91 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
92 declspaces for doppelgangers too.
93 (UsingEntry): Implement IResolveContext.
94 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
95 'this' as the resolve context.
96 (LocalAliasEntry): Likewise.
98 Implement parts of #77403
99 * roottypes.cs (RootDeclSpace): New. Used to represent the
100 toplevel declaration space. Each namespace declaration introduces
101 a "partial" root declaretion space.
102 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
103 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
104 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
105 from 'current_namespace.SlaveDeclSpace'.
106 (namespace_declaration): Likewise.
107 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
108 check. It can't happen now.
109 * decl.cs (DeclSpace.LookupType): Likewise.
110 * driver.cs (MainDriver): Sanity check.
112 2006-08-01 Raja R Harinath <rharinath@novell.com>
114 * decl.cs (DeclSpace.FindNestedType): Remove.
115 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
116 LookupTypeContainer to get the container of the nested type.
117 * class.cs (TypeContainer.FindNestedType): Make non-override.
119 2006-07-31 Raja R Harinath <rharinath@novell.com>
121 * decl.cs (DeclSpace.PartialContainer): Move field from ...
122 * class.cs (TypeContainer.PartialContainer): ... here.
123 (TypeContainer.AddBasesForPart): New helper.
124 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
126 * cs-parser.jay (current_class): Convert to DeclSpace.
127 (struct_declaration, interface_declaration, class_declaration):
128 Use AddBasesForPart instead of .Bases directly.
129 * const.cs, iterators.cs: Update to changes.
131 2006-07-28 Raja R Harinath <rharinath@novell.com>
133 * class.cs (TypeContainer.AddMemberType): Rename from
135 (TypeContainer.AddMember): Rename from AddToMemberContainer.
136 (AddTypeContainer): New. Combine AddClassOrStruct and
138 (AddPartial): Update. Add 'is_partial' argument.
139 * roottypes.cs: Update to changes.
140 * cs-parser.jay (push_current_class): New helper for handling
141 current_container and current_class.
142 (struct_declaration, interface_declaration, class_declaration):
145 2006-07-26 Raja R Harinath <rharinath@novell.com>
147 * roottypes.cs: Rename from tree.cs.
149 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
150 * tree.cs (Tree, ITreeDump): Remove types.
151 * rootcontext.cs (tree, Tree): Remove fields.
152 (root, ToplevelTypes): New.
153 * *.cs: Update to rename.
155 * tree.cs (Tree.RecordDecl): Remove.
156 (RootTypes.AddToTypeContainer): Record the toplevel type in its
158 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
160 2006-07-23 Raja R Harinath <harinath@gmail.com>
162 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
163 DoFlowAnalysis and OmitStructFlowAnalysis here.
164 (ec.With): Rename from WithUnsafe and generalize.
165 (ec.WithCheckState): Remove. All users can be handled by 'With'.
166 (ec.WithFlowAnalyis): New.
167 * ecore.cs, expression.cs, statement.cs: Update.
169 2006-07-22 Raja R Harinath <harinath@gmail.com>
171 * statement.cs (Block.ResolveMeta): Simplify slightly.
173 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
174 multiple boolean fields. Convert InUnsafe, constant_check_state,
175 check_state to flags.
176 (CheckState, ConstantCheckState): Update.
177 (InUnsafe): New read-only property.
178 (FlagsHandle): Rename from CheckStateHandle and convert to handle
180 (WithUnsafe): New helper similar to WithCheckState.
181 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
182 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
184 2006-07-21 Raja R Harinath <rharinath@novell.com>
186 Make comparisons use the same IL irrespective of whether they're
187 in a 'checked' or 'unchecked' context: one of the issues in #78899
188 * codegen.cs (EmitContext.CheckState): Make read-only property.
189 (EmitContext.ConstantCheckState): Likewise.
190 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
191 helper that implement a save/restore stack for CheckState
192 values. This is the only way to change check-state.
193 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
194 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
195 (CheckedExpr.EmitBranchable): New forwarding method.
196 (UnCheckedExpr): Likewise.
197 * statement.cs (Block.ResolveMeta): Use WithCheckState.
198 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
199 (Checked.Resolve, checked.DoEmit): Likewise.
201 2006-07-20 Miguel de Icaza <miguel@novell.com>
203 * anonymous.cs: Cache the resolved anonymous delegate, and return
204 this so that the ResolveTopBlock is only triggered once, not
207 Currently we trigger ResolvetopBlock twice due to a first pass of
208 argument check compatibility, and a second pass that does the
211 2006-07-16 Marek Safar <marek.safar@seznam.cz>
214 * driver.cs (MainDriver): When a file extension is missing,
217 2006-07-15 Marek Safar <marek.safar@seznam.cz>
219 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
221 * rootcontext.cs (Reset): Add helper_classes.
223 2006-07-15 Marek Safar <marek.safar@seznam.cz>
226 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
229 2006-07-13 Miguel de Icaza <miguel@novell.com>
231 * statement.cs (Lock): Handle expressions of type
232 TypeManager.null_type specially. Fixes #78770
234 2006-07-08 Marek Safar <marek.safar@seznam.cz>
236 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
239 2006-07-08 Marek Safar <marek.safar@seznam.cz>
241 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
242 for accessors as well.
243 * ecore.cs (EventExpr): Add AccessorTable.
245 2006-07-01 Marek Safar <marek.safar@seznam.cz>
248 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
249 for CS0122 where appropriate.
250 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
252 (Filter): Assembly can be null in the case of top level attributes.
254 2006-06-25 Marek Safar <marek.safar@seznam.cz>
258 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
259 is done at global level.
261 2006-06-24 Marek Safar <marek.safar@seznam.cz>
263 A fix for #77002, Implemented TypeForwarder support.
265 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
266 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
267 * typemanager.cs (): Add type_forwarder_attr_type.
269 2006-06-24 Marek Safar <marek.safar@seznam.cz>
271 * report.cs: Add CS0469 warning.
273 2006-06-21 Martin Baulig <martin@ximian.com>
275 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
276 the `try'-block, so we also report CS0016 etc. there.
278 2006-06-21 Martin Baulig <martin@ximian.com>
281 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
283 2006-06-21 Martin Baulig <martin@ximian.com>
285 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
286 also report CS1686 for parameters.
288 2006-06-21 Martin Baulig <martin@ximian.com>
290 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
291 instead of an error if the value is not implicitly convertible to
292 the switch types; fixes #77964.
294 2006-06-21 Raja R Harinath <rharinath@novell.com>
297 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
298 FieldBuilder is null.
301 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
302 'left' and 'right' before error-checking.
304 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
306 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
308 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
309 (FieldExpr.DoResolve): likewise.
310 (PropertyExpr.InstanceResolve): likewise.
311 (EventExpr.InstanceResolve): likewise.
313 2006-06-04 Marek Safar <marek.safar@seznam.cz>
315 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
316 attribute applicable tests for attribute argument.
318 2006-06-02 Raja R Harinath <rharinath@novell.com>
321 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
322 (Binary.OverloadResolve_PredefinedIntegral): New.
323 (Binary.OverloadResolve_PredefinedFloating): New.
324 (Binary.OverloadResolve_PredefinedString): New.
325 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
326 Follow the standard more closely, and treat numeric promotions in
327 terms of overload resolution.
328 (Binary.CheckShiftArguments): Simplify.
330 2006-06-01 Raja R Harinath <rharinath@novell.com>
332 * flowanalysis.cs (MyBitVector): Simplify representation.
333 (MyBitVector.Clone): Avoid allocating BitArray.
334 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
335 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
336 (*): Update. Change all references to MyBitVector.And and
337 MyBitVector.Or to &= and |=.
339 2006-05-29 Raja R Harinath <rharinath@novell.com>
342 * cs-parser.jay (formal_parameter_list): Extend the pattern below
343 to param arguments too.
345 2006-05-26 Miguel de Icaza <miguel@novell.com>
347 * cs-parser.jay: Catch another parsing form for arglist being
348 followed by other arguments. Fixes #78313.
350 2006-05-24 Raja R Harinath <rharinath@novell.com>
352 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
353 checking of out parameters to ...
354 (FlowBranchingToplevel.Merge): ... here.
355 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
356 set, propagate the origin upward, and only complain if there was
358 (FlowBranchingException.AddContinueOrigin): Likewise.
359 (FlowBranchingException.AddReturnOrigin): Likewise.
360 (FlowBranchingException.AddGotoOrigin): Likewise.
362 2006-05-23 Raja R Harinath <rharinath@novell.com>
364 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
365 unreachable, skip it.
366 (FlowBranchingException.Merge): Always propagate jumps, even if
367 the finally block renders subsequent code unreachable.
369 2006-05-18 Raja R Harinath <rharinath@novell.com>
372 * statement.cs (Goto.Resolve): Move responsibility for resolving
373 'goto' to FlowBranching.AddGotoOrigin.
374 (Goto.SetResolvedTarget): New. Callback to set the
375 LabeledStatement that's the target of the goto.
376 (Goto.DoEmit): Use Leave instead of Br when crossing an
377 unwind-protect boundary.
378 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
379 LookupLabel and adjust to new semantics.
380 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
381 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
382 Goto.SetResolvedTarget to update target.
383 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
384 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
385 AddBreakOrigin & co. Delay propagation until ...
386 (FlowBranchingException.Merge): ... this.
388 * statement.cs (Block.Resolve): Always depend on flow-branching to
389 determine unreachability. Kill workaround that originally emitted
390 only one statement after an "unreachable" label (see infloop in
393 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
394 This is still "wrong", but anything better would probably need a
395 multi-pass algorithm.
396 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
397 usage vector. Force current usage vector to be reachable, to
398 optimistically signify backward jumps.
399 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
401 (FlowBranchingLabeled.Merge): New. If no backward jump was
402 detected, return the original salted-away usage vector instead,
403 updated with appropriate changes. Print unreachable warning if
405 * statement.cs (Block.Resolve): Don't print unreachable warning on
408 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
410 * driver.cs: Pass filename without path to AssemblyBuilder's
411 AddResourceFile. Fixes bug #78407.
413 2006-05-17 Raja R Harinath <rharinath@novell.com>
415 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
416 * flowanalysis.cs (FlowBranchingLabeled): ... here.
417 (FlowBranching.MergeChild): Overwrite
418 reachability information from Labeled branchings too.
420 2006-05-16 Raja R Harinath <rharinath@novell.com>
422 * statement.cs (Goto.Resolve): Merge jump origins here ...
423 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
425 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
426 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
427 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
428 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
430 * statement.cs (Goto.Resolve): ... not here.
431 (Goto.Emit): Remove CS1632 check.
433 2006-05-14 Marek Safar <marek.safar@seznam.cz>
435 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
438 2006-05-11 Raja R Harinath <rharinath@novell.com>
440 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
441 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
442 (FlowBranchingException.Label): Likewise.
444 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
446 (MyBitVector.Or): Use it to avoid losing information (Count).
447 (FlowBranching.MergeOrigins): Likewise.
449 * flowanalysis.cs (UsageVector.IsDirty): Remove.
450 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
451 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
452 (UsageVector.ToString): Simplify.
453 (UsageVector.MergeSiblings): Move here from ...
454 (FlowBranching.Merge): ... here.
455 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
458 2006-05-10 Raja R Harinath <rharinath@novell.com>
460 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
461 null bitvector is treated as all-true.
463 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
464 (MyBitVector): Rationalize invariants. 'vector != null' implies
465 that we have our own copy of the bitvector. Otherwise,
466 'InheritsFrom == null' implies all inherited bits are true.
468 2006-05-09 Marek Safar <marek.safar@seznam.cz>
470 * statement.cs (LocalInfo): Add IsConstant.
471 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
472 local variable for constants.
474 2006-05-09 Raja R Harinath <rharinath@novell.com>
476 * flowanalysis.cs (MyBitVector.Empty): New.
477 (MyBitVector): Don't allow InheritedFrom to be null.
478 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
479 (UsageVector, FlowBranching): Update to changes.
481 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
482 recursion. The 'Parent == null' condition isn't sufficient for
484 (FlowBranching.AddBreakOrigin): Likewise.
485 (FlowBranching.AddContinueOrigin): Likewise.
486 (FlowBranching.AddReturnOrigin): Likewise.
487 (FlowBranching.StealFinallyClauses): Likewise.
488 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
489 (FlowBranching.CheckOutParameters): Likewise.
490 (FlowBranchingToplevel): Terminate all the above recursions here.
491 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
492 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
494 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
496 (FlowBranchingToplevel): New. Empty for now.
497 (FlowBranching.MergeTopBlock): Update.
498 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
499 branching for the anonymous delegate.
500 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
502 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
503 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
504 information at the start of the merge. Reorganize.
506 2006-05-07 Marek Safar <marek.safar@seznam.cz>
508 * class.cs (MethodData.Define): Method cannot implement interface accessor.
510 2006-05-07 Marek Safar <marek.safar@seznam.cz>
512 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
513 to newly introduced ctor.
515 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
516 message to one place.
517 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
520 2006-05-07 Marek Safar <marek.safar@seznam.cz>
522 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
524 * ecore.cs (Expression.ResolveAsConstant): Updated.
526 * statement.cs (ResolveMeta): Updated.
528 2006-05-06 Marek Safar <marek.safar@seznam.cz>
530 * cs-parser.jay: __arglist cannot be used in initializer.
532 2006-05-06 Marek Safar <marek.safar@seznam.cz>
535 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
538 2006-05-05 Raja R Harinath <rharinath@novell.com>
540 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
541 (LabeledStatement): Add 'name' parameter.
542 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
543 (Block.AddLabel): Update to changes.
544 * cs-parser.jay (labeled_statement): Likewise.
546 * flowanalysis.cs (BranchingType.Labeled): New.
547 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
548 (FlowBranchingLabeled): New. Does nothing for now, but will
549 eventually handle 'goto' flows.
550 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
551 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
552 that's terminated ...
553 (Block.Resolve): ... here.
555 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
556 (UsageVector.MergeFinallyOrigins): Likewise.
557 (FlowBranching.InTryOrCatch): Likewise.
558 (FlowBranching.AddFinallyVector): Likewise.
559 (FlowBranchingException): Update to changes.
562 * statement.cs (Return.Resolve): Move error checking to ...
563 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
564 (FlowBranchingException): Handle return origins like break and
566 (FlowBranching.UsageVector.CheckOutParameters): Remove.
568 2006-05-04 Marek Safar <marek.safar@seznam.cz>
571 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
574 2006-05-04 Marek Safar <marek.safar@seznam.cz>
577 * class.cs (MethodData.Define): Do public accessor check only when method
578 implements an interface.
580 2006-05-04 Raja R Harinath <rharinath@novell.com>
582 Remove special handling of 'break'
583 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
584 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
585 (UsageVector.Break): Remove.
586 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
588 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
590 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
591 UsageVector.Breaks (). Don't set NeedsReturnLabel.
593 2006-05-03 Marek Safar <marek.safar@seznam.cz>
596 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
597 be the interface member.
599 2006-05-03 Marek Safar <marek.safar@seznam.cz>
602 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
603 for emitting small (int) values.
605 2006-05-03 Raja R Harinath <rharinath@novell.com>
608 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
609 control-flow passes through the 'finally' after merging-in all the
610 control-flows from 'try' and the 'catch' clauses.
612 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
613 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
614 always true at the only non-recursive entry point.
615 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
616 FlowBranchingBreakable.
617 (FlowBranchingLoop): Remove.
618 * statement.cs (Return.DoResolve): Update to changes.
621 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
622 (FlowBranching.CreateBranching): Handle it: create a
623 FlowBranchingContinuable.
624 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
625 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
626 except that it handles the 'continue' command.
627 (FlowBranching.UsageVector.MergeOrigins): Rename from
629 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
630 except that it overrides AddContinueOrigin.
631 (FlowBranchingException): Override AddContinueOrigin, similar to
633 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
634 Create a new branching around the embedded statement.
635 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
636 control flow after the embedded statement.
637 (Continue.Resolve): Move all error checking to AddContinueOrigin.
639 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
640 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
641 FlowBranchingBreakable.
642 (FlowBranchingSwitch): Remove.
645 * statement.cs (Break.Resolve): Simplify. Move responsibility for
646 error reporting to ...
647 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
648 Rename from 'AddBreakVector'. Add new location argument. Return
649 a bool indicating whether the 'break' crosses an unwind-protect.
650 (FlowBranchingException.AddBreakOrigin): Add.
651 (FlowBranchingException.Merge): Propagate 'break's to surrounding
652 flowbranching after updating with the effects of the 'finally'
654 (FlowBranchingBreakable): New common base class for
655 FlowBranchingLoop and FlowBranchingSwitch.
657 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
659 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
661 2006-05-02 Raja R Harinath <rharinath@novell.com>
663 * statement.cs (Do.Resolve): If the loop is infinite, set the
665 (While.Resolve, For.Resolve): Set a barrier after the embedded
666 statement. There's no direct control flow that goes from the end
667 of the embedded statement to the end of the loop.
668 * flowanalysis.cs (FlowBranching.Infinite): Remove.
669 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
670 above ensure that the reachability is correctly computed.
672 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
673 (UsageVector.MergeBreakOrigins): If the current path is
674 unreachable, treat it as if all parameters/locals are initialized.
675 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
676 infinite loops before merging-in break origins.
678 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
679 (Reachability.Reachable): Split part into ...
680 (Reachability.Unreachable): ... this. Simplify.
681 (Reachability.IsUnreachable): Use 'Unreachable' instead.
683 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
684 (Reachability.SetThrowsSometimes): Likewise.
685 (FlowBranchingBlock.MergeTopBlock): Don't compare against
686 TriState.Always, use corresponding property.
687 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
688 (Block.Resolve): Likewise. Remove some redundant checks.
690 2006-05-02 Raja R Harinath <harinath@gmail.com>
692 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
693 (Reachability.Meet): Don't bother checking AlwaysThrows --
694 barrier is always set.
695 (FlowBranchingBlock.Merge): Likewise.
697 2006-05-01 Raja R Harinath <harinath@gmail.com>
699 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
700 checks for unreachable.
702 2006-05-01 Marek Safar <marek.safar@seznam.cz>
705 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
707 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
708 whether field is really assigned.
710 2006-04-30 Raja R Harinath <harinath@gmail.com>
712 * flowanalysis.cs (Reachability): Make 4-argument constructor
714 (Reachability.Meet): Rename from 'And'. Remove static variant.
715 (Reachability.Always): Rename from the highly misleading
716 'Reachability.Never'.
717 (FlowBranching.Merge): Update to changes. Mark an impossible
718 situation with a 'throw'.
719 (*): Update to changes.
721 2006-04-29 Raja R Harinath <harinath@gmail.com>
723 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
725 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
726 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
727 (*): Update to changes.
728 * statement.cs: Update to changes.
730 2006-04-28 Marek Safar <marek.safar@seznam.cz>
733 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
735 2006-04-28 Raja R Harinath <harinath@gmail.com>
737 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
740 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
741 argument to two arguments: an usage-vector and a bool. Move call
742 to FlowBranching.Merge () ...
743 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
745 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
746 handling of loop and switch reachability to ...
747 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
749 2006-04-27 Raja R Harinath <harinath@gmail.com>
751 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
752 handling to FlowBranchingLoop.InLoop.
753 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
755 2006-04-26 Marek Safar <marek.safar@seznam.cz>
758 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
759 anonymous method is allowed from AnonymousContainer here.
761 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
763 2006-04-24 Raja R Harinath <rharinath@novell.com>
766 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
768 2006-04-23 Marek Safar <marek.safar@seznam.cz>
771 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
772 (DoubleConstant.Reduce): Ditto.
774 2006-04-23 Raja R Harinath <rharinath@novell.com>
776 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
777 Remove 'lvalue_right_side' argument. Move parts to ...
778 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
779 (LocalVariable.DoResolveLValue): ... these.
781 2006-04-21 Raja R Harinath <rharinath@novell.com>
784 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
785 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
786 (LocalVariableReference.DoResolveBase): Use it to implement new
788 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
789 (Argument.Resolve): Simplify. Move CS1510 check ...
790 * ecore.cs (Expression.ResolveLValue): ... here.
791 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
792 (PropertyExpr.DoResolveLValue): Likewise.
793 (FieldExpr.Report_AssignToReadonly): Likewise.
794 (FieldExpr.DoResolve): Add 'out_access' argument. Use
795 LValueMemberAccess or LValueMemberOutAccess on instance depending
797 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
798 DoResolve as appropriate.
800 2006-04-20 Raja R Harinath <rharinath@novell.com>
803 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
804 implicit conversions on 'out' and 'ref' arguments.
806 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
807 improve clarity. Remove dead code.
810 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
811 (Catch.Resolve): Resolve VarBlock if it exists.
813 2006-04-19 Miguel de Icaza <miguel@novell.com>
815 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
816 twice, this was some residual code, the enumerator was emitted
817 properly in the two branche of if later.
819 2006-04-19 Raja R Harinath <rharinath@novell.com>
821 * expression.cs (Cast.ResolveLValue): Remove. The result of a
822 cast is never an lvalue.
823 (Cast.DoResolve, Cast.ResolveRest): Combine.
824 (Argument.Emit): Simplify slightly. Move 'Expr is
825 IMemoryLocation' check ...
826 (Argument.Resolve): ... here.
827 (Argument.Error_LValueRequired): Remove. Inline into only user.
829 Simplifications. Fix cs0191-2.cs
830 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
831 CS1649 and CS1651 to ...
832 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
833 the actual selection of the error code and message to a lookup
834 table. Add a dummy return value to simplify callsites.
835 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
836 readonly fields of other instances of the same type. Move CS0197
838 * expression.cs (Argument.Resolve): ... here. Simplify code.
839 Ensure that ec.InRefOutArgumentResolving is only set during LValue
840 resolution of an out or ref argument. The code simplification
841 above uses this invariant.
843 2006-04-18 Raja R Harinath <rharinath@novell.com>
845 Possibly fix #77752. Fix cs1690-[4-7].cs.
846 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
847 CheckMarshallByRefAccess. Drop parameter.
848 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
850 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
852 * report.cs (AllWarnings): Add CS1690.
853 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
855 (LocalVariableReference.DoResolveBase): Update.
857 2006-04-09 Marek Safar <marek.safar@seznam.cz>
859 * class.cs (MethodOrOperator): Moved common parts from method class.
860 detect obsolete attributes.
861 (Method.Define): Simplified as it reuses code from base.
862 (Constructor.ValidAttributeTargets): Fixed issue found during
864 (Destructor.ValidAttributeTargets): Fixed issue found during
866 (Operator): Finished refactoring set off by #78020. Operator class is now
867 ordinary method class.
869 * anonymous.cs: Updated.
871 * decl.cs (DeclSpace): Add IsGeneric
873 2006-04-09 Marek Safar <marek.safar@seznam.cz>
875 * class.cs (Constructor.Emit): Don't emit the attributes twice.
877 2006-04-09 Marek Safar <marek.safar@seznam.cz>
879 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
880 detect obsolete attributes.
881 (Method.CreateEmitContext): Moved to MethodOrOperator.
883 2006-04-09 Marek Safar <marek.safar@seznam.cz>
886 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
887 customized exception to make crash detection easier.
888 (MethodOrOperator): Started to work on new base class for methods and
890 (Method): Derives from MethodOrOperator.
891 (Constructor.Emit): Emits its own attributes.
892 (AbstractPropertyEventMethod.Emit): Ditto.
893 (Operator): Derives from MethodOrOperator, will refactor fully in extra
895 (Operator.Emit): It's temporary more tricky than should be.
897 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
899 * report.cs (InternalErrorException): Add ctor with inner exception.
901 2006-04-08 Marek Safar <marek.safar@seznam.cz>
904 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
907 2006-04-07 Marek Safar <marek.safar@seznam.cz>
910 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
913 2006-04-06 Marek Safar <marek.safar@seznam.cz>
915 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
916 attribute is present and Guid not.
917 (Interface.ApplyAttributeBuilder): Ditto.
919 * attribute.cs: Add error message.
921 2006-04-06 Marek Safar <marek.safar@seznam.cz>
925 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
926 sources (it's composite) so hold them in extra array as they are used in
927 Emit phase only. It worked in the previous versions by mistake.
928 (Attribute.Emit): Emit attribute for more owners when exist.
930 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
931 it has now different behaviour.
933 2006-04-04 Marek Safar <marek.safar@seznam.cz>
935 * constant.cs (Constant.IsDefaultInitializer): New method.
939 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
940 re-initialize default values. It saves KBs almost for every assembly.
941 Thanks Zoltan for the idea.
942 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
943 (ArrayCreation.DoResolve): Resolve only once.
944 (ArrayCreation.Emit): Emit static initializer only when it is faster.
945 (ArrayCreation.GetAttributableValue): Cope with optimized values.
947 2006-04-03 Zoltan Varga <vargaz@gmail.com>
949 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
952 2006-04-01 Marek Safar <marek.safar@seznam.cz>
954 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
955 in an embedded statement too.
957 2006-04-01 Raja R Harinath <rharinath@novell.com>
960 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
962 2006-04-01 Marek Safar <marek.safar@seznam.cz>
966 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
969 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
971 2006-03-31 Marek Safar <marek.safar@seznam.cz>
973 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
976 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
977 LocalTemporary change.
979 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
981 (ClassOrStruct.DefineFieldInitializers): Implemented static field
982 initializers optimization.
983 (ClassOrStruct.TypeAttr): Moved from modifiers.
984 (Constructor.CheckBase): Don't crash when static ctor has parameters.
985 (FieldBase.ResolveInitializer): Resolves initializer.
986 (FieldBase.HasDefaultInitializer): New property.
988 * cs-parser.jay: Removed message.
990 * expression.cs (CompilerGeneratedThis): New specialization.
992 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
994 2006-03-28 Marek Safar <marek.safar@seznam.cz>
996 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
998 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1000 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1001 be now EnumConstants only.
1003 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1005 * attribute.cs, driver.cs: Reset more caches.
1007 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1009 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1011 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1013 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1014 for easier reuse. Updated all overrides.
1015 (IntegralConstant): New base class for all integral constants.
1016 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1017 of the constant range, report custom error.
1018 (UIntConstant.Reduce): Fixed uint conversion.
1020 * ecore.cs, literal.cs: Reduce updates.
1022 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1026 * class.cs (Constructor.Define): Removed extra if for default ctors.
1027 A patch from Atsushi Enomoto.
1029 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1031 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1032 GetAttributableValue.
1034 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1037 * convert.cs (ImplicitConversionRequired): Error message moved to
1040 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1041 automatic implicit conversion of an output value.
1042 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1044 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1046 (TypeOf.GetAttributableValue): Add extra handling for object type.
1048 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1049 special error message.
1051 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1053 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1055 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1056 compatible with MS runtime.
1058 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1060 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1061 attribute arguments here.
1063 * class.cs (Indexer.Define): The check was moved to attribute class.
1065 2006-03-22 Marek Safar <marek.safar@seznam.cz>
1067 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1068 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1071 2006-03-22 Raja R Harinath <rharinath@novell.com>
1073 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1074 mcs to keep code differences small.
1075 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1076 * typemanager.cs (parameter_default_value_attribute_type): New.
1077 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1080 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1082 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1084 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1086 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1088 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1091 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1093 * doc-bootstrap.cs : fix build.
1095 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1097 * expression.cs (StringConcat.Append): Issue a warning when empty string
1100 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1102 * assign.cs (CompoundAssign.ResolveSource): Removed.
1104 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1107 * class.cs (TypeContainer.FindMethods): Removed.
1108 (TypeContainer.CheckMemberUsage): Made static.
1110 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1112 * constant.cs (CheckRange): Removed unused type argument.
1113 (CheckUnsigned): Removed unused type argument.
1115 * cs-parser.jay: Updated after MemberAccess clean up.
1116 Uses Length for empty string test.
1118 * cs-tokenizer.cs: Uses Length for empty string test.
1119 (IsCastToken): Made static.
1120 (is_hex): Made static.
1121 (real_type_suffix): Made static.
1123 * decl.cs (SetupCache): Made static.
1124 (OnGenerateDocComment): Removed unused ds argument.
1126 * delegate.cs (VerifyDelegate): Removed unused argument.
1128 * doc.cs: Uses Length for empty string test.
1130 * driver.cs: Uses Length for empty string test.
1132 * enum.cs (IsValidEnumType): Made static
1134 * expression.cs (EnumLiftUp): Removed unused argument.
1135 (ResolveMethodGroup): Ditto.
1136 (BetterConversion): Ditto.
1137 (GetVarargsTypes): Ditto.
1138 (UpdateIndices): Ditto.
1139 (ValidateInitializers): Ditto.
1140 (MemberAccess.ctor): Ditto.
1141 (GetIndexersForType): Ditto.
1143 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1145 * iterators.cs: Updated after MemberAccess clean up.
1147 * location.cs: Uses Length for empty string test.
1149 * namespace.cs: Uses Length for empty string test.
1151 * report.cs (CheckWarningCode): Made static.
1153 * statement.cs (LabeledStatement): Removed unused argument.
1155 * typemanager.cs (FilterNone): Removed.
1157 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1159 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1162 * class.cs: Updated.
1164 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1166 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1168 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1172 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1173 reporting, it's more tricky than I thought.
1175 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1179 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1181 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1182 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1183 Add more error reporting; Fixed issue with params.
1185 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1187 * cs-parser.jay: AnonymousMethod requires host container.
1189 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1191 2006-03-18 Raja R Harinath <harinath@gmail.com>
1193 * class.cs: Change 'TypeContainer ds' constructor argument to
1194 'DeclSpace parent'. Some classes were missed below due to
1195 different naming convention.
1197 * class.cs (MemberCore.Parent): Delete. This makes the
1198 ParentContainer changes below enforceable by the compiler.
1200 Treat pointers to enclosing declaration space as 'DeclSpace', not
1202 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1203 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1205 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1207 (Block.AddThisVariable): Likewise.
1208 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1209 (AbstractPropertyEventMethod.Emit): Likewise.
1210 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1211 (GetMethod.Define, SetMethod.Define): Likewise.
1212 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1213 (DelegateMethod.EmitMethod): Likewise.
1215 Fix regression test-partial-13.cs.
1216 Rationalize use of PartialContainer. Ensure that the partial
1217 class semantics can be tied to type-correctness, i.e., any
1218 violation will cause a compile error.
1219 * class.cs, const.cs: Access all fields that belong to class
1220 TypeContainer via ParentContainer. Arguments of EmitContexts and
1221 Resolve()-like functions still use 'Parent'.
1223 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1224 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1225 (PropertyMethod.CheckModifiers): Remove unused argument.
1226 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1229 2006-03-17 Raja R Harinath <harinath@gmail.com>
1231 Make semantics of PartialContainer simpler.
1232 * decl.cs (DeclSpace.IsPartial): Remove.
1233 * class.cs (TypeContainer.IsPartial): Likewise.
1234 (TypeContainer..ctor): Set PartialContainer to point to self.
1235 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1236 (TypeContainer.FindNestedType): Likewise.
1237 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1239 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1241 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1243 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1245 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1248 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1250 * class.cs (Operator.Define): An error for base conversion was not
1253 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1255 * iterator.cs : yield break is allowed in try statement which has
1256 catch clauses. Fixed bug #77767.
1258 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1260 A fix for #77593, #77574.
1262 * class.cs (MethodCore.CheckBase): Another if for operator.
1264 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1266 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1269 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1270 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1273 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1276 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1277 Updated after another emitcontext usage was clean up. It should help us to
1278 synchronize with gmcs easier.
1280 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1284 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1285 (Event.Define): ditto
1286 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1288 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1289 Removed redundant code and set NewSlot for Invoke method too.
1291 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1292 (Parameters.MergeGenerated): New method. Use this method when you merge
1293 compiler generated argument with user arguments.
1295 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1297 * attribute.cs (ResolveAsTypeTerminal): Removed.
1299 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1300 specialization for predefined types; 30% speed up.
1301 Finally placed obsolete check to right place.
1302 (Expression.ResolveType): Removed.
1304 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1305 Updated after ResolveType was removed.
1307 * expression.cs (Cast.ctor): Check void cast.
1308 (Binary.ResolveAsTypeTerminal): Is never type.
1309 (Conditional.ResolveAsTypeTerminal): Is never type.
1311 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1313 2006-03-01 Raja R Harinath <rharinath@novell.com>
1316 * expression.cs (ParameterReference.DoResolveBase): Change return
1318 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1322 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1325 * typemanager.cs (GetFullNameSignature): Don't nullref on
1326 protected accessors.
1328 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1330 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1331 these two separated members to simplify the code.
1332 (Attribute.Resolve): Refactored to use new fields and methods.
1333 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1334 implemented obsolete attribute checking.
1335 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1336 implemented obsolete checking again. It look line never ending quest ;-)
1337 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1339 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1341 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1343 *class.cs (Property.Define): Add RegisterProperty call.
1345 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1346 argument groups (only 2).
1348 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1349 encoding expression to arguments.
1350 (Expression.ExprClassToResolveFlags): Just turned to property.
1352 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1353 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1354 optimized as well as implemented support for zero-length attributes.
1356 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1357 Add caching of PropertyInfo's.
1359 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1361 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1362 error multiple times.
1364 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1366 New partial class implementation.
1367 A fix for #77027, #77029, #77403
1369 * attribute.cs (Attributable): Made attributes protected.
1371 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1372 the replacements of ClassPart and PartialContainer.
1373 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1374 (TypeContainer.AddInterface): Ditto.
1375 (TypeContainer.AddPartial): The main method for partial classes. It checks
1376 for errors and merges ModFlags and attributes. At the end class is added to
1378 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1380 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1381 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1382 from the rest of partial classes.
1383 (TypeContainer.GetClassBases): Simplified.
1384 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1386 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1387 (TypeContainer.HasExplicitLayout): Uses Flags now.
1388 (PartialContainer): Removed.
1389 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1390 (StaticClass): Was merged with Class.
1391 (Class.GetClassBases): class and static class bases are verified here.
1392 (Class.TypeAttr): Added static attributes when class is static.
1393 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1394 (MemberBase): In some cases we need to call parent container for partial
1395 class. It should be eliminated but it's not easy now.
1397 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1399 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1400 partial classed to accumulate class comments.
1401 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1403 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1405 * driver.cs (MainDriver): Tree.GetDecl was removed.
1407 * modifiers.cs (Modifiers): Add partial modifier.
1409 * tree.cs (Tree.decl): Removed.
1410 (RootTypes): Started to use this class more often for root types
1413 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1417 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1418 external interface does not have an attribute.
1420 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1422 Another prerequisites for new partial classs implementation.
1424 * attribute.cs (Attribute.Equal): Implemented.
1425 (Attribute.Emit): Changed as attributes can be applied more than twice.
1426 (Attributes.Emit): Check for duplicate attributes here.
1428 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1429 as a parameter, clean-up.
1431 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1435 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1436 contains obsolete attribute check which can in some cases look for base
1437 type of current class which is not initialized yet.
1438 (TypeContainer.BaseType): Replacement of ptype.
1440 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1442 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1444 First of prerequisites for new partial classs implemention.
1446 * attribute.cs (Attributable): Extended by ResolveContext;
1447 Attributes finally have correct context for resolving in all cases.
1448 (AttachTo): Attribute owner is assigned here.
1450 * codegen.cs (IResolveContext): Introduce new interface to hold
1451 all information needed in resolving phase.
1452 (EmitContext): Implements IResolveContext; more clean-up needed here.
1454 * decl.cs (MemberCore): Implemented IResolveContext.
1456 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1457 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1458 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1459 Refactored to use new IResolveContext instead of EmitContext; cleanup
1461 2006-02-06 Miguel de Icaza <miguel@novell.com>
1463 * codegen.cs (EmitScopeInitFromBlock): check here the
1464 capture_context, there is no need to make two calls to the
1467 * anonymous.cs: Add some debugging messages that might help me
1468 track other instances of this problem in the future (the
1469 regression of test 467).
1471 * cs-parser.jay: track the variable block, as we need to initalize
1472 any captured variables declared in this block for the "catch"
1473 portion of the "Try" statement.
1475 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1476 scope initialization for captured variables.
1478 Also, move the emit for the variables after the block location has
1481 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1483 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1485 2006-02-02 Miguel de Icaza <miguel@novell.com>
1487 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1488 commit yesterday, the initialization for the roots is necessary.
1489 What is not necessary is the scope activation.
1491 2006-02-02 Raja R Harinath <rharinath@novell.com>
1493 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1494 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1496 (Argument.Resolve): Remove CS0206 checks.
1498 2006-02-01 Miguel de Icaza <miguel@novell.com>
1500 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1501 scopes for all the roots, the scopes will now be emitted when the
1502 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1504 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1505 code. This reduces a lot of existing cruft.
1507 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1508 that the ScopeInfo is generated as we enter the scope, not at the
1509 time of use, which is what we used to do before.
1511 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1512 every time a Block is about to be emitted if we have a
1515 2006-02-01 Raja R Harinath <rharinath@novell.com>
1517 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1519 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1521 * typemanager.cs (cons_param_array_attribute): Make private.
1522 (Reset): Set it to null.
1523 (InitCoreHelpers): Don't initialize it.
1524 (ConsParamArrayAttribute): New. Initialize it as needed.
1525 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1527 2006-01-31 Miguel de Icaza <miguel@novell.com>
1529 * expression.cs: There might be errors reported during the
1530 selection of applicable methods. If there are errors, do not
1531 continue execution as it will lead the compiler to crash.
1533 2006-01-30 Miguel de Icaza <miguel@novell.com>
1535 * expression.cs: Member access is not allowed on anonymous
1536 methods. Fixes #77402.
1538 2006-01-30 Raja R Harinath <rharinath@novell.com>
1541 * cs-parser.jay (VariableDeclaration): Don't set
1542 current_array_type to null.
1543 (field_declaration, event_declaration, declaration_statement):
1544 Set it to null here.
1546 2006-01-28 Raja R Harinath <harinath@gmail.com>
1548 * typemanager.cs (GenericParameterPosition): New.
1551 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1553 * doc.cs : To process "include" elements, first we should create
1554 another list than XmlNodeList, because it could result in node
1555 removal, which could result in that the XmlNodeList gives up
1558 (Also made code identical to gmcs again.)
1560 2006-01-25 Miguel de Icaza <miguel@novell.com>
1562 * ecore.cs: Introduce an error report that we were not catching
1563 before, if not silent, we must report the error. Gonzalo ran into
1566 2006-01-23 Miguel de Icaza <miguel@novell.com>
1568 A fix for bug: #76957
1570 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1571 ComputeMethodHost before creating the method, this is a new
1574 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1575 that this method references (RegisterScope). The actual scope
1576 where the method is hosted is computed with the ComputeMethodHost
1577 before we create the method.
1579 Moved the Deepest routine here.
1581 (AnonymousContainer.ComputeMethodHost): New routine used to
1582 compute the proper ScopeInfo that will host the anonymous method.
1584 (ScopeInfo): Deal with multiple roots. The problem was that we
1585 did not have a unique root where all ScopeInfos could be hanged
1586 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1589 Remove AdjustMethodScope which is now computed at the end. Remove
1590 LinkScope which did a partial link, instead link all ScopeInfos
1591 before code generation from the new "LinkScopes" routine.
1593 Simplify all the Add* routines as they no longer need to maintain
1594 the tree, they just need to record that they are using variables
1597 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1598 routines to produce the forest of ScopeInfo trees.
1600 * class.cs (TypeContainer.AppendMethod): This is just like
1601 AddMethod, but ensures that an interface implementation method
1602 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1603 methods, but at the end.
1605 We use this functionality to ensure that the generated MoveNext
1606 method in the iterator class is resolved/emitted before the
1607 enumerator methods created.
1609 This is required because the MoveNext method computes the right
1610 ScopeInfo for the method. And the other methods will eventually
1611 need to resolve and fetch information computed from the anonymous
1614 2006-01-21 Raja R Harinath <harinath@gmail.com>
1615 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1618 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1620 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1621 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1623 2006-01-18 Raja R Harinath <rharinath@novell.com>
1625 Fix #76656, cs0231-2.cs.
1626 * cs-parser.jay (formal_parameter_list): Make error case catch
1628 (parenthesized_expression_0): Add CS1026 check.
1629 (invocation_expression): Remove unused { $$ = lexer.Location }.
1631 2006-01-17 Raja R Harinath <rharinath@novell.com>
1634 * cs-parser.jay (statement_expression): Don't list out the
1635 individual statement-expressions. Convert syntax error into
1638 2006-01-16 Raja R Harinath <rharinath@novell.com>
1641 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1642 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1643 CheckIntermediateModification.
1644 (FieldExpr.DoResolve): Add new two-argument version that
1645 allows us to resolve the InstanceExpression as an lvalue.
1646 The one-argument variant is now just a wrapper.
1647 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1648 Resolve the lhs as an lvalue if the it has a value type.
1649 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1650 from Assign.DoResolve.
1651 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1652 resolved as an lvalue.
1653 (PropertyExpr.DoResolve): Update.
1654 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1655 has a value type. Move CS1612 check here from
1656 CheckIntermediateModification.
1657 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1658 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1659 'right_side' of a ResolveLValue on an 'out' argument.
1660 (EmptyExpression.LValueMemberAccess): New. Used as the
1661 'right_side' of a propagated ResolveLValue on a value type.
1662 (LocalVariableReference.DoResolveBase): Recognize
1663 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1665 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1666 EmptyExpression.Null.
1668 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1670 * typemanager.cs : added IsGenericParameter(). In mcs it always
1672 * doc.cs : for generic parameters, use GenericParameterPosition,
1675 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1677 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1679 2006-01-12 Miguel de Icaza <miguel@novell.com>
1681 This fixes the problem where we used ldfld instead of ldflda to
1682 load the "THIS" pointer on captured parameters, when THIS is a
1683 value type. See bug #77205.
1685 * iterators.cs (CapturedThisReference.Emit): Pass false to
1686 EmitThis (we do not need the address).
1688 * codegen.cs (EmitThis): it needs to know whether we need the
1689 address of `this' or not. This is used by value types.
1691 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1692 every other call passes false.
1694 2006-01-12 Raja R Harinath <rharinath@novell.com>
1697 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1699 * expression.cs (Invocation.OverloadResolve): Update.
1700 (Invocation.DoResolve): Avoid double resolution of invocation.
1702 2006-01-11 Raja R Harinath <rharinath@novell.com>
1705 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1706 unary negation of floating point types as 0-expr; negation cannot
1707 overflow in floating point types.
1710 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1711 on operands of 'void' type.
1714 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1715 and ExclusiveOr for boolean constants too.
1717 2006-01-09 Raja R Harinath <rharinath@novell.com>
1720 * expression.cs (Invocation.OverloadResolve): Replace reflected
1721 override methods with their base virtual methods, rather than
1723 * typemanager.cs (TypeManager.GetOverride): New.
1725 2006-01-05 Jb Evain <jbevain@gmail.com>
1727 * class.cs (Property.Define, Indexer.Define): do not tag the
1728 properties as SpecialName | RTSpecialName.
1730 2006-01-04 Miguel de Icaza <miguel@novell.com>
1732 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1733 doing a low-level comparission of parameter types. It was lacking
1734 a check for __argslist.
1736 2005-12-30 Miguel de Icaza <miguel@novell.com>
1738 * expression.cs (ParameterReference.DoResolveBase): Allow
1739 reference parameters if they are local to this block.
1741 This allows the ref and out parameters of a delegate to be used in
1742 an anonymous method, for example:
1744 delegate void set (out int x);
1746 set s = delegate (out int x){
1750 This is used by functionality introduced late in the C# language.
1752 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1753 method that take ref and out parameters.
1755 Fixes #77119 which was a late change in the spec.
1757 2005-12-23 Miguel de Icaza <miguel@novell.com>
1759 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1760 parent if its the same scope. Fixes #77060.
1762 2005-12-21 Miguel de Icaza <miguel@novell.com>
1764 * driver.cs: Report the case of no source files and no -out:
1767 2005-12-20 Raja R Harinath <rharinath@novell.com>
1770 * expression.cs (ComposedCast.GetSignatureForError): Define.
1772 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1776 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1777 ListDictionary, to contain the ExternAliasEntry entries (in
1778 addition to the NamespaceEntry.aliases hashtable). This field is
1779 shared between the original entry and its doppelganger (bodyless
1781 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1782 extern_aliases field.
1783 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1784 lookup in extern_aliases.
1786 2005-12-16 Raja R Harinath <rharinath@novell.com>
1789 * class.cs (TypeContainer.Mark_HasEquals): New.
1790 (TypeContainer.Mark_HasGetHashCode): New.
1791 (ClassPart): Override them.
1792 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1795 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1796 'parent' argument to the base constructor.
1798 Remove all mention of TypeContainer from decl.cs.
1799 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1800 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1801 (DeclSpace.DeclSpace): Likewise.
1802 (DeclSpace.DefineMembers): Remove unused argument.
1803 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1804 debugging check -- we don't care if the debug code throws an
1805 InvalidCastException instead of an InternalErrorException.
1806 * class.cs (TypeContainer.DefineMembers): Update to changes.
1807 (TypeContainer.DoDefineMembers): Likewise.
1808 (TypeContainer.GetMethods): Likewise.
1809 (PropertyMember.Define): Likewise.
1810 (MemberBase.Parent): New property that forwards to
1811 MemberCore.Parent, but ensures that we get a TypeContainer.
1812 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1813 (RootContext.PopulateTypes): Likewise. Remove special case code
1814 for !RootContext.StdLib: DefineMembers is idempotent.
1816 2005-12-14 Miguel de Icaza <miguel@novell.com>
1818 * convert.cs (ExplicitConversionCore): Check the return value from
1819 ExplicitConversionCore which can return null on failure. Fixes #76914
1821 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1823 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1825 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1827 * doc.cs : The search for referenced namespace was insufficient to
1828 get global one as it used to do. Fixed bug #76965.
1830 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1832 * doc.cs : check name in cref in the last phase that whether it is
1835 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1837 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1840 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1842 * doc.cs : so it turned out that we cannot skip override check for
1843 interface members. Fixed bug #76954.
1845 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1847 * cs-tokenizer.cs : fixed bug #75984:
1848 - #warning and #error should not be handled when the source line
1850 - #line is not checked strictly when the source line is disabled.
1851 - #define and #undef is on the other hand checked strictly at any
1854 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1856 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1859 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1861 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1863 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1865 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1866 (FieldBase.Initializer): Initializer is now optional.
1867 (EventField.Define): Only event field can have initializer.
1869 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1871 * const.cs (Const): Reuse initializer.
1873 * cs-parser.jay: Updated after FieldBase changes.
1874 Added current_array_type to simplify array initializers.
1876 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1878 * expression.cs, iterators.cs: Updated.
1880 * namespace.cs (NamespaceEntry): Made UsingFound private.
1882 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1884 * parameterCollection.cs: Obsolete, removed.
1885 * parser.cs: Obsolete, removed.
1887 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1890 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1892 * enum.cs (Enum.Define): Set obsolete context here.
1894 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1897 - FindDocumentedMember() now expects 1) paramList as null
1898 when "we don't have to check the number of parameters" and
1899 2) Type.EmptyTypes when "there is no arguments".
1900 - Introduced FoundMember struct to hold the exact type which was
1901 used to find the documented member (the above change broke
1902 test-xml-044; it might be better just to use DeclaringType than
1903 what MS does, like this change does, but it depends on usage.)
1905 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1907 * doc.cs : documented member might be from DeclaringType for nested
1908 types. Fixed bug #76782.
1910 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1912 * anonymous.cs: Have the param code handle leaving copies on the
1913 stack etc. Allows anonymous params to take part in the assignment
1914 code (++, +=, etc). Fixes bug #76550
1916 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1917 it down to the anon code.
1919 * iterators.cs: Use dummy var here
1921 * codegen.cs: Handle new vars
1923 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1926 * class.cs (MethodData.Define): Set proper Obsolete context.
1928 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1930 (FieldExpr.DoResolve): Ditto.
1932 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1935 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1936 parent is not obsolete.
1938 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1940 * doc.cs : (FindDocumentedMember) find parameterless members first
1941 and get CS0419 in the early stage. Fixed first case of bug #76727.
1943 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1946 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1947 no error was reported.
1949 *expression.cs (Binary.DoResolve): left can be null.
1951 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1954 * class.cs (MethodData.Emit): Parameters should be labeled first.
1956 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1959 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1961 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1963 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1965 * class.cs (MethodCore): Parameter clean up.
1966 (IMethodData): Added ParameterInfo.
1967 (MethodData): Parameter clean up.
1968 (Indexer.Define): Parameter clean up.
1980 * typemanager.cs: Parameter clean up.
1982 * delegate.cs (Define): Get rid of duplicated code.
1984 * expression.cs (ParameterReference): Removed useless parameters
1986 (Invocation): Ditto.
1988 * parameter.cs (ParamsParameter): New class, params specialization.
1989 (ArglistParameter): Attemp to separate arglist.
1990 (Parameter): Refactored to be reusable and faster.
1991 (Parameter.Modifier): Made understandable.
1992 (Parameters): Changed to be used as a class for `this' assembly
1993 parameters. Refactored to use new specialized classes.
1995 * support.cs (ParameterData): Added Types property.
1996 (InternalParameters): Deleted.
1998 2005-08-20 Martin Baulig <martin@ximian.com>
2000 Merging this patch from GMCS to fix #75867.
2002 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2003 scope if we don't already have it.
2005 2005-11-17 Martin Baulig <martin@ximian.com>
2008 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2009 inherit the scope from our parent. Fixes #76653.
2011 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2013 * doc.cs : the previous patch does not actually fix the bug.
2014 PropertyInfo override check is now implemented and really fixed it.
2015 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2017 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2019 * doc.cs : apply "override filter" also to properties.
2022 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2024 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2025 no need to check overrides. For classes, omit those results from
2026 interfaces since they must exist in the class. Fixed bug #76726.
2028 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2030 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2031 with different parameters. Fixed the second problem in #76685.
2033 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2035 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2036 get expected 'protected' access in CheckValidFamilyAccess()).
2039 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2041 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2042 Fixed bug #76705. CS1569 was incorrectly commented out.
2044 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2046 * doc.cs : use Invocation.IsOverride() to do real override check.
2047 * expression.cs : made Invocation.IsOverride() internal.
2049 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2051 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2052 TypeBuilder.FindMembers() and filter overriden base members out.
2055 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2057 * doc.cs : ref/out parameters are represented as '@' (instead of
2058 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2060 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2062 * doc.cs : when there was no '.' in cref to methods in doc comment,
2063 then parameters were missing in the output. Fixed bug #76691.
2065 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2067 * driver.cs : don't output docs when there is an error.
2070 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2073 Now it should detect indexers. Fixed primary concern in bug #76685.
2074 Fixed CS0419 message to not show the identical member signature in
2077 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2079 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2080 instead of Type.FindMembers() since it does not handle events.
2083 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2085 * codegen.cs: Fixed typo (speficied -> specified).
2087 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2090 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2092 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2094 * attribute.cs: Changed error message.
2096 * cs-tokenizer.cs: One more check.
2098 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2100 * statement.cs (Block.Resolve): Ignore empty statement.
2102 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2104 * report.cs: Made error/warning methods more strict to avoid
2107 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2108 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2109 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2110 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2112 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2114 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2115 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2117 * class.cs (TypeContainer.IsComImport): New property.
2118 (Constructor.Define): Create proper ctor for ComImport types.
2120 * expression.cs (New.CheckComImport): Fixed.
2122 2005-11-07 Miguel de Icaza <miguel@novell.com>
2124 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2125 that a parameter has been captured does not mean that we do not
2126 have to do the rest of the processing. This fixes the second part
2127 of #76592. If there was another anonymous method capturing
2128 values in the past, the Scope would never be set for the second
2129 method that captured the same parameter.
2131 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2132 properly manipulate the stack. Second part of fix for #76592.
2134 * expression.cs (New): Add support for invoking "new" on
2135 interfaces that have been flagged with the ComImport attribute and
2136 the CoClass. Fixes #76637
2138 * statement.cs (Try.DoEmit): When a variable is captured, do not
2139 try to emit the vi.LocalBuilder variable as it has been captured.
2140 Create a temporary variable and store the results on the
2141 FieldBuilder. Fixes #76642
2143 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2145 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2147 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2149 * expression.cs (Binary.DoResolve): Added && optimalization.
2151 * typemanager.cs (AddUserType): Removed useless argument.
2153 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2155 * statement.cs (Block.variables): Uses ListDictionary.
2157 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2160 * class.cs (PartialContainer.EmitType): Customized to emit
2161 security attributes.
2162 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2163 for partial classes.
2165 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2168 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2169 access has to be fixed.
2171 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2173 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2176 * ecore.cs (NullCast.Reduce): Implemented.
2178 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2181 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2183 (Foreach.Resolve): Catch null properly.
2185 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2187 * cs-tokenizer.cs: Warning text fix.
2189 * driver.cs: AllWarningNumbers exposed on public interface.
2191 * report.cs (): Reviewed warning numbers.
2192 (IsValidWarning): Use binary search.
2194 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2196 * driver.cs: Implemeted resource visibility.
2197 (Resources): New class for code sharing between /res: and
2200 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2203 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2206 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2209 * ecore.cs (NullCast): Child is contant only.
2211 * literal.cs (NullLiteral.Reduce): null can be converted to any
2214 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2216 * driver.cs: Use Encoding.Default as default code page instead
2219 2005-10-27 Raja R Harinath <rharinath@novell.com>
2222 * expression.cs (Invocation.Error_InvalidArguments): Handle
2223 __arglist parameters.
2224 (Invocation.VerifyArgumentsCompat): Likewise.
2225 * support.cs (ReflectionParameters.GetSignatureForError): Print
2226 __arglist parameters.
2227 (InternalParamters.GetSignatureForError): Likewise.
2228 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2230 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2232 * attribute.cs (GetPropertyValue): Made public.
2234 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2236 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2238 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2241 * driver.cs: Reflect method name change.
2243 * statement.cs (Try.Resolve): Warn when try has both general
2246 * typemanager.cs: runtime_compatibility_attr_type new predefined
2249 2005-10-26 Raja R Harinath <harinath@gmail.com>
2252 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2253 treat it as an empty parameter list.
2255 2005-10-26 Raja R Harinath <rharinath@novell.com>
2258 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2259 ResolveAsTypeStep silent.
2260 * statement.cs (Block.AddConstant): Mark block as used.
2261 (Block.ResolveMeta): Avoid piling on error messages
2262 if a constant initializer resolution fails.
2264 2005-10-25 Raja R Harinath <rharinath@novell.com>
2266 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2268 (NamespaceEntry.VerifyAllUsing): New.
2269 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2270 behaviour. Delegates actual resolution of alias to ...
2271 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2272 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2274 * driver.cs (Driver.MainDriver): Update.
2276 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2277 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2279 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2281 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2282 RootNamespace.DefineNamespacesForAll.
2284 2005-10-24 Raja R Harinath <harinath@gmail.com>
2286 * typemanager.cs (assemblies, external_aliases, modules)
2287 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2288 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2289 overhead. Move resposibility ...
2290 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2291 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2293 2005-10-23 Raja R Harinath <harinath@gmail.com>
2295 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2296 cached_namespaces. Improve usage.
2297 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2298 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2299 Move from GlobalRootNamespace and simplify.
2300 (RootNamespace.Global): Make instance variable.
2301 (RootNamespace.RootNamespace): Add "alias name" parameter.
2302 (GlobalRootNamespace): Simplify drastically.
2303 (Namespace.Lookup): Don't use GetNamespace.
2304 * typemanager.cs (GetRootNamespace): Rename from
2305 ComputeNamespaceForAlias.
2306 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2308 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2310 * anonymous.cs (AnonymousContainer): Don't crash when container
2313 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2315 * expression.cs (Binary.DoResolve): Warn when comparing same
2318 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2321 * expression.cs (Binary.DoResolve): It looks like there are no
2322 convetsion rules in enum context.
2324 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2326 Add support for extern alias qualifiers.
2327 * typemanager.cs: Move some LookupTypeReflection code
2328 to namespace.cs, to have cleaner code. Added some methods
2329 to help us keep track of the extern aliased references.
2330 * driver.cs: Add suport for extern alias assemblies on command
2331 line and check for their warnings/errors. Also keep track of the
2332 extern aliased assemblies.
2333 * namespace.cs: Move the global functionality of Namespace
2334 to GlobalRootNamespace/RootNamespace. Now the global namespace
2335 is GlobalRootNamespace.Globa. Also the code moved from
2336 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2337 Finally added LocalAliasEntry (AliasEntry before) and
2338 ExternAliasEntry, to handle alias statements.
2339 * cs-parser.jay: Add support in the grammar for extern alias
2341 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2342 Update callings to Namespace (now in GlobalRootNamespace).
2344 2005-10-18 Raja R Harinath <rharinath@novell.com>
2347 * class.cs (TypeContainer.DefineType): Move updating of
2348 topological sort earlier in the code.
2349 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2351 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2354 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2356 * constant.cs (Constant.TryReduce): Moved from Cast class.
2357 (Reduce): Made little bit more OO and fixed missing conversions.
2359 * ecore.cs (Reduce): Implemented.
2360 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2362 * literal.cs (Reduce): Implemented.
2364 * class.cs: Reverted Miguel's wrong commit.
2366 2005-10-14 Miguel de Icaza <miguel@novell.com>
2368 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2370 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2372 * cs-parser.jay, expression.cs : CS0214 was missing error location
2373 for constants. Fixed bug #76404.
2375 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2378 * convert.cs (ExplicitConversionCore): Fixed object->enum
2381 2005-10-10 Raja R Harinath <rharinath@novell.com>
2383 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2385 (PropertyExpr.EmitCall): Likewise.
2386 * expression.cs (Invocation.EmitArguments): Handle case where
2388 (Invocation.EmitCall): Avoid allocating temporary variable if
2389 there are no arguments.
2391 2005-10-07 Raja R Harinath <rharinath@novell.com>
2394 * convert.cs (ImplicitConversionStandard): Move conversion of
2395 void* to arbitrary pointer types ...
2396 (ExplicitConversionStandard): .. here.
2397 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2398 error to always print typenames.
2400 2005-10-07 Raja R Harinath <rharinath@novell.com>
2402 * convert.cs (GetConversionOperator): Rename from
2403 GetConversionOperators. Move operator selection code from ...
2404 (UserDefinedConversion): ... here.
2406 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2408 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2411 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2413 * assign.cs (Assign.DoResolve): Error method changed.
2415 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2417 * const.cs (ResolveValue): Reset in_transit immediately.
2419 * constant.cs: Error method changed.
2421 * convert.cs: Removed useless location parameter.
2422 (ExplicitNumericConversion): Don't do double enum check.
2423 (ExplicitConversionCore): Renamed from ExplicitConversion.
2424 (ExplicitUnsafe): Extracted from ExplicitConversion.
2425 (ExplicitConversion): Uses for error reporting.
2427 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2429 (ResolveBoolean): Uses common error method.
2430 (CastToDecimal): Get rid of ec.
2431 (CastFromDecimal): Optimized.
2432 (ConvCast): Get rid of ec.
2434 * enum.cs (ResolveValue): Reset in_transit immediately.
2435 (Emit): Return after first error.
2437 * expression.cs: Convert changes.
2439 * literal.cs: Error method changed.
2441 * statement.cs: Error method changed.
2443 2005-10-03 Raja R Harinath <rharinath@novell.com>
2445 * support.cs (SeekableStreamReader.Position): Don't error out when
2446 the requested position is just beyond the end of the current
2449 2005-09-28 Raja R Harinath <rharinath@novell.com>
2451 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2452 try to keep in sync with the byte count of the underlying Stream.
2453 However, this limits us to a window size of 2048 characters: i.e.,
2454 the maximum lookahead of our lexer/parser can be 2048 characters.
2456 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2459 * driver.cs: Fix compilation files with full root path.
2461 2005-09-25 Miguel de Icaza <miguel@novell.com>
2463 * report.cs (SymbolRelatedToPreviousError): Format the output so
2464 it does not use an open parenthesis that is never closed.
2466 * driver.cs: Follow coding guidelines
2468 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2471 * const.cs (Const.ResolveValue): Check for assigning non-null
2472 value to reference type.
2474 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2476 * anonymous.cs: Implemented ExprClassName.
2478 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2481 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2484 * class.cs (StaticClass.DefineContainerMembers): Report protected
2487 * codegen.cs: if(ed) PRODUCTION.
2489 * convert.cs (Error_CannotImplicitConversion): Better error
2492 * cs-parser.jay: More error checks.
2494 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2496 * driver.cs (CSCParseOption): Enabled wrong option check.
2498 * ecore.cs (Expression.ExprClassName): Turned to property.
2499 (MemberExpr.CheckIntermediateModification): For checking boxed
2500 value types modification.
2502 * statement.cs (Fixed.Resolve): Expression type must be
2503 convertible to fixed type.
2504 (CollectionForeach.GetEnumeratorFilter,TryType):
2505 Small refactoring for easier error checking.
2507 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2509 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2512 * class.cs (GeneratedBaseInitializer): New class for customization
2513 compiler generated initializers.
2514 (MemberBase.DoDefine): Check Obsolete attribute here.
2515 (FieldMember.DoDefine): Ditto.
2517 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2520 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2521 (MemberCore.GetObsoleteAttribute): Removed argument.
2522 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2523 (MemberCore.CheckObsoleteType): New helper.
2527 * statement.cs: Updates after MemberCore changes.
2529 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2530 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2532 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2533 obsolete attribute for compiler construct.
2534 (As.DoResolve): Cache result.
2536 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2538 2005-09-26 Raja R Harinath <rharinath@novell.com>
2541 * expression.cs (This.VerifyFixed): In a value type T, the type of
2542 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2543 value type R, 'this' is treated as a value parameter.
2545 2005-09-22 Miguel de Icaza <miguel@novell.com>
2547 * statement.cs (Lock): Use the TemporaryVariable class instead of
2548 manually using local variables as those do not work when variables
2551 * ecore.cs: Moved the TemporaryVariable class from being a nested
2552 class inside Foreach to be a public class that can be employed in
2555 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2557 * cs-parser.jay: interface_accessors replaced by
2558 accessor_declarations.
2560 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2563 * statement.cs (GotoCase.Resolve): Convert null constant to
2565 (SwitchLabel.ResolveAndReduce): Ditto.
2566 (SwitchLabel.NullStringCase): Custom null stamp.
2567 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2569 typemanager.cs (CSharpSignature): Don't skip first argument
2572 2005-09-18 Miguel de Icaza <miguel@novell.com>
2574 * driver.cs: Set InEmacs based on the environment variable EMACS.
2576 * location.cs (InEmacs): in this mode, do not report column
2577 location as it confuses Emacs.
2579 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2581 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2582 expression.cs, iterators.cs, literal.cs: Store constants and
2585 * class.cs (MemberBase.ShortName): Pass location.
2587 * cs-parser.jay: Some location fixes.
2589 * ecore.cs (Expression.Location): Made virtual.
2591 2005-09-05 Miguel de Icaza <miguel@novell.com>
2593 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2594 if the underlying types are the same, otherwise we need to produce
2595 code that will do the proper cast.
2597 This was exposed by Marek's constant rewrite which produced
2598 invalid code for the call site:
2601 void Method (X v) {}
2605 This fixes test-49.cs
2607 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2609 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2610 Type/Object should be allowed as well. Fixed bug #75968.
2612 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2614 * expression.cs : (Binary.DoResolve): when one is enum constant and
2615 another is constant 0, then return enum one *as enum type*.
2618 2005-09-02 Raja R Harinath <rharinath@novell.com>
2620 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2624 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2625 flow-branching for LocalVariableReferences in case we were invoked
2626 from a MemberAccess.
2627 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2629 (LocalVariableReference.DoResolveBase): ... this.
2630 (MemberAccess.Resolve): Do the check that was disabled during
2633 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2636 (PartialContainer.Create): check abstract/sealed/static strictly
2637 but abstract/sealed can exist only at one side. Fixed bug #75883.
2639 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2642 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2643 specified, don't default to UnmanagedType.I4.
2645 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2647 * expression.cs : conditional operator should check possibly
2648 incorrect assign expression. Fixed bug #75946.
2650 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2652 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2653 Reverting the change. gmcs is much complex than mcs on this matter.
2655 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2657 * cs-tokenizer.cs : To read another token ahead of the actual
2658 consumption, use new SavedToken and cache token instead of moving
2659 back the stream with SeekableStreamReader (it seemed problematic).
2661 driver.cs : Thus use StreamReader directly.
2662 * support.cs : Thus removed SeekableStreamReader.
2664 2005-08-30 Raja R Harinath <rharinath@novell.com>
2667 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2668 (ScopeInfo.EmitScopeType): Use it to construct field names from
2669 names of captured locals.
2672 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2673 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2674 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2675 (ExplicitConversion): Remove enum cases already handled by
2676 implicit conversion. Move implicit conversion check to the beginning.
2677 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2678 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2679 Don't treat System.Enum as a struct.
2681 2005-08-30 Jb Evain <jbevain@gmail.com>
2683 * attribute.cs: handles as expression in parameters.
2685 2005-08-30 Raja R Harinath <rharinath@novell.com>
2688 * class.cs (TypeContainer.VerifyClsName): Don't use a
2689 PartialContainer when verifying CLS compliance.
2690 (AbstractPropertyEventMethod): Set Parent here, ...
2691 (PropertyMethod): ... not here.
2693 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2695 * attribute.cs : escaped attribute name should not be allowed to be
2696 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2698 2005-08-29 Raja R Harinath <rharinath@novell.com>
2701 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2702 when converting a long constant to unsigned long.
2703 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2704 detect where IsApplicable and VerifyArgumentsCompat disagree.
2706 2005-08-29 Raja R Harinath <rharinath@novell.com>
2707 and Carlos Alberto Cortez <carlos@unixmexico.org>
2710 * class.cs (TypeContainer.CanElideInitializer): New helper.
2711 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2712 can safely emitting the initializer of a field.
2714 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2716 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2717 allowed inside a switch (without loop). Fixed bug #75433.
2719 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2721 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2722 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2724 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2726 * driver.cs : kinda reverting the default encoding changes (not exact
2727 revert since I noticed that "codepage:reset" might not work fine).
2729 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2731 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2732 Location. Now getter and setter store location correctly.
2733 (errors/cs0111-12.cs now reports the expected location.)
2735 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2737 * driver.cs : Use default encoding on the environment.
2738 Removed (now that) extra parameter for SeekableStreamReader.
2739 * support.cs : (SeekableStreamReader) third .ctor() argument for
2740 StreamReader is not required (always true). preamble size could
2741 be acquired in simpler and safe way.
2743 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2745 * cs-parser.jay: report CS0642 at warning level 3
2746 and report CS0642 for an if else statement also
2747 fixes bug #74745. Patch by John Luke (and a bit
2749 Removed extra CS0642 warning check for "while",
2751 * statement.cs: In Block.Resolve(), CS0642 check
2752 is reimplemented to check a sequence of an empty
2753 statement and a block.
2755 Both fix bug #66777.
2757 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2759 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2760 detection until I fix it.
2762 * cs-tokenizer.cs: Changed error message.
2764 * cs-parser.jay: Fixed 2 error locations.
2766 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2767 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2770 * enum.cs (GetSignatureForError): Fixed.
2772 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2776 * typemanager.cs (RegisterProperty): Removed.
2778 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2780 2005-08-24 Raja R Harinath <rharinath@novell.com>
2783 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2784 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2786 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2788 * expression.cs : tiny fix is required for not warning positive ulong.
2791 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2793 * expression.cs : add CS0652 check for constant and integral
2794 expression. Fixed bug #53974.
2796 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2798 * expression.cs : in DoNumericPromotions(), check if there is implicit
2799 conversion overload for string (to check CS0034). Fixed bug #52492.
2801 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2803 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2805 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2807 * ecore.cs : report location when it is *not* Null.
2809 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2815 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2816 correctly. Fixed bug #75721.
2818 2005-08-23 Raja R Harinath <rharinath@novell.com>
2820 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2821 loop that performs 'min (pos, char_count)'.
2824 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2825 converted value in Operator.OnesComplement.
2827 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2829 * anonymous.cs: If the anon method is pulled into a helper class,
2830 it needs to be `internal' not `private'. Fixes runtime behavior on
2833 2005-08-20 Martin Baulig <martin@ximian.com>
2835 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2836 scope if we don't already have it.
2838 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2839 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2842 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2845 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2848 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2850 The big constants rewrite
2851 Fix #75746, #75685 and more
2852 As a side effect saved 1MB for MWF ;-)
2854 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2855 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2856 enum based for corlib compilation.
2858 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2861 * class.cs (FixedField.Define): Use ResolveAsConstant.
2863 * const.cs (IConstant): Interface constants and enums.
2864 (Const.ResolveValue): New method for constant resolvning.
2865 (ExternalConstant): Constants from imported assemblies.
2867 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2868 conversion; like enums.
2869 (Constant.ToType): Converts this constant to different type.
2870 (Constant.Increment): Adds 1.
2872 * convert.cs (ImplicitConversionRequired): Simplified.
2874 * cs-parser.jay: Create EnumMember directly.
2876 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2878 * doc.cs (GenerateEnumDocComment): Removed.
2880 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2881 (ConvertIntLiteral): Removed.
2882 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2884 * enum.cs (EnumMember): Implement IConstant.
2885 (Enum.IsValidEnumConstant): Removed.
2886 (Enum.GetNextDefaultValue): Removed.
2887 (Enum.FindMembers): Updated.
2888 (Enum.GenerateDocComment): Iterate enum members.
2890 * expression.cs (Cast.TryReduce): Handle enums correctly.
2891 (New.Constantify): Made public.
2892 (MemberAccess.DoResolve): Removed contant specific if(s).
2894 * literal.cs (NullLiteral): Implement new abstract methods.
2896 * statement.cs (GotoCase.Resolve): Use new constant methods.
2897 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2899 * typemanager.cs (LookupEnum): Removed.
2900 (IsEnumType): Fixed to work with corlib.
2901 (RegisterConstant): Removed.
2902 (LookupConstant): Removed.
2903 (GetConstant): Changed to work with IConstant.
2905 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2907 * location.cs : Fixed overflown (>255) column number.
2909 2005-08-03 Raja R Harinath <rharinath@novell.com>
2911 First cut of the qualified-alias-member feature.
2912 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2914 * cs-parser.jay (DOUBLE_COLON): New token.
2915 (namespace_or_type_name): Add rule for recognizing
2916 qualified-alias-members.
2917 (primary_expression): Likewise.
2918 (element_access): Allow QualifiedAliasMember as a possible
2919 type-bearing expression.
2920 (local_variable_type, local_variable_pointer_type): Likewise.
2921 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2922 aliases in the current and enclosing namespace declarations.
2923 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2924 * decl.cs (MemberName.is_double_colon): New.
2925 (MemberName.MemberName): Add new constructor for alias-member.
2926 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2927 * expression.cs (QualifiedAliasMember): New expression type.
2929 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2931 * location.cs : it borked when no argument was specified.
2933 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2935 * location.cs : tiny ToString() format fix.
2937 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2939 * statement.cs : oops, it was missing.
2941 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2943 A set of fixes for precise line/column location.
2946 "token" field now holds a file/line "delta", a line number offset
2947 from the segment, and a column number. See also:
2948 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2949 December/009508.html
2950 Removed static IsNull. Use instance IsNull property instead.
2952 For some tokens it stores Location. For Identifier it stores
2953 LocatedToken which is a pair of string name and location.
2954 Column numbers are adjusted only at getChar().
2956 Use Location.ToString() for reporting (it now contains column).
2958 Largely modified to use LocatedToken instead of
2959 string (IDENTIFIER), and to acquire Location from some tokens.
2960 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2961 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2963 Now MemberName holds Location. DeclSpace.ctor() receives Location
2964 as a parameter. Removed extra parameters to all derived classes.
2965 Replaced Location.IsNull() with instance property.
2966 * assign.cs, expression.cs :
2967 Added .ctor() overload that omits Location.
2969 Added "nameEscaped" flag that indicates the identifier was escaped
2970 in the source file. This fixes bug #57047.
2972 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2974 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2975 New method, looking for lo-case imported cls type.
2977 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2980 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2982 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2984 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2986 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2988 Optimized to save 3.5 MB for SWF compilation.
2990 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2992 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2993 (PartialContainer.Create): Moved logic AddToContainer.
2994 (PartialContainer.MarkForDuplicationCheck): Shares name.
2996 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2999 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3001 (Namespace.GetSignatureForError): New method.
3003 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3004 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3006 2005-08-01 Raja R Harinath <rharinath@novell.com>
3009 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3010 member lookup rather than qualifier_type, since qualifier_type can
3013 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3015 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3018 2005-07-31 Miguel de Icaza <miguel@novell.com>
3020 * statement.cs: Copy the local exception into the exception
3021 captured local. Fixes 75674
3023 2005-07-31 Raja R Harinath <harinath@gmail.com>
3026 * expression.cs (Invocation.OverloadResolve): Don't report error
3027 CS1501 if error CS1502 has been reported.
3028 (New.DoResolve): Delegate CS1501 reporting to
3029 Invocation.OverloadResolve.
3032 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3033 invariant-meaning-in-block property in an enclosing block if
3036 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3038 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3039 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3040 (Switch.CheckSwitch): Just save 50kb for SWF.
3042 2005-07-27 Martin Baulig <martin@ximian.com>
3044 * anonymous.cs (CaptureContext.AddField): Added
3045 `AnonymousContainer am' argument; compute its toplevel scope if
3046 it's not already computed. Fixes #75649.
3048 2005-07-26 Raja R Harinath <rharinath@novell.com>
3051 * class.cs (Constructor.Emit): Reset block to null if the block
3054 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3056 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3058 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3060 * class.cs (MethodData.Define): Check whether accessor implementing
3061 interface is public.
3063 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3065 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3068 * namespace.cs (LookupType): Moved same type check to...
3070 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3073 2005-07-21 Raja R Harinath <rharinath@novell.com>
3075 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3076 already found a typebuilder.
3077 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3078 MemberNames, not strings.
3080 * const.cs (Error_ExpressionMustBeConst):
3081 Rename from Error_EpressionMustBeConst.
3082 * const.cs, class.cs, statement.cd: Update.
3084 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3088 * const.cs (Const.LookupConstantValue): Report missing contant expression
3090 (Error_EpressionMustBeConstant): Only one error method.
3092 * class.cs, statement.c: Updated.
3094 2005-07-20 Raja R Harinath <rharinath@novell.com>
3096 * statement.cs (Block.Flags): Add back HasVarargs.
3097 (Block.flags): Make protected.
3098 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3100 * typemanager.cs (types, typecontainers, user_types): Remove.
3101 (UserTypes, TypeContainers): Likewise.
3102 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3103 (CleanUp, Reset): Update.
3104 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3105 (GetNestedType): Use Type.GetNestedType.
3106 (CoreLookupType): Take two arguments, the namespace and the
3107 basename of the type. Update to use the Namespace.Lookup
3109 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3110 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3111 string concatenation and substring matches.
3112 * class.cs, enum.cs, delegate.cs: Update to changes.
3114 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3116 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3117 Expression and made virtual.
3119 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3120 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3122 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3124 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3127 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3130 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3133 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3134 AssemblyCultureAttribute is not used on executable.
3137 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3139 2005-07-16 Raja R Harinath <rharinath@novell.com>
3142 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3143 New. Reports CS0252/CS0253.
3144 Mostly taken from preliminary patch by Duncak Mak.
3145 (Binary.DoResolveOperator): Store results of operator lookup.
3146 Use them to detect if we need to warn about unintended reference
3149 2005-07-15 Raja R Harinath <rharinath@novell.com>
3152 * namespace.cs (Namespace.Lookup): Add back location parameter.
3153 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3154 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3156 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3157 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3158 (Namespace.LookupType): ... this.
3159 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3161 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3162 purported to handle pointers.
3163 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3166 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3168 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3171 2005-07-15 Raja R Harinath <rharinath@novell.com>
3173 * namespace.cs (Namespace.Lookup): Drop location parameter.
3174 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3175 (NamespaceEntry.Lookup): ... this.
3176 (NamespaceEntry.Error_AmbiguousTypeReference):
3177 Move here from DeclSpace.
3178 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3180 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3181 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3182 Move to NamespaceEntry.
3183 * delegate.cs, expression.cs: Update to changes.
3185 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3187 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3188 CheckAttributeType and refactored.
3189 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3190 ResolveAsTypeTerminal error handling.
3191 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3193 (GetSignatureForError): Print errors in same way.
3196 * codegen.cs: Reflect attribute GetSignatureForError change.
3199 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3201 * namespace.cs (UsingEntry): Refactored to make fields private.
3204 statement.cs: Error_UnexpectedKind has extra parameter.
3206 2005-07-14 Raja R Harinath <rharinath@novell.com>
3208 * ecore.cs (IAlias): Remove.
3209 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3210 that implement the interface.
3211 * namespace.cs (Namespace): Likewise.
3212 (Namespace.declspaces): Renamed from 'defined_names'.
3213 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3214 DeclSpace instead of an IAlias.
3215 * tree.cs (Tree.AddDecl): Update.
3217 2005-07-12 Raja R Harinath <rharinath@novell.com>
3219 * statement.cs (Block.Flags); Remove HasVarargs.
3220 (Block.HasVarargs): Move to ToplevelBlock.
3221 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3222 (Block.Variables): Make protected. Initialize variable hashtable
3224 (Block.AddVariable): Update.
3225 (Block.Resolve): Update to changes.
3226 (ToplevelBlock.HasVarargs): New boolean.
3227 (ToplevelBlock.ThisVariable): Move here from Block.
3228 (ToplevelBlock.AddThisVariable): Likewise.
3229 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3230 * expression.cs (This.ResolveBase): Update to changes.
3231 (ArglistAccess.DoResolve): Likewise.
3233 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3236 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3238 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3239 not used and not used & assigned.
3240 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3242 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3245 * expression.cs (Is.DoResolve): null is never provided type.
3247 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3250 * cs-parser.jay: Less strict event error rule to catch more errors.
3252 2005-07-08 Martin Baulig <martin@ximian.com>
3254 Fix test-iter-10.cs - distinguish whether we `yield' in a property
3255 gettter (allowed) or setter (not allowed).
3257 * class.cs (Accessor): Implement IIteratorContainer.
3258 (Accessor.Yields): New public field.
3259 (PropertyBase.PropertyMethod.Define): Handle iterators on a
3263 (get_accessor_declaration, set_accessor_declaration): Set the
3264 `yields' flag on the accessor, not the property.
3265 (property_declaration): Do the iterators check on a per-accessor
3266 basis and not for the whole property.
3268 2005-07-08 Martin Baulig <martin@ximian.com>
3270 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3271 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3273 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3276 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3277 (ExtractSecurityPermissionSet): Cope with self referencing security
3278 attributes properly.
3280 * driver.cs (SetOutputFile): Made public property OutputFile.
3282 2005-07-07 Raja R Harinath <rharinath@novell.com>
3285 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3286 has_nonstatic_fields. Make into a FieldBase pointer.
3287 (TypeContainer.AddField): Add CS0282 check.
3288 (TypeContainer.EmitType): Update.
3290 2005-07-06 Miguel de Icaza <miguel@novell.com>
3292 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3293 compare if they start with __.
3295 2005-07-06 Raja R Harinath <rharinath@novell.com>
3297 * statement.cs (Switch.SwitchGoverningType): Only look at
3298 UserCasts that don't need implicit standard conversions to one of
3299 the allowed switch types (Fixes test-322.cs).
3300 (LocalInfo.Resolve): Re-enable sanity-test.
3302 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3304 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3306 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3308 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3310 2005-07-06 Raja R Harinath <rharinath@novell.com>
3313 * ecore.cs (SimpleName.GetSignatureForError): Add.
3314 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3315 (MemberAccess.GetSignatureForError): Add.
3317 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3319 The big error and warning messages review.
3349 * typemanager.cs: Updated.
3351 * class.cs: (MethodCore.SetYields): Moved here to share.
3352 (PropertyMethod.Define): Moved iterator setup here.
3354 * iterators.cs: Add orig_method to have full access to parent
3357 2005-07-05 Raja R Harinath <rharinath@novell.com>
3359 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3360 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3361 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3362 variable of struct type.
3363 * expression.cs (Unary.ResolveOperator): Update to change.
3364 (Indirection.VerifyFixed): Likewise.
3365 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3366 (ParameterReference.VerifyFixed): Value parameters are fixed.
3367 (This.VerifyFixed): Treat 'this' as a value parameter.
3368 * statement.cs (LocalInfo.IsFixed): Remove.
3370 2005-07-01 Martin Baulig <martin@ximian.com>
3372 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3373 `ec.EmitThis ()' to get the correct scope.
3375 2005-07-01 Martin Baulig <martin@ximian.com>
3377 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3378 instance is a ParameterReference; fixes #75299.
3380 2005-07-01 Martin Baulig <martin@ximian.com>
3382 Reverted Marek's latest patch (r46725):
3383 - it contains structural changes which are neither mentioned in
3384 the ChangeLog nor explained anywhere; for example the additional
3385 argument of EmitContext's and Iterator's .ctor's and the
3386 TypeContainer.DefineMembers() change.
3387 - structural changes like this should go in in seperate patches
3388 and not be hidden in a huge patch which just seems to affect
3389 warnings and errors.
3390 a big and hard to understand patch.
3391 - it breaks iterators and causes regressions, for instance in
3394 2005-06-30 Raja R Harinath <rharinath@novell.com>
3397 * expression.cs (Indexers.map): Remove.
3398 (Indexers.Append): Filter out inaccessible setters and getters.
3399 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3402 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3404 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3405 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3406 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3407 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3409 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3412 * class.cs (FieldBase.GetInitializerExpression): One more field
3415 2005-06-28 Miguel de Icaza <miguel@novell.com>
3417 * pending.cs: Do not define a proxy if the base method is virtual,
3418 it will be picked up by the runtime (bug 75270).
3420 2005-06-08 Martin Baulig <martin@ximian.com>
3422 The big Iterators rewrite :-)
3424 * iterators.cs: Rewrite this to use the anonymous methods framework.
3426 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3427 before the TypeContainers; see 2test-21.cs.
3430 (TypeContainer.DefineType): Don't create a new EmitContext if we
3431 already have one (this only happens if we're an Iterator).
3432 (TypeContainer.Define): Also call Define() on all our iterators.
3433 (Method.CreateEmitContext): Added support for iterators.
3436 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3437 (AnonymousContainer.CreateMethodHost): Moved here from
3438 AnonymousMethod and made abstract.
3439 (AnonymousContainer.CreateScopeType): New abstract method.
3440 (AnonymousContainer.IsIterator): New public property.
3441 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3442 get the ScopeTypeBuilder rather than manually defining it here.
3443 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3446 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3447 before RootContext.DefineTypes().
3449 * codegen.cs (EmitContext.RemapToProxy): Removed.
3450 (EmitContext.CurrentAnonymousMethod): Changed type from
3451 AnonymousMethod -> AnonymousContainer.
3452 (EmitContext.ResolveTopBlock): Protect from being called twice.
3453 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3454 (EmitContext.EmitThis): Removed the iterators hacks; use the
3455 anonymous methods framework for that.
3458 (ToplevelBlock.Container): Make this a property, not a field.
3459 (ToplevelBlock.ReParent): New public method; move the
3460 ToplevelBlock into a new container.
3461 (Foreach.TemporaryVariable): Simplify.
3463 2005-06-05 Martin Baulig <martin@ximian.com>
3465 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3466 (Block.AddTemporaryVariable): New public method; creates a new
3467 `LocalInfo' for a temporary variable.
3468 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3470 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3471 non-iterator variables.
3473 2005-06-05 Martin Baulig <martin@ximian.com>
3475 * statement.cs (Foreach.TemporaryVariable): Create the
3476 LocalBuilder in the Emit phase and not in Resolve since in some
3477 situations, we don't have an ILGenerator during Resolve; see
3478 2test-19.cs for an example.
3480 2005-06-04 Martin Baulig <martin@ximian.com>
3482 **** Merged r45395 from GCS ****
3484 The big Foreach rewrite - Part II.
3486 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3487 with `PropertyInfo ienumerator_getcurrent'.
3489 * codegen.cs (VariableStorage): Removed.
3492 (Foreach): Derive from Statement, not ExceptionStatement.
3493 (Foreach.CollectionForeach): New nested class. Moved all the code
3494 dealing with collection foreach here.
3495 (Foreach.ForeachHelperMethods): Removed.
3496 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3498 2005-05-23 Martin Baulig <martin@ximian.com>
3500 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3501 don't need to. Fix #75014.
3503 2005-05-20 Martin Baulig <martin@ximian.com>
3505 Merged r44808 from GMCS.
3507 * class.cs (TypeContainer.CircularDepException): Removed.
3508 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3509 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3510 (CS0146) and interface (CS0529) dependencies here.
3512 2005-06-21 Raja R Harinath <rharinath@novell.com>
3514 * expression.cs (Invocation.EmitCall): Fix initialization
3515 'this_call' to reflect current behaviour. Fix indentation.
3517 * convert.cs (FindMostEncompassedType): Add two trivial special
3518 cases (number_of_types == 0 || number_of_types == 1).
3519 (FindMostEncompasingType): Likewise.
3521 2005-06-17 Raja R Harinath <rharinath@novell.com>
3523 Some cleanups preparing for the fix of #75283.
3524 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3526 (EventExpr.InstanceResolve): Likewise.
3527 (EventExpr.DoResolve): Remove redundant checks.
3529 2005-06-10 Duncan Mak <duncan@novell.com>
3531 * cs-tokenizer.cs (process_directives): New flag for controlling
3532 the processing of preprocessor directives.
3533 (x_token): After seeing a '#', return Token.NONE instead of going
3534 to handle_preprocessing_directive() when not processing
3535 directives. This avoids unnecessary processing during the token peek in
3540 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3541 the existing error reporting methods instead of Report.Error.
3543 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3544 after Raja's rewrite.
3546 2005-06-08 Miguel de Icaza <miguel@novell.com>
3548 * class.cs: Small fix.
3550 2005-06-08 Raja R Harinath <rharinath@novell.com>
3553 * class.cs (GetPartialBases): Fix return value check of
3556 2005-06-07 Raja R Harinath <rharinath@novell.com>
3558 Ensure that partial classes are registered in their enclosing
3559 namespace. Initial part of fix of #75160.
3560 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3561 Register declspace with namespace here, not in
3562 DeclSpace.RecordDecl.
3563 * cs-parser.jay: Pass namespace to RecordDecl.
3564 * class.cs (PartialContainer.Create): Likewise.
3565 (ClassPart.DefineType): New sanity-check. Throws an exception if
3567 * decl.cs (Declspace.RecordDecl): Remove.
3568 * namespace.cs (NamespaceEntry.DefineName): Remove.
3570 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3572 * rootcontext.cs: Reset TargetExt as well.
3574 2005-06-03 Raja R Harinath <rharinath@novell.com>
3576 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3579 2005-06-02 Raja R Harinath <rharinath@novell.com>
3581 Fix #75080, cs0119.cs.
3582 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3584 (Expression.Resolve): ... this. Use it. Remove bogus code
3585 allowing ExprClass.Type and ExprClass.Namespace for
3586 ResolveFlags.VariableOrValue.
3587 (Expression.Resolve) [1-argument variant]: Change default resolve
3588 flags based on language version.
3589 (Expression.Error_UnexpectedKind): Use a simple string array
3590 rather than an ArrayList.
3591 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3593 (TypeOfVoid.DoResolve): Likewise.
3594 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3595 flags argument -- it always has the same value.
3597 2005-05-31 Raja R Harinath <rharinath@novell.com>
3600 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3601 Use it in the error message.
3602 * assign.cs, expression.cs, statement.cs: Update.
3604 2005-05-30 Raja R Harinath <rharinath@novell.com>
3607 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3608 the "almostMatchedMember" case too.
3609 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3610 that failed the accessibility checks to 'almost_match'.
3612 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3614 * attribute.cs: Use internal MethodBuilder methods to set
3615 ExactSpelling and SetLastError on PInvoke methods, instead
3616 of passing them via charset. Fixes #75060.
3618 2005-05-27 Raja R Harinath <rharinath@novell.com>
3620 * parameter.cs (Parameter): Remove TODO comment.
3621 (Parameter.DefineParameter): Remove Location parameter.
3622 (Parameters.LabelParameters): Likewise.
3623 * class.cs (Constructor.Emit): Update to change.
3624 (MethodData.Emit): Likewise.
3625 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3626 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3628 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3631 Removed Parameters.Location and added Parameter.Location instead.
3632 Removed Location parameter from Emit() and GetSignature().
3639 Modified all related calls.
3641 2005-05-26 Raja R Harinath <rharinath@novell.com>
3643 Improve user-defined conversion handling.
3644 * convert.cs (GetConversionOperators): Rewrite. Return only the
3645 applicable operators.
3646 (AddConversionOperators): New. Helper for GetConversionOperators.
3647 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3648 there is only one most encompassed/encompassing type.
3649 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3650 "applicable operator" handling.
3651 (UserConversion): Move cache here from GetConversionOperators.
3652 Directly cache the chosen operator, rather than the whole
3654 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3655 case. Allow conversion of decimal to sbyte and byte too.
3656 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3657 New static methods. Used to avoid allocating EmptyExpressions in
3660 2005-05-24 Duncan Mak <duncan@novell.com>
3662 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3663 another class, used in Convert.ExplicitNumericConversion.
3664 (CastToDecimal): New class, similar to above, but casts to
3665 System.Decimal, used in Convert.ImplicitNumericConversion and also
3666 in explicit convesion from double/float to decimal.
3668 * convert.cs (ImplicitNumericConversion): Handle implicit
3669 conversions to System.Decimal.
3670 (ExplicitNumericConversion): handle explicit conversions to
3675 2005-05-20 Miguel de Icaza <miguel@novell.com>
3677 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3678 know the type at this stage, just break through. Fixes #75008
3680 2005-05-19 Martin Baulig <martin@ximian.com>
3683 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3684 to disable error reporting.
3686 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3687 here since we don't want to report an error; see the new test-336.cs.
3689 2005-05-19 Raja R Harinath <rharinath@novell.com>
3691 * statement.cs (ToplevelBlock.GetParameterReference)
3692 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3693 Move here from class Block.
3694 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3695 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3697 2005-05-18 Martin Baulig <martin@ximian.com>
3702 (FlowBranching.Reachability): Add non-static public And() and Or()
3704 (FlowBranchingSwitch): New class; do the `break_origins' thing
3705 like in FlowBranchingLoop.
3706 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3707 reachability, not just locals and parameters.
3708 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3709 switch; MergeBreakOrigins() now takes care of that.
3711 2005-05-18 Martin Baulig <martin@ximian.com>
3713 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3714 a loop and may leave it, reset the barrier; fixes #74974.
3716 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3718 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3721 * cs-parser.jay: Catch more lexical errors.
3723 * report.cs: Add one more Error method.
3726 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3728 2005-05-17 Martin Baulig <martin@ximian.com>
3730 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3733 2005-05-16 Raja R Harinath <rharinath@novell.com>
3735 Fix test-382.cs. Emit values of decimal constants.
3736 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3738 (TypeContainer.AddField): ... this.
3739 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3740 with initializers to include 'Const's.
3741 (ClassPart.RegisterFieldForInitialization): Forward to
3743 * const.cs (Const.Const): Pass initializer to base class.
3744 (Const.Define): In case of decimal constants, register them for
3745 initialization in a static constructor.
3747 2005-05-14 Martin Baulig <martin@ximian.com>
3749 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3750 do not call ResolveUnreachable() on unreachable statements in
3751 here, see the comment in the source code.
3753 2005-05-13 Raja R Harinath <rharinath@novell.com>
3756 * expression.cs (BinaryResolveOperator): If one of the operands of
3757 an equality comparison is 'null' and the other is a pointer type,
3758 convert the null to a NullPointer.
3759 * convert.cs (ImplicitReferenceConversion): If the expression is a
3760 NullLiteral and the target type is a pointer type, return a
3761 NullPointer instead.
3762 (ImplicitConversionStandard): Likewise.
3764 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3766 * cs-parser.jay: Set readonly context based on special constructs.
3768 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3769 readonly variable error handling.
3771 * rootcontext.cs (EmitCode): Don't verify members when error
3774 * statement.cs (LocalInfo): Add reaodnly context information.
3775 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3777 2005-05-13 Raja R Harinath <rharinath@novell.com>
3779 * statement.cs (Block.Resolve): Revert change below. Modify fix
3780 for #74041 to initialize 'resolved' to false only for explicit
3781 blocks. Fixes #74873.
3783 2005-05-12 Raja R Harinath <harinath@gmail.com>
3786 * typemanager.cs (unmanaged_enclosing_types): New.
3787 (IsUnmanagedType): Avoid infloops by using
3788 'unmanaged_enclosing_types' to talk with recursive invocations.
3790 2005-05-13 Martin Baulig <martin@ximian.com>
3792 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3793 instance variable, not a local. Fix #74873.
3794 (Block.ResolveUnreachable): Set it to true here.
3796 2005-05-11 Duncan Mak <duncan@novell.com>
3798 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3799 continuing to process for 'arg'.
3800 (handle_preprocessing_directive): Check the argument of the #endif
3801 directive and report error CS1025 if there are any trailing
3804 According to the C# spec, having even whitespace after the #endif
3805 directive is illegal; however, because we call arg.TrimEnd ()
3806 beforehand, we have the same behavior as csc, allowing whitespace
3807 after the directive.
3811 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3815 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3816 (Constructor.GetObsoleteAttribute): Implemented correctly.
3818 2005-05-10 Martin Baulig <martin@ximian.com>
3820 * support.cs (ReflectionParameters.ParameterModifier): Use
3821 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3822 and `ParameterAttributes.In'. Fixes #74884.
3824 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3826 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3828 * expression.cs (Argument.GetParameterModifier): Turned to property.
3829 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3831 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3834 2005-05-09 Raja R Harinath <rharinath@novell.com>
3837 * decl.cs (MemberCache.AddMethods): Register override methods,
3838 rather than non-override methods.
3839 * typemanager.cs (RegisterOverride): New.
3840 (IsOverride): Update.
3842 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3846 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3847 recursive declaration.
3849 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3851 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3853 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3855 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3857 2005-05-05 Raja R Harinath <rharinath@novell.com>
3860 * decl.cs (DeclSpace.FamilyAccessible):
3861 Use TypeManager.IsNestedFamilyAccessible.
3863 Fix reopened #64812.
3864 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3867 2005-05-04 Raja R Harinath <rharinath@novell.com>
3868 Abin Thomas <projectmonokochi@rediffmail.com>
3869 Anoob V E <projectmonokochi@rediffmail.com>
3870 Harilal P R <projectmonokochi@rediffmail.com>
3873 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3874 allow access to all static members.
3876 2005-05-04 Martin Baulig <martin@ximian.com>
3878 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3880 2005-05-04 Martin Baulig <martin@ximian.com>
3884 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3885 section at the end; make things work if `default' is not the last
3888 2005-05-04 Martin Baulig <martin@ximian.com>
3892 * statement.cs (Switch): Replaced the `got_default' field with a
3893 `default_section' one.
3894 (Switch.CheckSwitch): Set `default_section' here.
3895 (Switch.Resolve): If we're a constant switch and the constant is
3896 not found, use the default section.
3898 2005-05-03 Martin Baulig <martin@ximian.com>
3900 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3902 * statement.cs (Foreach.ArrayForeach): New nested class.
3903 (Foreach.TemporaryVariable): New nested class.
3904 (Foreach.EmitArrayForeach): Removed; this is now in the new
3907 2005-05-03 Raja R Harinath <rharinath@novell.com>
3909 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3911 (VerifyPendingMethods): Revert change below.
3913 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3914 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3915 that used to trigger warning -28. Remove warning -28.
3916 * expression.cs (Invocation.OverloadResolve): Use
3917 TypeManager.IsOverride to distinguish override methods.
3920 * pending.cs (VerifyPendingMethods): If a base type implements the
3921 requested interface, don't bother checking individual methods of
3922 the base type. As a side-effect, this prevents the creation of
3923 unnecessary proxies.
3925 2005-05-02 Martin Baulig <martin@ximian.com>
3929 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3930 Also `And' the locals if the old vector is null.
3931 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3932 null; in this case we basically reset all the variables.
3934 2005-05-02 Martin Baulig <martin@ximian.com>
3938 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3939 Added `FlowBranching branching' argument; always `and' the
3940 variables instead of `or'ing them unless we're an infinite loop.
3942 * statement.cs (While.Resolve): Create a new sibling unless we're
3945 2005-05-02 Martin Baulig <martin@ximian.com>
3949 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3950 arguments; use it instead of creating a new TopLevelBlock.
3951 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3952 our ConstructorInitializer.
3955 (TopLevelBlock.TopLevelBranching): New public property.
3956 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3957 and create our `TopLevelBranching'.
3959 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3960 anonymous method host, use `block.TopLevelBranching' rather than
3961 creating a new branching.
3963 2005-04-20 Miguel de Icaza <miguel@novell.com>
3965 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3966 a ScopeInfo, if any of the current children is a child of the new
3967 entry, move those children there.
3969 2005-04-30 Martin Baulig <martin@ximian.com>
3971 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3972 at the beginning of a SwitchSection. Fix #73335.
3974 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3977 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3979 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3980 (FieldExpr.DoResolve): Obsolete members are ignored for field
3983 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3985 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3986 of arrays detection.
3988 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3990 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3992 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3995 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3997 * cs-parser.jay: Use the prefered version of -unsafe in error
4000 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4002 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4005 2005-04-20 John Luke <john.luke@gmail.com>
4007 * driver.cs: fix typo in error message, --outout to --output
4009 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4011 * codegen.cs (InRefOutArgumentResolving): New field.
4013 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4014 fields outside contructor.
4016 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4018 2005-04-19 Miguel de Icaza <miguel@novell.com>
4020 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4021 parameter code was not completed ever, so it was not as up-to-date
4022 as local variables. Must finish it.
4024 The bug fix was to compare the Toplevel of the block, not the
4025 current block. Thanks for Ben for pointing this out.
4027 2005-04-19 Raja R Harinath <rharinath@novell.com>
4029 * decl.cs (AddMethods): Use the declaring type of the problem
4030 method to determine if we want to squash a warning.
4032 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4034 * attribute.cs: Removed debug output.
4036 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4038 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4041 2005-04-18 Raja R Harinath <rharinath@novell.com>
4044 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4045 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4046 all null comparisons against reference types.
4048 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4051 * class.cs (TypeContainer.CircularDepException) New nested
4053 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4054 (TypeContainer.DefineType): Removed error, reset InTransit before
4056 (Class.DefineType): Throw exception when is in Transit.
4057 Catch exception and report error.
4058 (Struct.DefineType): Throw exception when is in Transit.
4059 Catch exception and report error.
4060 (Interface.DefineType): Throw exception when is in Transit.
4061 Catch exception and report error.
4063 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4064 handle nested exception handlers.
4066 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4069 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4070 InFinally and InCatch storage.
4072 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4073 (Catch.Resolve): Set and Restore ec.InCatch.
4074 (Try.Resolve): Set and Restore ec.InFinally.
4075 (Try.HasCatch): True when try has catch.
4077 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4079 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4080 for the same event member, so exclude such cases from warning 419.
4083 2005-04-16 Miguel de Icaza <miguel@novell.com>
4085 * expression.cs (Binary.ResolveOperator): Apply patch from John
4086 Luke to fix bug 59864: operators &, | and ^ on enumerations
4087 require that the same enum type on both sides.
4089 * driver.cs: Add warnings to old flag usage, this is to assist
4090 people who produce Makefiles and hope that the Makefiles will be
4093 * class.cs (TypeContainer.EmitType): Moved the definition of the
4094 special $PRIVATE$ field from the resolve phase to the Emit phase.
4095 During resolve we do not know if we are a struct with
4096 HasExplicitLayout, we know this only after the attributes for the
4099 Set the FieldOffset to zero on the dummy field that we create for
4100 the class. Fixes 74590.
4102 2005-04-16 Raja R Harinath <rharinath@novell.com>
4105 * ecore.cs (PropertyExpr.resolved): New.
4106 (DoResolve): Use it to handle a case of double resolution here.
4107 Handle a case of identical-name-and-type-name.
4108 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4109 resolution by storing the results of expression resolution back
4110 into the "probes" array.
4112 2005-04-15 Raja R Harinath <rharinath@novell.com>
4114 Fix cs0208-7.cs and cs0208-8.cs.
4115 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4116 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4117 error reporting to point out the reason a struct is not unmanaged.
4119 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4121 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4122 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4124 2005-04-13 Raja R Harinath <rharinath@novell.com>
4127 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4128 IdenticalNameAndTypeName here.
4129 (EventExpr.InstanceResolve): Likewise.
4131 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4133 C# 2.0 DefaultCharSetAttribute implementation
4135 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4136 which allows us to set GlobalNamespace for every resolve.
4137 (Attribute.ResolveArguments): Cut from Resolve.
4138 (Attribute.GetCharSetValue): Returns CharSet named argument.
4139 (Attribute.DefinePInvokeMethod): Gets default charset from
4141 (GlobalAttribute.ResolveAsTypeStep): Override.
4142 (GlobalAttribute.ResolveArguments): Override.
4144 * class.cs (TypeAttr): Is protected.
4146 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4147 (ModuleClass.DefaultCharSetType): New memeber.
4148 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4150 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4151 charset from module.
4153 * delegate.cs (TypeAttr): Override.
4154 (Delegate.DefineType): Use this TypeAttr.
4156 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4157 at very early stage (before types are defined) to resolve model
4158 module attributes. It will probably not work with corlib but it
4161 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4162 charset from module.
4164 * typemanager.cs (default_charset_type): New type.
4166 2005-04-13 Raja R Harinath <rharinath@novell.com>
4168 * decl.cs (MemberCache.AddMethods): Don't warn if
4169 System.Object.Finalize has buggy MethodAttributes.
4171 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4174 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4176 * doc.cs : detect ambiguous reference to overloaded members.
4177 Fixed bug #71603. MS 1.1 csc does not detect it.
4179 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4181 * doc.cs : delegates must not be referenced with parameters.
4184 2005-04-12 Miguel de Icaza <miguel@novell.com>
4186 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4188 2005-04-10 Miguel de Icaza <miguel@novell.com>
4190 * driver.cs (MainDriver): Stop processing if the CLS stage found
4193 (CompilerCallableEntryPoint.InvokeCompiler): Always
4194 reset after execution; Take a TextWriter argument for the
4197 * report.cs: Use the error stream instead of hardcoding stderr.
4199 2005-04-09 Miguel de Icaza <miguel@novell.com>
4201 * class.cs: Reduce code paths to test, too small of an
4202 optimization to make it worth the extra testing. Always perform
4205 2005-04-08 Raja R Harinath <rharinath@novell.com>
4208 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4209 operators that had errors reported on them.
4211 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4213 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4215 (Attribute.Resolve): Add named argument type checking.
4217 * class.cs (FixedField.Define): Use IsPrimitiveType
4219 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4221 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4222 unsafe parameter types.
4224 * statement.cs (Using.ResolveExpression): Add better error description.
4226 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4228 2005-04-08 Raja R Harinath <rharinath@novell.com>
4231 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4232 AttributeUsageAttribute in the emitcontext of the attribute class,
4233 not in the emitcontext of the attributable entity it was attached to.
4234 * cs-parser.jay: Use 'current_class', not 'current_container',
4235 when creating a GlobalAttribute.
4237 2005-04-08 Alp Toker <alp@atoker.com>
4239 * pending.cs: The fix to #58413 failed to compile methods implementing
4240 interfaces with/without params modifiers and vice versa, even though
4241 params modifiers aren't part of the signature. Make the modifier check
4242 less strict as in csc.
4244 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4245 Anoob V E <projectmonokochi@rediffmail.com>
4246 Harilal P R <projectmonokochi@rediffmail.com>
4249 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4250 modifiers of pending methods.
4251 (PendingImplementation.PendingImplementation): Initialize it.
4252 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4253 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4254 with ParameterData. Add check for modifiers.
4255 * class.cs (MethodData.Define): Update to changes.
4257 2005-04-07 Raja R Harinath <rharinath@novell.com>
4259 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4261 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4263 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4266 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4269 * typemanager.cs: Registered RequiredAttributeAttribute.
4271 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4273 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4274 Warning CS0169 is back at level 3.
4275 (IMethodData.SetMemberIsUsed): New method.
4277 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4278 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4280 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4282 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4284 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4287 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4290 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4291 to avoid the problems with nested types.
4293 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4294 Anoob V.E <projectmonokochi@rediffmail.com>
4295 Harilal P.R <projectmonokochi@rediffmail.com>
4296 Raja R Harinath <rharinath@novell.com>
4299 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4301 * typemanager (GetConstructor): Make public.
4303 2005-04-05 John Luke <john.luke@gmail.com>
4304 Raja R Harinath <rharinath@novell.com>
4307 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4308 struct too. Return false quicker in a few cases.
4309 (VerifyUnManaged): Use it.
4311 2005-04-05 Raja R Harinath <rharinath@novell.com>
4314 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4315 not 'unreachable_seen'.
4317 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4319 * attribute.cs (Attribute.GetValue): Removed unused.
4321 * codegen.cs (CodeGen.TrimExt): Removed unused.
4323 * cs-parser.jay (output): Removed unused.
4325 * cs-tokenizer.cs (hex_digits): Removed unused.
4327 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4329 * expression.cs (Indirection.LoadExprValue): Removed unused.
4330 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4332 * iterators.cs (Iterator.param_types): Removed unused.
4334 * statement.cs (Goto.block): Removed unused.
4335 (ToplevelBlock.did): Removed unused.
4336 (Switch.ResolveConstantSwitch): Removed unused.
4338 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4340 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4343 2005-04-01 Raja R Harinath <rharinath@novell.com>
4345 Fix #74232 and cs0208-3.cs.
4346 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4347 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4348 unmanaged type. Don't use FieldBuilders when 't' is a
4349 TypeBuilder. Use ModFlags and MemberType fields.
4350 * class.cs (MemberBase.member_type): Rename from MemberType.
4351 (MemberBase.MemberType): New property. Determines member_type on
4353 (MemberBase.DoDefine): Don't initialize MemberType here.
4354 (FieldMember.Define): Likewise.
4356 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4359 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4360 Attributes are emitted there.
4362 2005-04-01 Raja R Harinath <rharinath@novell.com>
4364 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4365 keyword in 'partial enum' too.
4366 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4368 Report from Kamil Skalski <nazgul@omega.pl>.
4371 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4372 have partial containers too.
4374 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4375 in block' checks to Block.CheckInvariantMeaningInBlock.
4376 * statement.cs (Block.GetKnownVariableInfo): Make private.
4377 (Block.IsVariableUsedInChildBlock): Remove.
4378 (Block.IsVariableUsedInBlock): Likewise.
4379 (Block.CheckInvariantMeaningInBlock): New. Show location of
4380 conflicting declaration.
4381 (Block.AddVariable): Make error messages less long-winded and more
4382 specific. Show location of conflicting declaration.
4383 * parameter.cs (Parameters.Location): New readonly property.
4385 2005-03-31 Raja R Harinath <rharinath@novell.com>
4387 Clean up semantics of invoking ResolveMemberAccess.
4388 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4389 can have an instance, ensure that we pass in a non-TypeExpression
4390 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4391 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4392 argument. Update to changes and simplify.
4393 (FieldExpr.Emitinstance): Remove CS0120 check.
4394 (PropertyExpr.EmitInstance): Likewise.
4395 * expression.cs (Argument.Resolve): Likewise.
4396 (Invocation.DoResolve): Update to changes in semantics of
4399 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4402 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4405 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4407 2005-03-31 Raja R Harinath <rharinath@novell.com>
4409 Fix difference in behaviour with commandline invocation.
4410 * driver.cs (Driver.Reset): New.
4411 (CompilerCallableEntryPoint): Call it.
4413 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4414 variable" warnings if the boolean expression failed to resolve.
4416 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4418 * attribute.cs: Fix the union of several permissions when some of them
4419 are unrestricted (so the result isn't an unrestricted permission set).
4422 2005-03-30 Raja R Harinath <rharinath@novell.com>
4424 * ecore.cs (MemberExpr): New class. Convert from interface
4426 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4427 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4429 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4430 (MethodGroupExpr.IsExplicitImpl): Remove.
4431 (Expression.GetFieldFromEvent): Remove.
4432 (SimpleName.MemberStaticCheck): Remove.
4433 (SimpleName.DoSimpleNameResolve): Update to changes.
4434 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4435 (MemberAccess.IdenticalNameAndTypeName): Remove.
4436 (MemberAccess.error176): Move to MemberExpr.
4437 (MemberAccess.DoResolve): Update to changes.
4438 (BaseAccess.DoResolve): Likewise.
4440 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4442 C# 2.0 Conditional attribute class implementation
4444 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4445 Analyzes class whether it has attribute which has ConditionalAttribute
4446 and its condition is not defined.
4448 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4449 (Class.IsExcluded): New method. Search for at least one defined
4450 condition in ConditionalAttribute of attribute class.
4452 2005-03-30 Raja R Harinath <rharinath@novell.com>
4454 * ecore.cs (PropertyExpr): Derive from Expression, not
4455 ExpressionStatement.
4456 (PropertyExpr.EmitStatement): Remove.
4458 2005-03-29 Raja R Harinath <rharinath@novell.com>
4461 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4462 internal field "value__" of an enum be private. The examples for
4463 "value__" that I found on MSDN all used FieldAttributes.Private.
4465 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4466 Don't mention IL method attribute names.
4468 Fix #47991. Remove a TODO.
4469 * statement.cs (Block.Toplevel): Make into a field.
4470 (Block.Parameters): Move into ToplevelBlock.
4471 (Block.known_variables): Rename from child_variable_names.
4472 (Block.Block): Remove variants that take Parameters. Initialize
4473 'Toplevel' with the immediately surrounding toplevel block.
4474 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4475 LocalInfo parameter.
4476 (Block.GetKnownVariableInfo): New.
4477 (Block.IsVariableNameUsedInChildBlock): Update.
4478 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4479 the block, even though it may not be in scope.
4480 (Block.AddVariable): Remove Parameters parameter. Use
4481 Toplevel.Parameters instead.
4482 (Block.AddConstant): Remove Parameters parameter.
4483 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4484 (Block.IsParamaterReference): Likewise.
4485 (Block.IsLocalParameter): Likewise. Simplify a lot.
4486 (ToplevelBlock.Parameters): New. Moved from Block.
4487 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4488 initialize Parameters to a non-null value.
4489 * cs-parser.jay: Update to changes.
4490 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4491 simple names that mean different things in the same block. Use
4492 Block.IsVariableNameUsedInBlock.
4494 2005-03-28 Raja R Harinath <rharinath@novell.com>
4496 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4497 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4498 GetTypeHandle. It is possible for a reflected type to derive from
4499 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4500 System.Array during mscorlib compilation).
4501 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4502 contain a method_hash, don't create one either. Don't create a
4503 deep copy of the base cache's method_hash.
4504 (MemberCache.SetupCache): Rename back from DeepCopy.
4505 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4506 already initialized. If we see an override function, add its
4507 underlying base virtual function to the member_hash too.
4509 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4511 2005-03-26 Raja R Harinath <harinath@acm.org>
4514 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4515 fails to resolve, ensure that the LHS is still resolved as an
4518 2005-03-25 Raja R Harinath <harinath@acm.org>
4520 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4522 (Enum.current_ec): Remove.
4523 (Enum.LookupEnumValue): Remove EmitContext argument.
4524 Just uses the one created during DefineType.
4525 (Enum.FindMembers): Update.
4526 * expression.cs (MemberAccess.DoResolve): Update.
4528 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4530 * assign.cs (Assign.DoResolve): Check for CS1717 when
4531 source and target are same (uses Equals).
4533 * expression.cs (LocalVariableReference, ParameterReference,
4534 This): Implemented Equals, GetHashCode.
4536 * statement.cs (Block.GetParameterReference): Removed useless
4539 2005-03-22 Raja R Harinath <rharinath@novell.com>
4542 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4543 blocks before deciding whether the error is cs0136 or cs0128.
4545 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4546 (using_alias_directive, using_namespace_directive): Pass
4547 MemberName, not an expression to Namespace.UsingAlias and
4549 (MakeName): Use the MemberName of the namespace.
4550 * namespace.cs (Namespace.MemberName): New.
4551 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4552 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4554 * decl.cs (MemberName.Name): Make readonly.
4555 (MemberName.FromDotted): New "constructor".
4556 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4557 (MemberCore.Name): Compute from MemberName on demand.
4558 (MemberCore.SetMemberName): Provide a way to change the
4560 (MemberCore.AddToContainer): Don't take a fullname parameter.
4561 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4562 fully qualified name of the container to the member name.
4563 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4564 only if the type is a member of the root container.
4565 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4566 MemberName.Left rather than searching for an embedded ".".
4567 (PartialContainer.CreatePart): Update to changes in RootContext.
4568 (MemberBase.ShortName): Turn into a property. Use
4569 MemberCore.SetMemberName.
4570 (MemberBase.ExplicitInterfaceName): Remove.
4571 (MemberBase.UpdateMemberName): Remove.
4572 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4573 (PropertyBase.SetMemberName): New override.
4574 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4575 (Tree.GetDecl): New.
4576 (Tree.AllDecls): Rename from Decls.
4577 * attribute.cs, enum.cs, report.cs: Update to changes.
4578 * driver.cs (MainDriver): Use MemberName.FromDotted on
4579 RootContext.MainClass.
4581 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4583 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4586 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4588 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4590 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4591 property accessor modifiers.
4593 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4594 fixed buffer attribute (CS1716).
4595 (PropertyMethod.HasCustomAccessModifier): When property accessor
4596 has custom modifier.
4598 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4600 (PropertyExpr.DoResolveLValue): Add CS0272.
4602 2005-03-17 Miguel de Icaza <miguel@novell.com>
4604 * convert.cs: When converting to a pointer, use the proper Conv.U
4605 or Conv.I depending on the source data type.
4607 * cs-tokenizer.cs: Make the size for large decimal constants,
4610 2005-03-17 Martin Baulig <martin@ximian.com>
4612 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4613 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4615 2005-03-17 Martin Baulig <martin@ximian.com>
4617 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4618 to bool so we can return an error condition.
4619 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4622 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4624 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4627 2005-03-16 Raja R Harinath <rharinath@novell.com>
4629 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4630 Refactor to avoid traversing the list of assemblies, and to avoid
4631 string concatenation.
4632 * typemanager.cs (guid_attr_type): Remove.
4633 (negative_hits, pointers, references): Remove hashes.
4635 (GetConstructedType): New. Uses type_hash to handle constructed
4636 types (arrays, references, pointers).
4637 (GetReferenceType, GetPointerType): Use it.
4638 (GetNestedType): New. Uses type_hash to handle nested types of
4640 (LookupType, LookupTypeDirect): Remove.
4641 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4642 'types' hash and LookupTypeReflection directly.
4643 (params_string, params_object): Use GetConstructedType.
4644 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4646 (Namespace.Lookup): Use cached_types.
4647 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4648 provided by old TypeManager.LookupType.
4649 * rootcontext.cs (MakeFQN): Remove.
4650 * decl.cs (DeclSpace.MakeFQN): Likewise.
4651 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4652 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4653 TypeManager.GetConstructedType.
4654 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4656 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4658 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4661 * cs-parser.jay: Reports CS1527 for any namespace element.
4663 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4666 * expression.cs (ParameterReference.IsAssigned): Changed error to
4668 (Error_WrongNumArguments): Moved CS0245 detection here.
4670 * statement.cs (Return.Resolve): Add CS1622 report.
4672 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4674 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4676 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4678 * attribute.cs expression.cs: Get rid of some allocations.
4680 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4682 * doc.cs : just eliminate the latest change.
4684 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4686 * doc.cs : commented out the latest change. It breaks xml-030.cs
4688 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4690 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4691 fail. So invoke CreateType() in FindDocumentedType().
4693 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4695 * cs-tokenizer.cs : added IsKeyword().
4696 * doc.cs : Detect keyword incorrectly used as identifier.
4697 Allow identifiers prefixed by @.
4699 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4701 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4702 It caused exception in namespace resolving (again!).
4704 * class.cs (Class.ctor): Removed exit.
4705 (PropertyMethod.ctor): ditto.
4707 * codegen.cs (Codegen.Reset): Reset static data.
4708 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4710 * cs-tokenizer.cs (Cleanup): Removed.
4712 * driver.cs (GetSystemDir): Rewrote to one line command.
4713 It caused problem with unloaded dynamic modules.
4714 (UnixParseOption): Removed Exit.
4715 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4716 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4717 Now can be mcs used as library.
4719 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4722 * location.cs (Reset): Reset static data.
4724 * namespace.cs (Reset): Reset static data.
4726 * report.cs (Report.Reset): Reset static data.
4728 * rootcontext.cs (RootContext.Reset): Reset static data.
4730 * tree.cs (RootTypes.ctor): Use Location.Null
4732 * typemanager.cs (TypeManager.Reset): Reset static data.
4733 (CoreLookupType): Removed Exit.
4734 (TypeHandle.Reset): Reset static data.
4736 2005-03-10 Raja R Harinath <rharinath@novell.com>
4739 * typemanager.cs (ComputeNamespaces): Import namespaces from
4740 referenced modules too.
4742 2005-03-09 Raja R Harinath <rharinath@novell.com>
4744 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4747 2005-03-09 Raja R Harinath <rharinath@novell.com>
4749 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4750 enclosing DeclSpace. This ensures that a name-lookup populates
4751 more caches and there are fewer 'TypeExpression's. Carve out
4752 nested type lookup into ...
4753 (LookupNestedTypeInHierarchy): ... this.
4755 2005-03-09 Raja R Harinath <rharinath@novell.com>
4757 Clean up a few partial-class semantics.
4758 Fixes test-357.cs and cs1618-2.cs.
4759 * cs-parser.jay (struct_declaration): Use 'current_class' as
4760 parent of newly-created struct. Remove call to Register ().
4761 Use 'pop_current_class' to complete handing the current struct.
4762 (interface_declaration): Likewise.
4763 (class_declaration): Likewise.
4764 (enum_declaration): Use 'current_class' as parent of newly created
4766 (delegate_declaration): Likewise.
4767 (pop_current_class): New function. This is used to handle closing
4768 up the 'current_class' and 'current_container', and pointing them
4769 to the enclosing class/container.
4770 (CSharpParser): Initialize 'current_class' too.
4771 * decl.cs (MemberCore): Add check for invariant: a partial
4772 container is not a parsed entity, and thus does not enclose any
4774 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4775 (DeclSpace.BaseTypeExpr): Use it.
4776 (DeclSpace.LookupType): Add check for invariant.
4777 * class.cs (TypeContainer): Add check for invariant: a nested
4778 class should have the same NamespaceEntry as its enclosing class.
4779 (TypeContainer.EmitFieldInitializers): Make virtual.
4780 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4782 (TypeContainer.Register): Remove.
4783 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4784 null. Use TypeResolveEmitContext for resolving base types and
4785 interfaces. Move initialization of Parts.TypeBuilder here from
4787 (TypeContainer.DefineNestedTypes): ... here.
4788 (PartialContainer): Take a Namespace not a NamespaceEntry.
4789 (PartialContainer.Create): Don't use Register. Call the
4790 appropriate Add... function directly.
4791 (ClassPart): Take both the PartialContainer and the enclosing
4792 class as constructor arguments.
4793 (ClassPart.EmitFieldInitializers): Override.
4794 (ClassPart.PartFindNestedTypes): Remove.
4795 (FieldBase.GetInitializerExpression): Resolve the initializer
4796 expression in the emit context of the enclosing class.
4797 * tree.cs (RootTypes): Remove Register ().
4799 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4801 * cs-parser.jay: Removed CS0134.
4803 * driver.cs: Removed CS1901.
4805 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4806 for predefined types.
4808 2005-03-07 Duncan Mak <duncan@novell.com>
4810 * codegen.cs (Save): Catch UnauthorizedAccessException as
4811 well. Fixes bug #73454.
4813 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4815 * cs-tokenizer.cs (xtoken): Add CS1035.
4817 * class.cs (MethodData.Define): Add CS0683.
4818 (FieldMember.ctor): Add CS0681.
4820 2005-03-07 Raja R Harinath <rharinath@novell.com>
4822 * ecore.cs (SimpleName.DoResolve): Rename from
4823 SimpleName.DoResolveAllowStatic.
4824 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4825 Pass 'intermediate' flag to MemberStaticCheck.
4826 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4827 of "intermediate" lookups via MemberAccess.
4828 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4829 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4831 2005-03-07 Raja R Harinath <rharinath@novell.com>
4834 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4835 slipped in because of variable names that are identical to a
4836 builtin type's BCL equivalent ('string String;', 'int Int32;').
4837 (PropertyExpr.EmitInstance): Likewise.
4839 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4841 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4843 * report.cs (warning_ignore_table): Made public.
4845 2005-03-04 Raja R Harinath <rharinath@novell.com>
4848 * class.cs (MethodData.Emit): Pass 'container' to
4849 container.GetObsoleteAttribute instead of 'container.Parent'.
4851 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4853 * cs-parser.jay: Add 1534 error test.
4855 * iterators.cs (Yield.CheckContext): Add error 1629.
4856 (Iterator.ctor): Save unsafe modifier.
4857 (MoveNextMethod.DoEmit): Restore unsafe context.
4859 * namespace.cs (UsingAlias): Better error message.
4861 2005-03-03 Dan Winship <danw@novell.com>
4863 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4864 the warning message [#73219]
4866 2005-03-03 Raja R Harinath <rharinath@novell.com>
4868 Fix compile with MCS 1.0.0.0.
4869 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4870 w_restore to not depend on string constant folding.
4872 2005-03-03 Raja R Harinath <rharinath@novell.com>
4874 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4875 CS0246 check to users who passed 'silent = false'.
4876 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4878 (SimpleName.SimpleNameResolve): Update.
4879 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4880 (MemberAccess.IdenticalNameAndTypeName): Update.
4881 * doc.cs (FindDocumentedTypeNonArray): Update.
4883 2005-03-03 Raja R Harinath <rharinath@novell.com>
4885 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4886 * parameters.cs (ComputeAndDefineParameters): Remove.
4887 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4888 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4889 Use GetParameterInfo.
4891 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4893 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4895 2005-03-02 Raja R Harinath <rharinath@novell.com>
4897 Unify DeclSpace.LookupType and DeclSpace.FindType.
4898 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4899 is in charge of defining nested types on demand.
4900 (DeclSpace.LookupType): Use it when the current_type is a
4901 TypeBuilder. Use LookupTypeDirect for reflected types.
4902 (DeclSpace.FindType): Remove.
4903 (DeclSpace.LookupInterfaceOrClass): Likewise.
4904 (DeclSpace.DefineTypeAndParents): Likewise.
4905 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4906 DeclSpace.LookupType.
4907 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4908 * typemanager.cs (LookupType): Simplify.
4909 (AddUserType): Remove type from negative_hits.
4910 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4911 * class.cs (TypeContainer.FindMembers): Move handling of nested
4913 (TypeContainer.FindMembers_NestedTypes): ... here.
4914 (TypeContainer.FindNestedType): Implement override.
4915 (ClassPart.FindNestedType): Delegate to PartialContainer.
4916 (ClassPart.PartFindNestedType): Looks up the nested types of the
4919 2005-03-02 Martin Baulig <martin@ximian.com>
4921 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4922 static constructor in static classes.
4924 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4926 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4927 sizeParamIndex is not specified.
4929 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4932 * report.cs (WarningMessage.IsEnabled): Missing null check.
4934 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4936 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4937 in the fields and not in the properties.
4939 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4941 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4944 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4946 * attribute.cs: Small refactoring (improved robustness).
4947 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4948 (ValidateGuid): Removed.
4949 (Resolve): Removed referenced to above mentioned.
4950 (GetAttributeUsage): Made private and changed to work without
4952 (GetIndexerAttributeValue): Don't crash.
4953 (GetConditionalAttributeValue): Ditto.
4954 (GetClsCompliantAttributeValue): Ditto.
4955 (ExtractSecurityPermissionSet): All attributes exceptions are
4957 (GetPropertyValue): New helper.
4958 (GetMethodImplOptions): New method.
4959 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4960 some missing properties.
4962 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4963 (Method.ApplyAttributeBuilder): Updated.
4965 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4968 2005-02-28 Raja R Harinath <rharinath@novell.com>
4971 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4972 non-simple types (array, pointer, reference).
4974 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4976 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4978 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4980 (Method.CheckBase): Catch wrong destructor here.
4981 (MethodData.Define): Add errors 550, 668.
4983 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4985 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4987 * pending.cs (VerifyPendingMethods): Add error 551.
4989 * typemanager.cs (CSharpName): Next error report helper.
4991 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4993 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4994 attributes. Removed useless attribute double check.
4995 It saves almost 2MBs for corlib.
4997 2005-02-25 Raja R Harinath <rharinath@novell.com>
5000 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5001 called twice in case of error.
5003 2005-02-23 Chris Toshok <toshok@ximian.com>
5005 Fix compiler portions of #72827.
5006 * statement.cs (Block.Emit): call Begin/EndScope on the
5007 EmitContext instead of the ILGenerator.
5009 * codegen.cs (EmitContext.BeginScope): new method, call
5010 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5012 (EmitContext.BeginScope): same, but EndScope and CloseScope
5014 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5015 offset and call the superclass's OpenScope(int) with it.
5016 (SymbolWriter.CloseScope): get the current il
5017 offset and call superclass's CloseScope(int) with it.
5019 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5021 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5022 CS1677 for out and ref as well.
5024 * class.cs (Method.Define): Add error CS1599 detection.
5026 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5028 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5030 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5032 * support.cs.cs (ModifierDesc): New helper method.
5034 2005-02-23 Raja R Harinath <rharinath@novell.com>
5035 Abin Thomas <projectmonokochi@rediffmail.com>
5036 Anoob V E <projectmonokochi@rediffmail.com>
5037 Harilal P R <projectmonokochi@rediffmail.com>
5040 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5041 MemberLookup (used for error reporting) actually returns a result.
5042 Fix error report number (122, not 112).
5044 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5045 Anoob V E <projectmonokochi@rediffmail.com>
5046 Harilal P R <projectmonokochi@rediffmail.com>
5049 * pending.cs (PendingImplementation.GetAbstractMethods):
5050 Find NonPublic members too.
5052 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5054 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5057 * class.cs (MethodCore.CheckMethodAgainstBase):
5058 Add error 239 report.
5060 2005-02-21 Raja R Harinath <rharinath@novell.com>
5063 * expression.cs (Invocation.IsApplicable): Make public.
5064 (Invocation.IsParamsMethodApplicable): Likewise.
5065 * delegate.cs (Delegate.VerifyApplicability): Don't use
5066 Invocation.VerifyArgumentCompat for parameter applicability
5067 testing. Use Invocation.IsApplicable and
5068 Invocation.IsParamsMethodApplicable.
5070 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5072 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5074 * class.cs (Operator.Define): Add error 217 report.
5076 2005-02-21 Raja R Harinath <rharinath@novell.com>
5078 * namespace.cs (UsingEntry.Resolve): Undo change below.
5080 2005-02-21 Raja R Harinath <rharinath@novell.com>
5083 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5084 disable the error message when the extended MemberLookup also
5086 (Expression.MemberLookupFinal): Update.
5087 (SimpleName.DoSimpleNameResolve): Update.
5088 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5089 Don't use MemberLookupFinal.
5090 (New.DoResolve): Update.
5091 (BaseAccess.CommonResolve): Update.
5093 2005-02-21 Raja R Harinath <rharinath@novell.com>
5096 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5097 occured previously, don't resolve again.
5099 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5102 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5103 argument. Call ResolveAttributeUsage for unresolved.
5104 when types doesn't match ctor arguments.
5106 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5107 for nested attribute classes.
5108 (Class.attribute_usage): Removed.
5109 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5110 for attribute class.
5112 * ecore.cs (IsAttribute): Removed.
5114 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5116 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5118 (attribute_types): Removed.
5119 (EmitCode): Global attributes are emited as the latest.
5121 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5123 * class.cs (EmitFieldInitializers): Don't emit field initializer
5124 for default values when optimilization is on.
5126 * constant.cs (Constant.IsDefaultValue): New property.
5128 * driver.cs: Add /optimize handling.
5132 * literal.cs: Implement new IsDefaultValue property.
5134 * rootcontext.cs (Optimize): New field, holds /optimize option.
5136 2005-02-18 Raja R Harinath <rharinath@novell.com>
5138 Fix crasher in re-opened #72347.
5139 * namespace.cs (Namespace.Lookup): Return null if
5140 DeclSpace.DefineType returns null.
5143 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5145 2005-02-18 Raja R Harinath <rharinath@novell.com>
5147 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5148 now returns null if it cannot resolve to an lvalue.
5149 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5150 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5151 returned null. Remove check for SimpleName.
5152 (EventExpr.DoResolveLValue): New.
5153 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5154 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5156 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5158 (Unary.ResolveOperator): Move CS0211 check ...
5159 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5161 (Unary.DoResolveLValue): Simplify.
5162 (AddressOf.DoResolveLValue): New.
5163 (ArrayAccess.DoResolveLValue): New.
5165 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5167 * attribute.cs (Attribute.Resolve): Add arguments casting for
5168 when types doesn't match ctor arguments.
5170 2005-02-16 Raja R Harinath <rharinath@novell.com>
5172 Fix parts of #63202.
5173 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5174 lookup of operator in base type. Ensure that all checks happen
5175 when the operator resolves to an "op_..." method.
5177 2005-02-15 Raja R Harinath <rharinath@novell.com>
5180 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5181 'ignore_cs0104' parameter. Pass it to ...
5182 (NamespaceEntry.Lookup): ... this.
5183 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5184 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5185 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5186 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5187 Update. Request that cs0104 errors be ignored.
5188 (ComposedCast.ResolveAsTypeStep): Update.
5190 2005-02-14 Raja R Harinath <rharinath@novell.com>
5193 * expression.cs (Invocation.BetterFunction): Remove support for
5194 comparing virtual functions and their overrides.
5195 (Invocation.IsOverride): New.
5196 (Invocation.OverloadResolve): Don't consider 'override' functions
5197 during candidate selection. Store them in a lookaside list.
5198 If the selected method is a 'virtual' function, use the list to
5199 find any overrides that are closer to the LHS type.
5201 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5203 * expression.cs (New.DoResolve): Add complex core type reduction.
5204 (New.Constantify): Converts complex core type syntax like 'new int ()'
5207 2005-02-14 Raja R Harinath <rharinath@novell.com>
5209 * decl.cs (EntryType.EntryType): New constructor to create an
5210 updated copy of a cache entry.
5211 (MemberCache.AddMethods): Use it.
5212 (MemberCache.ClearDeclaredOnly): Remove.
5213 (MemberCache.MemberCache): Update.
5215 2005-02-11 Miguel de Icaza <miguel@novell.com>
5217 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5218 variable. This one is represents the actual low-level declaration
5219 of the method, as opposed to the semantic level `IsStatic'.
5221 An anonymous method which is hosted into a static method might be
5222 actually an instance method. IsStatic would reflect the
5223 container, while MethodIsStatic represents the actual code
5226 * expression.cs (ParameterReference): Use the new MethodIsStatic
5227 instead of IsStatic.
5229 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5230 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5231 set on the current EmitContext.
5233 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5234 resolve our casted expression as an LValue. This triggers the
5235 proper LValue processing that is later required by Assign.
5239 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5241 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5243 C# 2.0 Fixed buffer implementation
5245 * anonymous.cs: Update after RegisterHelperClass renaming.
5247 * attribute.cs (AttributeTester.fixed_buffer_cache):
5248 Cache of external fixed buffers.
5249 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5250 implementation if field is fixed buffer else null.
5253 (TypeContainer.AddField): Accept FieldMember instead of Field.
5254 (FieldBase.IsFieldClsCompliant): Extracted code from
5255 VerifyClsCompliance descendant customization.
5256 (FixedField): New class handles fixed buffer fields.
5257 (FixedFieldExternal): Keeps information about imported fixed
5259 (IFixedField): Make access to internal or external fixed buffer
5262 * cs-parser.jay: Add fixed buffer parsing.
5264 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5267 * expression.cs (Indirection): Extended implementation to accept
5269 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5270 (ElementAccess.MakePointerAccess): Get type as parameter.
5271 (DoResolve): Add fixed buffer field expression conversion.
5272 (DoResolveLValue): Ditto.
5273 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5274 (ArrayPtr): Derives from FixedBufferPtr.
5275 (ArrayPtr.Emit): Add extra emit for array elements.
5277 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5279 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5280 for compiler generated types.
5281 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5283 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5284 and consume less memory.
5285 (Fixed.Resolve): Add fixed buffer case.
5287 * typemanager.cs (compiler_generated_attr_ctor,
5288 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5289 (HasElementType): Add our own implementation to work on every
5292 2005-02-11 Miguel de Icaza <miguel@novell.com>
5294 * anonymous.cs (CaptureContext): Track whether `this' has been
5297 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5298 only captured `this' if it was implicitly done (instance
5299 methods/variables were used).
5301 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5302 `this' must be captured.
5304 2005-01-30 Miguel de Icaza <miguel@novell.com>
5306 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5307 is null it means that there has been no need to capture anything,
5308 so we just create a sibling.
5310 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5312 Just a partial fix. The other half is fairly elusive.
5314 2005-02-10 Raja R Harinath <rharinath@novell.com>
5316 Fix #52586, cs0121-4.cs.
5317 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5318 and return a hashtable.
5319 (MemberCache.ClearDeclaredOnly): New.
5320 (MemberCache.MemberCache): Update to change. Make a deep copy of
5321 the method_hash of a base type too.
5322 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5323 type methods. Overwrite entries with the same MethodHandle so
5324 that the ReflectedType is correct. The process leaves in base
5325 virtual functions and their overrides as distinct entries.
5326 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5327 matters since it was boxed in a ArrayList before.
5328 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5330 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5331 case of a virtual function and its override (choose the overload
5333 (Invocation.OverloadResolve): Avoid 'override' members during
5334 'applicable_type' calculation.
5336 2005-02-09 Raja R Harinath <rharinath@novell.com>
5338 Combine two near-redundant caches.
5339 * typemanager.cs (method_params): Rename from method_internal_params.
5340 (TypeManager.GetParameterData): New. Replace
5341 Invocation.GetParameterData.
5342 (TypeManager.LookupParametersByBuilder): Remove.
5343 * expression.cs (Invocation.method_parameter_cache): Remove.
5344 (Invocation.GetParameterData): Remove.
5346 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5349 2005-02-08 Raja R Harinath <rharinath@novell.com>
5352 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5353 TypeManager.multicast_delegate_type is null, resolve it by looking
5354 up "System.MulticastDelegate".
5355 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5357 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5358 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5359 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5362 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5363 (LabeledStatement.AddReference): New. Set 'referenced'.
5364 (Goto.Resolve): Use it.
5366 2005-02-05 John Luke <john.luke@gmail.com>
5368 * driver.cs: remove duplicate -doc line in Usage ()
5370 2005-02-04 Raja R Harinath <rharinath@novell.com>
5372 * location.cs (Location.AddFile): Fix CS2002 error report.
5374 2005-02-02 Martin Baulig <martin@ximian.com>
5376 * delegate.cs (Delegate.DefineType): Report an internal error if
5377 TypeManager.multicast_delegate_type is null. See bug #72015 for
5380 2005-02-02 Raja R Harinath <rharinath@novell.com>
5382 Fix a crasher in a variant of #31984.
5383 * const.cs (Constant.CheckBase): New override that defers the
5384 new-or-override check in case the base type hasn't been populated
5386 (Constant.Define): Ensure the new-or-override check is performed.
5388 2005-02-01 Duncan Mak <duncan@ximian.com>
5390 * const.cs (LookupConstantValue): Check that `ce' is not null
5391 before calling GetValue ().
5393 2005-02-01 Raja R Harinath <rharinath@novell.com>
5395 Fix test-334.cs (#69519).
5396 * cs-parser.jay (using_alias_directive): Pass in an expression to
5397 NamespaceEntry.UsingAlias.
5398 (using_namespace_directive): Pass in an expression to
5399 NamespaceEntry.Using.
5400 (namespace_name): Don't flatten to a string.
5401 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5402 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5404 (NamespaceEntry.UsingEntry): Likewise.
5405 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5407 (NamespaceEntry.LookupForUsing): Remove.
5408 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5410 (NamespaceEntry.Lookup): Remove support for dotted names.
5412 2005-02-01 Raja R Harinath <rharinath@novell.com>
5414 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5416 (NamespaceEntry.ImplicitParent): Compute on demand.
5417 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5418 parallels the current.
5419 (NamespaceEntry.LookupForUsing): Use it.
5420 (NamespaceEntry.Lookup): If the current namespace-entry is
5421 implicit, don't search aliases and using tables.
5423 2005-02-01 Raja R Harinath <rharinath@novell.com>
5426 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5428 (TypeContainer.BaseCache): Compute on demand.
5429 (TypeContainer.FindMembers): Define constants and types if they're
5430 not already created.
5431 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5433 * const.cs (Constant.Define): Make idempotent.
5435 2005-01-29 Miguel de Icaza <miguel@novell.com>
5437 * pending.cs: Produce better code (no nops produced by using Ldarg
5440 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5441 i - 1' it should be arg + 1.
5445 2005-01-28 Raja R Harinath <rharinath@novell.com>
5447 * attribute.cs (Attribute.CheckAttributeType): Make private
5449 (Attribute.ResolveType): Make virtual.
5450 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5451 handling of RootContext.Tree.Types.
5453 2005-01-27 Raja R Harinath <rharinath@novell.com>
5455 Update attribute-handling to use the SimpleName/MemberAccess
5457 * cs-parser.jay (attribute): Pass in an expression to the
5458 constructors of Attribute and GlobalAttribute.
5459 * attribute.cs (Attribute): Take an expression for the name.
5460 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5461 passed in attribute name expression.
5462 (Attribute.CheckAttributeType): Use it.
5463 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5464 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5465 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5466 argument to prevent error messages if the lookup fails.
5468 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5470 * expression.cs (Indirection): Implemented IVariable interface
5471 to support indirection in AddressOf operator.
5472 (PointerArithmetic.Emit): Add optimalization for case where
5473 result can be precomputed.
5475 2005-01-26 Martin Baulig <martin@ximian.com>
5477 * class.cs (TypeContainer.AttributeTargets): Return the correct
5478 AttributeTargets depending on our `Kind' instead of throwing an
5479 exception; fixes #71632.
5481 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5484 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5487 2005-01-25 Raja R Harinath <rharinath@novell.com>
5490 * expression.cs (MemberAccess.DoResolve): Don't complain with
5491 cs0572 when the LHS of a member access has identical name and type
5494 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5497 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5499 Create custom PermissionSet only for PermissionSetAttribute.
5501 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5504 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5505 delegates in static class.
5507 2005-01-24 Martin Baulig <martin@ximian.com>
5509 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5510 merging an implicit block, just use its reachability.
5512 * statement.cs (Block.Resolve): Make the unreachable code check
5513 work wrt. implicit blocks; see test-337 from #63842.
5515 2005-01-21 Alp Toker <alp@atoker.com>
5517 * cs-parser.jay: destructor_declaration's container is PartialContainer
5518 not Class when partial types are used, so use Kind prop instead of
5521 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5523 * cs-parser.jay: Improve error reporting when an interface
5526 2005-01-20 Dick Porter <dick@ximian.com>
5528 * support.cs: SeekableStreamReader fix from Sandor Dobos
5529 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5530 chars are read. Fixes bug 70369.
5532 2005-01-20 Raja R Harinath <rharinath@novell.com>
5534 * cs-parser.jay (catch_clause): Simplify current_block handling
5537 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5539 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5540 code with ImplicitStandardConversion to handle the implicit
5541 conversion of method groups into valid delegate invocations.
5543 The problem is that in parameter handling we were using this code
5544 path. Fixes bug #64698
5546 2005-01-19 Raja R Harinath <rharinath@novell.com>
5548 * cs-parser.jay: Fix several infelicities.
5549 - Avoid assigning to the parser value stack. Code like
5550 '$3 = null' is unclean. Synthesize a value for the code block
5552 - Avoid using oob_stack for storing location information. Use ...
5553 (_mark_): ... this. New (empty) rule. Saves the current location
5555 (foreach_statement): Avoid using oob_stack for current_block
5556 handling. Use technique used in for_statement and
5557 using_statement. Synthesize a value for the code block to store
5558 additional intermediate information.
5560 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5562 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5563 of a different type is only allowed to private fields of a
5564 containing type, not on fields of a base class.
5566 See test-174.cs and error cs0122-9.cs
5568 2005-01-13 Raja R Harinath <rharinath@novell.com>
5570 Fix test-335.cs (bug #58126).
5571 * cs-parser.jay (argument): Split out non-expression parts of the
5572 rule into 'non_simple_argument'.
5573 (invocation_expression): Support parenthesized invocations with
5574 multiple arguments, and with single non-simple arguments.
5576 2005-01-13 Raja R Harinath <rharinath@novell.com>
5578 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5581 2005-01-12 Raja R Harinath <rharinath@novell.com>
5583 Fix cs0038-1.cs, cs1640-6.cs.
5584 * ecore.cs (Expression.Resolve): Remove special-case for
5585 SimpleName in error-handling.
5586 (Expression.almostMatchedMembers): Relax access permission to
5588 (Expression.MemberLookupFailed): Handle duplicates in
5589 almostMatchedMembers list.
5590 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5591 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5592 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5593 overload if the passed in MemberInfo is a MethodBase.
5595 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5598 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5599 for non-CAS & merge permission sets properly.
5601 2005-01-11 Raja R Harinath <rharinath@novell.com>
5603 Improve standard-compliance of simple name and member access
5604 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5605 * ecore.cs (FullNamedExpression): New abstract base class
5606 for Namespaces and TypeExpressions.
5607 (ResolveFlags.SimpleName): Remove.
5608 (SimpleName): Remove support for dotted names.
5609 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5610 DeclSpace.FindType and DeclSpace.LookupType.
5611 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5612 (Expression.ExprClassName): Make member function.
5613 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5614 a namespace. Remove creation of dotted "SimpleName"s.
5615 (MemberAccess.DoResolve): Likewise.
5616 * decl.cs (DeclSpace.Cache): Make private.
5617 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5618 (DeclSpace.FindType): Update.
5619 (DeclSpace.LookupType): Move here from RootContext. Return a
5620 FullNamedExpression.
5621 * namespace.cs (Namespace): Derive from FullNamedExpression
5622 so that it can be part of expression resolution.
5623 (Namespace.Lookup): Return an FullNamedExpression.
5624 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5626 * rootcontext.cs (NamespaceLookup): Remove.
5627 (LookupType): Move to DeclSpace.
5628 * attribute.cs (CheckAttributeType): Update.
5629 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5630 (FindDocumentedTypeNonArray): Likewise.
5632 2005-01-11 Raja R Harinath <rharinath@novell.com>
5634 Fix cs0509.cs, cs1632.cs.
5635 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5636 is the same as IsInterface.
5637 (TypeContainer.GetClassBases): Likewise.
5638 * statement.cs (LabeledStatement.ig): New field.
5639 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5641 (LabeledStatement.DoEmit): Check that the label was created with
5642 the same ILGenerator.
5644 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5647 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5648 accessors to its properties.
5650 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5651 from accessors to property.
5653 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5656 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5659 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5661 * attribute.cs: Check for null and empty strings.
5663 I have lost another battle to Paolo.
5665 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5668 * class.cs (PropertyMethod): Set Parent field in ctors.
5669 (SetMethod.InternalParameters): Add unsafe switch hack.
5670 Override MarkForDuplicationCheck where it is appropriate.
5672 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5673 It says whether container allows members with the same name.
5675 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5676 Removed is_method parameter.
5678 2005-01-06 Duncan Mak <duncan@ximian.com>
5680 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5681 because the previous change led to incorrect reporting of CS1032
5682 ("Cannot define/undefine preprocessor symbols after first token in
5683 file"). Instead of using `tokens_seen' as the only flag that
5684 triggers CS1040, introduce `comments_seen'. This new flag is used
5685 to signify having seen comments on the current line, so it is
5686 unset after a newline.
5688 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5690 * doc.cs : When searching for a type, find nested type too.
5691 This fixes bug #71040.
5693 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5696 - Warn missing member comment on those classes which also does not
5697 have doc comments. Fixed bug #71041.
5698 - Don't warn missing doc comment on default constructor.
5701 2005-01-06 Duncan Mak <duncan@ximian.com>
5703 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5704 comments, set `tokens_seen' to true. This allows us to detect
5705 misplaced preprocessor directives (i.e. not at the beginning of
5706 the a line, nor after whitespaces). In that case, report error
5707 CS1040. This fixes bug #56460.
5709 * cs-parser.jay (interface_member_declaration): Add checks for
5710 IsExplicitImpl, and report CS0541 error if an interface member is
5711 defined as an explicit interface declaration.
5713 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5716 * class.cs (PropertyMethod): Set Parent field in ctors.
5717 (SetMethod.InternalParameters): Add unsafe switch hack.
5719 * decl.cs (MemberCore.Parent): Cannot be readonly.
5721 2005-01-06 Raja R Harinath <rharinath@novell.com>
5723 * decl.cs (DeclSpace.ResolveType): Remove.
5724 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5725 Merge in code from ...
5726 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5727 * class.cs, enum.cs: Update to changes.
5729 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5731 * anonymous.cs: Ensure that we init the scope of our parent if it
5732 has not been initialized yet.
5734 2004-12-30 Duncan Mak <duncan@ximian.com>
5736 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5737 if field.FieldBuilder is null. Fixes #70758.
5739 * convert.cs: Fixed some typos and updated some of the comments.
5740 (ImplicitStandardConversionExists):
5741 (TryImplicitIntConversion): If `target_type' is an interface and
5742 the type of `ic' implements this interface, return true or a new
5743 BoxedCast instead of null. This fixes #70468.
5745 2004-12-29 Duncan Mak <duncan@ximian.com>
5747 * expression.cs (Argument.Emit): Check that Expr is
5748 IMemoryLocation before casting to it, and report CS1510 otherwise.
5752 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5754 * statement.cs (Block.ThisVariable): remove the recursion here, to
5755 make the --profile more sane.
5757 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5759 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5760 assembly, by JB Evain.
5762 2004-12-17 Raja R Harinath <rharinath@novell.com>
5764 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5765 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5766 "parent" refers to enclosing type/class. "base" refers to superclass.
5768 2004-12-17 Raja R Harinath <rharinath@novell.com>
5770 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5771 Ensure that we only have GlobalAttributes.
5772 * attribute.cs (Attribute.Emit): Make non-virtual.
5773 (GlobalAttribute.Emit): Remove.
5774 (Attribute.Resolve): Make virtual.
5775 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5776 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5777 the argument. Don't create one.
5778 (Attribute.GetObsoleteAttribute): Likewise.
5779 (Attribute.GetClsCompliantAttributeValue): Likewise.
5780 * class.cs, decl.cs: Update to changes.
5782 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5784 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5786 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5788 * statement.cs (Foreach.Resolve): Add error 186 report.
5790 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5792 * expression.cs (Conditional.DoResolve): Add warning 429.
5794 * statement.cs (If.Resolve): Add warning 665.
5796 2004-12-16 Raja R Harinath <rharinath@novell.com>
5798 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5799 except when in the parser, and in GlobalAttribute.
5800 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5801 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5802 RootContext.Tree.Types.NamespaceEntry once work is done.
5803 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5804 and resets RootContext.Tree.Types.NamespaceEntry.
5806 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5808 * cs-parser.jay: Don't create a block for every variable.
5810 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5812 * location.cs: Provide extra information.
5814 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5815 variables from the captured environment, it is the ldarg_0.
5817 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5819 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5822 * class.cs: Changed warning level for 169 to avoid developer
5823 displeasure from warning flooding. It will be changed back when they
5824 fix most of current BCL warnings.
5826 * RootContext.cs: Pushed default WarningLevel to 3.
5828 * statement.cs: Removed unused variable.
5830 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5832 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5833 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5834 Add error 502 report.
5835 (StaticClass.DefineType): Add error 441 report.
5836 (Class.AllowedModifiersProp): New virtual property as temporary
5837 extension to AllowedModifiers.
5838 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5839 to share implementation with StaticClass and don't call virtual
5842 * driver.cs (MainDriver): Add error 1558 test.
5844 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5845 report. Moved error 36 test here.
5847 * statement.cs (Throw.Resolve): Add error 724 report.
5849 * typemanager.cs: Add out_attribute_type core type.
5851 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5853 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5855 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5857 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5860 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5862 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5863 Add error 3023 report.
5864 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5866 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5869 2004-12-12 John Luke <john.luke@gmail.com>
5871 * driver.cs (AddArgs): take -- into account when
5872 adding arguments, fixes bug 65710
5874 2004-12-12 Martin Baulig <martin@ximian.com>
5876 * expression.cs (Unary.TryReduceNegative): Added support for
5877 SByteConstant and ByteConstant.
5878 (Unary.Reduce): Check error values from TryReduceNegative().
5880 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5882 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5883 and report exception as error 182.
5885 2004-12-10 Raja R Harinath <rharinath@novell.com>
5887 * driver.cs (Main): Fix message when there are warnings.
5889 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5891 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5893 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5895 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5896 Reduced number of warnings.
5898 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5900 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5902 * driver.cs: Removed message.
5904 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5906 2004-12-08 <vargaz@freemail.hu>
5908 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5910 2004-12-08 Martin Baulig <martin@ximian.com>
5912 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5913 instead of a CS3002 for properties and indexer.
5915 2004-12-08 Martin Baulig <martin@ximian.com>
5917 * decl.cs (MemberName.ToString): Make this work again.
5919 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5921 * attribute.cs (Resolve): Add error 591 detection.
5923 * class.cs (FieldMember.Define): Add error 1547 detection.
5924 (Indexer.Define): Add error 620 detection.
5925 (Operator.Define): Add error 590 detection.
5927 * ecore.cs: Missing argument for error 79.
5929 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5932 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5935 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5938 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5940 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5941 Some operator comments were suppressed.
5942 * doc.cs : Implicit/explicit operator name in doc comments are like
5943 "op_Explicit(type)~returnType", so added suffix handling.
5945 2004-12-07 Martin Baulig <martin@ximian.com>
5948 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5949 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5950 (DeclSpace.ec): New protected field; store the EmitContext here.
5951 (DeclSpace.EmitContext): New public property; moved here from
5953 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5956 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5957 (Enum.Emit): Don't create a new EmitContext.
5959 * delegate.cs (Delegate.DefineType): Always create the
5962 * iterators.cs (Iterators.DefineIterator): Create a new
5963 EmitContext and store it in `ec'.
5965 2004-08-24 Martin Baulig <martin@ximian.com>
5968 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5969 this for accessibility checks.
5970 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5971 IsNestedFamilyAccessible.
5972 (TypeManager.IsSubclassOf): New method, do what the name actually
5975 2004-12-06 Raja R Harinath <rharinath@novell.com>
5977 Fix crash on cs0657-17.cs.
5978 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5979 Use RootContext.Tree.Types, not 'new RootTypes ()'.
5980 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5981 the case where the NamespaceEntry gets overwritten.
5983 2004-12-06 Marek Safar <marek.safar@seznam.cz>
5985 Fixed #69195, #56821
5986 * ecore.cs (ResolveBoolean): Tiny refactoring.
5988 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5989 of right expression resolving when left is false constant and
5990 operator is LogicalAnd OR true constant and operator is LogicalOr.
5992 * statement.cs (ResolveUnreachable): Always reports warning.
5994 2004-12-05 Miguel de Icaza <miguel@ximian.com>
5996 * class.cs: Distinguish between 1721 and 1722 (just a little help
5997 for the programmer).
5999 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6001 * delegate.cs: Only allow this on new versions of the language.
6003 2004-12-02 Duncan Mak <duncan@ximian.com>
6005 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6007 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6008 here as a static method. Take an additional bool out parameter
6009 `must_do_cs1540_check' for signaling to InstanceResolve.
6010 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6011 member field from PropertyExpr class and made it an argument of
6013 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6014 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6015 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6016 and `remove_accessor' as well as InstanceResolve: report CS0122
6021 2004-12-03 Raja R Harinath <rharinath@novell.com>
6023 Fix test-327.cs, test-328.cs, and put in early infrastructure
6024 for eventually fixing #52697.
6025 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6026 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6028 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6029 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6030 (VerifyUsing, error246): Update.
6031 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6032 'NamespaceEntry.LookupNamespaceOrType'.
6034 2004-12-03 Martin Baulig <martin@ximian.com>
6036 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6037 method as our child, call AnonymousMethod.Compatible() on it.
6039 2004-12-03 Raja R Harinath <rharinath@novell.com>
6041 Disable XML documentation support in 'basic' profile.
6042 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6043 Redirect XmlElement to System.Object.
6044 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6045 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6046 * mcs.exe.sources: Add doc-bootstrap.cs.
6047 * doc-bootstrap.cs: New file. Contains empty stub implementation
6050 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6052 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6053 comments are allowed.
6055 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6057 * delegate.cs: Add checks for subtypes in paramaters and return values
6058 in VerifyMethod () to add support for Covariance/Contravariance
6061 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6063 * report.cs: Remove extra closing parenthesis.
6065 * convert.cs (Error_CannotImplicitConversion): If the name of the
6066 types are the same, provide some extra information.
6068 * class.cs (FieldBase): Use an unused bit field from the field to
6069 encode the `has_offset' property from the FieldMember. This saves
6070 a couple of Ks on bootstrap compilation.
6072 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6073 method as our child, return the AnonymousMethod resolved
6076 * expression.cs (New.DoResolve): Allow return values from
6077 NewDelegate to also include AnonymousMethods.
6081 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6084 * attribute.cs (Resolve): Improved implementation of params
6085 attribute arguments.
6087 * support.cs (ParameterData): Add HasParams to be faster.
6089 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6091 all things are for /doc support:
6093 * doc.cs: new file that supports XML documentation generation.
6094 * mcs.exe.sources: added doc.cs.
6096 Handle /doc command line option.
6097 Report error 2006 instead of 5 for missing file name for /doc.
6098 Generate XML documentation when required, after type resolution.
6100 Added support for picking up documentation (/// and /** ... */),
6101 including a new XmlCommentState enumeration.
6103 Added lines to fill Documentation element for field, constant,
6104 property, indexer, method, constructor, destructor, operator, event
6105 and class, struct, interface, delegate, enum.
6106 Added lines to warn incorrect comment.
6108 Added Documentation field (passed only when /doc was specified).
6110 Added DocComment, DocCommentHeader, GenerateDocComment() and
6111 OnGenerateDocComment() and some supporting private members for
6112 /doc feature to MemberCore.
6114 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6116 Added overriden DocCommentHeader.
6118 Added overriden DocCommentHeader and GenerateDocComment().
6120 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6122 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6123 unwrapping the enumeration values, chain to
6124 DoConstantNumericPromotions again, so we can promote things to the
6125 fundamental types (takes care of enums that are bytes, sbytes).
6129 2004-12-01 Raja R Harinath <rharinath@novell.com>
6131 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6132 Fix long-standing bug in type-lookup. Use FindType instead of
6133 LookupType when ec.ResolvingTypeTree.
6134 (Attribute.ResolveType, Attribute.Resolve)
6135 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6137 (Attributes.Search): Remove internal version. Update.
6138 (Attributes.SearchMulti): Update.
6139 (Attributes.GetClsCompliantAttribute): Remove.
6140 (Attributes.GetIndexerNameAttribute): Remove.
6141 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6142 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6143 * class.cs (Indexer.Define): Likewise.
6145 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6148 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6149 MarshallByReference members access.
6151 * expression.cs: Use CheckMarshallByRefAccess;
6152 Better error CS0197 message.
6154 * report.cs: Print whole related error message.
6156 2004-11-30 Raja R Harinath <rharinath@novell.com>
6158 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6159 the current directory to help debugging.
6161 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6163 * class (GetClassBases): Better error 60 report.
6164 (EventProperty): Disabled warning 67 detection.
6166 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6169 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6171 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6174 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6177 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6179 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6181 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6183 * attribute.cs (Attribute.Resolve): Refine error reporting and
6184 report a cs0117 if the identifier does not exist, to distinguish
6185 from 0617 which is a miss-use of the actual identifier.
6187 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6188 between cs0070 and cs0079.
6190 * class.cs (MemberBase.DoDefine): When reporting a wrong
6191 accessibility level, we use MethodCore to compare instead of
6192 Method (this was a regression in some refactoring effort).
6194 So now we correctly report cs0056 again.
6196 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6197 testing the target_type (which was known to be object_type) and
6198 not the source type (which is anonymous_method).
6200 Fixed reporting of error cs1660.
6202 * expression.cs (UserCast.Source): Expose the underlying cast.
6204 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6205 allowed types to find a match to int32 first (most common).
6207 In addition, it ignores any ImplicitUserConversions that did an
6208 internal implicit conversion (as the switch statement allows only
6209 one integral conversion to exist).
6211 * class.cs (PartialContainer.Create): rename `name' to
6212 `member_name' for clarity. Then replace the string calls with a
6213 call to MemberName.GetPartialName, as now using
6214 MemberName.ToString is an error (this is due to the side effects
6215 it had, that were fixed in the past).
6217 This will restore the error reporting on a number of partial class
6218 errors that were missusing this (and getting an exception as a
6219 results, which is now just a plain textual warning, because
6220 yyparse debug output would crash otherwise).
6222 2004-11-26 Raja R Harinath <rharinath@novell.com>
6224 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6226 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6228 * rootcontext.cs (LookupType): Make sure to cache lookups that
6229 don't give us a negative result. This saves about 5% of corlib
6232 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6234 * report.cs (AbstractMessage.Print): messages are sent to stderr
6236 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6237 non-interface in the list of interfaces (at this point, either
6238 parent was properly set, or a base class is being listed in the
6239 interfaces section).
6241 This flags error 1722, and resolves the crash from bug 69259.
6243 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6245 * statement.cs (Using.EmitExpressionFinally): make this work right
6246 for valuetypes. Fixes 69926.
6248 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6250 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6251 converted to an enum" here, before we try to change the underlying
6252 type. This code exists, but it is a different code path than the
6253 one used while encoding constants.
6255 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6256 old bug: when converting from the null literal to a pointer,
6257 return an EmptyCast, not the NullLiteral.
6259 This fixes #69921, the recent null_type changes probably made this
6262 (ImplicitReferenceConversionExists): In addition, resynchronized
6263 the code here, so it matches the same code in
6264 ImplicitReferenceConversionExists for the `from any class-type S
6265 to any interface-type T'.
6268 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6270 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6272 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6274 * cs-parser.jay: Use verbosity accordingly.
6276 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6278 * expression.cs (Unary.ResolveOperator): Do not report warning;
6279 AddressOf reads from variable.
6281 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6283 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6287 * attribute.cs (Attributable): Removed CheckTargets.
6288 (Attributes.Emit): Explicit attribute targets are tested here.
6290 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6291 not enabled for interfaces.
6293 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6294 (GetAssemblyName): Ouch next bug there.
6296 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6298 * expression.cs: Error 275 added.
6300 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6302 Fix bug #69177 (Implemented decimal constant support)
6304 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6305 (BinaryFold): Add DecimalConstant.
6307 * const.cs (Define): Decimal constant
6309 (ChangeType): Add decimal type handling.
6310 (LookupConstantValue): Don't set value for decimal type but
6311 emit DecimalConstantAttribute. Needed for constant optimization.
6313 * constant.cs (ToDecimal): New method.
6314 (ConvertToDecimal): New method.
6315 (IntConstant): Implemented ConvertToDecimal.
6316 (DecimalConstant.Emit): Emit optimized version for decimals in
6319 * expression.cs (ResolveOperator): Changed order of constant
6320 reduction to work correctly with native types which have
6321 overloaded operators.
6322 (ResolveMemberAccess): Extract constant value from attribute
6325 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6327 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6328 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6329 (ChangeType): Decimal is special.
6330 (TypeToCoreType): Add decimal type.
6332 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6334 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6337 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6339 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6342 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6344 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6346 * pending.cs (PendingImplementation): Grab only interfaces.
6348 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6350 * statement.cs (ForeachHelperMethods): Add location member and
6351 error 202 detection.
6353 2004-11-19 Raja R Harinath <rharinath@novell.com>
6355 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
6356 automatically handled by executable.make.
6357 (PROGRAM): Make profile-specific.
6359 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6361 * expression.cs (DoResolveBase): Fixed wrong warning for out
6364 2004-11-18 Martin Baulig <martin@ximian.com>
6366 Merged latest changes into gmcs. Please keep this comment in
6367 here, it makes it easier for me to see what changed in MCS since
6368 the last time I merged.
6370 2004-11-17 Raja R Harinath <rharinath@novell.com>
6372 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6373 (TypeHandle.GetMemberCache): New.
6374 (TypeHandle.TypeHandle): Update.
6375 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6376 (TypeManager.LookupParentInterfacesCache):
6377 Rename from LookupInterfaceCache. Optimize slightly.
6378 (TypeManager.MemberLookup_FindMembers): Update.
6379 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6381 (AddCacheContents): Rename from AddHashtable.
6382 * class.cs (TypeContainer.parent_container): Remove.
6383 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6384 (TypeContainer.DoDefineMembers): Don't initialize it.
6385 Update to name changes.
6387 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6389 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6390 that factors the code to check access modifiers on override.
6392 (PropertyBase): Use the code here.
6394 Patch from Lluis S'anchez, fixes bug #69361.
6396 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6398 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6399 routine that is used to report the use of a captured variable
6400 whose address has been taken.
6402 There are two checks: one when variables are being captured and
6403 the other check is when the address of a variable is taken.
6405 (because an anonymous methods might be resolved before *or* after
6406 the address has been taken) and
6408 * expression.cs (Conditional.DoResolve): Remove the special
6409 casing that Martin added to trueExpr and falseExpr being both
6410 NullLiteral. We get the right behavior now just by introducing
6411 the null_type into the compiler.
6413 * convert.cs (ExplicitConversion): Change the code to use
6414 null_type instead of testing `expr is NullLiteral'.
6415 (ImplicitConversionStandard): use null_type too.
6416 (ImplicitReferenceConversionExists): use null_type too.
6417 (ImplicitReferenceConversion): use null_type too.
6419 * literal.cs: The type of `NullLiteral' is now null_type instead
6421 (Resolve): Set the type here.
6423 * typemanager.cs: Introduce null_type.
6425 2004-11-17 Martin Baulig <martin@ximian.com>
6427 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6428 direction, like FindMembers() does. Fixes #69546, testcase is in
6431 2004-11-16 Martin Baulig <martin@ximian.com>
6433 This is based on a patch from Marek Safar, see bug #69082.
6434 Fixes bugs #63705 and #67130.
6436 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6437 method; create a MemberCache for an interface type and cache the
6440 * decl.cs (IMemberContainer.ParentContainer): Removed.
6441 (IMemberContainer.ParentCache): New property.
6442 (MemberCache.SetupCacheForInterface): Removed.
6443 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6444 to create a cache for an interface's "parent".
6446 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6449 2004-11-16 Martin Baulig <martin@ximian.com>
6451 Merged back from gmcs; these changes already went into gmcs a
6452 couple of weeks ago.
6455 (TypeManager.AddUserType): Removed the `ifaces' argument.
6456 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6458 (TypeManager.AddUserInterface): Removed.
6459 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6461 (TypeManager.GetInterfaces): Likewise.
6462 (TypeManager.GetExplicitInterfaces): Likewise.
6464 * ecore.cs (TypeExpr.GetInterfaces): Removed.
6466 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6467 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6469 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6471 * statement.cs: Avoid adding bools to a hashtable.
6473 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6475 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6476 calling an unsafe method from a safe location.
6478 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6481 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6483 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6485 * namespace.cs (VerifyUsing): use GetPartialName instead of
6488 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6490 * statement.cs (Return.Resolve): Fix regression in typo: if
6491 `in_exc', we have to request a NeedReturnLabel, this was a typo
6492 introduced in the anonymous method check-in. Fixes #69131.
6494 * Indexers were using the ShortName when defining themselves,
6495 causing a regression in the compiler bootstrap when applying the
6496 patch from 2004-11-02 (first part), now they use their full name
6497 and the bug is gone.
6499 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6501 * driver.cs: Strip the path from the names of embedded resources. Fixes
6504 2004-11-04 Raja R Harinath <rharinath@novell.com>
6506 Fix error message regression: cs0104-2.cs.
6507 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6508 (AliasEntry.Resolve): Update.
6509 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6511 (RootContext.LookupType): Update.
6513 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6515 * cs-parser.jay: Add support for handling accessor modifiers
6516 * class: Add support port accessor modifiers and error checking,
6517 define PropertyMethod.Define as virtual (not abstract anymore)
6518 * ecore.cs: Add checking for proeprties access with access modifiers
6519 * iterators.cs: Modify Accessor constructor call based in the modified
6521 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6523 * expression.cs (StringConcat): Handle being called twice,
6524 as when we have a concat in a field init with more than two
6527 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6529 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6530 special case explicit implementations, we should always produce
6531 the .property or .event declaration.
6533 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6534 since it will not return correct data if people use this
6535 unresolved in the presence of using statements (see test-313).
6537 * class.cs (MethodData.Define): If we are an explicit interface
6538 implementation, set the method name to the full name of the
6539 interface plus the name of the method.
6541 Notice that using the method.MethodName.GetFullName() does not
6542 work, as it will only contain the name as declared on the source
6543 file (it can be a shorthand in the presence of using statements)
6544 and not the fully qualifed type name, for example:
6548 class D : ICloneable {
6549 object ICloneable.Clone () {
6553 Would produce a method called `ICloneable.Clone' instead of
6554 `System.ICloneable.Clone'.
6556 * namespace.cs (Alias.Resolve): Use GetPartialName.
6558 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6560 * cs-parser.jay: Add error 1055 report.
6562 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6564 * assign.cs (Assign.DoResolve): Only do the transform of
6565 assignment into a New if the types are compatible, if not, fall
6566 through and let the implicit code deal with the errors and with
6567 the necessary conversions.
6569 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6571 * cs-parser.jay: Add error 1031 report.
6573 * cs-tokenizer.cs: Add location for error 1038.
6575 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6577 * cs-parser.jay: Add error 1016 report.
6579 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6581 * cs-parser.jay: Add errors 1575,1611 report.
6583 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6585 * cs-parser.jay: Add error 1001 report.
6587 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6590 * attribute.cs (GetMarshal): Add method argument for
6591 caller identification.
6593 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6594 agument for GetMarshal and RuntimeMissingSupport.
6596 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6598 * attribute.cs (ExtractSecurityPermissionSet): Removed
6599 TypeManager.code_access_permission_type.
6601 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6603 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6605 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6606 for obsolete use of a variable here. Fixes regression on errors
6607 cs0619-25 and cs0619-26.
6609 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6611 Fix #62358, implemented security attribute encoding.
6613 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6614 Tests permitted SecurityAction for assembly or other types.
6615 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6616 data from SecurityPermissionAttribute to PermisionSet class.
6618 * class.cs (ApplyAttributeBuilder): Added special handling
6619 for System.Security.Permissions.SecurityAttribute based types.
6621 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6622 special handling for System.Security.Permissions.SecurityAttribute
6625 * enum.cs (ApplyAttributeBuilder): Added special handling
6626 for System.Security.Permissions.SecurityAttribute based types.
6628 * parameter.cs (ApplyAttributeBuilder): Added special handling
6629 for System.Security.Permissions.SecurityAttribute based types.
6631 * rootcontext.cs: Next 2 core types.
6633 * typemanager.cs (TypeManager.security_permission_attr_type):
6634 Built in type for the SecurityPermission Attribute.
6635 (code_access_permission_type): Build in type.
6637 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6639 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6640 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6641 all of this information into
6642 EmitContext.EmitCapturedVariableInstance.
6644 * codegen.cs (EmitCapturedVariableInstance): move here the
6645 funcionality of emitting an ldarg.0 in the presence of a
6646 remapping. This centralizes the instance emit code.
6648 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6649 then emit a load of this: it means that we have reached the
6650 topmost ScopeInfo: the one that contains the pointer to the
6651 instance of the class hosting the anonymous method.
6653 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6654 captures to the topmost CaptureContext.
6656 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6658 * expression.cs (LocalVariableReference): Move the knowledge about
6659 the iterators into codegen's EmitCapturedVariableInstance.
6661 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6663 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6664 all code paths return a value from an anonymous method (it is the
6665 same as the 161 error, but for anonymous methods).
6667 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6669 The introduction of anonymous methods in the compiler changed
6670 various ways of doing things in the compiler. The most
6671 significant one is the hard split between the resolution phase
6672 and the emission phases of the compiler.
6674 For instance, routines that referenced local variables no
6675 longer can safely create temporary variables during the
6676 resolution phase: they must do so from the emission phase,
6677 since the variable might have been "captured", hence access to
6678 it can not be done with the local-variable operations from the runtime.
6682 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6683 is a toplevel block.
6685 (ToplevelBlock): A new kind of Block, these are the blocks that
6686 are created by the parser for all toplevel method bodies. These
6687 include methods, accessors and anonymous methods.
6689 These contain some extra information not found in regular blocks:
6690 A pointer to an optional CaptureContext (for tracking captured
6691 local variables and parameters). A pointer to the parent
6694 (Return.Resolve): Catch missmatches when returning a value from an
6695 anonymous method (error 1662).
6696 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6699 (Break.Resolve): ditto.
6701 (SwitchLabel): instead of defining the labels during the
6702 resolution phase, we now turned the public ILLabel and ILLabelCode
6703 labels into methods called GetILLabelCode() and GetILLabel() that
6704 only define the label during the Emit phase.
6706 (GotoCase): Track the SwitchLabel instead of the computed label
6707 (its contained therein). Emit the code by using
6708 SwitchLabel.GetILLabelCode ().
6710 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6711 whether the Local has been captured or not.
6713 (LocalInfo.IsCaptured): New property, used to tell whether the
6714 local has been captured.
6716 * anonymous.cs: Vastly updated to contain the anonymous method
6719 The main classes here are: CaptureContext which tracks any
6720 captured information for a toplevel block and ScopeInfo used to
6721 track the activation frames for various local variables.
6723 Each toplevel block has an optional capture context associated
6724 with it. When a method contains an anonymous method both the
6725 toplevel method and the anonymous method will create a capture
6726 context. When variables or parameters are captured, they are
6727 recorded on the CaptureContext that owns them, for example:
6731 MyDelegate d = delegate {
6736 Here `a' will be recorded as captured on the toplevel
6737 CapturedContext, the inner captured context will not have anything
6738 (it will only have data if local variables or parameters from it
6739 are captured in a nested anonymous method.
6741 The ScopeInfo is used to track the activation frames for local
6742 variables, for example:
6744 for (int i = 0; i < 10; i++)
6745 for (int j = 0; j < 10; j++){
6746 MyDelegate d = delegate {
6751 At runtime this captures a single captured variable `i', but it
6752 captures 10 different versions of the variable `j'. The variable
6753 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6754 recorded on a child.
6756 The toplevel ScopeInfo will also track information like the `this'
6757 pointer if instance variables were referenced (this is necessary
6758 as the anonymous method lives inside a nested class in the host
6759 type of the method).
6761 (AnonymousMethod): Expanded to track the Toplevel, implement
6762 `AnonymousMethod.Compatible' to tell whether an anonymous method
6763 can be converted to a target delegate type.
6765 The routine now also produces the anonymous method content
6767 (AnonymousDelegate): A helper class that derives from
6768 DelegateCreation, this is used to generate the code necessary to
6769 produce the delegate for the anonymous method that was created.
6771 * assign.cs: API adjustments for new changes in
6772 Convert.ImplicitStandardConversionExists.
6774 * class.cs: Adjustments to cope with the fact that now toplevel
6775 blocks are of type `ToplevelBlock'.
6777 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6778 insteda of standard blocks.
6780 Flag errors if params arguments are passed to anonymous methods.
6782 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6783 `CurrentAnonymousMethod' which points to the current Anonymous
6784 Method. The variable points to the AnonymousMethod class that
6785 holds the code being compiled. It is set in the new EmitContext
6786 created for the anonymous method.
6788 (EmitContext.Phase): Introduce a variable and an enumeration to
6789 assist in enforcing some rules about when and where we are allowed
6790 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6791 only one that enfonces this right now).
6793 (EmitContext.HaveCaptureInfo): new helper method that returns
6794 whether we have a CapturedContext initialized.
6796 (EmitContext.CaptureVariable): New method used to register that a
6797 LocalInfo must be flagged for capturing.
6799 (EmitContext.CapturedParameter): New method used to register that a
6800 parameters must be flagged for capturing.
6802 (EmitContext.CapturedField): New method used to register that a
6803 field must be flagged for capturing.
6805 (EmitContext.HaveCapturedVariables,
6806 EmitContext.HaveCapturedFields): Return whether there are captured
6807 variables or fields.
6809 (EmitContext.EmitMethodHostInstance): This is used to emit the
6810 instance for the anonymous method. The instance might be null
6811 (static methods), this (for anonymous methods that capture nothing
6812 and happen to live side-by-side with the current method body) or a
6813 more complicated expression if the method has a CaptureContext.
6815 (EmitContext.EmitTopBlock): Routine that drives the emission of
6816 code: it will first resolve the top block, then emit any metadata
6817 and then emit the code. The split is done so that we can extract
6818 any anonymous methods and flag any captured variables/parameters.
6820 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6821 during this phase, the ILGenerator should not be used as labels
6822 and local variables declared here might not be accessible to any
6823 code that is part of an anonymous method.
6825 Exceptions to this include the temporary variables that are
6826 created by some statements internally for holding temporary
6829 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6832 (EmitContext.TemporaryReturn): This method is typically called
6833 from the Emit phase, and its the only place where we allow the
6834 ReturnLabel to be defined other than the EmitMeta. The reason is
6835 that otherwise we would have to duplicate a lot of logic in the
6836 Resolve phases of various methods that today is on the Emit
6839 (EmitContext.NeedReturnLabel): This no longer creates the label,
6840 as the ILGenerator is not valid during the resolve phase.
6842 (EmitContext.EmitThis): Extended the knowledge in this class to
6843 work in anonymous methods in addition to iterators.
6845 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6846 code is necessary on the stack to access the instance to a local
6847 variable (the variable will be accessed as a field).
6849 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6850 EmitContext.EmitAddressOfParameter): Routines to support
6851 parameters (not completed at this point).
6853 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6854 will also remove the parameters.
6856 * convert.cs (Convert): Define a `ConstantEC' which points to a
6857 null. This is just to prefity some code that uses
6858 ImplicitStandardConversion code and do not have an EmitContext
6861 The idea is to flag explicitly that at that point in time, it is
6862 known that the conversion will not trigger the delegate checking
6863 code in implicit conversions (which requires a valid
6866 Everywhere: pass new EmitContext parameter since
6867 ImplicitStandardConversionExists now requires it to check for
6868 anonymous method conversions.
6870 (Convert.ImplicitStandardConversionExists): If the type of an
6871 expression is the anonymous_method_type, and the type is a
6872 delegate, we invoke the AnonymousMethod.Compatible method to check
6873 whether an implicit conversion is possible.
6875 (Convert.ImplicitConversionStandard): Only do implicit method
6876 group conversions if the language level is not ISO_1.
6878 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6879 MethodInfo for the Invoke method. used by Delegate and
6882 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6883 method conversions if the target type is a delegate.
6885 Removed extra debugging nops.
6887 (LocalVariableReference): Turn the `local_info' into a public
6890 Add `prepared' field, the same hack used for FieldExprs to cope
6891 with composed assignments, as Local variables do not necessarily
6892 operate purely on the stack as they used to: they can be captured
6895 Add `temp' for a temporary result, like fields.
6897 Refactor DoResolve and DoResolveLValue into DoResolveBase.
6899 It now copes with Local variables that are captured and emits the
6900 proper instance variable to load it from a field in the captured
6903 (ParameterReference.DoResolveBase): During the resolve phase,
6904 capture parameters if we are in an anonymous method.
6906 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6907 anonymous method, use the EmitContext helper routines to emit the
6908 parameter reference.
6910 * iterators.cs: Set RemapToProxy to true/false during the
6913 * parameters.cs (GetParameterByName): New helper method.
6915 * typemanager.cs (anonymous_method_type) a new type that
6916 represents an anonyous method. This is always an internal type,
6917 used as a fencepost to test against the anonymous-methodness of an
6920 2004-10-20 Marek Safar <marek.safar@seznam.cz>
6922 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6924 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6926 2004-10-18 Martin Baulig <martin@ximian.com>
6928 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6929 `Type' directly, but call ResolveType() on it.
6930 (Catch.Resolve): Likewise.
6931 (Foreach.Resolve): Likewise.
6933 2004-10-18 Martin Baulig <martin@ximian.com>
6935 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6936 `Type' directly, but call ResolveType() on it.
6937 (Probe.DoResolve): Likewise.
6938 (ArrayCreation.LookupType): Likewise.
6939 (TypeOf.DoResolve): Likewise.
6940 (SizeOf.DoResolve): Likewise.
6942 2004-10-18 Martin Baulig <martin@ximian.com>
6944 * expression.cs (Invocation.BetterFunction): Put back
6945 TypeManager.TypeToCoreType().
6947 2004-10-18 Raja R Harinath <rharinath@novell.com>
6949 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6952 2004-10-18 Martin Baulig <martin@ximian.com>
6954 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
6955 `Type' directly, but call ResolveType() on it.
6957 2004-10-18 Martin Baulig <martin@ximian.com>
6959 * class.cs (FieldMember.Define): Don't access the TypeExpr's
6960 `Type' directly, but call ResolveType() on it.
6961 (MemberBase.DoDefine): Likewise.
6963 * expression.cs (New.DoResolve): Don't access the TypeExpr's
6964 `Type' directly, but call ResolveType() on it.
6965 (ComposedCast.DoResolveAsTypeStep): Likewise.
6967 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6968 `Type' directly, but call ResolveType() on it.
6970 2004-10-17 John Luke <john.luke@gmail.com>
6972 * class.cs (Operator.GetSignatureForError): use CSharpName
6974 * parameter.cs (Parameter.GetSignatureForError): Returns
6975 correct name even if was not defined.
6977 2004-10-13 Raja R Harinath <rharinath@novell.com>
6980 * class.cs (TypeContainer.EmitContext): New property.
6981 (DefineNestedTypes): Create an emitcontext for each part.
6982 (MethodCore.DoDefineParameters): Use container's emitcontext.
6983 Pass type array to InternalParameters.
6984 (MemberBase.DoDefine): Use container's emitcontext.
6985 (FieldMember.Define): Likewise.
6986 (Event.Define): Likewise.
6987 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6988 Pass type array to InternalParameters.
6989 (SetIndexerMethod.GetParameterInfo): Likewise.
6990 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6991 * delegate.cs (Define): Pass emitcontext to
6992 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6993 array to InternalParameters.
6994 * expression.cs (ParameterReference.DoResolveBase): Pass
6995 emitcontext to GetParameterInfo.
6996 (ComposedCast.DoResolveAsTypeStep): Remove check on
6997 ec.ResolvingTypeTree.
6998 * parameter.cs (Parameter.Resolve): Change argument to
6999 EmitContext. Use ResolveAsTypeTerminal.
7000 (Parameter.GetSignature): Change argument to EmitContext.
7001 (Parameters.ComputeSignature): Likewise.
7002 (Parameters.ComputeParameterTypes): Likewise.
7003 (Parameters.GetParameterInfo): Likewise.
7004 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7005 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7006 * support.cs (InternalParameters..ctor): Remove variant that takes
7008 * typemanager.cs (system_intptr_expr): New.
7009 (InitExpressionTypes): Initialize it.
7011 2004-10-12 Chris Toshok <toshok@ximian.com>
7013 * cs-parser.jay: fix location for try_statement and catch_clause.
7015 2004-10-11 Martin Baulig <martin@ximian.com>
7017 * report.cs: Don't make --fatal abort on warnings, we have
7018 -warnaserror for that.
7020 2004-10-07 Raja R Harinath <rharinath@novell.com>
7022 More DeclSpace.ResolveType avoidance.
7023 * decl.cs (MemberCore.InUnsafe): New property.
7024 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7025 with newly created EmitContext.
7026 (FieldMember.Define): Likewise.
7027 * delegate.cs (Delegate.Define): Likewise.
7028 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7029 only if normal name-lookup fails.
7030 (TypeExpr.DoResolve): Enable error-checking.
7031 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7032 (SizeOf.DoResolve): Likewise.
7033 (ComposedCast.DoResolveAsTypeStep): Likewise.
7034 (StackAlloc.DoResolve): Likewise.
7035 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7036 (Block.Unsafe): New property.
7037 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7038 (Unsafe): Set 'unsafe' flag of contained block.
7039 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7040 (Fixed.Resolve): Likewise.
7041 (Catch.Resolve): Likewise.
7042 (Using.ResolveLocalVariableDecls): Likewise.
7043 (Foreach.Resolve): Likewise.
7045 2004-10-05 John Luke <john.luke@gmail.com>
7047 * cs-parser.jay: add location to error CS0175
7049 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7051 * ecore.cs (Expression.Constantity): Add support for turning null
7054 * const.cs (Const.Define): Allow constants to be reference types
7055 as long as the value is Null.
7057 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7059 * namespace.cs (NamespaceEntry.Using): No matter which warning
7060 level is set, check if this namespace name has already been added.
7062 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7064 * expression.cs: reftype [!=]= null should always use br[true,false].
7067 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7070 * attribute.cs: Enum conversion moved to
7071 GetAttributeArgumentExpression to be applied to the all
7074 2004-10-01 Raja R Harinath <rharinath@novell.com>
7076 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7077 * class.c (TypeContainer.DefineType): Flag error if
7078 base types aren't accessible due to access permissions.
7079 * decl.cs (DeclSpace.ResolveType): Move logic to
7080 Expression.ResolveAsTypeTerminal.
7081 (DeclSpace.ResolveTypeExpr): Thin layer over
7082 Expression.ResolveAsTypeTerminal.
7083 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7084 Refactor code into NestedAccess. Use it.
7085 (DeclSpace.NestedAccess): New.
7086 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7087 argument to silence errors. Check access permissions.
7088 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7089 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7090 (Cast.DoResolve): Likewise.
7091 (New.DoResolve): Likewise.
7092 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7093 (TypeOf.DoResolve): Likewise.
7095 * expression.cs (Invocation.BetterConversion): Return the Type of
7096 the better conversion. Implement section 14.4.2.3 more faithfully.
7097 (Invocation.BetterFunction): Make boolean. Make correspondence to
7098 section 14.4.2.2 explicit.
7099 (Invocation.OverloadResolve): Update.
7100 (Invocation): Remove is_base field.
7101 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7102 (Invocation.Emit): Likewise.
7104 2004-09-27 Raja R Harinath <rharinath@novell.com>
7106 * README: Update to changes.
7108 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7110 * cs-parser.jay: Reverted 642 warning fix.
7112 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7115 * decl.cs (FindMemberWithSameName): Indexer can have more than
7118 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7120 * expression.cs (LocalVariableReference.DoResolveLValue):
7121 Do not report warning 219 for out values.
7122 (EmptyExpression.Null): New member to avoid extra allocations.
7124 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7126 * cs-parser.jay: Fix wrong warning 642 report.
7128 * cs-tokenizer.cs (CheckNextToken): New helper;
7129 Inspect next character if is same as expected.
7131 2004-09-23 Martin Baulig <martin@ximian.com>
7133 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7134 (Convert.ImplicitReferenceConversionExists): Likewise.
7136 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7138 * class.cs (Operator.Define): Add error 448 and 559 report.
7140 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7142 * class.cs (MemberBase.IsTypePermitted): New protected
7143 method for checking error CS0610.
7145 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7147 * class.cs (TypeContainer.HasExplicitLayout): New property
7148 Returns whether container has StructLayout attribute set Explicit.
7149 (FieldMember): New abstract class for consts and fields.
7150 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7151 (Field): Reuse FieldMember.
7153 * const.cs (Const): Reuse FieldMember.
7155 * rootcontext.cs: EmitConstants call moved to class.
7157 2004-09-22 Martin Baulig <martin@ximian.com>
7159 Thanks to Peter Sestoft for this bug report.
7161 * expression.cs (Conditional): If both the `trueExpr' and the
7162 `falseExpr' is a NullLiteral, return a NullLiteral.
7164 2004-09-22 Martin Baulig <martin@ximian.com>
7166 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7167 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7168 for the "get_Current" call.
7170 2004-09-22 Martin Baulig <martin@ximian.com>
7172 Marek and me just fixed one of our oldest bugs: #28562 :-)
7174 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7176 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7177 we're an EnumConstant, just return that.
7178 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7179 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7180 to get the value which'll actually be written into the attribute.
7181 However, we have to use GetValue() to access the attribute's value
7184 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7186 * constant.cs (Constant.IsNegative): New abstract property
7189 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7190 (StackAlloc.DoResolve): Reused IsNegative.
7192 2004-09-21 Martin Baulig <martin@ximian.com>
7194 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7195 if we're used in an iterator, we may be called from different
7198 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7199 we actually have an exception block.
7201 2004-09-20 John Luke <jluke@cfl.rr.com>
7203 * class.cs, cs-parser.jay: Improve the error report for 1520:
7204 report the actual line where the error happens, not where the
7207 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7208 Pass location information that was available elsewhere.
7210 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
7212 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7213 runtime to delay sign assemblies.
7215 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7217 * cs-parser.jay: Do not report the stack trace, this is barely
7220 2004-08-22 John Luke <john.luke@gmail.com>
7222 * driver.cs : check that a resource id is not already used
7223 before adding it, report CS1508 if it is, bug #63637
7225 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7227 * ecore.cs: Removed dead code.
7229 2004-09-18 Marek Safar <marek.safar@seznam.cz>
7231 * class.cs: Do not report warning CS0067 on the interfaces.
7233 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7235 * cs-parser.jay: Add error 504 report.
7237 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7239 * rootcontext.cs: WarningLevel is 4 by default now.
7241 * statement.cs (Fixed.Resolve): Do not null
7244 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7247 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7248 deep search when property is not virtual.
7249 (PropertyExpr.ResolveAccessors): Make one call for both
7252 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7255 * statement.cs: Error 152 report constains also location.
7257 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7260 * const.cs: Explicitly set constant as static.
7262 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7265 * cs-parser.jay: Add error 1017 report.
7267 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7269 Fixed bug #59980, #64224
7270 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7272 * typemanager.cs (IsSpecialMethod): Simplified
7274 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7276 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7277 condition with better params.
7279 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7282 * attribute.cs (Resolve): Property has to have both
7285 2004-09-14 Martin Baulig <martin@ximian.com>
7287 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7289 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7292 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7293 called and is obsolete then this member suppress message
7294 when call is inside next [Obsolete] method or type.
7296 * expression.cs: Use TestObsoleteMethodUsage member.
7298 2004-09-14 Martin Baulig <martin@ximian.com>
7300 * cs-parser.jay: Sync a bit with the GMCS version.
7302 2004-09-14 Martin Baulig <martin@ximian.com>
7304 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7305 (CSharpParser.yacc_verbose_flag): New public field.
7307 * genericparser.cs: Removed.
7309 2004-09-14 Raja R Harinath <rharinath@novell.com>
7311 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7313 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7315 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7317 2004-09-10 Martin Baulig <martin@ximian.com>
7319 Backported my MemberName changes from GMCS into MCS.
7321 - we are now using a special `MemberName' class instead of using
7322 strings; in GMCS, the `MemberName' also contains the type
7325 - changed the grammar rules a bit:
7326 * the old `member_name' is now a `namespace_or_type_name':
7327 The rule is that we use `namespace_or_type_name' everywhere
7328 where we expect either a "member name" (GetEnumerator) or a
7329 "member name" with an explicit interface name
7330 (IEnumerable.GetEnumerator).
7331 In GMCS, the explicit interface name may include type arguments
7332 (IEnumerable<T>.GetEnumerator).
7333 * we use `member_name' instead of just `IDENTIFIER' for
7335 The rule is that we use `member_name' wherever a member may
7336 have type parameters in GMCS.
7338 * decl.cs (MemberName): New public class.
7339 (MemberCore.MemberName): New public readonly field.
7340 (MemberCore.ctor): Take a `MemberName' argument, not a string.
7341 (DeclSpace): Likewise.
7343 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7344 * enum.cs (Enum.ctor): Likewise.
7346 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7348 (AliasEntry.ctor): Take a MemberName, not an Expression.
7349 (AliasEntry.UsingAlias): Likewise.
7351 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7352 (IMethodData.MemberName): Changed type from string to MemberName.
7353 (MemberBase.ExplicitInterfaceName): Likewise.
7354 (AbstractPropertyEventMethod.SetupName): Make this private.
7355 (AbstractPropertyEventMethod.ctor): Added `string prefix'
7356 argument; compute the member name here.
7357 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7358 on the `member.MemberName' and the `prefix'.
7360 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7362 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7363 thus, we get a `MemberName' instead of a `string'. These
7364 declarations may have type parameters in GMCS.
7365 (interface_method_declaration, delegate_declaration): Likewise.
7366 (class_declaration, interface_declaration): Likewise.
7367 (method_header): Use `namespace_or_type_name' instead of
7368 `member_name'. We may be an explicit interface implementation.
7369 (property_declaration, event_declaration): Likewise.
7370 (member_name): This is now just an `IDENTIFIER', not a
7371 `namespace_or_type_name'.
7372 (type_name, interface_type): Removed.
7373 (namespace_or_type_name): Return a MemberName, not an Expression.
7374 (primary_expression): Use `member_name' instead of `IDENTIFIER';
7375 call GetTypeExpression() on the MemberName to get an expression.
7376 (IndexerDeclaration.interface_type): Changed type from string to
7378 (MakeName): Operate on MemberName's instead of string's.
7380 2004-09-13 Raja R Harinath <rharinath@novell.com>
7383 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7384 (NamespaceEntry.Lookup): Add new argument to flag if we want the
7385 lookup to avoid symbols introduced by 'using'.
7386 * rootcontext.cs (NamespaceLookup): Update.
7388 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7390 * class.cs (TypeContainer.DoDefineMembers): Do not call
7391 DefineDefaultConstructor for static classes.
7393 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7395 * attribute.cs (Attribute.Resolve): Add error 653 report.
7397 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7399 (Method.ApplyAttributeBuilder): Add error 685 report.
7400 (Operator.Define): Add error 564 report.
7402 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7404 * expression.cs (Invocation.DoResolve): Add error
7407 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7410 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7412 * class.cs (ConstructorInitializer.Resolve):
7413 Wrong error number (515->516).
7415 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7417 * class.cs (Indexer.Define): Add error 631 report.
7419 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7421 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7423 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7425 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7427 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7429 * cs-parser.jay: Added error CS0241 report.
7431 2004-09-10 Raja R Harinath <rharinath@novell.com>
7433 * cs-parser.jay (fixed_statement): Introduce a scope for the
7434 declaration in the 'fixed' statement.
7436 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7438 * cs-parser.jay: Added CS0230 error report.
7440 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7442 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7444 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7446 * expression.cs (Argument.Resolve): Added error CS0192 and
7449 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7451 C# 2.0 #pragma warning feature
7453 * cs-tokenizer.cs (PreProcessPragma): New method;
7454 Handles #pragma directive.
7456 * report.cs (WarningRegions): New class; Support
7457 class for #pragma warning directive. It tests whether
7458 warning is enabled for a given line.
7460 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7462 * const.cs: Add more descriptive error report, tahnks to
7465 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7467 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7469 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7471 * expression.cs: Apply patch from Ben: Remove dead code from
7472 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7473 as that code just threw an exception anwyays.
7475 * const.cs: Remove the call to the turnintoconstant, for details
7478 * literal.cs: The type of the null-literal is the null type; So
7479 we use a placeholder type (literal.cs:System.Null, defined here)
7482 * expression.cs (Conditional.DoResolve): Remove some old code that
7483 is no longer needed, conversions have been fixed.
7485 (ArrayCreationExpression.DoResolve): Return false if we fail to
7486 resolve the inner expression.
7488 2004-09-07 Raja R Harinath <rharinath@novell.com>
7491 * cs-parser.jay (delegate_declaration): Record a delegate
7492 declaration as a type declaration.
7493 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7495 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7497 * parameter.cs: Do not crash if the type can not be resolved.
7499 * expression.cs: Report errors with unsafe pointers, fixes #64896
7501 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7503 * expression.cs: Pointer arith always needs to do a conv.i
7504 if the operand is a long. fix 65320
7506 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7508 Fixed cs0619-37.cs, cs0619-38.cs
7510 * enum.cs (GetObsoleteAttribute): Removed.
7512 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7513 on Enum member is double staged. The first is tested member
7516 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7518 Fixed #56986, #63631, #65231
7520 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7521 adds member to name container.
7522 (TypeContainer.AddToTypeContainer): New method, adds type to
7524 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7525 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7526 AddOperator): Simplified by reusing AddToMemberContainer.
7527 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7529 (Method.CheckForDuplications): Fixed implementation to test all
7531 (MemberBase): Detection whether member is explicit interface
7532 implementation is now in constructor.
7533 (MemberBase.UpdateMemberName): Handles IndexerName.
7534 (Accessor): Changed to keep also location information.
7535 (AbstractPropertyEventMethod): Is derived from MemberCore.
7536 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7537 will be emited or not.
7538 (PropertyBase.AreAccessorsDuplicateImplementation):
7539 Tests whether accessors are not in collision with some method.
7540 (Operator): Is derived from MethodCore to simplify common
7543 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7545 (DeclSpace.AddToContainer): Adds the member to defined_names
7546 table. It tests for duplications and enclosing name conflicts.
7548 * enum.cs (EnumMember): Clean up to reuse the base structures
7550 2004-09-03 Martin Baulig <martin@ximian.com>
7552 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7553 into TypeContainer, to make partial classes work again.
7555 2004-09-03 Martin Baulig <martin@ximian.com>
7557 * rootcontext.cs (RootContext.V2): Removed.
7559 2004-03-23 Martin Baulig <martin@ximian.com>
7561 * expression.cs (Invocation.OverloadResolve): Added `bool
7562 may_fail' argument and use it instead of the Location.IsNull() hack.
7564 2004-09-03 Martin Baulig <martin@ximian.com>
7566 Merged latest changes into gmcs. Please keep this comment in
7567 here, it makes it easier for me to see what changed in MCS since
7568 the last time I merged.
7570 2004-09-03 Raja R Harinath <rharinath@novell.com>
7573 * expression.cs (BetterConversion): Don't allow either conversion
7574 to be null. Remove redundant implicit conversion test when 'q ==
7575 null' -- when this function is invoked, we already know that the
7576 implicit conversion exists.
7577 (BetterFunction): Assume that 'best' is non-null. Remove
7578 redundant reimplementation of IsApplicable when 'best' is null.
7579 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7580 number of arguments.
7581 (IsAncestralType): Extract from OverloadResolve.
7582 (OverloadResolve): Make robust to the MethodGroupExpr being
7583 unsorted. Implement all the logic of Section 14.5.5.1, and
7584 support overloading of methods from multiple applicable types.
7585 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7587 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7588 (RealError, Warning): Append type of report to related symbol.
7590 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7592 * enum.cs: Fixed CLS-Compliance checks for enum members.
7593 Error tests cs3008-8.cs, cs3014-8.cs
7595 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7597 Fixed bug #62342, #63102
7598 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7599 like ImplementMethod.
7601 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7603 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7606 2004-09-02 Martin Baulig <martin@ximian.com>
7608 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7609 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7612 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7614 C# 2.0 Static classes implemented
7616 * class.cs (TypeContainer): instance_constructors,
7617 initialized_fields, initialized_static_fields,
7618 default_constructor, base_inteface_types are protected to be
7619 accessible from StaticClass.
7620 (TypeContainer.DefineDefaultConstructor): New virtual method
7621 for custom default constructor generating
7622 (StaticClass): New class to handle "Static classes" feature.
7624 * cs-parser.jay: Handle static keyword on class like instance
7627 * driver.cs: Added "/langversion" command line switch with two
7628 options (iso-1, default).
7630 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7632 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7634 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7636 * delegate.cs: Style.
7638 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7640 * delegate.cs: Add seperate instance expr field for miguel.
7642 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7644 * PointerArithmetic (Resolve): make sure we are not doing
7645 pointer arith on void*. Also, make sure we are resolved
7646 by not setting eclass until resolve.
7648 All callers: Make sure that PointerArithmetic gets resolved.
7650 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7652 * ArrayCreation (LookupType): If the type does not resolve
7653 to an array, give an error.
7655 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7657 * statement.cs (Try.Resolve): Fixed bug #64222
7659 2004-08-27 Martin Baulig <martin@ximian.com>
7662 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7665 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7667 * ecore.cs (Constantify): Get underlying type via
7668 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7669 Windows in special cases.
7671 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7673 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7674 for obtaining also private methods.
7675 (GetRemoveMethod): Used GetRemoveMethod (true)
7676 for obtaining also private methods.
7678 2004-08-24 Martin Baulig <martin@ximian.com>
7680 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7681 MethodAttributes.HideBySig for operators.
7683 2004-08-23 Martin Baulig <martin@ximian.com>
7685 Back to the old error reporting system :-)
7687 * report.cs (Message): Removed.
7688 (Report.MessageData, ErrorData, WarningData): Removed.
7689 (Report.Error, Warning): Back to the old system.
7691 2004-08-23 Martin Baulig <martin@ximian.com>
7693 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7695 * class.cs (TypeContainer.ParentContainer): New public virtual
7696 method; replaces the explicit interface implementation.
7697 (ClassPart.ParentContainer): Override.
7699 2004-08-23 Martin Baulig <martin@ximian.com>
7701 * statement.cs (Switch): Added support for constant switches; see
7702 #59428 or test-285.cs.
7704 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7707 * statement.cs (GetEnumeratorFilter): Removed useless
7708 logic because C# specs is strict. GetEnumerator must be
7711 2004-08-22 Martin Baulig <martin@ximian.com>
7713 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7714 a switch and may break, reset the barrier. Fixes #59867.
7716 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7718 CLS-Compliance speed up (~5% for corlib)
7720 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7721 New method. Tests container for CLS-Compliant names
7723 * class.cs (TypeContainer.VerifyClsName): New method.
7724 Checks whether container name is CLS Compliant.
7725 (Constructor): Implements IMethodData.
7727 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7728 low-case table for CLS Compliance test.
7729 (MemberCache.VerifyClsParameterConflict): New method.
7730 Checks method parameters for CS3006 error.
7732 * enum.cs (EnumMember): Is derived from MemberCore.
7733 (Enum.VerifyClsName): Optimized for better performance.
7735 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7737 * report.cs: Renamed Error_T to Error and changed all
7740 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7742 * class.cs (TypeContainer.IndexerArrayList): New inner class
7743 container for indexers.
7744 (TypeContainer.DefaultIndexerName): New constant for default
7745 indexer name. Replaced all "Item" with this constant.
7746 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7748 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7749 DefaultMemberAttribute constructor.
7751 2004-08-05 Martin Baulig <martin@ximian.com>
7753 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7756 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7758 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7759 multi platforms problem.
7761 * compiler.csproj: Included shared files.
7763 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7765 Fix bug 60333, 55971 in the more general way
7766 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7767 Added arg_type argument for constant conversion.
7768 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7770 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7773 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7774 OperatorArrayList, MethodCoreArrayList for typecontainer
7775 containers. Changed class member types to these new types.
7776 (MethodArrayList.DefineMembers): Added test for CS0659.
7778 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7780 * cfold.cs: Synchronize the folding with the code in expression.cs
7781 Binary.DoNumericPromotions for uint operands.
7783 * attribute.cs: Revert patch from Raja, it introduced a regression
7784 while building Blam-1.2.1 (hard to isolate a test case).
7786 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7790 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7792 (MethodCore.parent_method): New member. The method we're overriding
7793 if this is an override method.
7794 (MethodCore.CheckBase): Moved from Method class and made common.
7795 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7797 (MethodCore.CheckForDuplications): New abstract method. For custom
7798 member duplication search in a container
7799 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7800 method and its return type.
7801 (Event.conflict_symbol): New member. Symbol with same name in the
7805 (MemberCache.FindMemberWithSameName): New method. The method
7806 is looking for conflict with inherited symbols.
7808 2004-08-04 Martin Baulig <martin@ximian.com>
7810 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7812 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7814 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7816 * report.cs (Message): New enum for better error, warning reference in
7818 (MessageData): New inner abstract class. It generally handles printing of
7819 error and warning messages.
7820 Removed unused Error, Warning, Message methods.
7822 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7824 Fix for cs0592-8.cs test
7826 (Attributable.ValidAttributeTargets): Made public.
7827 (Attribute.ExplicitTarget): New member for explicit target value.
7828 (Attribute.CheckTargets): Now we translate explicit attribute
7829 target to Target here.
7831 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7833 * ecore.cs (MethodGroupExpr): new IsBase property.
7835 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7837 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7838 rather than an instance expr.
7840 (DelegateCreation.Emit): Use the method group rather than
7841 the instance expression. Also, if you have base.Foo as the
7842 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7844 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7846 (NewDelegate.DoResolve): Only check for the existance of Invoke
7847 if the method is going to be needed. Use MethodGroupExpr.
7849 (NewDelegate.Emit): Remove, DelegateCreation implements this.
7851 * expression.cs: For pointer arith., make sure to use
7852 the size of the type, not the size of the pointer to
7855 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7858 * class.cs (Class): Added error CS0502 test.
7860 2004-08-03 John Luke <jluke@cfl.rr.com>
7861 Raja R Harinath <rharinath@novell.com>
7864 * attribute.cs (Attribute.complained_before): New flag.
7865 (Attribute.ResolveType, Attribute.Resolve),
7866 (Attribute.DefinePInvokeMethod): Set it.
7867 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7869 2004-08-03 Martin Baulig <martin@ximian.com>
7871 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7872 use a user-defined operator; we still need to do numeric
7873 promotions in case one argument is a builtin type and the other
7874 one has an implicit conversion to that type. Fixes #62322.
7876 2004-08-02 Martin Baulig <martin@ximian.com>
7878 * statement.cs (LocalInfo.Flags): Added `IsThis'.
7879 (LocalInfo.IsThis): New public property.
7880 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7882 2004-08-01 Martin Baulig <martin@ximian.com>
7884 * class.cs (TypeContainer.GetClassBases): Don't set the default
7885 here since we may get called from GetPartialBases().
7886 (TypeContainer.DefineType): If GetClassBases() didn't return a
7887 parent, use the default one.
7889 2004-07-30 Duncan Mak <duncan@ximian.com>
7891 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7893 2004-07-30 Martin Baulig <martin@ximian.com>
7895 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7897 * class.cs (SourceMethod): New public class, derive from the
7898 symbol writer's ISourceMethod.
7899 (Method): Use the new symbol writer API.
7901 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7902 as argument and use the new symbol writer.
7905 (SourceFile): Implement the symbol writer's ISourceFile.
7906 (Location.SymbolDocument): Removed.
7907 (Location.SourceFile): New public property.
7909 * symbolwriter.cs: Use the new symbol writer API.
7911 2004-07-30 Raja R Harinath <rharinath@novell.com>
7913 * Makefile (install-local): Remove. Functionality moved to
7916 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
7918 * Makefile: Install mcs.exe.config file together with mcs.exe.
7919 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7920 correct runtime version.
7922 2004-07-25 Martin Baulig <martin@ximian.com>
7925 (TypeContainer.RegisterOrder): Removed, this was unused.
7926 (TypeContainer, interface_order): Removed.
7927 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7928 TypeContainer as argument since we can also be called with a
7929 `PartialContainer' for a partial class/struct/interface.
7930 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7931 of checking whether we're an `Interface' - we could be a
7933 (PartialContainer.Register): Override; call
7934 AddClass()/AddStruct()/AddInterface() on our parent.
7936 * cs-parser.jay (interface_member_declaration): Add things to the
7937 `current_container', not the `current_class'.
7939 * rootcontext.cs (RegisterOrder): The overloaded version which
7940 takes an `Interface' was unused, removed.
7942 * typemanager.cs (TypeManager.LookupInterface): Return a
7943 `TypeContainer', not an `Interface'.
7944 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7945 contain a `PartialContainer' for an interface, so check it's
7946 `Kind' to figure out what it is.
7948 2004-07-25 Martin Baulig <martin@ximian.com>
7950 * class.cs (Class.DefaultTypeAttributes): New public constant.
7951 (Struct.DefaultTypeAttributes): Likewise.
7952 (Interface.DefaultTypeAttributes): Likewise.
7953 (PartialContainer.TypeAttr): Override this and add the
7954 DefaultTypeAttributes.
7956 2004-07-25 Martin Baulig <martin@ximian.com>
7958 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7959 we can just use the `Parent' field instead.
7961 2004-07-25 Martin Baulig <martin@ximian.com>
7963 * class.cs (TypeContainer.Emit): Renamed to EmitType().
7965 2004-07-25 Martin Baulig <martin@ximian.com>
7967 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7968 our parts before defining any methods.
7969 (TypeContainer.VerifyImplements): Make this virtual.
7970 (ClassPart.VerifyImplements): Override and call VerifyImplements()
7971 on our PartialContainer.
7973 2004-07-25 Martin Baulig <martin@ximian.com>
7975 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7977 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7978 argument, we can just use the `Parent' field instead.
7981 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
7982 (MemberBase.DoDefine): Likewise.
7984 2004-07-24 Martin Baulig <martin@ximian.com>
7986 * decl.cs (MemberCore.Parent): New public field.
7987 (DeclSpace.Parent): Moved to MemberCore.
7989 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7990 (MemberBase.ctor): Added TypeContainer argument, pass it to our
7992 (FieldBase, Field, Operator): Likewise.
7993 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7994 (EventField, Event): Likewise.
7996 2004-07-23 Martin Baulig <martin@ximian.com>
7998 * class.cs (PartialContainer): New public class.
7999 (ClassPart): New public class.
8000 (TypeContainer): Added support for partial classes.
8001 (TypeContainer.GetClassBases): Splitted some of the functionality
8002 out into GetNormalBases() and GetPartialBases().
8004 * cs-tokenizer.cs (Token.PARTIAL): New token.
8005 (Tokenizer.consume_identifier): Added some hacks to recognize
8006 `partial', but only if it's immediately followed by `class',
8007 `struct' or `interface'.
8009 * cs-parser.jay: Added support for partial clases.
8011 2004-07-23 Martin Baulig <martin@ximian.com>
8013 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8014 a `DeclSpace' and also made it readonly.
8015 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8016 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8017 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8019 * cs-parser.jay: Pass the `current_class', not the
8020 `current_container' (at the moment, this is still the same thing)
8021 to a new Method, Property, Event, Indexer or Constructor.
8023 2004-07-23 Martin Baulig <martin@ximian.com>
8025 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8026 and removed the `current_interface' one.
8027 (struct_declaration, class_declaration, interface_declaration):
8028 Set `current_class' to the newly created class/struct/interface;
8029 set their `Bases' and call Register() before parsing their body.
8031 2004-07-23 Martin Baulig <martin@ximian.com>
8033 * class.cs (Kind): New public enum.
8034 (TypeContainer): Made this class abstract.
8035 (TypeContainer.Kind): New public readonly field.
8036 (TypeContainer.CheckDef): New public method; moved here from
8038 (TypeContainer.Register): New public abstract method.
8039 (TypeContainer.GetPendingImplementations): New public abstract
8041 (TypeContainer.GetClassBases): Removed the `is_class' and
8042 `is_iface' parameters.
8043 (TypeContainer.DefineNestedTypes): Formerly known as
8045 (ClassOrStruct): Made this class abstract.
8047 * tree.cs (RootTypes): New public type.
8049 2004-07-20 Martin Baulig <martin@ximian.com>
8051 * tree.cs (Tree.RecordNamespace): Removed.
8052 (Tree.Namespaces): Removed.
8054 * rootcontext.cs (RootContext.IsNamespace): Removed.
8056 * cs-parser.jay (namespace_declaration): Just create a new
8057 NamespaceEntry here.
8059 2004-07-20 Martin Baulig <martin@ximian.com>
8061 * statement.cs (ExceptionStatement): New abstract class. This is
8062 now used as a base class for everyone who's using `finally'.
8063 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8064 our local variables before using them.
8066 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8067 virtual method. This is used by Yield.Resolve() to "steal" an
8068 outer block's `finally' clauses.
8069 (FlowBranchingException): The .ctor now takes an ExceptionStatement
8072 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8073 version which takes an ExceptionStatement. This version must be
8074 used to create exception branchings.
8077 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8078 (Iterator.EmitMoveNext): Added exception support; protect the
8079 block with a `fault' clause, properly handle 'finally' clauses.
8080 (Iterator.EmitDispose): Run all the `finally' clauses here.
8082 2004-07-20 Martin Baulig <martin@ximian.com>
8084 * iterator.cs: This is the first of a set of changes in the
8085 iterator code. Match the spec more closely: if we're an
8086 IEnumerable, then GetEnumerator() must be called. The first time
8087 GetEnumerator() is called, it returns the current instance; all
8088 subsequent invocations (if any) must create a copy.
8090 2004-07-19 Miguel de Icaza <miguel@ximian.com>
8092 * expression.cs: Resolve the constant expression before returning
8095 2004-07-19 Martin Baulig <martin@ximian.com>
8097 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8098 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8099 the return type of the new EmitContext.
8101 2004-07-18 Martin Baulig <martin@ximian.com>
8103 * class.cs (Property.Define): Fix iterators.
8105 * iterators.cs (Iterator.Define): Moved the
8106 `container.AddInterator (this)' call here from the .ctor; only do
8107 it if we resolved successfully.
8109 2004-07-17 Miguel de Icaza <miguel@ximian.com>
8111 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8112 `true' for preprocessing directives that we parse. The return
8113 value indicates whether we should return to regular tokenizing or
8114 not, not whether it was parsed successfully.
8116 In the past if we were in: #if false ... #line #endif, we would
8117 resume parsing after `#line'. See bug 61604.
8119 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8120 building: IsEnumType should return true only for enums, not for
8121 enums or System.Enum itself. This fixes #61593.
8123 Likely what happened is that corlib was wrong: mcs depended on
8124 this bug in some places. The bug got fixed, we had to add the
8125 hack, which caused bug 61593.
8127 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8128 that was a workaround for the older conditions.
8130 2004-07-16 Ben Maurer <bmaurer@ximian.com>
8132 * assign.cs: IAssignMethod has a new interface, as documented
8133 inline. All assignment code now uses this new api.
8135 * ecore.cs, expression.cs: All classes which implement
8136 IAssignMethod now use the new interface.
8138 * expression.cs (Invocation): add a hack to EmitCall so that
8139 IndexerAccess can be the target of a compound assignment without
8140 evaluating its arguments twice.
8142 * statement.cs: Handle changes in Invocation api.
8144 2004-07-16 Martin Baulig <martin@ximian.com>
8146 * iterators.cs: Rewrote this. We're now using one single Proxy
8147 class for both the IEnumerable and the IEnumerator interface and
8148 `Iterator' derives from Class so we can use the high-level API.
8150 * class.cs (TypeContainer.AddIterator): New method.
8151 (TypeContainer.DoDefineType): New protected virtual method, which
8152 is called from DefineType().
8153 (TypeContainer.DoDefineMembers): Call DefineType() and
8154 DefineMembers() on all our iterators.
8155 (TypeContainer.Emit): Call Emit() on all our iterators.
8156 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8158 * codegen.cs (EmitContext.CurrentIterator): New public field.
8160 2004-07-15 Martin Baulig <martin@ximian.com>
8163 (TypeManager.not_supported_exception_type): New type.
8165 2004-07-14 Martin Baulig <martin@ximian.com>
8167 * iterators.cs: Use real error numbers.
8169 2004-07-14 Martin Baulig <martin@ximian.com>
8171 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8172 requires this to be a System.Collection.IEnumerable and not a
8173 class implementing that interface.
8174 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8176 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8178 * class.cs: Fixed previous fix, it broke some error tests.
8180 2004-07-12 Martin Baulig <martin@ximian.com>
8182 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8185 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8187 * assign.cs (LocalTemporary): Add new argument: is_address,If
8188 `is_address' is true, then the value that we store is the address
8189 to the real value, and not the value itself.
8191 * ecore.cs (PropertyExpr): use the new local temporary
8192 stuff to allow us to handle X.Y += z (where X is a struct)
8194 2004-07-08 Martin Baulig <martin@ximian.com>
8196 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8197 not always return, just like we're doing in Using.Resolve().
8199 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8201 * cs-parser.jay (fixed_statement): flag this as Pinned.
8203 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8205 * typemanager.cs (TypeManager): Removed MakePinned method, this
8206 mechanism is replaced with the .NET 2.x compatible mechanism of
8207 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8209 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8210 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8211 `IsFixed' property which has a different meaning.
8213 2004-07-02 Raja R Harinath <rharinath@novell.com>
8215 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8216 visible from inside a nested class, not just the names of the
8217 immediately enclosing class.
8220 2004-06-24 Raja R Harinath <rharinath@novell.com>
8222 * expression.cs (BetterConversion): Remove buggy special-case
8223 handling of "implicit constant expression conversions". At this
8224 point, we already know that the conversion is possible -- we're
8225 only checking to see which is better.
8227 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8229 * cs-parser.jay: Added error CS0210 test.
8231 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8233 * cs-parser.jay: Added error CS0134 test.
8235 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8238 * cs-parser.jay: Added error CS0145 test.
8240 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8242 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8244 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8246 * expression.cs (StackAlloc.Resolve): The argument may not
8247 be a constant; deal with this case.
8249 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8251 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8252 GetIndexerAttributeValue.
8253 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8255 * class.cs (Indexer.Define): Added error tests for CS0415,
8258 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8260 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8263 2004-06-23 Martin Baulig <martin@ximian.com>
8265 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8266 neither return nor throw, reset the barrier as well. Fixes #60457.
8268 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8270 * class.cs : EventAttributes is now set to None by default.
8271 This fixes bug #60459.
8273 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8276 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8277 Don't throw exception but return null (it's sufficient now).
8279 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8281 * typemanager.cs (GetArgumentTypes): Faster implementation.
8283 2004-06-18 Martin Baulig <martin@ximian.com>
8285 * attribute.cs (Attribute.Resolve): Check whether we're an
8286 EmptyCast which a Constant child. Fixes #60333.
8288 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8290 * statement.cs (EmitCollectionForeach): Account for the fact that
8291 not all valuetypes are in areas which we can take the address of.
8292 For these variables, we store to a temporary variable. Also, make
8293 sure that we dont emit a `callvirt' on a valuetype method.
8295 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8297 * expression.cs (StackAlloc.DoReSolve): Added test for
8298 negative parameter (CS0247).
8300 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8303 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8305 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8308 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8311 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8313 Fix bug #58254 & cs1555.cs, cs1556.cs
8314 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8316 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8318 * cs-parser.jay: Added error CS1669 test for indexers.
8320 2004-06-11 Martin Baulig <martin@ximian.com>
8322 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8323 call this twice: for params and varargs methods.
8325 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8328 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8330 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8332 * attribute.cs (Attribute.GetValidTargets): Made public.
8335 (AbstractPropertyEventMethod): New class for better code sharing.
8336 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8338 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8340 2004-06-11 Raja R Harinath <rharinath@novell.com>
8343 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8344 that the call to Resolve is part of a MemberAccess.
8345 (Expression.Resolve): Use it for SimpleName resolution.
8346 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8347 Add 'intermediate' boolean argument.
8348 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
8349 error message when the SimpleName can be resolved ambiguously
8350 between an expression and a type.
8351 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8353 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8354 call on the left-side.
8356 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8359 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8361 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8363 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8365 2004-06-11 Martin Baulig <martin@ximian.com>
8367 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8368 varargs methods if applicable.
8370 2004-06-11 Martin Baulig <martin@ximian.com>
8372 * expression.cs (Invocation.EmitCall): Don't use
8373 `method.CallingConvention == CallingConventions.VarArgs' since the
8374 method could also have `CallingConventions.HasThis'.
8376 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8378 * class.cs (Event.GetSignatureForError): Implemented.
8379 Fixed crash in error test cs3010.cs
8381 2004-06-10 Miguel de Icaza <miguel@ximian.com>
8383 * cs-tokenizer.cs: Change the way we track __arglist to be
8384 consistent with the other keywords.
8386 2004-06-09 Miguel de Icaza <miguel@ximian.com>
8388 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8391 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
8393 * codegen.cs: Check that all referenced assemblies have a strongname
8394 before strongnaming the compiled assembly. If not report error CS1577.
8395 Fix bug #56563. Patch by Jackson Harper.
8396 * typemanager.cs: Added a method to return all referenced assemblies.
8397 Fix bug #56563. Patch by Jackson Harper.
8399 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8402 (Method.ApplyAttributeBuilder): Moved and added conditional
8403 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8406 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8408 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8411 * class.cs: (EventField.attribute_targets): Changed default target.
8413 2004-06-08 Martin Baulig <martin@ximian.com>
8415 * expression.cs (Invocation.EmitCall): Enable varargs methods.
8417 2004-06-08 Martin Baulig <martin@ximian.com>
8419 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8421 2004-06-07 Martin Baulig <martin@ximian.com>
8423 Added support for varargs methods.
8425 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8428 * cs-parser.jay: Added support for `__arglist'.
8430 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8432 * expression.cs (Argument.AType): Added `ArgList'.
8433 (Invocation): Added support for varargs methods.
8434 (ArglistAccess): New public class.
8435 (Arglist): New public class.
8437 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8439 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
8440 a method's top-level block if the method has varargs.
8442 * support.cs (ReflectionParameters, InternalParameters): Added
8443 support for varargs methods.
8445 2004-06-07 Miguel de Icaza <miguel@ximian.com>
8447 * class.cs: Provide location in indexer error report.
8449 * driver.cs: Use standard names.
8451 * namespace.cs: Catch the use of using after a namespace has been
8452 declared also on using aliases.
8454 2004-06-03 Raja R Harinath <rharinath@novell.com>
8457 * typemanager.cs (closure_private_ok, closure_invocation_type)
8458 (closure_qualifier_type, closure_invocation_assembly)
8459 (FilterWithClosure): Move to ...
8460 (Closure): New internal nested class.
8461 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8462 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8463 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8464 (MemberLookup, MemberLookupFailed): Use it.
8465 * expression.cs (New.DoResolve): Treat the lookup for the
8466 constructor as being qualified by the 'new'ed type.
8467 (Indexers.GetIndexersForTypeOrInterface): Update.
8469 2004-06-03 Marek Safar <marek.safar@seznam.cz>
8472 (GetConditionalAttributeValue): New method. Returns
8473 condition of ConditionalAttribute.
8474 (SearchMulti): New method. Returns all attributes of type 't'.
8475 Use it when attribute is AllowMultiple = true.
8476 (IsConditionalMethodExcluded): New method.
8479 (Method.IsExcluded): Implemented. Returns true if method has conditional
8480 attribute and the conditions is not defined (method is excluded).
8481 (IMethodData): Extended interface for ConditionalAttribute support.
8482 (PropertyMethod.IsExcluded): Implemented.
8485 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8488 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8491 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
8493 * expression.cs (ArrayCreationExpression): Make this just an
8494 `expression'. It can't be a statement, so the code here was
8497 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8500 * typemanager.cs (GetFullNameSignature): New method for
8503 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8506 * class.cs (MemberBase.GetSignatureForError): New virtual method.
8507 Use this method when MethodBuilder is null.
8508 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8509 Added test for error CS0626 (MONO reports error for this situation).
8510 (IMethodData.GetSignatureForError): Extended interface.
8512 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8515 (AttributeTester.GetObsoleteAttribute): Returns instance of
8516 ObsoleteAttribute when type is obsolete.
8519 (TypeContainer.VerifyObsoleteAttribute): Override.
8520 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8521 (MethodCode.VerifyObsoleteAttribute): Override.
8522 (MemberBase.VerifyObsoleteAttribute): Override.
8525 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8526 and report proper error.
8529 Delegate.VerifyObsoleteAttribute): Override.
8532 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8533 and report proper error.
8534 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8537 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8541 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8542 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8543 Added test for ObsoleteAttribute.
8546 (Catch): Derived from Statement.
8548 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8550 Fixed bug #59071 & cs0160.cs
8552 * statement.cs (Try.Resolve): Check here whether order of catch
8553 clauses matches their dependencies.
8555 2004-05-31 Miguel de Icaza <miguel@ximian.com>
8557 * Reverted patch to namespace.cs (Use lookuptypedirect). This
8558 caused a regression: #59343. Referencing nested classes from an
8559 assembly stopped working.
8561 2004-05-31 Martin Baulig <martin@ximian.com>
8563 MCS is now frozen for beta 2.
8565 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8567 * convert.cs: add a trivial cache for overload operator resolution.
8569 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8571 * decl.cs: If possible, use lookuptypedirect here. We can only do
8572 this if there is no `.' after the namespace. Avoids using
8573 LookupType, which does lots of slow processing.
8574 (FindNestedType) New method, does what it says :-).
8575 * namespace.cs: use LookupTypeDirect.
8576 * rootcontext.cs: use membercache, if possible.
8577 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8579 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8582 According to the spec,
8584 In a member access of the form E.I, if E is a single identifier,
8585 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8586 field, property, localvariable, or parameter with the same type as
8587 the meaning of E as a type-name (§3.8), then both possible
8588 meanings of E are permitted.
8590 We did not check that E as a simple-name had the same type as E as
8593 This trivial check gives us 5-7% on bootstrap time.
8595 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8597 * expression.cs (Invocation.OverloadResolve): Avoid the
8598 use of hashtables and boxing here by allocating on demand.
8600 2004-05-30 Martin Baulig <martin@ximian.com>
8602 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8603 we're doing a silent lookup. Don't try to lookup nested types in
8604 TypeManager.object_type (thanks to Ben Maurer).
8606 2004-05-30 Martin Baulig <martin@ximian.com>
8608 Committing a patch from Ben Maurer.
8610 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8612 2004-05-29 Martin Baulig <martin@ximian.com>
8614 * class.cs (IMethodData.ShouldIgnore): New method.
8616 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8617 `Location' argument, we don't need it anywhere. Use
8618 `IMethodData.ShouldIgnore ()' instead of
8619 `MethodData.GetMethodFlags ()'.
8620 (TypeManager.AddMethod): Removed.
8621 (TypeManager.AddMethod2): Renamed to AddMethod.
8623 2004-05-29 Martin Baulig <martin@ximian.com>
8625 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8627 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8628 converting from a class type S to an interface type and we already
8629 have an object on the stack, don't box it again. Fixes #52578.
8631 2004-05-29 Martin Baulig <martin@ximian.com>
8633 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8634 Added support for `params' parameters. Fixes #59267.
8636 2004-05-29 Martin Baulig <martin@ximian.com>
8638 * literal.cs (NullPointer): Provide a private .ctor which sets
8639 `type' to TypeManager.object_type. Fixes #59048.
8641 2004-05-29 Martin Baulig <martin@ximian.com>
8643 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8644 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8646 * ecore.cs (EventExpr.instance_expr): Make the field private.
8648 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8650 Fixed bug #50080 & cs0214-2.cs
8651 * expression.cs (Cast.DoResolve): Check unsafe context here.
8653 * statement.cs (Resolve.DoResolve): Likewise.
8655 2004-05-26 Martin Baulig <martin@ximian.com>
8657 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8659 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8660 (RootContext.LookupType): Pass down the `silent' flag.
8662 2004-05-25 Martin Baulig <martin@ximian.com>
8665 (MethodGroupExpr.IdenticalTypeName): New public property.
8666 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8667 expression actually refers to a type.
8669 2004-05-25 Martin Baulig <martin@ximian.com>
8671 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8672 for #56176 and made it actually work.
8674 2004-05-25 Martin Baulig <martin@ximian.com>
8676 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8677 (FieldExpr, PropertyExpr): Override and implement
8678 CacheTemporaries. Fixes #52279.
8680 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8682 * location.cs: In the new compiler listing a file twice is a
8683 warning, not an error.
8685 2004-05-24 Martin Baulig <martin@ximian.com>
8687 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8688 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8690 2004-05-24 Martin Baulig <martin@ximian.com>
8692 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8693 walking the `using' list. Fixes #53921.
8695 2004-05-24 Martin Baulig <martin@ximian.com>
8697 * const.cs (Const.LookupConstantValue): Added support for
8698 EmptyCast's; fixes #55251.
8700 2004-05-24 Martin Baulig <martin@ximian.com>
8702 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8703 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8704 which does the CS0135 check. The reason is that we first need to
8705 check whether the variable actually exists.
8707 2004-05-24 Martin Baulig <martin@ximian.com>
8709 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8710 than RootContext.LookupType() to find the explicit interface
8713 2004-05-24 Raja R Harinath <rharinath@novell.com>
8715 * Makefile: Simplify. Use executable.make.
8716 * mcs.exe.sources: New file. List of sources of mcs.exe.
8718 2004-05-24 Anders Carlsson <andersca@gnome.org>
8722 Use the invariant culture when doing String.Compare for CLS case
8725 2004-05-23 Martin Baulig <martin@ximian.com>
8727 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8728 don't have any dots. Fixes #52622, added cs0246-8.cs.
8730 * namespace.cs (NamespaceEntry.Lookup): Likewise.
8732 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8734 * class.cs (MemberBase.Define): Reuse MemberType member for
8735 resolved type. Other methods can use it too.
8737 2004-05-23 Martin Baulig <martin@ximian.com>
8739 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8740 the variable also exists in the current block (otherwise, we need
8741 to report a CS0103). Fixes #58670.
8743 2004-05-23 Martin Baulig <martin@ximian.com>
8745 * flowanalysis.cs (Reachability.Reachable): Compute this
8746 on-the-fly rather than storing it as a field.
8748 2004-05-23 Martin Baulig <martin@ximian.com>
8750 * flowanalysis.cs (Reachability.And): Manually compute the
8751 resulting `barrier' from the reachability.
8753 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8756 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8757 instance of ObsoleteAttribute when symbol is obsolete.
8760 (IMethodData): Extended interface for ObsoleteAttribute support.
8762 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8764 * attribute.cs: Fix bug #55970
8766 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8770 (GetObsoleteAttribute): New method. Creates the instance of
8772 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8773 ObsoleteAttribute when member is obsolete.
8774 (AttributeTester.Report_ObsoleteMessage): Common method for
8775 Obsolete error/warning reporting.
8778 (TypeContainer.base_classs_type): New member for storing parent type.
8781 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8782 for this MemberCore.
8784 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8786 * attribute.cs, const.cs: Fix bug #58590
8788 2004-05-21 Martin Baulig <martin@ximian.com>
8790 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8791 out parameters if the end of the method is unreachable. Fixes
8794 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8796 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8797 Hari was right, why extra method.
8799 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8801 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8803 2004-05-20 Martin Baulig <martin@ximian.com>
8805 Merged this back from gmcs to keep the differences to a minumum.
8807 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8808 instead of a Declspace.
8809 (Attribute.ResolveType): Likewise.
8810 (Attributes.Search): Likewise.
8811 (Attributes.Contains): Likewise.
8812 (Attributes.GetClsCompliantAttribute): Likewise.
8814 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8816 (MethodData.ApplyAttributes): Take an EmitContext instead of a
8819 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8821 Fix bug #58688 (MCS does not report error when the same attribute
8824 * attribute.cs (Attribute.Emit): Distinction between null and default.
8826 2004-05-19 Raja R Harinath <rharinath@novell.com>
8828 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8829 of a top-level attribute without an attribute target.
8830 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8832 (Attribute.Conditional_GetConditionName),
8833 (Attribute.Obsolete_GetObsoleteMessage): Update.
8834 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8835 part of ScanForIndexerName.
8836 (Attribute.CanIgnoreInvalidAttribute): New function.
8837 (Attribute.ScanForIndexerName): Move to ...
8838 (Attributes.ScanForIndexerName): ... here.
8839 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8840 (Attributes.Search): New internal variant that can choose not to
8841 complain if types aren't resolved. The original signature now
8843 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8844 complaints suppressed.
8845 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8846 only if it not useful.
8847 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8848 top-level for attributes that are shared between the assembly
8849 and a top-level class.
8850 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8851 * class.cs: Update to reflect changes.
8852 (DefineIndexers): Fuse loops.
8853 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
8854 a couple more variants of attribute names.
8856 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8858 Fix bug #52585 (Implemented explicit attribute declaration)
8861 (Attributable.ValidAttributeTargets): New abstract method. It gets
8862 list of valid attribute targets for explicit target declaration.
8863 (Attribute.Target): It holds target itself.
8864 (AttributeSection): Removed.
8865 (Attribute.CheckTargets): New method. It checks whether attribute
8866 target is valid for the current element.
8869 (EventProperty): New class. For events that are declared like
8870 property (with add and remove accessors).
8871 (EventField): New class. For events that are declared like field.
8874 * cs-parser.jay: Implemented explicit attribute target declaration.
8876 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
8877 Override ValidAttributeTargets.
8880 (ReturnParameter): Class for applying custom attributes on
8882 (ParameterAtribute): New class. Class for applying custom
8883 attributes on the parameter type.
8885 2004-05-17 Miguel de Icaza <miguel@ximian.com>
8887 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8890 (Method): Allow UNSAFE here.
8892 * modifiers.cs: Support unsafe reporting.
8894 2004-05-17 Marek Safar <marek.safar@seznam.cz>
8896 * decl.cs: Fix bug #58478.
8898 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8900 * statement.cs: When checking for unreachable code on an EmptyStatement,
8901 set the location. Fixes bug #58488.
8903 2004-05-13 Miguel de Icaza <miguel@ximian.com>
8905 * driver.cs: Add -pkg handling.
8907 From Gonzalo: UseShelLExecute=false
8909 2004-05-12 Marek Safar <marek.safar@seznam.cz>
8912 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8914 (Attribute.IsClsCompliaceRequired): Moved to base for better
8916 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8917 when attribute is AttributeUsageAttribute.
8918 (Attribute.GetValidTargets): Simplified.
8919 (Attribute.GetAttributeUsage): New method returns AttributeUsage
8920 attribute for this type.
8921 (Attribute.ApplyAttributes): Method renamed to Emit and make
8923 (GlobalAttributeSection): New class for special handling of global
8924 attributes (assembly, module).
8925 (AttributeSection.Emit): New method.
8927 * class.cs: Implemented Attributable abstract methods.
8928 (MethodCore.LabelParameters): Moved to Parameter class.
8929 (Accessor): Is back simple class.
8930 (PropertyMethod): Implemented Attributable abstract class.
8931 (DelegateMethod): Implemented Attributable abstract class.
8932 (Event): New constructor for disctintion between normal Event
8933 and Event with accessors.
8935 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8937 * codegen.cs, const.cs, decl.cs, delegate.cs:
8938 (CommonAssemblyModulClass): Implemented Attributable abstract class
8941 * enum.cs: Implement IAttributeSupport interface.
8942 (EnumMember): New class for emum members. Implemented Attributable
8946 (ParameterBase): Is abstract.
8947 (ReturnParameter): New class for easier [return:] attribute handling.
8949 * typemanager.cs: Removed builder_to_attr.
8951 2004-05-11 Raja R Harinath <rharinath@novell.com>
8954 * attribute.cs (Attribute.GetPositionalValue): New function.
8955 * class.cs (TypeContainer.VerifyMembers): New function.
8956 (TypeContainer.Emit): Use it.
8957 (ClassOrStruct): New base class for Class and Struct.
8958 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
8959 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8961 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8962 then each non-static field should have a FieldOffset attribute.
8963 Otherwise, none of the fields should have a FieldOffset attribute.
8964 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
8965 and FieldOffset attributes.
8966 * typemanager.cs (TypeManager.struct_layout_attribute_type)
8967 (TypeManager.field_offset_attribute_type): New core types.
8968 (TypeManager.InitCoreTypes): Initialize them.
8970 2004-05-11 Michal Moskal <malekith@pld-linux.org>
8972 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8973 Return correct type.
8976 2004-05-09 Miguel de Icaza <miguel@ximian.com>
8978 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8979 be implicitly converted to ulong.
8981 * expression.cs: The logic for allowing operator &, | and ^ worked
8982 was wrong, it worked before because we did not report an error in
8983 an else branch. Fixes 57895.
8985 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8986 allow volatile fields to be reference types.
8988 2004-05-07 Miguel de Icaza <miguel@ximian.com>
8990 * driver.cs: Add support for /debug-
8992 2004-05-07 Raja R Harinath <rharinath@novell.com>
8994 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
8995 Add a 'complain' parameter to silence errors.
8996 (Attribute.Resolve): Update to changes. Put in sanity check to catch
8997 silently overlooked type-resolutions.
8998 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9000 (Attributes.Search): New function.
9001 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9002 (Attributes.GetAttributeFullName): Remove hack.
9003 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9004 Update to reflect changes.
9005 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9006 Use Attributes.Search instead of nested loops.
9008 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9011 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9012 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9013 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9015 * report.cs: (Report.Warning): Renamed to Warning_T because of
9016 parameter collision.
9018 2004-05-05 Raja R Harinath <rharinath@novell.com>
9020 * expression.cs (MemberAccess.ResolveMemberAccess):
9021 Exit with non-zero status after Report.Error.
9022 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9024 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9026 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9028 * support.cs: Don't hang when the file is empty.
9030 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9032 * support.cs: In SeekableStreamReader, compute the preamble size of the
9033 underlying stream. Position changes should take into account that initial
9036 2004-05-03 Todd Berman <tberman@sevenl.net>
9038 * driver.cs: remove unused GetSysVersion function.
9040 2004-05-03 Todd Berman <tberman@sevenl.net>
9042 * driver.cs: Remove the hack from saturday, as well as the hack
9043 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9044 link_paths to get that bit proper.
9046 2004-05-01 Todd Berman <tberman@sevenl.net>
9048 * driver.cs: Try a LoadFrom before a Load, this checks the current
9049 path. This is currently a bug in mono that is be fixed, however, this
9050 provides a workaround for now. This will be removed when the bug
9053 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9055 * CryptoConvert.cs: Updated to latest version. Fix issue with
9056 incomplete key pairs (#57941).
9058 2004-05-01 Todd Berman <tberman@sevenl.net>
9060 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9063 2004-04-30 Jackson Harper <jackson@ximian.com>
9065 * codegen.cs: Open keys readonly.
9067 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9069 * typemanager.cs: don't report cyclic struct layout when a struct
9070 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9071 which has 2 Pango.Rectangle fields.
9073 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9075 * expression.cs: Handle IntPtr comparisons with IL code
9076 rather than a method call.
9078 2004-04-29 Martin Baulig <martin@ximian.com>
9080 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9081 the list of PropertyInfo's in class hierarchy and find the
9082 accessor. Fixes #56013.
9084 2004-04-29 Martin Baulig <martin@ximian.com>
9086 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9088 2004-04-29 Martin Baulig <martin@ximian.com>
9090 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9092 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9094 2004-04-29 Martin Baulig <martin@ximian.com>
9096 * class.cs (ConstructorInitializer.Resolve): Check whether the
9097 parent .ctor is accessible. Fixes #52146.
9099 2004-04-29 Martin Baulig <martin@ximian.com>
9101 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9103 * statement.cs (Using.EmitLocalVariableDecls): Use
9104 TypeManager.idisposable_type, not typeof (IDisposable).
9105 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9107 2004-04-29 Martin Baulig <martin@ximian.com>
9109 * class.cs (Event.Define): Don't emit the field and don't set
9110 RTSpecialName and SpecialName for events on interfaces. Fixes
9113 2004-04-29 Raja R Harinath <rharinath@novell.com>
9115 Refactor Attribute.ApplyAttributes.
9116 * attribute.cs (Attributable): New base class for objects that can
9117 have Attributes applied on them.
9118 (Attribute): Make AttributeUsage fields public.
9119 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9120 (Attribute.IsInternalCall): New property.
9121 (Attribute.UsageAttr): Convert to a public read-only property.
9122 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9123 (Attribute.ResolveType, Attribute.Resolve)
9124 (Attribute.ScanForIndexerName): Update to reflect changes.
9125 (Attribute.CheckAttributeTarget): Re-format.
9126 (Attribute.ApplyAttributes): Refactor, to various
9127 Attributable.ApplyAttributeBuilder methods.
9128 * decl.cs (MemberCore): Make Attributable.
9129 * class.cs (Accessor): Make Attributable.
9130 (MethodData.ApplyAttributes): Use proper attribute types, not
9132 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9133 (TypeContainer.ApplyAttributeBuilder)
9134 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9135 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9136 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9137 (Operator.ApplyAttributeBuilder): New factored-out methods.
9138 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9139 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9140 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9141 * parameter.cs (ParameterBase): New Attributable base class
9142 that can also represent Return types.
9143 (Parameter): Update to the changes.
9145 2004-04-29 Jackson Harper <jackson@ximian.com>
9147 * driver.cs: Prefer the corlib system version when looking for
9148 assemblies in the GAC. This is still a hack, but its a better hack
9151 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9153 * decl.cs, enum.cs: Improved error 3005 reporting.
9155 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9156 (related_symbols): New private member for list of symbols
9157 related to reported error/warning.
9159 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9161 2004-04-29 Martin Baulig <martin@ximian.com>
9163 * ecore.cs (Expression.Constantify): If we're an enum and
9164 TypeManager.TypeToCoreType() doesn't give us another type, use
9165 t.UnderlyingSystemType. Fixes #56178.
9167 2004-04-29 Martin Baulig <martin@ximian.com>
9169 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9170 interfaces and for each interface, only add members directly
9171 declared in that interface. Fixes #53255.
9173 2004-04-28 Martin Baulig <martin@ximian.com>
9175 * expression.cs (ConditionalLogicalOperator): Use a temporary
9176 variable for `left' to avoid that we evaluate it more than once;
9179 2004-04-28 Martin Baulig <martin@ximian.com>
9181 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9184 2004-04-28 Martin Baulig <martin@ximian.com>
9186 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9189 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9190 whether the type is not void (CS1547).
9192 2004-04-28 Martin Baulig <martin@ximian.com>
9194 * expression.cs (Unary.DoResolveLValue): Override this and report
9195 CS0131 for anything but Operator.Indirection.
9197 2004-04-28 Martin Baulig <martin@ximian.com>
9199 Committing a patch from Ben Maurer; see bug #50820.
9201 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9204 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9207 2004-04-28 Martin Baulig <martin@ximian.com>
9209 Committing a patch from Ben Maurer; see bug #50820.
9211 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9214 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9217 2004-04-28 Martin Baulig <martin@ximian.com>
9219 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9220 (Block.AddLabel): Call DoLookupLabel() to only search in the
9223 2004-04-28 Martin Baulig <martin@ximian.com>
9225 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9226 comparing StringConstants and NullLiterals in Equality and Inequality.
9228 2004-04-28 Jackson Harper <jackson@ximian.com>
9230 * driver.cs: Attempt to load referenced assemblies from the
9231 GAC. This is the quick and dirty version of this method that
9232 doesnt take into account versions and just takes the first
9233 canidate found. Will be good enough for now as we will not have more
9234 then one version installed into the GAC until I update this method.
9236 2004-04-28 Martin Baulig <martin@ximian.com>
9238 * typemanager.cs (TypeManager.CheckStructCycles): New public
9239 static method to check for cycles in the struct layout.
9241 * rootcontext.cs (RootContext.PopulateTypes): Call
9242 TypeManager.CheckStructCycles() for each TypeContainer.
9243 [Note: We only need to visit each type once.]
9245 2004-04-28 Martin Baulig <martin@ximian.com>
9247 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9249 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9250 success and added `out object value'. Use a `bool resolved' field
9251 to check whether we've already been called rather than
9252 `ConstantValue != null' since this breaks for NullLiterals.
9254 2004-04-28 Raja R Harinath <rharinath@novell.com>
9256 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9257 setting of this flag, since the 'set' method may be non-public.
9259 2004-04-28 Raja R Harinath <rharinath@novell.com>
9261 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9262 check on current_vector.Block.
9264 2004-04-27 Martin Baulig <martin@ximian.com>
9266 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9267 a field initializer. Fixes #56459.
9269 2004-04-27 Martin Baulig <martin@ximian.com>
9271 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9272 we're not attempting to use an indexer. Fixes #52154.
9274 2004-04-27 Martin Baulig <martin@ximian.com>
9276 * statement.cs (Return): Don't create a return label if we don't
9277 need it; reverts my change from January 20th. Thanks to Ben
9280 2004-04-27 Martin Baulig <martin@ximian.com>
9282 According to the spec, `goto' can only leave a nested scope, but
9285 * statement.cs (Block.LookupLabel): Only lookup in the current
9286 block, don't recurse into parent or child blocks.
9287 (Block.AddLabel): Check in parent and child blocks, report
9288 CS0140/CS0158 if we find a duplicate.
9289 (Block): Removed this indexer for label lookups.
9290 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9291 this already does the error reporting for us.
9294 (FlowBranching.UsageVector.Block): New public variable; may be null.
9295 (FlowBranching.CreateSibling): Added `Block' argument.
9296 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9297 label for the target of a `goto' and check whether we're not
9298 leaving a `finally'.
9300 2004-04-27 Martin Baulig <martin@ximian.com>
9302 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9303 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9306 2004-04-27 Martin Baulig <martin@ximian.com>
9308 * statement.cs (Block.AddLabel): Also check for implicit blocks
9309 and added a CS0158 check.
9311 2004-04-27 Martin Baulig <martin@ximian.com>
9313 * flowanalysis.cs (FlowBranchingLoop): New class.
9314 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9315 UsageVector's instead of an ArrayList.
9316 (FlowBranching.Label): Likewise.
9317 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9318 (FlowBranching.AddBreakVector): New method.
9320 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9322 * attribute.cs: Small regression fix: only convert the type if we
9323 the type is different, fixes System.Drawing build.
9325 2004-04-27 Martin Baulig <martin@ximian.com>
9327 * attribute.cs (Attribute.Resolve): If we have a constant value
9328 for a named field or property, implicity convert it to the correct
9331 2004-04-27 Raja R Harinath <rharinath@novell.com>
9333 * statement.cs (Block.Block): Implicit blocks share
9334 'child_variable_names' fields with parent blocks.
9335 (Block.AddChildVariableNames): Remove.
9336 (Block.AddVariable): Mark variable as "used by a child block" in
9337 every surrounding block.
9338 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9339 been used in a child block, complain about violation of "Invariant
9340 meaning in blocks" rule.
9341 * cs-parser.jay (declare_local_variables): Don't use
9342 AddChildVariableNames.
9343 (foreach_statement): Don't create an implicit block: 'foreach'
9346 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9348 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9349 converting from 0L to ulong. Fixes 57522.
9351 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9353 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9354 derived class hides via 'new' keyword field from base class (test-242.cs).
9355 TODO: Handle this in the more general way.
9357 * class.cs (CheckBase): Ditto.
9359 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9361 * decl.cs (caching_flags): New member for storing cached values
9363 (MemberCore.Flags): New enum where bit flags for caching_flags
9365 (MemberCore.cls_compliance): Moved to caching_flags.
9366 (DeclSpace.Created): Moved to caching_flags.
9368 * class.cs: Use caching_flags instead of DeclSpace.Created
9370 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9372 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9373 if we are only a derived class, not a nested class.
9375 * typemanager.cs: Same as above, but do this at the MemberLookup
9376 level (used by field and methods, properties are handled in
9377 PropertyExpr). Allow for the qualified access if we are a nested
9380 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9382 * class.cs: Refactoring.
9383 (IMethodData): New inteface; Holds links to parent members
9384 to avoid member duplication (reduced memory allocation).
9385 (Method): Implemented IMethodData interface.
9386 (PropertyBase): New inner classes for get/set methods.
9387 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9388 (Event): New inner classes for add/remove methods.
9389 (Event.DelegateMethod): Implemented IMethodData interface.
9391 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9392 EmitContext (related to class.cs refactoring).
9394 2004-04-21 Raja R Harinath <rharinath@novell.com>
9396 * delegate.cs (Delegate.VerifyApplicability): If the number of
9397 arguments are the same as the number of parameters, first try to
9398 verify applicability ignoring any 'params' modifier on the last
9402 2004-04-16 Raja R Harinath <rharinath@novell.com>
9404 * class.cs (TypeContainer.AddIndexer): Use
9405 'ExplicitInterfaceName' to determine if interface name was
9406 explicitly specified. 'InterfaceType' is not initialized at this time.
9407 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9408 Indexers array is already in the required order. Initialize
9409 'IndexerName' only if there are normal indexers.
9410 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9411 (TypeContainer.Emit): Emit DefaultMember attribute only if
9412 IndexerName is initialized.
9415 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9417 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9420 2004-04-15 Raja R Harinath <rharinath@novell.com>
9422 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9426 * attribute.cs (Attribute.Resolve): Check for duplicate named
9430 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9432 * iterators.cs (MarkYield): track whether we are in an exception,
9433 and generate code accordingly. Use a temporary value to store the
9434 result for our state.
9436 I had ignored a bit the interaction of try/catch with iterators
9437 since their behavior was not entirely obvious, but now it is
9438 possible to verify that our behavior is the same as MS .NET 2.0
9442 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9444 * iterators.cs: Avoid creating temporaries if there is no work to
9447 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9448 Enumerations, use TypeManager.EnumToUnderlying and call
9451 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9454 (This.Emit): Use EmitContext.EmitThis to emit our
9457 (This.EmitAssign): Ditto.
9459 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9460 codepaths, we will move all the functionality into
9463 (FieldExpr.EmitAssign): Ditto.
9465 This fixes several hidden bugs that I uncovered while doing a code
9466 review of this today.
9468 * codegen.cs (EmitThis): reworked so the semantics are more clear
9469 and also support value types "this" instances.
9471 * iterators.cs: Changed so that for iterators in value types, we
9472 do not pass the value type as a parameter.
9474 Initialization of the enumerator helpers is now done in the caller
9475 instead of passing the parameters to the constructors and having
9476 the constructor set the fields.
9478 The fields have now `assembly' visibility instead of private.
9480 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9482 * expression.cs (Argument.Resolve): Check if fields passed as ref
9483 or out are contained in a MarshalByRefObject.
9485 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9486 another compiler type.
9488 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9490 * class.cs (Indexer.Define): use the new name checking method.
9491 Also, return false on an error.
9492 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9493 (is_identifier_[start/part]_character): make static.
9495 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9497 * expression.cs (Binary.ResolveOperator): Do no append strings
9498 twice: since we can be invoked more than once (array evaluation)
9499 on the same concatenation, take care of this here. Based on a fix
9500 from Ben (bug #56454)
9502 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9504 * codegen.cs: Fix another case where CS1548 must be reported (when
9505 delay-sign isn't specified and no private is available #56564). Fix
9506 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9507 error when MCS is used on the MS runtime and we need to delay-sign
9508 (which seems unsupported by AssemblyBuilder - see #56621).
9510 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9512 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9513 (TypeManager.ComputeNamespaces): Faster implementation for
9516 * compiler.csproj: Updated AssemblyName to mcs.
9518 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9520 * rootcontext.cs: Add new types to the boot resolution.
9522 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9523 MulticastDelegate is not allowed.
9525 * typemanager.cs: Add new types to lookup: System.TypedReference
9528 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9529 check for TypedReference or ArgIterator, they are not allowed.
9531 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9532 makes us properly catch 1510 in some conditions (see bug 56016 for
9535 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9537 * CryptoConvert.cs: update from corlib version
9540 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9542 * class.cs (Indexer.Define): Check indexername declaration
9544 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9546 * attribute.cs (IsClsCompliant): Fixed problem with handling
9547 all three states (compliant, not-compliant, undetected).
9549 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9551 * attribute.cs (Attribute): Location is now public.
9552 (Resolve): Store resolved arguments (pos_values) in attribute class.
9553 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9554 (GetClsCompliantAttributeValue): New method that gets
9555 CLSCompliantAttribute value.
9556 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9557 if exists else null.
9558 (AttributeTester): New class for CLS-Compliant verification routines.
9560 * class.cs (Emit): Add CLS-Compliant verification.
9561 (Method.GetSignatureForError): Implemented.
9562 (Constructor.GetSignatureForError): Implemented
9563 (Constructor.HasCompliantArgs): Returns if constructor has
9564 CLS-Compliant arguments.
9565 (Constructor.Emit): Override.
9566 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9567 is needed to test only parameters.
9568 (FieldBase.GetSignatureForError): Implemented.
9569 (TypeContainer): New member for storing base interfaces.
9570 (TypeContainer.FindMembers): Search in base interfaces too.
9572 * codegen.cs (GetClsComplianceAttribute): New method that gets
9573 assembly or module CLSCompliantAttribute value.
9574 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9576 (ModuleClass.Emit): Add error 3012 test.
9578 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9580 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9581 state for all decl types.
9582 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9583 if CLS-Compliant tests are required.
9584 (IsClsCompliaceRequired): New method. Analyze whether code
9585 must be CLS-Compliant.
9586 (IsExposedFromAssembly): New method. Returns true when MemberCore
9587 is exposed from assembly.
9588 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9589 value or gets cached value.
9590 (HasClsCompliantAttribute): New method. Returns true if MemberCore
9591 is explicitly marked with CLSCompliantAttribute.
9592 (IsIdentifierClsCompliant): New abstract method. This method is
9593 used to testing error 3005.
9594 (IsIdentifierAndParamClsCompliant): New method. Common helper method
9595 for identifier and parameters CLS-Compliant testing.
9596 (VerifyClsCompliance): New method. The main virtual method for
9597 CLS-Compliant verifications.
9598 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9599 null. I don't know why is null (too many public members !).
9600 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9601 and get value of first CLSCompliantAttribute that found.
9603 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9604 (VerifyClsCompliance): Override and add extra tests.
9606 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9607 clscheck- disable CLS-Compliant verification event if assembly is has
9608 CLSCompliantAttribute(true).
9610 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9611 ApllyAttribute is now called in emit section as in the other cases.
9612 Possible future Emit integration.
9613 (IsIdentifierClsCompliant): New override.
9614 (VerifyClsCompliance): New override.
9615 (GetEnumeratorName): Returns full enum name.
9617 * parameter.cs (GetSignatureForError): Implemented.
9619 * report.cs (WarningData): New struct for Warning message information.
9620 (LocationOfPreviousError): New method.
9621 (Warning): New method. Reports warning based on the warning table.
9622 (Error_T): New method. Reports error based on the error table.
9624 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9625 verifications are done here.
9627 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9629 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9630 CLSCompliantAttribute.
9631 (all_imported_types): New member holds all imported types from other
9633 (LoadAllImportedTypes): New method fills static table with exported types
9634 from all referenced assemblies.
9635 (Modules): New property returns all assembly modules.
9637 2004-03-30 Miguel de Icaza <miguel@ximian.com>
9639 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9640 throwing a parser error.
9642 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9643 which removes the hardcoded get_/set_ prefixes for properties, as
9644 IL allows for the properties to be named something else.
9648 * expression.cs: Do not override operand before we know if it is
9651 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9653 * typemanager.cs: support for pinned variables.
9655 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9657 * decl.cs, typemanager.cs: Avoid using an arraylist
9658 as a buffer if there is only one result set.
9660 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9662 * expression.cs: Make sure you cant call a static method
9663 with an instance expression, bug #56174.
9665 2004-03-29 Miguel de Icaza <miguel@ximian.com>
9667 * class.cs (IsDuplicateImplementation): Improve error reporting to
9668 flag 663 (method only differs in parameter modifier).
9670 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9671 in preprocessor directives.
9673 * location.cs (LookupFile): Allow for the empty path.
9675 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
9676 better approach for some of that patch, but its failing with the
9677 CharSet enumeration. For now try/catch will do.
9679 * typemanager.cs: Do not crash if a struct does not have fields.
9682 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9684 * expression.cs: cs0213, cant fix a fixed expression.
9687 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9689 * cs-parser.jay: detect invalid embeded statements gracefully.
9692 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9694 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9697 the invocation type may not be a subclass of the tye of the item/
9698 The type of the item must be a subclass of the invocation item.
9703 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
9705 * attribute.cs: Added methods to get a string and a bool from an
9706 attribute. Required to information from AssemblyKeyFileAttribute,
9707 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9708 * codegen.cs: Modified AssemblyName creation to include support for
9709 strongnames. Catch additional exceptions to report them as CS1548.
9710 * compiler.csproj: Updated include CryptoConvert.cs.
9711 * compiler.csproj.user: Removed file - user specific configuration.
9712 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
9713 Mono.Security assembly. The original class is maintained and tested in
9714 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9715 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9716 like CSC 8.0 (C# v2) supports.
9717 * Makefile: Added CryptoConvert.cs to mcs sources.
9718 * rootcontext.cs: Added new options for strongnames.
9720 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
9722 * driver.cs: For --expect-error, report error code `2'
9723 if the program compiled with no errors, error code `1' if
9724 it compiled with an error other than the one expected.
9726 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
9728 * compiler.csproj: Updated for Visual Studio .NET 2003.
9729 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9730 * compiler.sln: Updated for Visual Studio .NET 2003.
9732 2004-03-24 Ravi Pratap M <ravi@ximian.com>
9734 * expression.cs: Fix bug #47234. We basically need to apply the
9735 rule that we prefer the conversion of null to a reference type
9736 when faced with a conversion to 'object' (csc behaviour).
9738 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9740 * statement.cs: Shorter form for foreach, eliminates
9741 a local variable. r=Martin.
9743 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9745 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9746 checks if we can use brtrue/brfalse to test for 0.
9747 * expression.cs: use the above in the test for using brtrue/brfalse.
9750 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9752 * expression.cs: Rewrite string concat stuff. Benefits:
9754 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9755 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9756 rather than a concat chain.
9758 * typemanager.cs: Add lookups for more concat overloads.
9760 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9762 * expression.cs: Emit shorter il code for array init.
9779 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
9781 * statement.cs: Before, two switch blocks would be merged if the
9782 total size of the blocks (end_item - begin_item + 1) was less than
9783 two times the combined sizes of the blocks.
9785 Now, it will only merge if after the merge at least half of the
9790 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
9792 * class.cs : csc build fix for GetMethods(). See bug #52503.
9794 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
9796 * expression.cs: Make sure fp comparisons work with NaN.
9797 This fixes bug #54303. Mig approved this patch a long
9798 time ago, but we were not able to test b/c the runtime
9801 2004-03-19 Miguel de Icaza <miguel@ximian.com>
9803 * ecore.cs (TypExpr.GetHashCode): implement this overload.
9805 2004-03-19 Martin Baulig <martin@ximian.com>
9807 * class.cs (MemberCore.IsDuplicateImplementation): Report the
9808 error here and not in our caller.
9810 2004-03-19 Martin Baulig <martin@ximian.com>
9812 * interface.cs: Completely killed this file.
9813 (Interface): We're now a TypeContainer and live in class.cs.
9815 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9816 argument; we're now also called for interfaces.
9817 (TypeContainer.DefineMembers): Allow this method being called
9819 (TypeContainer.GetMethods): New public method; formerly known as
9820 Interface.GetMethod(). This is used by PendingImplementation.
9821 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9822 it's now private and non-static.
9823 (Interface): Moved this here; it's now implemented similar to
9825 (Method, Property, Event, Indexer): Added `bool is_interface'
9826 argument to their .ctor's.
9827 (MemberBase.IsInterface): New public field.
9829 * cs-parser.jay: Create normal Method, Property, Event, Indexer
9830 instances instead of InterfaceMethod, InterfaceProperty, etc.
9831 (opt_interface_base): Removed; we now use `opt_class_base' instead.
9832 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9834 2004-03-19 Martin Baulig <martin@ximian.com>
9836 * class.cs (MethodCore.IsDuplicateImplementation): New private
9837 method which does the CS0111 checking.
9838 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9839 Use IsDuplicateImplementation().
9841 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9843 * decl.cs (FindMemberToOverride): New method to find the correct
9844 method or property to override in the base class.
9846 - Make Method/Property use the above method to find the
9847 version in the base class.
9848 - Remove the InheritableMemberSignatureCompare as it is now
9851 This patch makes large code bases much faster to compile, as it is
9852 O(n) rather than O(n^2) to do this validation.
9854 Also, it fixes bug 52458 which is that nested classes are not
9855 taken into account when finding the base class member.
9857 Reviewed/Approved by Martin.
9859 2004-03-17 Marek Safar <marek.safar@seznam.cz>
9861 * interface.cs: In all interface classes removed redundant
9862 member initialization.
9864 2004-03-16 Martin Baulig <martin@ximian.com>
9866 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9868 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9870 * decl.cs (DefineTypeAndParents): New helper method to define a
9871 type's containers before the type itself is defined; This is a
9872 bug exposed by the recent changes to Windows.Forms when an
9873 implemented interface was defined inside a class that had not been
9876 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9878 (Check): Loop correctly to report errors modifiers
9879 (UNSAFE was not in the loop, since it was the same as TOP).
9881 * interface.cs: Every interface member now takes a ModFlags,
9882 instead of a "is_new" bool, which we set on the base MemberCore.
9884 Every place where we called "UnsafeOk" in the interface, now we
9885 call the proper member (InterfaceMethod.UnsafeOK) instead to get
9886 the unsafe settings from the member declaration instead of the
9887 container interface.
9889 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
9891 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9892 `set_indexer_name' to the pending bits (one per type).
9894 We fixed a bug today that was picking the wrong method to
9895 override, since for properties the existing InterfaceMethod code
9896 basically ignored the method name. Now we make sure that the
9897 method name is one of the valid indexer names.
9899 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
9901 * support.cs (SeekableStreamReader): Keep track of stream byte
9902 positions and don't mix them with character offsets to the buffer.
9904 Patch from Gustavo Giráldez
9906 2004-03-15 Marek Safar <marek.safar@seznam.cz>
9908 * interface.cs (InterfaceSetGetBase): Removed double member
9909 initialization, base class does it as well.
9911 2004-03-13 Martin Baulig <martin@ximian.com>
9913 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9914 when compiling corlib.
9916 2004-03-13 Miguel de Icaza <miguel@ximian.com>
9918 * convert.cs (ExplicitConversion): We were reporting an error on
9919 certain conversions (object_type source to a value type, when the
9920 expression was `null') before we had a chance to pass it through
9921 the user defined conversions.
9923 * driver.cs: Replace / and \ in resource specifications to dots.
9926 * class.cs: Add check for duplicate operators. Fixes 52477
9928 2004-03-11 Miguel de Icaza <miguel@ximian.com>
9930 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9931 that are in the middle of the statements, not only at the end.
9934 * class.cs (TypeContainer.AddField): No longer set the
9935 `HaveStaticConstructor' flag, now we call it
9936 `UserDefineStaticConstructor' to diferentiate the slightly
9937 semantic difference.
9939 The situation is that we were not adding BeforeFieldInit (from
9940 Modifiers.TypeAttr) to classes that could have it.
9941 BeforeFieldInit should be set to classes that have no static
9946 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9948 And most importantly Zoltan's comment:
9950 http://bugzilla.ximian.com/show_bug.cgi?id=44229
9952 "I think beforefieldinit means 'it's ok to initialize the type sometime
9953 before its static fields are used', i.e. initialization does not need
9954 to be triggered by the first access to the type. Setting this flag
9955 helps the JIT to compile better code, since it can run the static
9956 constructor at JIT time, and does not need to generate code to call it
9957 (possibly lots of times) at runtime. Unfortunately, mcs does not set
9958 this flag for lots of classes like String.
9960 csc sets this flag if the type does not have an explicit static
9961 constructor. The reasoning seems to be that if there are only static
9962 initalizers for a type, and no static constructor, then the programmer
9963 does not care when this initialization happens, so beforefieldinit
9966 This bug prevents the AOT compiler from being usable, since it
9967 generates so many calls to mono_runtime_class_init that the AOT code
9968 is much slower than the JITted code. The JITted code is faster,
9969 because it does not generate these calls if the vtable is type is
9970 already initialized, which is true in the majority of cases. But the
9971 AOT compiler can't do this."
9973 2004-03-10 Miguel de Icaza <miguel@ximian.com>
9975 * class.cs (MethodData.Emit): Refactor the code so symbolic
9976 information is generated for destructors; For some reasons we
9977 were taking a code path that did not generate symbolic information
9980 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
9982 * class.cs: Create a Constructor.CheckBase method that
9983 takes care of all validation type code. The method
9984 contains some code that was moved from Define.
9986 It also includes new code that checks for duplicate ctors.
9987 This fixes bug #55148.
9989 2004-03-09 Joshua Tauberer <tauberer@for.net>
9991 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9992 a { ... }-style array creation invokes EmitStaticInitializers
9993 which is not good for reference-type arrays. String, decimal
9994 and now null constants (NullCast) are not counted toward
9995 static initializers.
9997 2004-03-05 Martin Baulig <martin@ximian.com>
9999 * location.cs (SourceFile.HasLineDirective): New public field;
10000 specifies whether the file contains or is referenced by a "#line"
10002 (Location.DefineSymbolDocuments): Ignore source files which
10003 either contain or are referenced by a "#line" directive.
10005 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10007 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10008 direct access to our parent, so check the method inline there.
10010 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10012 * expression.cs (Invocation.EmitCall): Miguel's last commit
10013 caused a regression. If you had:
10018 In Foo the implict this would be null.
10020 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10022 * expression.cs (Invocation.EmitCall): If the method is not
10023 virtual, do not emit a CallVirt to it, use Call.
10025 * typemanager.cs (GetFullNameSignature): Improve the method to
10026 cope with ".ctor" and replace it with the type name.
10028 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10029 as an argument the ConstructorBuilder where it is being defined,
10030 to catch the recursive constructor invocations.
10032 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10034 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10035 routines to check if a type is an enumerable/enumerator allow
10036 classes that implement the IEnumerable or IEnumerator interfaces.
10038 * class.cs (Property, Operator): Implement IIteratorContainer, and
10039 implement SetYields.
10041 (Property.Define): Do the block swapping for get_methods in the
10042 context of iterators. We need to check if Properties also
10043 include indexers or not.
10045 (Operator): Assign the Block before invoking the
10046 OperatorMethod.Define, so we can trigger the Iterator code
10049 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10050 Property and Operator classes are not created when we parse the
10051 declarator but until we have the block completed, so we use a
10052 singleton SimpleIteratorContainer.Simple to flag whether the
10053 SetYields has been invoked.
10055 We propagate this setting then to the Property or the Operator to
10056 allow the `yield' to function.
10058 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10060 * codegen.cs: Implemented attribute support for modules.
10061 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10062 Assembly/Module functionality.
10064 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10065 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10066 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10068 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10070 * interface.cs (FindMembers): The operation is performed on all base
10071 interfaces and not only on the first. It is required for future CLS Compliance patch.
10073 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10075 * statement.cs, codegen.cs:
10076 This patch deals with patterns such as:
10078 public class List : IEnumerable {
10080 public MyEnumerator GetEnumerator () {
10081 return new MyEnumerator(this);
10084 IEnumerator IEnumerable.GetEnumerator () {
10088 public struct MyEnumerator : IEnumerator {
10093 Before, there were a few things we did wrong:
10094 1) we would emit callvirt on a struct, which is illegal
10095 2) we emited ldarg when we needed to emit ldarga
10096 3) we would mistakenly call the interface methods on an enumerator
10097 type that derived from IEnumerator and was in another assembly. For example:
10099 public class MyEnumerator : IEnumerator
10101 Would have the interface methods called, even if there were public impls of the
10102 method. In a struct, this lead to invalid IL code.
10104 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10106 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10109 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10111 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10113 * cs-parser.jay: Fix small regression: we were not testing V2
10114 compiler features correctly.
10116 * interface.cs: If the emit context is null, then create one
10118 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10120 * decl.cs (GetSignatureForError): New virtual method to get full name
10121 for error messages.
10123 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10124 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10126 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10127 Duplicated members and code in these classes has been removed.
10128 Better encapsulation in these classes.
10130 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10132 * assign.cs (Assign.DoResolve): When dealing with compound
10133 assignments, there is a new rule in ECMA C# 2.4 (might have been
10134 there before, but it is documented here) that states that in:
10138 If b is of type int, and the `op' is a shift-operator, then the
10139 above is evaluated as:
10143 * expression.cs (Binary.ResolveOperator): Instead of testing for
10144 int/uint/long/ulong, try to implicitly convert to any of those
10145 types and use that in pointer arithmetic.
10147 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10148 method to print information for from the type, not from the
10149 null-method we were given.
10151 2004-02-01 Duncan Mak <duncan@ximian.com>
10153 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10154 parsing for cmd, fixes bug #53694.
10156 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10158 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10159 in the member name duplication tests. Property and operator name duplication
10160 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10162 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10164 * interface.cs (PopulateMethod): Fixed crash when interface method
10165 returns not existing type (error test cs0246-3.cs).
10167 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10169 * cs-parser.jay (interface_accessors): Re-write actions to also
10170 store attributes attached to get and set methods. Fix spelling
10173 (inteface_property_declaration): Modify accordingly.
10175 (InterfaceAccessorInfo): New helper class to store information to pass
10176 around between rules that use interface_accessors.
10178 * interface.cs (Emit): Apply attributes on the get and set
10179 accessors of properties and indexers too.
10181 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10182 right MethodBuilder when applying attributes to the get and set accessors.
10184 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10186 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10188 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10190 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10192 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10194 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10195 changes that treat `yield' specially when present before `break'
10196 or `return' tokens.
10198 * cs-tokenizer.cs: yield is no longer a keyword.
10200 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10202 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10203 setting for default constructors.
10204 For default constructors are almost every time set wrong Modifier. The
10205 generated IL code has been alright. But inside mcs this values was
10206 wrong and this was reason why several of my CLS Compliance tests
10209 2004-01-22 Martin Baulig <martin@ximian.com>
10211 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10212 not a QualifiedIdentifier. This is what `type_name_expression'
10213 was previously doing.
10214 (type_name_expression): Removed; the code is now in
10215 `namespace_or_type_name'.
10216 (qualified_identifier): Removed, use `namespace_or_type_name'
10218 (QualifiedIdentifier): Removed this class.
10220 2004-01-22 Martin Baulig <martin@ximian.com>
10222 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10223 not a string as alias name.
10225 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10227 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10228 #52730 bug, and instead compute correctly the need to use a
10229 temporary variable when requesting an address based on the
10230 static/instace modified of the field and the constructor.
10232 2004-01-21 Martin Baulig <martin@ximian.com>
10234 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10235 class and namespace before looking up aliases. Fixes #52517.
10237 2004-01-21 Martin Baulig <martin@ximian.com>
10239 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10240 assinged in a 'try'; fixes exception4.cs.
10242 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10243 * class.cs : Implemented parameter-less constructor for TypeContainer
10245 * decl.cs: Attributes are now stored here. New property OptAttributes
10247 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10249 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10251 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10253 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10254 (CSharpSignature): New method for indexer and property signature.
10256 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10258 * pending.cs (IsVirtualFilter): Faster implementation.
10260 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10262 * typemanager.cs: Avoid inclusion of same assembly more than once.
10264 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10266 * cs-parser.jay: Fixed problem where the last assembly attribute
10267 has been applied also to following declaration (class, struct, etc.)
10269 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10271 * class.cs: Added error CS0538, CS0539 reporting.
10272 Fixed crash on Microsoft runtime when field type is void.
10274 * cs-parser.jay: Added error CS0537 reporting.
10276 * pending.cs: Added error CS0535 reporting.
10277 Improved error report for errors CS0536, CS0534.
10279 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10281 Merge a few bits from the Anonymous Method MCS tree.
10283 * statement.cs (ToplevelBlock): New class for toplevel methods,
10284 will hold anonymous methods, lifted variables.
10286 * cs-parser.jay: Create toplevel blocks for delegates and for
10287 regular blocks of code.
10289 2004-01-20 Martin Baulig <martin@ximian.com>
10291 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10292 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10293 and `NeedExplicitReturn'; added `IsLastStatement'.
10294 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10295 have a `ReturnLabel' or we're not unreachable.
10297 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10298 child's reachability; don't just override ours with it. Fixes
10299 #58058 (lluis's example).
10300 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10301 InFinally(), InLoop(), InSwitch() and
10302 BreakCrossesTryCatchBoundary() methods.
10304 * statement.cs (Return): Do all error checking in Resolve().
10305 Unless we are the last statement in a top-level block, always
10306 create a return label and jump to it.
10307 (Break, Continue): Do all error checking in Resolve(); also make
10308 sure we aren't leaving a `finally'.
10309 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10310 statement in a top-level block.
10311 (Block.Flags): Added `IsDestructor'.
10312 (Block.IsDestructor): New public property.
10314 2004-01-20 Martin Baulig <martin@ximian.com>
10316 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10318 2004-01-20 Martin Baulig <martin@ximian.com>
10320 * statement.cs (Statement.ResolveUnreachable): New public method.
10321 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10322 (Block.Resolve): Resolve unreachable statements.
10324 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10326 * expression.cs: We need to fix the case where we do
10327 not have a temp variable here.
10329 * assign.cs: Only expression compound assignments need
10330 temporary variables.
10332 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10334 * flowanalysis.cs: Reduce memory allocation in a few ways:
10335 - A block with no variables should not allocate a bit
10337 - A method with no out parameters does not need any tracking
10338 for assignment of the parameters, so we need not allocate
10341 public readonly Type[] VariableTypes;
10342 public readonly string[] VariableNames;
10343 Are redundant. The data is already stored in the variable
10344 map, so we need not allocate another array for it.
10345 - We need to add alot of checks for if (params | locals) == null
10346 due to the first two changes.
10348 2004-01-18 Miguel de Icaza <miguel@ximian.com>
10350 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10351 implement IMemoryLocation, we store a copy on a local variable and
10352 take the address of it. Patch from Benjamin Jemlich
10354 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10355 to use a special "type_name_expression" rule which reduces the
10356 number of "QualifiedIdentifier" classes created, and instead
10357 directly creates MemberAccess expressions.
10359 2004-01-17 Miguel de Icaza <miguel@ximian.com>
10361 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10362 that fixes #52853. Null literal assignment to ValueType
10364 * class.cs (MethodData.Emit): Instead of checking the name of the
10365 method to determine if its a destructor, create a new derived
10366 class from Method called Destructor, and test for that.
10368 * cs-parser.jay: Create a Destructor object instead of a Method.
10370 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10374 2004-01-16 Miguel de Icaza <miguel@ximian.com>
10376 * expression.cs (Binary.ResolveOperator): Perform an implicit
10377 conversion from MethodGroups to their delegate types on the
10378 Addition operation.
10380 * delegate.cs: Introduce a new class DelegateCreation that is the
10381 base class for `NewDelegate' and `ImplicitDelegateCreation',
10382 factor some code in here.
10384 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10385 conversion from MethodGroups to compatible delegate types.
10387 * ecore.cs (Expression.Resolve): Do not flag error 654
10388 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10389 we allow conversions from MethodGroups to delegate types now.
10391 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10392 assignments in v2 either.
10394 2004-01-10 Miguel de Icaza <miguel@ximian.com>
10396 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10397 static read-only fields in ctors.
10399 Applied patch from Benjamin Jemlich
10401 * expression.cs (UnaryMutator): Avoid leaking local variables.
10403 2004-01-09 Miguel de Icaza <miguel@ximian.com>
10405 * cs-tokenizer.cs (IsCastToken): Allow the various native types
10406 here to return true, as they can be used like this:
10408 (XXX) int.MEMBER ()
10410 Fixed 49836 and all the other dups
10412 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
10414 * driver.cs: Implement /win32res and /win32icon.
10416 2004-01-08 Miguel de Icaza <miguel@ximian.com>
10418 * cs-parser.jay: Add a rule to improve error handling for the
10419 common mistake of placing modifiers after the type.
10421 2004-01-07 Miguel de Icaza <miguel@ximian.com>
10423 * cs-parser.jay (interface_event_declaration): Catch
10424 initialization of events on interfaces, and report cs0068
10426 * cs-parser.jay (interface_event_declaration): Catch
10427 initialization of events.
10429 * ecore.cs: Better report missing constructors.
10431 * expression.cs (Binary.ResolveOperator): My previous bug fix had
10432 the error reporting done in the wrong place. Fix.
10434 * expression.cs (Binary.ResolveOperator): Catch the
10435 operator + (E x, E y) error earlier, and later allow for implicit
10436 conversions in operator +/- (E e, U x) from U to the underlying
10439 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10440 52596, if the container class is abstract, the default constructor
10441 is protected otherwise its public (before, we were always public).
10443 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10446 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10447 Jemlich that fixes bug #52597, MCS was generating invalid code for
10448 idisposable structs. Thanks to Ben for following up with this
10451 2004-01-06 Miguel de Icaza <miguel@ximian.com>
10453 * driver.cs: Allow assemblies without code to be generated, fixes
10456 2004-01-07 Nick Drochak <ndrochak@gol.com>
10458 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10460 2004-01-05 Miguel de Icaza <miguel@ximian.com>
10462 * cs-parser.jay: Add rules to improve error reporting if fields or
10463 methods are declared at the namespace level (error 116)
10465 * Add rules to catch event add/remove
10467 2004-01-04 David Sheldon <dave-mono@earth.li>
10469 * expression.cs: Added matching ")" to error message for
10472 2004-01-03 Todd Berman <tberman@gentoo.org>
10474 * ecore.cs, attribute.cs:
10475 Applying fix from #52429.
10477 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10479 * ecore.cs, expression.cs, statement.cs:
10480 Total rewrite of how we handle branching. We
10481 now handle complex boolean expressions with fewer
10482 jumps. As well if (x == 0) no longer emits a ceq.
10484 if (x is Foo) is much faster now, because we generate
10487 Overall, we get a pretty big improvement on our benchmark
10488 tests. The code we generate is smaller and more readable.
10490 I did a full two-stage bootstrap. The patch was reviewed
10491 by Martin and Miguel.
10493 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10495 * cs-parser.jay: Make primary_expression not take a QI.
10496 we dont need this because the member_access rule covers
10497 us here. So we replace the rule with just IDENTIFIER.
10499 This has two good effects. First, we remove a s/r conflict.
10500 Second, we allocate many fewer QualifiedIdentifier objects.
10502 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10504 * attribute.cs: Handle MarshalAs attributes as pseudo, and
10505 set the correct information via SRE. This prevents
10506 hanging on the MS runtime. Fixes #29374.
10508 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10510 * convert.cs: correctly handle conversions to value types
10511 from Enum and ValueType as unboxing conversions.
10513 Fixes bug #52569. Patch by Benjamin Jemlich.
10515 2004-01-02 Ravi Pratap <ravi@ximian.com>
10517 * expression.cs (BetterConversion): Prefer int -> uint
10518 over int -> ulong (csc's behaviour). This fixed bug #52046.
10520 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10522 * decl.cs (MemberCache.FindMembers): now returns a
10525 * typemanager.cs: In general, go with with ^^.
10526 (CopyNewMethods): take an IList.
10527 (RealMemberLookup): Only allocate an arraylist
10528 if we copy from two sets of methods.
10530 This change basically does two things:
10531 1) Fewer array lists allocated due to CopyNewMethods.
10532 2) the explicit cast in MemberList costed ALOT.
10534 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10536 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10537 a hashtable to avoid needless string allocations when an identifier is
10538 used more than once (the common case).
10540 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10542 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10543 is broken, it will not return anything. So, we
10544 have to use the information we have in mcs to
10547 * typemanager.cs: Add a cache for GetInterfaces,
10548 since this will now be used more often (due to ^^)
10550 (GetExplicitInterfaces) New method that gets the
10551 declared, not effective, interfaces on a type
10552 builder (eg, if you have interface IFoo, interface
10553 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10556 This patch makes MCS able to bootstrap itself on
10559 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10561 * expression.cs: Remove the Nop's that Miguel put
10564 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10566 * report.cs, codegen.cs: Give the real stack trace to
10567 the error when an exception is thrown.
10569 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10571 * decl.cs: only allocate hashtables for ifaces if
10574 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10576 * expression.cs: fix the error from cs0121-2.cs
10577 (a parent interface has two child interfaces that
10578 have a function with the same name and 0 params
10579 and the function is called through the parent).
10581 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10583 * class.cs, rootcontext.cs, typmanager.cs: do not
10586 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10588 * codegen.cs: remove stack for the ec flow branching.
10589 It is already a linked list, so no need.
10591 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10593 * Makefile: Allow custom profiler here.
10595 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10597 * typemanager.cs (LookupType):
10598 - Use a static char [], because split takes
10599 a param array for args, so it was allocating
10601 - Do not store true in a hashtable, it boxes.
10603 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10605 * flowanalysis.cs: bytify common enums.
10607 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10609 * modifiers.cs: Add a new set of flags for the
10610 flags allowed on explicit interface impls.
10611 * cs-parser.jay: catch the use of modifiers in
10612 interfaces correctly.
10613 * class.cs: catch private void IFoo.Blah ().
10615 All related to bug #50572.
10617 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10619 * decl.cs: Rewrite the consistant accessability checking.
10620 Accessability is not linear, it must be implemented in
10621 a tableish way. Fixes #49704.
10623 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10625 * expression.cs: Handle negation in a checked context.
10626 We must use subtraction from zero. Fixes #38674.
10628 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10630 * class.cs: Ignore static void main in DLLs.
10631 * rootcontext.cs: Handle the target type here,
10632 since we are have to access it from class.cs
10633 * driver.cs: account for the above.
10635 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10637 * report.cs: Give line numbers and files if available.
10639 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10641 * driver.cs: Implement /addmodule.
10643 * typemanager.cs: Change 'modules' field so it now contains Modules not
10646 2003-12-20 Martin Baulig <martin@ximian.com>
10648 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10649 (FieldBase.IsAssigned): Removed this field.
10650 (FieldBase.SetAssigned): New public method.
10651 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10653 2003-12-20 Martin Baulig <martin@ximian.com>
10655 * expression.cs (LocalVariableReference.DoResolve): Don't set
10656 `vi.Used' if we're called from DoResolveLValue().
10658 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10659 returns the usage vector it just merged into the current one -
10660 pass this one to UsageWarning().
10661 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10662 of the `EmitContext', don't call this recursively on our children.
10664 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
10666 * driver.cs: Implement /target:module.
10668 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10670 * support.cs (CharArrayHashtable): New helper class.
10672 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
10673 char arrays, not strings, so we can avoid creating a string in
10674 consume_identifier if the identifier is a keyword.
10676 2003-12-16 Martin Baulig <martin@ximian.com>
10678 * statement.cs (LocalInfo.Assigned): Removed this property.
10679 (LocalInfo.Flags): Removed `Assigned'.
10680 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10681 and uses flow analysis.
10682 (Block.UsageWarning): Made this method private.
10683 (Block.Resolve): Call UsageWarning() if appropriate.
10685 * expression.cs (LocalVariableReference.DoResolve): Always set
10686 LocalInfo.Used here.
10688 2003-12-13 Martin Baulig <martin@ximian.com>
10690 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10691 any value here; we're now using flow analysis to figure out
10692 whether a statement/block returns a value.
10694 2003-12-13 Martin Baulig <martin@ximian.com>
10696 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10698 (FlowBranching.MergeFinally): Don't call
10699 `branching.CheckOutParameters()' here, this is called in
10701 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10702 when adding the `finally' vector.
10704 2003-12-13 Martin Baulig <martin@ximian.com>
10707 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10708 actually work and also fix #48962.
10710 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10712 * decl.cs: Do not check System.Object for nested types,
10713 since we know it does not have any. Big bang for buck:
10716 Run 1: 8.35 seconds
10717 Run 2: 8.32 seconds
10718 corlib: 17.99 seconds
10720 Run 1: 8.17 seconds
10721 Run 2: 8.17 seconds
10722 corlib: 17.39 seconds
10724 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10726 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10727 time we are returning 0 members, so we save alot here.
10729 2003-12-11 Martin Baulig <martin@ximian.com>
10731 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10732 `MergeChild()', also just take the `FlowBranching' as argument;
10733 call Merge() on it and return the result.
10734 (FlowBranching.Merge): We don't need to do anything if we just
10737 2003-12-11 Martin Baulig <martin@ximian.com>
10739 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10740 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10741 Maurer for this idea.
10743 2003-12-11 Martin Baulig <martin@ximian.com>
10745 * flowanalysis.cs (MergeResult): This class is now gone; we now
10746 use the `UsageVector' for this. The reason for this is that if a
10747 branching just has one sibling, we don't need to "merge" them at
10748 all - that's the next step to do.
10749 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10752 2003-12-11 Martin Baulig <martin@ximian.com>
10754 Reworked flow analyis and made it more precise and bug-free. The
10755 most important change is that we're now using a special `Reachability'
10756 class instead of having "magic" meanings of `FlowReturns'. I'll
10757 do some more cleanups and optimizations and also add some more
10758 documentation this week.
10760 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10761 largely reworked this class.
10762 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10763 the new `Reachability' class instead of having "magic" values here.
10764 (FlowBranching): We're now using an instance of `Reachability'
10765 instead of having separate `Returns', `Breaks' etc. fields.
10767 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10768 based on flow analysis; ignore the return value of block.Emit ().
10770 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10772 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10773 if they are private.
10775 2003-12-09 Martin Baulig <martin@ximian.com>
10777 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10778 call them directly on the UsageVector.
10780 2003-12-09 Martin Baulig <martin@ximian.com>
10782 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10783 Changed return type from `FlowReturns' to `Reachability'.
10785 2003-12-09 Martin Baulig <martin@ximian.com>
10787 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10788 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10789 `Reachable' fields with a single `Reachability' one.
10791 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10793 * class.cs (FindMembers): Remove foreach's.
10798 Run 1: 8.74 seconds
10799 Run 2: 8.71 seconds
10802 Run 1: 8.64 seconds
10803 Run 2: 8.58 seconds
10806 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10811 This patch does a few things:
10812 1. EmptyStatement is now a singleton, so it is never reallocated.
10813 2. All blah is EmptyStatement constructs have been changed to
10814 blah == EmptyStatement.Value, which is much faster and valid
10815 now that EmptyStatement is a singleton.
10816 3. When resolving a block, rather than allocating a new array for
10817 the non-empty statements, empty statements are replaced with
10818 EmptyStatement.Value
10819 4. Some recursive functions have been made non-recursive.
10820 Mainly the performance impact is from (3), however (1) and (2) are needed for
10821 this to work. (4) does not make a big difference in normal situations, however
10822 it makes the profile look saner.
10827 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10828 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10829 Total memory allocated: 56397 KB
10832 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10833 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10834 Total memory allocated: 55666 KB
10836 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10838 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10839 than the hashtable in a hashtable version
10841 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10842 we always end up concating a string. This results in a huge perf
10843 loss, because many strings have to be tracked by the GC. In this
10844 patch, we first use a hashtable that works with two keys, so that
10845 the strings do not need to be concat'ed.
10849 Run 1: 8.74 seconds
10850 Run 2: 8.71 seconds
10853 Run 1: 8.65 seconds
10854 Run 2: 8.56 seconds
10856 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10858 * Makefile: Add a new target `do-time' that does a quick and simple
10859 profile, leaving easy to parse output.
10861 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10863 * codegen.cs (Init): Create the dynamic assembly with
10864 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10866 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10868 * support.cs: Make the PtrHashtable use only one
10869 instance of its comparer.
10871 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10873 * typemanager.cs: Fix lookup of GetNamespaces.
10875 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10877 * expression.cs: Removed redundant line.
10879 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10880 ArrayLists, use for loops with bounds.
10882 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10885 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10886 arraylists, use for loop with bounds.
10888 The above three changes give us a 0.071 second performance
10889 improvement out of 3.294 seconds down to 3.223. On my machine
10890 the above changes reduced the memory usage by 1,387 KB during
10891 compiler bootstrap.
10893 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10894 QualifiedIdentifiers. Before we created a new string through
10895 concatenation, and mostly later on, the result would be
10896 manipulated by DecomposeQI through string manipulation.
10898 This reduced the compiler memory usage for bootstrapping from
10899 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10900 compile times in 0.05 seconds.
10902 2003-11-28 Dick Porter <dick@ximian.com>
10904 * support.cs: Do string compares with the Invariant culture.
10912 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10913 the comparison is done with the Invariant culture.
10915 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10917 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10918 GetEnumerator method.
10920 (ProbeCollectionType): Iterate starting at the most specific type
10921 upwards looking for a GetEnumerator
10923 * expression.cs: Shift count can be up to 31 for int/uint and 63
10926 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10928 * statement.cs (Block.LookupLabel): Also look for the label on the
10929 children blocks. Use a hash table to keep track of visited
10932 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10933 we actually did transform the other operand, otherwise fall back
10934 to the common codepath that casts to long.
10936 * cs-tokenizer.cs: Use the same code pattern as the int case.
10937 Maybe I should do the parsing myself, and avoid depending on the
10938 Parse routines to get this done.
10940 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10942 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10943 which fixes bug 51347. This time test it.
10945 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10946 attributes for example can not tell the difference between these.
10947 The difference was only a syntax feature of the language.
10949 * attribute.cs: Apply attributes to delegates.
10951 * delegate.cs: Call the apply attributes method.
10953 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10955 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10956 comparing 0 vs Byte.MinValue, not the value
10958 (ImplicitConversionRequired): When reporting a conversion error,
10959 use error 31 to print out the constant error instead of the
10962 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10963 which fixes bug 51347.
10965 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10967 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10968 which fixes the -warnaserror command line option.
10970 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10972 * cfold.cs (DoNumericPromotions): During constant folding of
10973 additions on UIntConstant, special case intconstants with
10974 IntConstants like we do on the expression binary operator.
10976 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10978 * convert.cs (ImplicitReferenceConversion): We were missing a case
10979 (System.Enum are not value types or class types, so we need to
10980 classify them separatedly).
10982 * driver.cs: We do not support error 2007.
10984 2003-11-12 Jackson Harper <jackson@ximian.com>
10986 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10987 system directory. Also use the full file name so users can
10988 libraries names mscorlib-o-tron.dll in a non system dir.
10990 2003-11-10 Martin Baulig <martin@ximian.com>
10992 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10993 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10994 calling `ResolveType()' on them, directly assign their `Type'.
10996 2003-11-08 Martin Baulig <martin@ximian.com>
10998 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10999 return value and the `out parent' parameter.
11000 (TypeContainer.DefineType): Moved the CS0644 check into
11001 GetClassBases(). Don't pass the interface types to the
11002 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11003 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11005 * ecore.cs (TypeExpr.IsAttribute): New property.
11006 (TypeExpr.GetInterfaces): New method.
11008 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11009 TypeExpr instead of a Type.
11010 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11011 (Interface.DefineType): Don't pass the interface types to the
11012 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11013 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11015 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11016 instead of a `Type[]'.
11017 (TypeManager.RegisterBuilder): Likewise.
11018 (TypeManager.AddUserInterface): Likewise.
11019 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11020 `Type[]' and also return a `TypeExpr[]'.
11021 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11023 2003-11-08 Martin Baulig <martin@ximian.com>
11025 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11028 2003-11-08 Martin Baulig <martin@ximian.com>
11030 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11031 TypeManager.ResolveExpressionTypes().
11033 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11034 instead of an Expression.
11035 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11036 (TypeExpression): New public class; formerly known as `TypeExpr'.
11038 * expression.cs (ComposedCast): Derive from TypeExpr.
11040 * typemanager.cs (TypeManager.system_*_expr): These are now
11041 TypExpr's instead of Expression's.
11042 (TypeManager.ResolveExpressionTypes): New public static function;
11043 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11046 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11048 * expression.cs (New.DoResolve): Do not dereference value that
11049 might be a null return.
11051 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11052 sure that the constant value has the right type. Fixes an
11053 unreported bug, similar to 50425.
11055 * const.cs (Const.LookupConstantValue): Call
11056 ImplicitStandardConversionExists before doing a conversion to
11057 avoid havng the TypeManager.ChangeType do conversions.
11059 Reduced the number of casts used
11061 (Const.ChangeType): New routine to enable reuse of the constant
11062 type changing code from statement.
11064 * typemanager.cs (ChangeType): Move common initialization to
11065 static global variables.
11069 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11070 every value type to go through, even if it was void. Fix that.
11072 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11073 character of the define, and the is_identifier_part_character for
11074 the rest of the string.
11076 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11078 * expression.cs (UnaryMutator.EmitCode): When I updated
11079 LocalVariableReference.DoResolve, I overdid it, and dropped an
11080 optimization done on local variable references.
11082 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11084 * ecore.cs: Convert the return from Ldlen into an int.
11086 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11088 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11089 the accessibility, this is a special case for toplevel non-public
11090 classes (internal for instance).
11092 2003-10-20 Nick Drochak <ndrochak@gol.com>
11094 * ecore.cs: Fix typo and build. Needed another right paren.
11096 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11098 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11099 `internal' case regular and protected, but not allowing protected
11100 to be evaluated later. Bug 49840
11102 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11104 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11105 to kb.Nlast, and not the kb.nFirst to isolate the switch
11108 Extract the underlying type, so enumerations of long/ulong are
11109 treated like long/ulong.
11111 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11113 * expression.cs (New): Overload the meaning of RequestedType to
11114 track the possible creation of the NewDelegate type, since
11115 DoResolve is invoked more than once for new constructors on field
11118 See bugs: #48800 and #37014
11120 * cs-parser.jay (declare_local_constants): Take an arraylist
11121 instead of a single constant.
11123 (local_constant_declaration): It should take a
11124 constant_declarators, not a constant_declarator. Fixes 49487
11126 * convert.cs: Fix error report.
11128 2003-10-13 Jackson Harper <jackson@ximian.com>
11130 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11133 2003-10-09 Martin Baulig <martin@ximian.com>
11135 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11137 (MethodCore.DoDefineParameters): Removed the TypeContainer
11138 argument; use the DeclSpace which was passed to the .ctor instead.
11139 (MethodCore.CheckParameter): Take a DeclSpace instead of a
11140 TypeContainer; we only need a DeclSpace here.
11142 2003-10-09 Martin Baulig <martin@ximian.com>
11144 * class.cs (MethodData): Added additional `DeclSpace ds' argument
11146 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11147 EmitContext's .ctor.
11149 2003-10-09 Martin Baulig <martin@ximian.com>
11151 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11152 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11153 AsAccessible(), moved them as well.
11155 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11157 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11159 * cs-parser.jay : Renamed yyName to yyNames related to jay.
11161 2003-10-07 Miguel de Icaza <miguel@ximian.com>
11163 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11164 generation for >=, as spotted by Paolo, bug 48679.
11165 Patch from David Waite.
11167 * cs-tokenizer.cs: Add handling for #pragma.
11169 * cs-parser.jay: Allow for both yield and yield return in the
11170 syntax. The anti-cobolization of C# fight will go on!
11172 * class.cs (TypeBuilder.DefineType): Catch error condition here
11173 (Parent.DefineType erroring out and returning null).
11175 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11176 coping with enumerations variables, we were mistakenly processing
11177 them as a regular value type instead of built-in types. Fixes the
11180 * typemanager.cs (IsBuiltinOrEnum): New method.
11182 2003-09-30 Miguel de Icaza <miguel@ximian.com>
11184 * cs-parser.jay: Upgrade: yield now needs the return clause.
11186 2003-09-19 Martin Baulig <martin@ximian.com>
11188 * decl.cs (MemberCache.SetupCacheForInterface): Take a
11189 `MemberCache parent' argument. Normally, an interface doesn't
11190 have a parent type except System.Object, but we use this in gmcs
11191 for generic type parameters.
11193 2003-09-18 Martin Baulig <martin@ximian.com>
11195 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11196 on `type.IsInterface'; don't check whether the type has a parent
11197 to determine whether it's an interface.
11199 2003-09-15 Martin Baulig <martin@ximian.com>
11201 * class.cs (TypeContainer.DefineType): Added an error flag to
11202 avoid reporting duplicate CS0146's ("class definition is
11205 * driver.cs (Driver.MainDriver): Abort if
11206 RootContext.ResolveTree() reported any errors.
11208 2003-09-07 Martin Baulig <martin@ximian.com>
11210 * report.cs (Error, Warning): Added overloaded versions which take
11211 a `params object[] args' and call String.Format().
11213 2003-09-07 Martin Baulig <martin@ximian.com>
11215 * decl.cs (DeclSpace..ctor): Don't call
11216 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11217 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
11218 (DeclSpace.RecordDecl): New method.
11220 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11222 2003-09-02 Ravi Pratap <ravi@ximian.com>
11224 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11225 value attributes to be applied to ParameterBuilders.
11227 * class.cs (MethodCore.LabelParameters): Make static and more
11228 generic so that it can be used from other places - like interface
11229 methods, for instance.
11231 * interface.cs (Interface.Emit): Call LabelParameters before
11232 emitting attributes on the InterfaceMethod.
11234 2003-08-26 Martin Baulig <martin@ximian.com>
11236 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11237 resolving aliases; fixes #47927.
11239 2003-08-26 Martin Baulig <martin@ximian.com>
11241 * statement.cs (Using.DoResolve): This is internally emitting a
11242 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11243 do not always return. Fixes #47681.
11245 2003-08-26 Martin Baulig <martin@ximian.com>
11247 * decl.cs (MemberCore): Moved WarningNotHiding(),
11248 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11250 (AdditionResult): Make this nested in DeclSpace.
11251 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11252 argument; call NamespaceEntry.Define() unless we're nested in a
11255 * namespace.cs (Namespace.DefineName): New public function. This
11256 is called from DeclSpace's .ctor to add
11257 (Namespace.Lookup): Include DeclSpaces in the lookup.
11259 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11261 * const.cs (Const): Derive from MemberBase, not MemberCore.
11263 2003-08-25 Martin Baulig <martin@ximian.com>
11265 * convert.cs (Convert.ExplicitReferenceConversion): When
11266 converting from an interface type to a class, unbox if the target
11267 type is a struct type. Fixes #47822.
11269 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11271 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11274 2003-08-22 Martin Baulig <martin@ximian.com>
11276 * class.cs (TypeManager.DefineType): When defining a nested type,
11277 call DefineType() on our parent; fixes #47801.
11279 2003-08-22 Martin Baulig <martin@ximian.com>
11281 * class.cs (MethodData.Define): While checking if a method is an
11282 interface implementation, improve the test a bit more to fix #47654.
11284 2003-08-22 Martin Baulig <martin@ximian.com>
11286 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11287 correctly; fixes #47722.
11289 2003-08-22 Martin Baulig <martin@ximian.com>
11291 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11292 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11294 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11296 2003-08-22 Martin Baulig <martin@ximian.com>
11298 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11299 can only be assigned in static constructors. Fixes #47161.
11301 2003-08-22 Martin Baulig <martin@ximian.com>
11303 Rewrote and improved the flow analysis code.
11305 * flowbranching.cs (FlowBranching): Make this class abstract.
11306 (FlowBranching.CreateBranching): New static function to create a
11307 new flow branching.
11308 (FlowBranchingBlock, FlowBranchingException): New classes.
11309 (FlowBranching.UsageVector.Type): New public readonly field.
11310 (FlowBranching.UsageVector.Breaks): Removed the setter.
11311 (FlowBranching.UsageVector.Returns): Removed the setter.
11312 (FlowBranching.UsageVector): Added Break(), Return(),
11313 NeverReachable() and Throw() methods to modify the reachability.
11314 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11315 done by FlowBranching.Merge().
11316 (FlowBranching.UsageVector.MergeChild): New method; merges the
11317 merge result into the current vector.
11318 (FlowBranching.Merge): New abstract method to merge a branching.
11320 2003-08-12 Martin Baulig <martin@ximian.com>
11322 * expression.cs (Indirection.CacheTemporaries): Create the
11323 LocalTemporary with the pointer type, not its element type.
11325 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11327 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11328 token was a keyword or not.
11330 Add `error' options where an IDENTIFIER was expected; Provide
11331 CheckToken and CheckIdentifierToken convenience error reporting
11334 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11336 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11337 NameSpaceEntry NameSpaceEntry.
11339 (LookupInterfaceOrClass): Avoid creating a full qualified name
11340 from namespace and name: avoid doing lookups when we know the
11341 namespace is non-existant. Use new Tree.LookupByNamespace which
11342 looks up DeclSpaces based on their namespace, name pair.
11344 * driver.cs: Provide a new `parser verbose' to display the
11345 exception thrown during parsing. This is turned off by default
11346 now, so the output of a failure from mcs is more graceful.
11348 * namespace.cs: Track all the namespaces defined in a hashtable
11351 (IsNamespace): New method
11353 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11355 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11356 we know that we need to concatenate (full typename can never be
11361 * statement.cs: Use a bitfield; Do not initialize to null things
11362 which are done by the constructor by default.
11364 * cs-parser.jay: bug fix, parameter was 4, not 3.
11366 * expression.cs: Just use the property;
11368 * statement.cs: No need for GetVariableInfo method.
11370 2003-08-08 Martin Baulig <martin@ximian.com>
11372 * flowanalysis.cs (FlowReturns): This is now nested in the
11373 `FlowBranching' class.
11374 (MyBitVector): Moved this here from statement.cs.
11375 (FlowBranching.SiblingType): New enum type.
11376 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11378 2003-08-07 Martin Baulig <martin@ximian.com>
11380 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11381 `FlowBranching' class and called `BranchingType'.
11383 2003-08-07 Martin Baulig <martin@ximian.com>
11385 * flowanalysis.cs: Moved all the control flow analysis code into
11388 2003-08-07 Martin Baulig <martin@ximian.com>
11390 * assign.cs (Assign.DoResolve): `target' must either be an
11391 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11394 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11396 * expression.cs (BinaryMethod): This kind of expression is created by the
11397 Binary class if it determines that the operator has to be handled
11400 (BinaryDelegate): This kind of expression is created if we are
11401 dealing with a + or - operator on delegates.
11403 (Binary): remove method, argumetns, and DelegateOperator: when
11404 dealing with methods,
11406 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11408 * statement.cs (Block): use bitfields for the three extra booleans
11409 we had in use. Remove unused topblock parameter.
11411 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11413 * assign.cs: Drop extra unneeded tests.
11415 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11417 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11419 * statement.cs (Foreach): Use VariableStorage instead of
11422 * codegen.cs (VariableStorage): New class used by clients that
11423 require a variable stored: locals or fields for variables that
11424 need to live across yield.
11426 Maybe provide a convenience api for EmitThis+EmitLoad?
11428 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11431 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11433 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11434 RemapParameterLValue): New methods that are used to turn a
11435 precomputed FieldInfo into an expression like this:
11439 The idea is to use this instead of making LocalVariableReference
11440 have more than one meaning.
11442 * cs-parser.jay: Add error production to BASE.
11444 * ecore.cs: Deal with TypeManager.GetField returning null, which
11445 is now a valid return value.
11447 (FieldExprNoAddress): New expression for Fields whose address can
11450 * expression.cs (LocalVariableReference): During the resolve
11451 phases, create new expressions if we are in a remapping context.
11452 Remove code that dealt with remapping here.
11454 (ParameterReference): same.
11456 (ProxyInstance): New expression, like the `This' expression, but
11457 it is born fully resolved. We know what we are doing, so remove
11458 the errors that are targeted to user-provided uses of `this'.
11460 * statement.cs (Foreach): our variable is now stored as an
11461 Expression; During resolution, follow the protocol, dont just
11462 assume it will return this.
11464 2003-08-06 Martin Baulig <martin@ximian.com>
11466 * support.cs (SeekableStreamReader.cs): New public class.
11468 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11469 SeekableStreamReader instead of the normal StreamReader.
11471 2003-08-04 Martin Baulig <martin@ximian.com>
11473 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11474 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11475 deambiguate casts and delegate invocations.
11476 (parenthesized_expression): Use the new tokens to ensure this is
11477 not a cast of method invocation.
11479 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11480 when reading a `)' and Deambiguate_CloseParens () was previously
11483 * expression.cs (ParenthesizedExpression): New class. This is
11484 just used for the CS0075 test.
11485 (Binary.DoResolve): Check for CS0075.
11487 2003-07-29 Ravi Pratap <ravi@ximian.com>
11489 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11490 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11491 reference comparison.
11493 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11494 examine the ReturnType for equality - this is necessary in the
11495 cases of implicit and explicit operators whose signature also
11496 includes the return type.
11498 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11500 * namespace.cs: Cache the result of the namespace computation,
11501 instead of computing it every time.
11503 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11505 * decl.cs: Use a global arraylist that we reuse over invocations
11506 to avoid excesive memory consumption. Reduces memory usage on an
11507 mcs compile by one meg (45 average).
11509 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11510 private, work around that.
11512 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11514 * literal.cs (IntLiteral): Define Zero and One static literals.
11516 * cs-parser.jay (integer_literal): use static literals to reduce
11517 memory usage for the most used literals (0, 1 and -1). 211kb
11518 reduced in memory usage.
11520 Replace all calls to `new ArrayList' with `new
11521 ArrayList(4)' which is a good average number for most allocations,
11522 and also requires only 16 bytes of memory for its buffer by
11525 This reduced MCS memory usage in seven megabytes for the RSS after
11528 2003-07-28 Ravi Pratap <ravi@ximian.com>
11530 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11531 handle params methods the correct way by forming only one
11532 applicable set with params and normal methods in them. Earlier we
11533 were looking at params methods only if we found no normal methods
11534 which was not the correct thing to do.
11536 (Invocation.BetterFunction): Take separate arguments indicating
11537 when candidate and the best method are params methods in their
11540 This fixes bugs #43367 and #46199.
11542 * attribute.cs: Documentation updates.
11544 (CheckAttribute): Rename to CheckAttributeTarget.
11545 (GetValidPlaces): Rename to GetValidTargets.
11547 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11548 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11552 2003-07-28 Martin Baulig <martin@ximian.com>
11554 * class.cs (TypeContainer.DefineMembers): Use the base type's full
11555 name when looking up the base class of a nested class. Fixes #46977.
11557 2003-07-26 Martin Baulig <martin@ximian.com>
11559 * expression.cs (Indexers.Indexer): New nested struct; contains
11560 getter, setter and the indexer's type.
11561 (Indexers.Properties): This is now an ArrayList of
11562 Indexers.Indexer's.
11563 (IndexerAccess.DoResolveLValue): Correctly set the type if the
11564 indexer doesn't have any getters.
11566 * assign.cs (Assign.DoResolve): Also do the implicit conversions
11567 for embedded property and indexer assignments.
11569 2003-07-26 Martin Baulig <martin@ximian.com>
11571 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11572 preprocessor directive is not the first non-whitespace character
11575 2003-07-26 Martin Baulig <martin@ximian.com>
11577 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11578 namespace parsing, follow the spec more closely.
11580 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11581 NamespaceEntry.Lookup().
11583 2003-07-25 Martin Baulig <martin@ximian.com>
11585 * MethodCore.cs (OverridesSomething): New public field; it's set
11586 from TypeContainer.DefineMembers if this method overrides
11587 something (which doesn't need to be a method). Fix #39462.
11589 2003-07-25 Ravi Pratap <ravi@ximian.com>
11591 * typemanager.cs (GetMembers): Ensure that the list of members is
11592 reversed. This keeps things in sync.
11594 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11595 find an AttributeUsage attribute.
11597 * expression.cs (Invocation.OverloadResolve): Perform the check
11598 which disallows Invoke to be directly called on a Delegate.
11600 (Error_InvokeOnDelegate): Report error cs1533.
11602 2003-07-25 Martin Baulig <martin@ximian.com>
11604 * expression.cs (Indexers.GetIndexersForType): Only look in the
11605 interface hierarchy if the requested type is already an
11606 interface. Fixes #46788 while keeping #46502 fixed.
11608 2003-07-25 Martin Baulig <martin@ximian.com>
11610 * class.cs (TypeContainer.DefineMembers): Check whether all
11611 readonly fields have been assigned and report warning CS0649 if
11614 * statement.cs (LocalInfo.IsFixed): Always return true if this is
11617 2003-07-24 Ravi Pratap <ravi@ximian.com>
11619 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11620 returned from GetMethods to make things consistent with the
11621 assumptions MCS makes about ordering of methods.
11623 This should comprehensively fix bug #45127 and it does :-)
11625 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11626 ordering is actually reverse.
11628 * Clean up some debug messages I left lying around.
11630 * interface.cs (Populate*): Get rid of code which emits attributes
11631 since the stage in which we emit attributes is the 'Emit' stage,
11632 not the define stage.
11634 (Emit): Move attribute emission for interface members here.
11636 2003-07-22 Ravi Pratap <ravi@ximian.com>
11638 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11639 closely: we eliminate methods in base types when we have an
11640 applicable method in a top-level type.
11642 Please see section 14.5.5.1 for an exact description of what goes
11645 This fixes bug #45127 and a host of other related to corlib compilation.
11647 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11648 array is the method corresponding to the top-level type (this is
11649 because of the changes made to icall.c) so we change this
11652 (MethodGroupExpr.Name): This too.
11654 * typemanager.cs (GetElementType): New method which does the right
11655 thing when compiling corlib.
11657 * everywhere: Make use of the above in the relevant places.
11659 2003-07-22 Martin Baulig <martin@ximian.com>
11661 * cs-parser.jay (invocation_expression): Moved
11662 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11663 `cast_expression', but create a InvocationOrCast which later
11664 resolves to either an Invocation or a Cast.
11666 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11667 method; call this before EmitStatement() to make sure that this
11668 expression can be used as a statement.
11670 * expression.cs (InvocationOrCast): New class; resolves to either
11671 an Invocation or a Cast.
11673 * statement.cs (StatementExpression): Call ResolveStatement() on
11674 the ExpressionStatement before emitting it.
11676 2003-07-21 Martin Baulig <martin@ximian.com>
11678 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11679 `ref' and `out' attributes match; fixes #46220.
11680 (MemberAccess.ResolveMemberAccess): You can't reference a type
11681 through an expression; fixes #33180.
11682 (Indexers.GetIndexersForType): Don't return the indexers from
11683 interfaces the class implements; fixes #46502.
11685 2003-07-21 Martin Baulig <martin@ximian.com>
11687 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11688 CS0661 checks; fixes bug #30442.
11690 2003-07-21 Martin Baulig <martin@ximian.com>
11692 * decl.cs (AdditionResult): Added `Error'.
11694 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11696 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11697 makes cs0031.cs actually work.
11699 2003-07-20 Martin Baulig <martin@ximian.com>
11701 * namespace.cs: Fixed that bug which caused a crash when compiling
11702 the debugger's GUI.
11704 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11706 * typemanager.cs (LookupTypeReflection): Never expose types which
11707 are NotPublic, NestedPrivate, NestedAssembly, or
11708 NestedFamANDAssem. We used to return these, and later do a check
11709 that would report a meaningful error, but the problem is that we
11710 would not get the real match, if there was a name override.
11712 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11714 * namespace.cs (Namespace, Name): Do not compute the namespace
11715 name dynamically, compute it in the constructor. This reduced
11716 memory usage by 1697 KB.
11718 * driver.cs: Use --pause to pause at the end.
11720 2003-07-17 Peter Williams <peter@newton.cx>
11722 * Makefile: Change the name of the test target so that it doesn't
11723 conflict with the recursive test target.
11725 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11727 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11728 AddressOf): Do not use EmitThis, that was wrong, use the actual
11731 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11733 * class.cs (MethodData.Define): While checking if a method is an
11734 interface implementation, improve the test: If we are not public
11735 (use new test here: use the computed MethodAttributes directly,
11736 instead of the parsed modifier flags) check if the `implementing'
11737 method comes from an interface or not.
11739 * pending.cs (VerifyPendingMethods): Slightly better error
11742 * makefile: add test target that does the mcs bootstrap.
11744 2003-07-16 Ravi Pratap <ravi@ximian.com>
11746 * interface.cs (Define): Do nothing here since there are no
11747 members to populate etc. Move the attribute emission out of here
11748 since this was just totally the wrong place to put it. Attribute
11749 application happens during the 'Emit' phase, not in the 'Define'
11752 (Emit): Add this method and move the attribute emission here
11754 * rootcontext.cs (EmitCode): Call the Emit method on interface
11757 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11759 * expression.cs (OverloadResolve): Report error only if Location
11760 is not 'Null' which means that there was a probe going on.
11762 2003-07-14 Martin Baulig <martin@ximian.com>
11764 * expression.cs (ConditionalLogicalOperator): New public class to
11765 implement user defined conditional logical operators.
11766 This is section 14.11.2 in the spec and bug #40505.
11768 2003-07-14 Martin Baulig <martin@ximian.com>
11770 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11772 2003-07-14 Martin Baulig <martin@ximian.com>
11774 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11776 * ecore.cs (IVariable.VerifyFixed): New interface method.
11778 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11779 operator, check whether the variable is actually fixed. Fixes bug
11780 #36055. Set a variable definitely assigned when taking its
11781 address as required by the spec.
11783 * statement.cs (LocalInfo.IsFixed): New field.
11784 (LocalInfo.MakePinned): Set `IsFixed' to true.
11786 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11788 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11789 for .ctors, ensure that we only ask for members declared in the
11790 attribute type (BindingFlags.DeclaredOnly).
11794 * expression.cs (Error_WrongNumArguments): Report error 1501
11795 correctly the way CSC does.
11797 2003-07-13 Martin Baulig <martin@ximian.com>
11799 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11800 lookup on the fully qualified name, to make things like "X.X" work
11801 where "X.X" is a fully qualified type name, but we also have a
11802 namespace "X" in the using list. Fixes #41975.
11804 2003-07-13 Martin Baulig <martin@ximian.com>
11806 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11807 function. If we're a CompoundAssign, we need to create an embedded
11808 CompoundAssign, not an embedded Assign.
11809 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11812 2003-07-13 Martin Baulig <martin@ximian.com>
11814 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11815 work to fix bug #46088.
11817 2003-07-13 Ravi Pratap <ravi@ximian.com>
11819 * class.cs (Operator.Emit): Do not emit attributes here - it is
11820 taken care of by the Method class that we delegate too. This takes
11821 care of bug #45876.
11823 2003-07-10 Martin Baulig <martin@ximian.com>
11825 * expression.cs (TypeOfVoid): New class.
11826 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11828 2003-07-10 Martin Baulig <martin@ximian.com>
11830 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11833 2003-07-10 Martin Baulig <martin@ximian.com>
11835 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11836 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11838 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11840 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11842 2003-07-10 Martin Baulig <martin@ximian.com>
11844 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11845 of decimal. Fixes #42850.
11847 NOTE: I also fixed the created byte blob, but this doesn't work on
11848 the MS runtime and csc never produces any byte blobs for decimal
11851 2003-07-10 Martin Baulig <martin@ximian.com>
11853 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11854 structs; fixes #32068.
11855 (Block.AddChildVariableNames): Fixed #44302.
11857 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11859 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11861 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11863 * attribute.cs: And this test is onger needed.
11865 2003-07-08 Martin Baulig <martin@ximian.com>
11867 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11868 inaccessible types. Fixes #36313.
11870 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11872 * namespace.cs (NamespaceEntry): Create implicit entries for all
11873 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11874 implicit entries for N1.N2 and N1.
11876 2003-07-08 Martin Baulig <martin@ximian.com>
11878 Rewrote the handling of namespaces to fix a lot of the issues
11879 wrt. `using' aliases etc.
11881 * namespace.cs (Namespace): Splitted this class into a
11882 per-assembly `Namespace' and a per-file `NamespaceEntry'.
11884 * typemanager.cs (TypeManager.IsNamespace): Removed.
11885 (TypeManager.ComputeNamespaces): Only compute namespaces from
11886 loaded assemblies here, not the namespaces from the assembly we're
11887 currently compiling.
11889 2003-07-08 Martin Baulig <martin@ximian.com>
11891 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11893 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11895 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11898 I thought about the memory savings here, but LookupTypeReflection
11899 is used under already very constrained scenarios. Compiling
11900 corlib or mcs only exposes one hit, so it would not really reduce
11901 any memory consumption.
11903 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11905 * typemanager.cs: fixes bug #45889 by only adding public types from
11906 other assemblies to the list of known types.
11908 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11910 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11911 on the type we resolved.
11913 2003-07-05 Martin Baulig <martin@ximian.com>
11915 * pending.cs (PendingImplementation.ParentImplements): Don't
11916 create the proxy if the parent is abstract.
11918 * class.cs (TypeContainer.DefineIndexers): Process explicit
11919 interface implementations first. Fixes #37714.
11921 2003-07-04 Miguel de Icaza <miguel@ximian.com>
11923 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11924 defined recursively; but since we modify the input parameters
11925 (left is set to `this' temporarily), we reset this value if the
11926 left_is_explicit is false, which gives the original semantics to
11929 * literal.cs (NullPointer): new class used to represent a null
11930 literal in a pointer context.
11932 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11933 type is a pointer, use a NullPointer object instead of a
11934 NullLiteral. Closes 43687
11936 (ExplicitConversion): Convert pointer values using
11937 the conv opcode to the proper type.
11939 * ecore.cs (New): change ValueTypeVariable property into a method,
11940 that returns whether the valuetype is suitable for being used.
11942 * expression.cs (Binary.DoNumericPromotions): Only return if we
11943 the int constant was a valid uint, and we can return both left and
11944 right as uints. If not, we continue processing, to trigger the
11945 type conversion. This fixes 39018.
11947 * statement.cs (Block.EmitMeta): During constant resolution, set
11948 the CurrentBlock property on the emitcontext, so that we resolve
11949 constants propertly.
11951 2003-07-02 Martin Baulig <martin@ximian.com>
11953 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11954 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11956 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11957 than emitting it here.
11959 * statement.cs: Fixed some more flow analysis bugs.
11961 2003-07-02 Martin Baulig <martin@ximian.com>
11963 * class.cs (MethodData.Define): When implementing interface
11964 methods, set Final unless we're Virtual.
11966 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11967 check work for interface methods.
11969 2003-07-01 Martin Baulig <martin@ximian.com>
11971 * ecore.cs (EmitContext.This): Replaced this property with a
11972 GetThis() method which takes a Location argument. This ensures
11973 that we get the correct error location for a CS0188.
11975 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11977 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11978 ImplicitStandardConversion.
11980 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11982 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11984 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11987 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11989 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11992 (MethodData.Define): Turn off initlocals for unsafe methods.
11994 2003-06-29 Miguel de Icaza <miguel@ximian.com>
11996 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11997 complete; Fixes #37521.
11999 * delegate.cs: Use Modifiers.TypeAttr to compute the
12000 TypeAttributes, instead of rolling our own. This makes the flags
12001 correct for the delegates.
12003 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12005 * class.cs (Constructor.Define): Set the private flag for static
12006 constructors as well.
12008 * cs-parser.jay (statement_expression): Set the return value to
12009 null, to avoid a crash when we catch an error.
12011 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12013 * cs-parser.jay: Applied patch from Jackson that adds support for
12014 extern and unsafe modifiers to destructor declarations.
12016 * expression.cs: Report error 21 if the user is trying to index a
12019 * driver.cs: Add an error message, suggested by the bug report.
12021 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12022 if we do not have a ": this ()" constructor initializer. Fixes 45149
12024 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12026 * namespace.cs: Add some information to reduce FAQs.
12028 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12030 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12031 underlying enumeration types. Fixes #43915.
12033 * expression.cs: Treat ushort/short as legal values to be used in
12034 bitwise operations.
12036 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12038 * delegate.cs: transfer custom attributes for paramenters from
12039 the delegate declaration to Invoke and BeginInvoke.
12041 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12043 * attribute.cs: handle custom marshalers and emit marshal info
12046 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12048 * makefile.gnu: Added anonymous.cs to the compiler sources.
12050 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12052 * iterators.cs: Change the name of the proxy class to include two
12055 * cs-parser.jay: Update grammar to include anonymous methods.
12057 * anonymous.cs: new file.
12059 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12061 * class.cs (Field.Define): Add missing test for pointers and
12064 2003-05-27 Ravi Pratap <ravi@ximian.com>
12066 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12067 we use the stobj opcode.
12069 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12070 since it wasn't the correct fix.
12072 It still is puzzling that we are required to use stobj for IntPtr
12073 which seems to be a ValueType.
12075 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12077 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12078 during regular simple name resolution. Now, the trick is that
12079 instead of returning for processing the simplename, we do a
12080 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12081 contextual lookup type). If a match is found, return that, if
12082 not, return for further composition.
12084 This fixes long-standing 30485.
12086 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12087 using the address to initialize an object, do an Stobj instead of
12088 using the regular Stelem.
12090 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12091 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12092 Because if we are a BaseIndexerAccess that value will be true.
12095 * statement.cs (GotoCase.Resolve): Return after reporting an
12096 error, do not attempt to continue.
12098 * expression.cs (PointerArithmetic.Emit): If our operand is a
12099 long, convert our constants to match the operand before
12100 multiplying. Convert to I type before adding. Fixes 43670.
12102 2003-05-14 Ravi Pratap <ravi@ximian.com>
12104 * enum.cs (ImplicitConversionExists) : Rename to
12105 ImplicitEnumConversionExists to remove ambiguity.
12107 * ecore.cs (NullCast): New type of cast expression class which
12108 basically is very similar to EmptyCast with the difference being
12109 it still is a constant since it is used only to cast a null to
12111 (eg. (string) null)
12113 * convert.cs (ImplicitReferenceConversion): When casting a null
12114 literal, we return a NullCast.
12116 * literal.cs (NullLiteralTyped): Remove - I don't see why this
12117 should be around anymore.
12119 The renaming (reported was slightly wrong). Corrections:
12121 ConvertImplicitStandard -> ImplicitConversionStandard
12122 ConvertExplicitStandard -> ExplicitConversionStandard
12124 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12125 before passing them in !
12127 * convert.cs (ImplicitConversionStandard): When comparing for
12128 equal expr and target types, ensure that expr is not a
12131 In general, we must not be checking (expr_type ==
12132 target_type) in the top level conversion methods
12133 (ImplicitConversion, ExplicitConversion etc). This checking is
12134 done in the methods that they delegate to.
12136 2003-05-20 Miguel de Icaza <miguel@ximian.com>
12138 * convert.cs: Move Error_CannotConvertType,
12139 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12140 ImplicitNumericConversion, ImplicitConversionExists,
12141 ImplicitUserConversionExists, StandardConversionExists,
12142 FindMostEncompassedType, FindMostSpecificSource,
12143 FindMostSpecificTarget, ImplicitUserConversion,
12144 ExplicitUserConversion, GetConversionOperators,
12145 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12146 TryImplicitIntConversion, Error_CannotConvertImplicit,
12147 ConvertImplicitRequired, ConvertNumericExplicit,
12148 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12149 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12152 Perform the following renames:
12154 StandardConversionExists -> ImplicitStandardConversionExists
12155 ConvertImplicit -> ImplicitConversion
12156 ConvertImplicitStandard -> ImplicitStandardConversion
12157 TryImplicitIntConversion -> ImplicitIntConversion
12158 ConvertImplicitRequired -> ImplicitConversionRequired
12159 ConvertNumericExplicit -> ExplicitNumericConversion
12160 ConvertReferenceExplicit -> ExplicitReferenceConversion
12161 ConvertExplicit -> ExplicitConversion
12162 ConvertExplicitStandard -> ExplicitStandardConversion
12164 2003-05-19 Martin Baulig <martin@ximian.com>
12166 * statement.cs (TypeInfo.StructInfo): Made this type protected.
12167 (TypeInfo): Added support for structs having structs as fields.
12169 * ecore.cs (FieldExpr): Implement IVariable.
12170 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12171 VariableInfo for the field.
12173 2003-05-18 Martin Baulig <martin@ximian.com>
12175 * expression.cs (This.DoResolve): Report a CS0027 if we're
12176 emitting a field initializer.
12178 2003-05-18 Martin Baulig <martin@ximian.com>
12180 * expression.cs (This.ResolveBase): New public function.
12181 (This.DoResolve): Check for CS0188.
12183 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12186 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12187 `instance_expression' to null if we don't have any non-static
12190 2003-05-18 Martin Baulig <martin@ximian.com>
12192 Reworked the way how local variables and parameters are handled by
12193 the flow analysis code.
12195 * statement.cs (TypeInfo, VariableMap): New public classes.
12196 (VariableInfo): New public class. This is now responsible for
12197 checking whether a variable has been assigned. It is used for
12198 parameters and local variables.
12199 (Block.EmitMeta): Take the InternalParameters as argument; compute
12200 the layout of the flow vectors here.
12201 (Block.LocalMap, Block.ParameterMap): New public properties.
12202 (FlowBranching): The .ctor doesn't get the InternalParameters
12203 anymore since Block.EmitMeta() now computes the layout of the flow
12205 (MyStructInfo): This class is now known as `StructInfo' and nested
12206 in `TypeInfo'; we don't access this directly anymore.
12208 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12209 property and removed IsAssigned(), IsFieldAssigned(),
12210 SetAssigned() and SetFieldAssigned(); we now call them on the
12211 VariableInfo so we don't need to duplicate this code everywhere.
12213 * expression.cs (ParameterReference): Added `Block block' argument
12215 (LocalVariableReference, ParameterReference, This): The new
12216 VariableInfo class is now responsible for all the definite
12219 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12220 IsParameterAssigned, SetParameterAssigned): Removed.
12222 2003-05-18 Martin Baulig <martin@ximian.com>
12224 * typemanager.cs (InitCoreTypes): Try calling
12225 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12226 the 3-args-version. Corlib now also needs our `void_type'.
12227 (GetMethod): Added overloaded version which takes an optional
12228 `bool report_errors' to allow lookups of optional methods.
12230 2003-05-12 Martin Baulig <martin@ximian.com>
12232 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12233 only used for locals and not for parameters.
12235 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12237 * support.cs (InternalParameters.ParameterType): Return the
12238 ExternalType of the parameter.
12240 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12243 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12245 * class.cs (MethodData.Define): Do not set the `newslot' on
12246 interface members, if they are also flagged as "override".
12248 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12249 better code for ++i and i++. This only works for static fields
12250 and local variables.
12252 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12253 want to pull the DeclSpace out of the builder_to_declspace instead
12254 of the TypeBuilder (like in TypeContainer.FindMembers).
12256 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12257 instead of LookupTypeContainer. Fixes the crash on .NET for
12258 looking up interface members.
12260 * const.cs: Create our own emit context during the Definition
12261 stage, so that constants are evaluated in the proper context, when
12262 a recursive definition happens.
12264 2003-05-11 Martin Baulig <martin@ximian.com>
12266 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12267 new block for a switch section.
12268 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12269 the adding/lookup in the switch block. Fixes #39828.
12271 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12273 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12274 functionality: I needed to convert the data after I had performed
12275 the add/sub operation into the operands type size.
12277 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12278 pass the type for the box operation, otherwise the resulting
12279 object would have been of type object.
12281 (BoxedCast): Add constructor to specify the type to box as.
12283 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12285 * iterators.cs: I was reusing the `count' variable inadvertently,
12286 take steps to not allow this to happen.
12288 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12290 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12291 by creating an array at the point where the params starts and
12292 putting all those arguments there, then adjusting the size of the
12295 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12297 * expression.cs (New.AddressOf): Implement interface
12298 IMemoryLocation. This is used when the `new' operator is used in
12299 the context of an invocation to a method on a value type.
12301 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12304 * namespace.cs: Also check the using aliases here.
12306 * driver.cs: Move the test for using validity after the types have
12307 been entered, so we do a single pass that also includes the using
12310 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12311 in the regular case. CreateSiblingForFinally is doing extra
12314 * attribute.cs (GetAttributeArgumentExpression): Store the result
12315 on an out value, and use the return value to indicate failure
12316 instead of using null (which is a valid return for Constant.GetValue).
12318 * statement.cs: Perform the analysis flow for the increment
12319 portion after the statement, because this will be the real flow of
12320 execution. Fixes #42385
12322 * codegen.cs (EmitContext.EmitArgument,
12323 EmitContext.EmitStoreArgument): New helper functions when the
12324 RemapToProxy flag is set.
12326 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12329 Add support for remapping parameters.
12331 * iterators.cs: Propagate parameter values; Store parameter
12332 values in the proxy classes.
12334 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12336 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12337 need a proxy reference; I do not know what I was thinking
12339 * cs-parser.jay (constructor_initializer): catch another error,
12340 and display nice message.
12342 (field_declaration): catch void field declaration
12343 to flag a better error.
12345 * class.cs (MemberBase.CheckBase): Report an error instead of a
12346 warning if a new protected member is declared in a struct.
12347 (Field.Define): catch the error of readonly/volatile.
12349 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12351 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12352 volatile variable is taken
12354 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12356 * statement.cs (Fixed.Resolve): Report an error if we are not in
12359 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12361 * typemanager.cs: reuse the code that handles type clashes for
12362 delegates and enumerations.
12364 * class.cs (Report28): Always report.
12366 * expression.cs (EncodeAsAttribute): Allow nulls here.
12368 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12370 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12371 the functionality for testing whether an expression is valid for
12372 an attribute here. Also handle the case of arrays of elements
12375 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12376 encoding a linear array into an array of objects that are suitable
12377 to be passed to an CustomAttributeBuilder.
12379 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12381 * ecore.cs: (FieldExpr): Handle field remapping here.
12383 * iteratators.cs: Pass the instance variable (if the method is an
12384 instance method) to the constructors, so we can access the field
12385 variables on the class.
12387 TODO: Test this with structs. I think the THIS variable on
12388 structs might have to be a pointer, and not a refenrece
12390 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12392 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12393 local variables to fields in a proxy class.
12395 * iterators.cs (PopulateProxy): Rename our internal fields to
12397 Create a <THIS> field if we are an instance method, so we can
12398 reference our parent container variables.
12399 (MapVariable): Called back from the EmitContext code to enter a
12400 new variable to field mapping into the proxy class (we just create
12404 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12405 for using the remapped locals to fields.
12407 I placed the code here, because that gives the same semantics to
12408 local variables, and only changes the Emit code.
12410 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12411 statements inside iterators.
12412 (VariableInfo): Add a FieldBuilder for the cases when we are
12413 remapping local variables to fields in a proxy class
12415 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12416 current_block != null.
12418 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12419 not cope with strings, as it has been moved to the
12420 TableSwitchEmit. Fixed bug in switch generation.
12422 * expression.cs (New.DoResolve): Provide more context for the user
12423 when reporting an error.
12425 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12428 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12429 check the permissions for it. Note than in a type-resolution
12430 context the check was already present in DeclSpace.ResolveType,
12431 but was missing from the MemberAccess.
12433 (ArrayCreation.CheckIndices): warn if the user has
12434 more nested levels of expressions, but there are no more
12435 dimensions specified. Avoids crash on bug 41906.
12437 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12439 * statement.cs (Block): replace Implicit bool, for a generic
12441 New flag: `Unchecked'. This is used during the EmitMeta phase
12442 (which is out-of-line with the regular Resolve/Emit process for a
12443 statement, as this is done ahead of time, but still gets a chance
12444 to call constant resolve).
12446 (Block.Flags): new enum for adding a new flag.
12448 (Block.EmitMeta): track the state of unchecked.
12450 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12451 to enable constant resolution to work there as well.
12453 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12455 * typemanager.cs (ienumerable_type): Also look up
12456 System.Collections.IEnumerable.
12458 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12460 TODO: Test more than one conditional per method.
12462 * class.cs (Indexer.Define): Report the location where the user is
12463 referencing the unsupported feature.
12465 (MethodData): Overload the use of `conditionals' to
12466 minimize the creation of needless ArrayLists. This saves roughly
12467 212kb on my machine.
12469 (Method): Implement the new IIteratorContainer interface.
12470 (Method.SetYields): Implement the method by setting the ModFlags
12471 to contain METHOD_YIELDS.
12473 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12474 which just got set to null.
12476 * iterators.cs: New file.
12478 (Yield, YieldBreak): New statements.
12480 * statement.cs (Return.Resolve): Flag an error if we are used in
12481 an iterator method.
12483 * codegen.cs (InIterator): New flag set if the code is being
12484 compiled in an iterator method.
12486 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12487 internal modifier, and we just use it to avoid adding extra
12488 fields, as this is seldom used.
12490 * cs-parser.jay: Add yield_statement (yield and yield break).
12492 * driver.cs: New flag -v2 to turn on version 2 features.
12494 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12495 hashtable when v2 is enabled.
12497 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12499 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12500 there is already a namespace defined with this name.
12502 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12503 people upgraded their corlibs.
12505 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12506 always use fully qualified types, no need to use the compiler
12509 (TypeManager.IsNamespace): Use binarysearch.
12511 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12512 AddDelegate): I did not quite use the new IsValid API properly: I
12513 have to pass the short-name and the fullname. I was passing only
12514 the basename instead of the fullname sometimes.
12516 (TypeContainer.DefineType): call NamespaceClash.
12518 * interface.cs (Interface.DefineType): use NamespaceClash before
12521 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12524 * enum.cs: (Enum.DefineType): use NamespaceClash before
12527 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12528 speed increase. First, use the negative_hits cache when we get a
12529 negative. Second, add the type with its full original name
12530 instead of the new . and + encoded name (reflection uses + to
12531 separate type from a nested type). Use LookupTypeReflection
12532 directly which bypasses the type->name hashtable (that we already
12533 know does not contain the type.
12535 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12536 location/container type.
12538 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12540 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12542 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12544 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12545 method is being referenced in the method group from a static
12546 context, and report error 120 if so.
12548 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12551 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12552 is created, we create the A namespace).
12554 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12557 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12559 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12560 invocation to ModuleBuilder.GetType with the same values will
12561 return a new type instance, so we need to cache its return
12564 * expression.cs (Binary.ResolveOperator): Only allow the compare
12565 operators on enums if they are of the same type.
12567 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12568 types of ValueType on their own case. Before we were giving them
12569 the same treatment as objects.
12571 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12572 fullname. Short name is used to compare against container name.
12573 Fullname is used to check against defined namespace names.
12575 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12576 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12578 (Method.CheckBase): Call parent.
12579 (MemberBase.CheckBase): Check for protected members on sealed
12581 (PropertyBase.CheckBase): Call parent.
12582 (Field.Define): Call parent.
12584 * report.cs: Negative error codes are now mapped to 8000 - code,
12585 so that the display is render more nicely.
12587 * typemanager.cs: Do not use try/catch, instead report a regular
12590 (GetPointerType, GetReferenceType): These methods provide
12591 mechanisms to obtain the T* and T& from a T. We had the code
12592 previously scattered around the code base, and it also used
12593 TypeManager.LookupType that would go through plenty of caches.
12594 This one goes directly to the type source.
12596 In some places we did the Type.GetType followed by
12597 ModuleBuilder.GetType, but not in others, so this unifies the
12598 processing as well.
12600 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12601 statements now that we have namespace information.
12603 * typemanager.cs (IsNamespace): New method, returns whether the
12604 string presented is a namespace or not.
12606 (ComputeNamespaces): New public entry point, computes the list of
12607 available namespaces, using the GetNamespaces API call in Mono, or
12608 the slower version in MS.NET.
12610 Now before we start the semantic analysis phase, we have a
12611 complete list of namespaces including everything that the user has
12614 Deleted old code to cache namespaces in .nsc files.
12616 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12618 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12619 class/struct location definition Location for the implicit
12620 constructor location.
12622 (Operator.Define): Use the location of the operator for the
12623 implicit Method definition.
12625 (Constructor.Emit): use the constructor location for the implicit
12626 base initializer constructor.
12628 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12629 and the Expression class now contains two new methods:
12631 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12632 isolate type lookup from the rest of the resolution process.
12634 Since we use Expressions to hold type definitions due to the way
12635 we parse the input we have historically overloaded Resolve to
12636 perform the Type lookups if a special flag is passed. Now this is
12637 eliminated and two methods take their place.
12639 The differences in the two methods between xStep and xTerminal is
12640 that xStep is involved in our current lookup system that uses
12641 SimpleNames to compose a name, while xTerminal is used just to
12642 catch the case where the simplename lookup failed.
12644 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12646 * expression.cs (ResolveMemberAccess): Remove redundant code.
12647 TypeExpr expressions are always born fully resolved.
12649 * interface.cs (PopulateMethod): Do not lookup the types twice.
12650 We were doing it once during SemanticAnalysis and once during
12653 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12654 in local variable type definitions, were being returned as a
12655 SimpleName (we decomposed everything into a string), that is
12656 because primary_expression was being used instead of a type in the
12657 grammar (reduce/reduce conflicts).
12659 The part that was wrong is that we converted the expression into a
12660 string (an oversimplification in one hand, compounded with primary
12661 expressions doing string concatenation).
12667 Would return "A.B.C[]" as a SimpleName. This stopped things like
12668 using clauses from working on this particular context. And a type
12669 was being matched directly against "A.B.C[]".
12671 We now use the correct approach, and allow for ComposedCast to be
12672 part of the unary expression. So the "A.B.C []" become a composed
12673 cast of "A.B.C" (as a nested group of MemberAccess with a
12674 SimpleName at the end) plus the rank composition "[]".
12678 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12680 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12681 for the access level checking.
12683 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12684 `TypeContainer container', because I kept getting confused when I
12685 was debugging this code.
12687 * expression.cs (Indexers): Instead of tracking getters/setters,
12688 we now track them in parallel. We create one arraylist less, but
12689 most importantly it is possible now for the LValue code to find a
12690 matching get for a set.
12692 (IndexerAccess.DoResolveLValue): Update the code.
12693 GetIndexersForType has been modified already to extract all the
12694 indexers from a type. The code assumed it did not.
12696 Also make the code set the correct return type for the indexer.
12697 This was fixed a long time ago for properties, but was missing for
12698 indexers. It used to be void_type.
12700 (Binary.Emit): Test first for doubles instead of
12701 floats, as they are more common.
12703 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12704 when dealing with floats and the <=, >= operators. This fixes bug
12707 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12708 to load the array value by emitting a load on the foreach variable
12709 type. This was incorrect.
12711 We now emit the code to load an element using the the array
12712 variable type, and then we emit the conversion operator.
12716 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12718 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12720 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12722 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12723 test for protection before we test for signatures.
12725 (MethodSignature.ToString): implement.
12727 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12728 to the case where we reduced into a LongConstant.
12730 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12731 depend on whether the information is acurrate, because the
12732 Microsoft runtime will always claim that the array type is public,
12733 regardless of the real state.
12735 If the type is a pointer, another problem happens: the type is
12736 reported as non-public in Microsoft.
12738 In both cases we have to call CheckAccessLevel recursively with
12739 the underlying type as the argument to be tested.
12741 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12743 * assign.cs (Assign.Emit): If we are dealing with a compound
12744 assignment expression, we should use the code path that stores the
12745 intermediate result in a temporary value. This fixes #40903.
12747 *expression.cs (Indirection.ToString): Provide ToString method for
12750 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12752 * class.cs: Null out fields holding references to Block objects so
12753 they can be garbage collected.
12755 * expression.cs (OverloadResolve): Remove unused local.
12757 2003-04-07 Martin Baulig <martin@ximian.com>
12759 * codegen.cs (EmitContext.CurrentFile): New public field.
12760 (EmitContext.Mark): Use the CurrentFile to check whether the
12761 location is in the correct file.
12762 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12764 2003-04-07 Martin Baulig <martin@ximian.com>
12766 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12768 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12769 location. [FIXME: The location argument which gets passed to this
12770 method is sometimes wrong!]
12772 2003-04-07 Nick Drochak <ndrochak@gol.com>
12774 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12776 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12778 * expression.cs (Indirection.EmitAssign): We were using the
12779 temporary, but returning immediately instead of continuing the
12782 2003-04-06 Martin Baulig <martin@ximian.com>
12784 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12785 if it's a nested child, but also deriving from the outer class.
12788 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12789 nested child, but also deriving from the outer class. See
12791 (FilterWithClosure): We may access private members of the outer
12792 class if we're a nested child and deriving from the outer class.
12793 (RealMemberLookup): Only set `closure_private_ok' if the
12794 `original_bf' contained BindingFlags.NonPublic.
12796 2003-04-05 Martin Baulig <martin@ximian.com>
12798 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12800 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12802 * class.cs (Event.Define): Do not allow abstract events to have
12805 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12807 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12808 block in event declarations.
12810 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12811 value type, get its address.
12813 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12814 leaving a class on the stack instead of a boolean value (int
12815 0/1). Change the code so we compare against null, and then the
12816 result against zero.
12818 * class.cs (TypeContainer.GetClassBases): We were checking for the
12819 parent class being sealed too late.
12821 * expression.cs (Binary.Emit): For <= and >= when dealing with
12822 floating point values, use cgt.un and clt.un instead of cgt and
12825 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12827 * statement.cs: Apply the same optimization as MS: skip the
12828 GetEnumerator returning an IEnumerator, and use the one returning a
12829 CharEnumerator instead. This allows us to avoid the try-finally block
12832 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12834 * cs-parser.jay: Attributes cannot be applied to
12835 namespaces. Fixes #40473
12837 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12840 (Add*): check if the name is valid using the full name for constants,
12841 fields, properties and events.
12843 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12845 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12846 char constants to be part of the enumeration.
12848 * expression.cs (Conditional.DoResolve): Add support for operator
12849 true. Implements the missing functionality from 14.12
12851 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12852 operator true/false as required by the spec.
12854 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12855 implicit conversion to boolean.
12857 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12858 also one where the type implements `operator true'.
12860 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12861 get an expression that will invoke operator true based on an
12864 (GetConversionOperators): Removed the hack that called op_True
12867 (Expression.ResolveBoolean): Move this from Statement.
12869 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12871 * ecore.cs (FieldExpr): do not allow initialization of initonly
12872 fields on derived classes
12874 2003-03-13 Martin Baulig <martin@ximian.com>
12876 * statement.cs (Block.Emit): Call ig.BeginScope() and
12877 ig.EndScope() when compiling with debugging info; call
12878 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12880 2003-03-08 Miguel de Icaza <miguel@ximian.com>
12882 * expression.cs (Indexers): Do not construct immediately, allow
12883 for new members to be appended as we go. Fixes 38143
12885 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12887 * expression.cs: save/restore context when resolving an unchecked
12890 2003-03-05 Miguel de Icaza <miguel@ximian.com>
12892 * cfold.cs: Catch division by zero in modulus operator during
12895 2003-03-03 Miguel de Icaza <miguel@ximian.com>
12897 * interface.cs (Interface.DefineMembers): Avoid defining members
12900 2003-02-27 Miguel de Icaza <miguel@ximian.com>
12902 * driver.cs: handle the +/- options for -noconfig
12904 * statement.cs (Unckeched.Resolve): Also track the state of
12905 unchecked in the Resolve phase.
12907 2003-02-27 Martin Baulig <martin@ximian.com>
12909 * ecore.cs (Expression.MemberLookup): Don't create a
12910 MethodGroupExpr for something which is not a method. Fixes #38291.
12912 2003-02-25 Miguel de Icaza <miguel@ximian.com>
12914 * class.cs (MemberBase.CheckParameters): Also check that the type
12915 is unmanaged if it is a pointer.
12917 * expression.cs (SizeOf.Resolve): Add location information.
12919 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12920 a managed type is declared.
12922 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12923 parameter modifiers as well. Fixes bug 38606
12925 * class.cs: Very sad. Am backing out the speed up changes
12926 introduced by the ArrayList -> Array in the TypeContainer, as they
12927 were not actually that much faster, and introduced a bug (no error
12928 reports on duplicated methods).
12930 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12931 source first, this will guarantee that we have a valid expression
12932 before calling in lower levels functions that will require a
12933 resolved object. Then use this original_source in the
12934 target.ResolveLValue instead of the original source that was
12937 Another change. Use target.Resolve instead of LValueResolve.
12938 Although we are resolving for LValues, we will let the Assign code
12939 take care of that (it will be called again from Resolve). This
12940 basically allows code like this:
12942 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12943 class Y { void A (X x) { x [0] += o; }
12945 The problem was that the indexer was trying to resolve for
12946 set_Item (idx, object o) and never finding one. The real set_Item
12947 was set_Item (idx, X). By delaying the process we get the right
12952 2003-02-23 Martin Baulig <martin@ximian.com>
12954 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12955 while calling DoEmit ().
12957 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12958 source files; if you use the #line directive inside a method, the
12959 compiler stops emitting line numbers for the debugger until it
12960 reaches the end of the method or another #line directive which
12961 restores the original file.
12963 2003-02-23 Martin Baulig <martin@ximian.com>
12965 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12967 2003-02-23 Martin Baulig <martin@ximian.com>
12969 * statement.cs (Block.AddChildVariableNames): We need to call this
12970 recursively, not just for our immediate children.
12972 2003-02-23 Martin Baulig <martin@ximian.com>
12974 * class.cs (Event.Define): Always make the field private, like csc does.
12976 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12977 actually work, fixes bug #37521.
12979 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12981 * delegate.cs: When creating the various temporary "Parameters"
12982 classes, make sure that we call the ComputeAndDefineParameterTypes
12983 on those new parameters (just like we do with the formal ones), to
12984 allow them to be resolved in the context of the DeclSpace.
12986 This fixes the bug that Dick observed in Bugzilla #38530.
12988 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12990 * expression.cs (ResolveMemberAccess): When resolving a constant,
12991 do not attempt to pull a constant if the value was not able to
12992 generate a valid constant.
12994 * const.cs (LookupConstantValue): Do not report more errors than required.
12996 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12998 * expression.cs: fixes bug #38328.
13000 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13002 * class.cs: Changed all the various members that can be part of a
13003 class from being an ArrayList to be an Array of the right type.
13004 During the DefineType type_list, interface_list, delegate_list and
13005 enum_list are turned into types, interfaces, delegates and enums
13008 And during the member population, indexer_list, event_list,
13009 constant_list, field_list, instance_constructor_list, method_list,
13010 operator_list and property_list are turned into their real arrays.
13012 Although we could probably perform this operation earlier, for
13013 good error reporting we need to keep the lists and remove the
13014 lists for longer than required.
13016 This optimization was triggered by Paolo profiling the compiler
13017 speed on the output of `gen-sample-program.pl' perl script.
13019 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13020 not crash in methods like MemberLookupFailed that use this field.
13022 This problem arises when the compiler fails to resolve a type
13023 during interface type definition for example.
13025 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13027 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13028 inherit from System.Object, so we have to stop at null, not only
13029 when reaching System.Object.
13031 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13033 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13034 DeclaredOnly because the parent indexer might have had a different
13035 name, but did not loop until the top of the hierarchy was reached.
13037 The problem this one fixes is 35492: when a class implemented an
13038 indexer from an interface, we were getting the interface method
13039 (which was abstract) and we were flagging an error (can not invoke
13042 This also keeps bug 33089 functioning, and test-148 functioning.
13044 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13045 out if a method is special is to see if it is declared in a
13046 property or event, or whether it is one of the predefined operator
13047 names. This should fix correctly #36804.
13049 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13051 The goal here is to remove the dependency on EmptyCast.Peel ().
13052 Killing it completely.
13054 The problem is that currently in a number of places where
13055 constants are expected, we have to "probe" for an EmptyCast, and
13056 Peel, which is not the correct thing to do, as this will be
13057 repetitive and will likely lead to errors.
13059 The idea is to remove any EmptyCasts that are used in casts that
13060 can be reduced to constants, so we only have to cope with
13063 This bug hunt was triggered by Bug 37363 and the desire to remove
13064 the duplicate pattern where we were "peeling" emptycasts to check
13065 whether they were constants. Now constants will always be
13068 * ecore.cs: Use an enumconstant here instead of wrapping with
13071 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13072 throwing me off. By handling this we can get rid of a few hacks.
13074 * statement.cs (Switch): Removed Peel() code.
13076 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13078 * class.cs: Location information for error 508
13080 * expression.cs (New.DoResolve): Add a guard against double
13081 resolution of an expression.
13083 The New DoResolve might be called twice when initializing field
13084 expressions (see EmitFieldInitializers, the call to
13085 GetInitializerExpression will perform a resolve on the expression,
13086 and later the assign will trigger another resolution
13088 This leads to bugs (#37014)
13090 * delegate.cs: The signature for EndInvoke should contain any ref
13091 or out parameters as well. We were not doing this in the past.
13093 * class.cs (Field.Define): Do not overwrite the type definition
13094 inside the `volatile' group. Turns out that volatile enumerations
13095 were changing the type here to perform a validity test, which
13098 2003-02-12 Miguel de Icaza <miguel@ximian.com>
13100 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13101 and structs, we do not want to load the instance variable
13103 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13104 enum_type has to be handled like an object reference (implicit
13105 conversions exists from this to object), but the regular IsClass
13106 and IsValueType tests will never return true for this one.
13108 Also we use TypeManager.IsValueType instead of type.IsValueType,
13109 just for consistency with the rest of the code (this is only
13110 needed if we ever use the construct exposed by test-180.cs inside
13111 corlib, which we dont today).
13113 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
13115 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13118 2003-02-09 Martin Baulig <martin@ximian.com>
13120 * namespace.cs (Namespace..ctor): Added SourceFile argument.
13121 (Namespace.DefineNamespaces): New static public method; this is
13122 called when we're compiling with debugging to add all namespaces
13123 to the symbol file.
13125 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13126 pass it to the Namespace's .ctor.
13128 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13129 and MethodBase arguments; pass the namespace ID to the symwriter;
13130 pass the MethodBase instead of the token to the symwriter.
13131 (SymbolWriter.DefineNamespace): New method to add a namespace to
13134 2003-02-09 Martin Baulig <martin@ximian.com>
13136 * symbolwriter.cs: New file. This is a wrapper around
13137 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
13138 methods here in near future.
13140 2003-02-09 Martin Baulig <martin@ximian.com>
13142 * codegen.cs (EmitContext.Mark): Just pass the arguments to
13143 ILGenerator.MarkSequencePoint() which are actually used by the
13146 2003-02-09 Martin Baulig <martin@ximian.com>
13148 * location.cs (SourceFile): New public sealed class. This
13149 contains the name and an index which is used in the location's token.
13150 (Location): Reserve an appropriate number of bits in the token for
13151 the source file instead of walking over that list, this gives us a
13152 really huge performance improvement when compiling with debugging.
13154 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13155 `SourceFile' argument instead of a string.
13156 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13157 but don't parse/tokenize here, we need to generate the list of all
13158 source files before we do that.
13159 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13162 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13163 instead of a string.
13165 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13168 2003-02-09 Martin Baulig <martin@ximian.com>
13170 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13171 filename on `#line default'.
13173 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13175 * statement.cs: don't clear the pinned var when the fixed statement
13176 returns from the method (fixes bug#37752).
13178 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13180 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13183 2003-02-07 Martin Baulig <martin@ximian.com>
13185 * driver.cs: Removed the `--debug-args' command line argument.
13187 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13188 automatically by the AsssemblyBuilder.
13189 (CodeGen.InitializeSymbolWriter): We don't need to call any
13190 initialization function on the symbol writer anymore. This method
13191 doesn't take any arguments.
13193 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13195 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13196 from referenced assemblies as well.
13198 2003-02-02 Martin Baulig <martin@ximian.com>
13200 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13202 2003-02-02 Martin Baulig <martin@ximian.com>
13204 * class.cs (Constructor.Emit): Open the symbol writer before
13205 emitting the constructor initializer.
13206 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13207 single-stepping through constructor initializers.
13209 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13211 * class.cs: Handle error 549: do not allow virtual methods in
13214 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13216 * decl.cs: Check access levels when resolving types
13218 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13220 * statement.cs: Add parameters and locals set in catch blocks that might
13221 return to set vector
13223 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13225 * class.cs (Operator): Set the SpecialName flags for operators.
13227 * expression.cs (Invocation.DoResolve): Only block calls to
13228 accessors and operators on SpecialName methods.
13230 (Cast.TryReduce): Handle conversions from char constants.
13233 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13235 * statement.cs: small memory and time optimization in FlowBranching.
13237 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13239 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13240 problem that the last fix but in the other sid (Set).
13242 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13243 access when there is no indexer in the hierarchy.
13245 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13247 * class.cs: Combine some if statements.
13249 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13251 * driver.cs: fixed bug #37187.
13253 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13255 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13256 any indexer, it's needed to build a list with all the indexers in the
13257 hierarchy (AllGetters), else we have problems. Fixes #35653.
13259 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13261 * class.cs (MethodData.Define): It is wrong for an interface
13262 implementation to be static in both cases: explicit and implicit.
13263 We were only handling this in one case.
13265 Improve the if situation there to not have negations.
13267 * class.cs (Field.Define): Turns out that we do not need to check
13268 the unsafe bit on field definition, only on usage. Remove the test.
13270 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13272 * driver.cs: use assembly.Location instead of Codebase (the latest
13273 patch made mcs fail when using MS assemblies).
13275 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13277 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13278 get the path to *corlib.dll.
13280 2003-01-21 Nick Drochak <ndrochak@gol.com>
13284 * typemanager.cs: Remove compiler warnings
13286 2003-01-20 Duncan Mak <duncan@ximian.com>
13288 * AssemblyInfo.cs: Bump the version number to 0.19.
13290 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13292 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13294 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13296 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13298 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13300 * cs-parser.jay: Small fix: we were not comparing the constructor
13301 name correctly. Thanks to Zoltan for the initial pointer.
13303 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13305 * cs-tokenizer.cs: Set file name when specified with #line
13307 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13309 * cs-parser.jay: Only perform the constructor checks here if we
13310 are named like the class; This will help provider a better
13311 error. The constructor path is taken when a type definition is
13312 not found, but most likely the user forgot to add the type, so
13313 report that rather than the constructor error.
13315 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13317 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13320 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13322 * cs-parser.jay: Add cleanup call.
13324 2003-01-13 Duncan Mak <duncan@ximian.com>
13326 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13327 consistent with other methods.
13329 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13331 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13333 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13335 * attribute.cs: only set GuidAttr to true when we have a
13338 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13342 * typemanager.cs: fixes to allow mcs compile corlib with the new
13343 Type.IsSubclassOf fix.
13345 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13347 * expression.cs (LocalVariableReference.DoResolve): Classify a
13348 constant as a value, not as a variable. Also, set the type for
13351 * cs-parser.jay (fixed_statement): take a type instead of a
13352 pointer_type, so we can produce a better error message later.
13354 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13357 (For.DoEmit): Make inifinite loops have a
13358 non-conditional branch back.
13360 (Fixed.DoEmit): First populate the pinned variables, then emit the
13361 statement, then clear the variables. Before I was emitting the
13362 code once for each fixed piece.
13365 2003-01-08 Martin Baulig <martin@ximian.com>
13367 * statement.cs (FlowBranching.MergeChild): A break in a
13368 SWITCH_SECTION does not leave a loop. Fixes #36155.
13370 2003-01-08 Martin Baulig <martin@ximian.com>
13372 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13373 lives in the same number space than `param_map'. Fixes #36154.
13375 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13377 * cs-parser.jay (constructor_declaration): Set the
13378 Constructor.ModFlags before probing for it. This makes the
13379 compiler report 514, 515 and 132 (the code was there, but got
13382 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13383 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13384 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13386 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13388 * enum.cs: create the enum static fields using the enum type.
13390 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13392 * class.cs: don't try to create the ParamBuilder for the return
13393 type if it's not needed (and handle it breaking for the ms runtime
13396 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13398 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13400 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13402 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13403 the command. This showed up while compiling the JANET source
13404 code, which used \r as its only newline separator.
13406 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13408 * class.cs (Method.Define): If we are an operator (because it
13409 reuses our code), then set the SpecialName and HideBySig. #36128
13411 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13413 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13414 exception, report error 120 `object reference required'.
13416 * driver.cs: Add --pause option, used during to measure the size
13417 of the process as it goes with --timestamp.
13419 * expression.cs (Invocation.DoResolve): Do not allow methods with
13420 SpecialName to be invoked.
13422 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13424 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13425 number before adding it.
13427 2002-12-21 Ravi Pratap <ravi@ximian.com>
13429 * ecore.cs (StandardImplicitConversion): When in an unsafe
13430 context, we allow conversion between void * to any other pointer
13431 type. This fixes bug #35973.
13433 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13435 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13436 is not thrown when extensionless outputs are used
13438 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13440 * rootcontext.cs: fixed compilation of corlib.
13442 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13444 * attribute.cs (Attributes.Contains): Add new method.
13446 * class.cs (MethodCore.LabelParameters): if the parameter is an
13447 `out' parameter, check that no attribute `[In]' has been passed.
13449 * enum.cs: Handle the `value__' name in an enumeration.
13451 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13453 * decl.cs: Added special case to allow overrides on "protected
13456 2002-12-18 Ravi Pratap <ravi@ximian.com>
13458 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13459 since it makes much more sense.
13461 (Attributes.ctor): Don't require a Location parameter.
13463 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13465 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13466 since we already have that information per attribute.
13468 * everywhere : make appropriate changes.
13470 * class.cs (LabelParameters): Write the code which actually
13471 applies attributes to the return type. We can't do this on the MS
13472 .NET runtime so we flag a warning in the case an exception is
13475 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13477 * const.cs: Handle implicit null conversions here too.
13479 2002-12-17 Ravi Pratap <ravi@ximian.com>
13481 * class.cs (MethodCore.LabelParameters): Remove the extra
13482 Type [] parameter since it is completely unnecessary. Instead
13483 pass in the method's attributes so that we can extract
13484 the "return" attribute.
13486 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13488 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13489 of ignoring it and letting the compile continue.
13491 * typemanager.cs (ChangeType): use an extra argument to return an
13492 error condition instead of throwing an exception.
13494 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13496 * expression.cs (Unary.TryReduce): mimic the code for the regular
13497 code path. Perform an implicit cast in the cases where we can
13498 implicitly convert to one of the integral types, and then reduce
13499 based on that constant. This fixes bug #35483.
13501 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13503 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13505 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13507 * namespace.cs: fixed bug #35489.
13509 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13511 * class.cs: Remove some dead code.
13513 * cs-parser.jay: Estimate the number of methods needed
13514 (RootContext.MethodCount);
13516 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13517 numbers instead of StringBuilders.
13519 * support.cs (PtrHashtable): Add constructor with initial size;
13520 We can now reduce reallocations of the method table.
13522 2002-12-10 Ravi Pratap <ravi@ximian.com>
13524 * attribute.cs (ApplyAttributes): Keep track of the emitted
13525 attributes on a per-target basis. This fixes bug #35413.
13527 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13529 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13530 default to the Windows 1252 encoding.
13532 (UnixParseOption): Support version, thanks to Alp for the missing
13535 * AssemblyInfo.cs: Add nice assembly information.
13537 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13540 * cs-parser.jay: Allow a trailing comma before the close bracked
13541 in the attribute_section production.
13543 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13544 address of the instance was being taken, I will take this out,
13545 because we take the address of the object immediately here.
13547 2002-12-09 Ravi Pratap <ravi@ximian.com>
13549 * typemanager.cs (AreMultipleAllowed): Take care of the most
13550 obvious case where attribute type is not in the current assembly -
13553 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13555 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13556 definitions, instead of doing that afterwards.
13558 Also we use a nice little hack, depending on the constructor, we
13559 know if we are a "composed" name or a simple name. Hence, we
13560 avoid the IndexOf test, and we avoid
13562 * codegen.cs: Add code to assist in a bug reporter to track down
13563 the source of a compiler crash.
13565 2002-12-07 Ravi Pratap <ravi@ximian.com>
13567 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13568 types have been emitted for a given element and flag an error
13569 if something which does not have AllowMultiple set is used more
13572 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13573 attribute types and their corresponding AllowMultiple properties
13575 (AreMultipleAllowed): Check the property for a given type.
13577 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13578 property in the case we have a TypeContainer.
13580 (Attributes.AddAttribute): Detect duplicates and just skip on
13581 adding them. This trivial fix catches a pretty gross error in our
13582 attribute emission - global attributes were being emitted twice!
13584 Bugzilla bug #33187 is now fixed.
13586 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13588 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13589 instead of pp_and).
13591 * expression.cs (Binary.ResolveOperator): I can only use the
13592 Concat (string, string, string) and Concat (string, string,
13593 string, string) if the child is actually a concatenation of
13596 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13598 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13599 context where we need a 2-character lookahead.
13601 * pending.cs (PendingImplementation): Rework so we can keep track
13602 of interface types all the time, and flag those which were
13603 implemented by parents as optional.
13605 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13607 * expression.cs (Binary.ResolveOperator): Use
13608 String.Concat(string,string,string) or
13609 String.Concat(string,string,string,string) when possible.
13611 * typemanager: More helper methods.
13614 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13616 * pending.cs: remove the bogus return from GetMissingInterfaces()
13617 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13619 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13621 * namespace.cs: avoid duplicated 'using xxx' being added to
13622 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13623 when we get more than one 'using' statement for the same namespace.
13624 Report a CS0105 warning for it.
13626 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13628 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13629 of calling getChar/putback, uses internal knowledge of it.
13631 (xtoken): Reorder tokenizer so most common patterns are checked
13632 first. This reduces the compilation time in another 5% (from 8.11s
13633 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13635 The parsing time is 22% of the compilation in mcs, and from that
13636 64% is spent on the tokenization process.
13638 I tried using a binary search for keywords, but this is slower
13639 than the hashtable. Another option would be to do a couple of
13642 * Not use a StringBuilder, instead use an array of chars,
13643 with a set value. Notice that this way we could catch
13644 the 645 error without having to do it *afterwards*.
13646 * We could write a hand-parser to avoid the hashtable
13647 compares altogether.
13649 The identifier consumption process takes 37% of the tokenization
13650 time. Another 15% is spent on is_number. 56% of the time spent
13651 on is_number is spent on Int64.Parse:
13653 * We could probably choose based on the string length to
13654 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13657 Another 3% is spend on wrapping `xtoken' in the `token' function.
13659 Handle 0xa0 as whitespace (#34752)
13661 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13663 * typemanager.cs (IsCLRType): New routine to tell whether a type
13664 is one of the builtin types.
13666 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13667 typecode in more places instead of doing pointer comparissions.
13668 We could leverage some knowledge about the way the typecodes are
13671 New code to cache namespaces in assemblies, it is currently not
13672 invoked, to be used soon.
13674 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13676 * expression.cs (Binary.ResolveOperator): specially handle
13677 strings, and do not perform user-defined operator overloading for
13680 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13682 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13683 internalcall as it is a pretty simple operation; Avoid whenever
13684 possible to call Char.IsLetter.
13686 (consume_identifier): Cut by half the number of
13687 hashtable calls by merging the is_keyword and GetKeyword behavior.
13689 Do not short-circuit, because if we do, we
13690 report errors (ie, #if false && true would produce an invalid
13694 2002-11-24 Martin Baulig <martin@ximian.com>
13696 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13697 check constant ranges and report a CS0221. Fixes #33186.
13699 2002-11-24 Martin Baulig <martin@ximian.com>
13701 * cs-parser.jay: Make this work for uninitialized variable
13702 declarations in the `for' initializer. Fixes #32416.
13704 2002-11-24 Martin Baulig <martin@ximian.com>
13706 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13707 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13709 2002-11-24 Martin Baulig <martin@ximian.com>
13711 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13712 argument; if true, we also check for user-defined conversions.
13713 This is only needed if both arguments are of a user-defined type.
13714 Fixes #30443, added test-175.cs.
13715 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13717 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13719 2002-11-24 Martin Baulig <martin@ximian.com>
13721 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13722 function to get the store opcode.
13723 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13724 only emit the Ldelema if the store opcode is Stobj. You must run
13725 both test-34 and test-167 to test this. Fixes #34529.
13727 2002-11-23 Martin Baulig <martin@ximian.com>
13729 * ecore.cs (Expression.MemberLookup): Added additional
13730 `qualifier_type' argument which is used when we're being called
13731 from MemberAccess.DoResolve() and null if we're called from a
13733 (Expression.MemberLookupFailed): New method to report errors; this
13734 does the CS1540 check and reports the correct error message.
13736 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13737 argument for the CS1540 check and redone the way how we're dealing
13738 with private members. See the comment in the source code for details.
13739 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13740 `closure_start_type' to `closure_qualifier_type' and check whether
13741 it's not null. It was not this filter being broken, it was just
13742 being called with the wrong arguments.
13744 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13745 and pass it the correct `qualifier_type'; this also does the error
13748 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13750 * expression.cs (Invocation.EmitParams): If the we are dealing
13751 with a non-built-in value type, load its address as well.
13753 (ArrayCreation): Use a a pretty constant instead
13754 of the hardcoded value 2. Use 6 instead of 2 for the number of
13755 static initializers.
13757 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13758 because they are not really value types, just glorified integers.
13760 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13762 * ecore.cs: Remove redundant code for enumerations, make them use
13763 the same code path as everything else, fixes the casting issue
13764 with enumerations in Windows.Forms.
13766 * attribute.cs: Do only cast to string if it is a string, the
13767 validation happens later.
13769 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13770 people upgrade their corlibs.
13772 * ecore.cs: Oops, enumerations were not following the entire code path
13774 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13776 * typemanager.cs (FilterWithClosure): Commented out the test for
13777 1540 in typemanager.cs, as it has problems when accessing
13778 protected methods from a parent class (see test-174.cs).
13780 * attribute.cs (Attribute.ValidateGuid): new method.
13781 (Attribute.Resolve): Use above.
13783 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13785 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13787 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13788 handling for enumerations, as we only needed the TypeContainer
13789 functionality to begin with (this is required for the fix below to
13790 work for enums that reference constants in a container class for
13793 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13795 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13796 a valid TypeBuilder to perform lookups on.o
13798 * class.cs (InheritableMemberSignatureCompare): Use true in the
13799 call to GetGetMethod and GetSetMethod, because we are comparing
13800 the signature, and we need to get the methods *even* if they are
13803 (PropertyBase.CheckBase): ditto.
13805 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13806 GotoCase.Resolve): Use Peel on EmpytCasts.
13808 * ecore.cs (EmptyCast): drop child, add Peel method.
13810 2002-11-17 Martin Baulig <martin@ximian.com>
13812 * ecore.cs (EmptyCast.Child): New public property.
13814 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13815 label resolved to an EmptyCast. Fixes #34162.
13816 (GotoCase.Resolve): Likewise.
13817 (Block.EmitMeta): Likewise.
13819 2002-11-17 Martin Baulig <martin@ximian.com>
13821 * expression.cs (Invocation.BetterConversion): Prefer int over
13822 uint; short over ushort; long over ulong for integer literals.
13823 Use ImplicitConversionExists instead of StandardConversionExists
13824 since we also need to check for user-defined implicit conversions.
13825 Fixes #34165. Added test-173.cs.
13827 2002-11-16 Martin Baulig <martin@ximian.com>
13829 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13830 with the `true' and `false' literals. Fixes #33151.
13832 2002-11-16 Martin Baulig <martin@ximian.com>
13834 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13835 October 22nd; don't do the cs1540 check for static members.
13837 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13838 now using our own filter here and doing the cs1540 check again.
13840 2002-11-16 Martin Baulig <martin@ximian.com>
13842 * support.cs (InternalParameters): Don't crash if we don't have
13843 any fixed parameters. Fixes #33532.
13845 2002-11-16 Martin Baulig <martin@ximian.com>
13847 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13848 when looking up static methods to make this work on Windows.
13851 2002-11-16 Martin Baulig <martin@ximian.com>
13853 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13854 a setter rather than using PropertyInfo.CanWrite.
13856 2002-11-15 Nick Drochak <ndrochak@gol.com>
13858 * class.cs: Allow acces to block member by subclasses. Fixes build
13861 2002-11-14 Martin Baulig <martin@ximian.com>
13863 * class.cs (Constructor.Emit): Added the extern/block check.
13866 2002-11-14 Martin Baulig <martin@ximian.com>
13868 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13869 iteration while looking for indexers, this is needed because the
13870 indexer may have a different name in our base classes. Fixed the
13871 error reporting (no indexers at all, not get accessor, no
13872 overloaded match). Fixes bug #33089.
13873 (IndexerAccess.DoResolveLValue): Likewise.
13875 2002-11-14 Martin Baulig <martin@ximian.com>
13877 * class.cs (PropertyBase.CheckBase): Make this work for multiple
13878 indexers. Fixes the first part of bug #33089.
13879 (MethodSignature.InheritableMemberSignatureCompare): Added support
13882 2002-11-13 Ravi Pratap <ravi@ximian.com>
13884 * attribute.cs (Attribute.Resolve): Catch the
13885 NullReferenceException and report it since it isn't supposed to
13888 2002-11-12 Miguel de Icaza <miguel@ximian.com>
13890 * expression.cs (Binary.EmitBranchable): Also handle the cases for
13891 LogicalOr and LogicalAnd that can benefit from recursively
13892 handling EmitBranchable. The code now should be nice for Paolo.
13894 2002-11-08 Miguel de Icaza <miguel@ximian.com>
13896 * typemanager.cs (LookupType): Added a negative-hit hashtable for
13897 the Type lookups, as we perform quite a number of lookups on
13898 non-Types. This can be removed once we can deterministically tell
13899 whether we have a type or a namespace in advance.
13901 But this might require special hacks from our corlib.
13905 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13906 and double which avoids a conversion from an integer to a double.
13908 * expression.cs: tiny optimization, avoid calling IsConstant,
13909 because it effectively performs the lookup twice.
13911 2002-11-06 Miguel de Icaza <miguel@ximian.com>
13913 But a bogus return here to keep the semantics of the old code
13914 until the Mono runtime is fixed.
13916 * pending.cs (GetMissingInterfaces): New method used to remove all
13917 the interfaces that are already implemented by our parent
13918 classes from the list of pending methods.
13920 * interface.cs: Add checks for calls after ResolveTypeExpr.
13922 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13924 * class.cs (Class.Emit): Report warning 67: event not used if the
13925 warning level is beyond 3.
13927 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13928 being a NullLiteral.
13930 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13933 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13934 path that might fail if a type can not be resolved.
13936 * expression.cs (Binary.Emit): Emit unsigned versions of the
13939 * driver.cs: use error 5.
13941 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13943 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13945 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13947 * cs-parser.jay (switch_section): A beautiful patch from Martin
13948 Baulig that fixed 33094.
13950 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13952 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13953 Check whether the base is abstract and report an error if so.
13955 * expression.cs (IndexerAccess.DoResolveLValue,
13956 IndexerAccess.DoResolve): ditto.
13958 (Invocation.DoResolve): ditto.
13960 (Invocation.FullMethodDesc): Improve the report string.
13962 * statement.cs (Block): Eliminate IsVariableDefined as it is
13963 basically just a wrapper for GetVariableInfo.
13965 * ecore.cs (SimpleName): Use new
13967 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13968 type, as we return the actual parameter ref/unref state on a
13971 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13973 * support.cs: Return proper flags REF/OUT fixing the previous
13976 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13977 not used to mean `ref' but `ref or out' in ParameterReference
13979 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13980 full type signature instead of calling TypeManger.CSharpName
13983 * support.cs (InternalParameters.ParameterDesc): Do not compare
13984 directly to the modflags, because REF/OUT will actually be bitsets
13987 * delegate.cs (VerifyMethod): Check also the modifiers.
13989 * cs-tokenizer.cs: Fix bug where floating point values with an
13990 exponent where a sign was missing was ignored.
13992 * driver.cs: Allow multiple assemblies to be specified in a single
13995 2002-10-28 Miguel de Icaza <miguel@ximian.com>
13997 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
13998 because identifiers after a parenthesis would end up in this kind
13999 of production, and we needed to desamiguate it for having casts
14002 (UserDefinedType *) xxx
14004 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14006 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14007 we should set on the Bindingflags.NonPublic, but not turn on
14008 private_ok. private_ok controls whether a Private member is
14009 returned (this is chekced on the filter routine), while the
14010 BindingFlags.NonPublic just controls whether private/protected
14011 will be allowed. This fixes the problem part of the problem of
14012 private properties being allowed to be used in derived classes.
14014 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14015 so we can call the children DoResolveLValue method (this will
14016 properly signal errors on lvalue assignments to base properties)
14018 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14019 getter are null, and we have a property info, we know that this
14020 happened because the lookup failed, so we report an error 122 for
14021 protection level violation.
14023 We also silently return if setter and getter are null in the
14024 resolve functions, this condition only happens if we have flagged
14025 the error before. This is the other half of the problem.
14027 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14028 not have accessibility information, that is why we were returning
14029 true in the filter function in typemanager.cs.
14031 To properly report 122 (property is inaccessible because of its
14032 protection level) correctly, we report this error in ResolveAccess
14033 by failing if both the setter and the getter are lacking (ie, the
14036 DoResolve and DoLResolve have been modified to check for both
14037 setter/getter being null and returning silently, the reason being
14038 that I did not want to put the knowledge about this error in upper
14041 int old = Report.Errors;
14042 x = new PropertyExpr (...);
14043 if (old != Report.Errors)
14048 So the property expr is returned, but it is invalid, so the error
14049 will be flagged during the resolve process.
14051 * class.cs: Remove InheritablePropertySignatureCompare from the
14052 class, as we no longer depend on the property signature to compute
14053 whether it is possible to implement a method or not.
14055 The reason is that calling PropertyInfo.GetGetMethod will return
14056 null (in .NET, in Mono it works, and we should change this), in
14057 cases where the Get Method does not exist in that particular
14062 class X { public virtual int A { get { return 1; } } }
14064 class Z : Y { public override int A { get { return 2; } } }
14066 Would fail in Z because the parent (Y) would not have the property
14067 defined. So we avoid this completely now (because the alternative
14068 fix was ugly and slow), and we now depend exclusively on the
14071 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14072 reference method, instead of using the property.
14074 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14075 routines are gone now.
14077 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14078 names, they were incorrectly named.
14080 * cs-tokenizer.cs: Return are more gentle token on failure.
14082 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14083 had an out-of-sync index variable, which caused it to remove from
14084 the list of pending methods the wrong method sometimes.
14086 2002-10-22 Miguel de Icaza <miguel@ximian.com>
14088 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14089 CanWrite, because those refer to this particular instance of the
14090 property, and do not take into account the fact that we can
14091 override single members of a property.
14093 Constructor requires an EmitContext. The resolution process does
14094 not happen here, but we need to compute the accessors before,
14095 because the resolution does not always happen for properties.
14097 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14098 subclass, before we did not update this flag, but we did update
14101 (GetAccessors): Drop this routine, as it did not work in the
14102 presence of partially overwritten set/get methods.
14104 Notice that this broke the cs1540 detection, but that will require
14107 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14111 * driver.cs: issue a warning instead of an error if we don't support
14112 debugging for the platform. Also ignore a couple of errors that may
14113 arise when trying to write the symbols. Undo my previous patch.
14115 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14117 * driver.cs: ignore /debug switch except for Unix platforms.
14119 2002-10-23 Nick Drochak <ndrochak@gol.com>
14121 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14123 2002-10-21 Miguel de Icaza <miguel@ximian.com>
14125 * driver.cs: Do not make mcs-debug conditional, so we do not break
14126 builds that use it.
14128 * statement.cs (UsageVector.MergeChildren): I would like Martin to
14129 review this patch. But basically after all the children variables
14130 have been merged, the value of "Breaks" was not being set to
14131 new_breaks for Switch blocks. I think that it should be set after
14132 it has executed. Currently I set this to the value of new_breaks,
14133 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14134 conservative, but I do not understand this code very well.
14136 I did not break anything in the build, so that is good ;-)
14138 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14140 2002-10-20 Mark Crichton <crichton@gimp.org>
14142 * cfold.cs: Fixed compile blocker. Really fixed it this time.
14144 2002-10-20 Nick Drochak <ndrochak@gol.com>
14146 * cfold.cs: Fixed compile blocker.
14148 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14150 * driver.cs: I was chekcing the key, not the file.
14152 2002-10-19 Ravi Pratap <ravi@ximian.com>
14154 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14155 message that we were generating - we just need to silently return
14158 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14160 * class.cs (Event.Define): Change my previous commit, as this
14161 breaks the debugger. This is a temporary hack, as it seems like
14162 the compiler is generating events incorrectly to begin with.
14164 * expression.cs (Binary.ResolveOperator): Added support for
14165 "U operator - (E x, E y)"
14167 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14170 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14171 init-only variables, but this path did not take into account that
14172 there might be also instance readonly variables. Correct this
14175 This fixes bug 32253
14177 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14180 * driver.cs: Change the extension for modules to `netmodule'
14182 * cs-parser.jay: Improved slightly the location tracking for
14183 the debugger symbols.
14185 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14186 modifiers that were specified instead of the hardcoded value
14187 (FamAndAssem). This was basically ignoring the static modifier,
14188 and others. Fixes 32429.
14190 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14191 fixed a bug in the process (32476)
14193 * expression.cs (ArrayAccess.EmitAssign): Patch from
14194 hwang_rob@yahoo.ca that fixes bug 31834.3
14196 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14198 * driver.cs: Make the module extension .netmodule.
14200 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14202 * driver.cs: Report an error if the resource file is not found
14203 instead of crashing.
14205 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14206 false, like Emit does.
14208 2002-10-16 Nick Drochak <ndrochak@gol.com>
14210 * typemanager.cs: Remove unused private member. Also reported mcs
14211 bug to report this as a warning like csc.
14213 2002-10-15 Martin Baulig <martin@gnome.org>
14215 * statement.cs (Statement.Emit): Made this a virtual method; emits
14216 the line number info and calls DoEmit().
14217 (Statement.DoEmit): New protected abstract method, formerly knows
14218 as Statement.Emit().
14220 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14222 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14224 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14225 have fixed a remaining problem: not every AddXXXX was adding a
14226 fully qualified name.
14228 Now everyone registers a fully qualified name in the DeclSpace as
14229 being defined instead of the partial name.
14231 Downsides: we are slower than we need to be due to the excess
14232 copies and the names being registered this way.
14234 The reason for this is that we currently depend (on the corlib
14235 bootstrap for instance) that types are fully qualified, because
14236 we dump all the types in the namespace, and we should really have
14237 types inserted into the proper namespace, so we can only store the
14238 basenames in the defined_names array.
14240 2002-10-10 Martin Baulig <martin@gnome.org>
14242 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14243 from bug #31834, see the bug report for a testcase which is
14246 2002-10-10 Martin Baulig <martin@gnome.org>
14248 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14249 flow analysis code for this.
14251 * statement.cs (Do, While, For): Tell the flow analysis code about
14253 (FlowBranching.UsageVector): Added support for infinite loops.
14254 (Block.Resolve): Moved the dead code elimination here and use flow
14257 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14259 * class.cs (Field.Define): Catch cycles on struct type
14262 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14263 fields if the fields are static. We only need to check instance
14266 * expression.cs (As.DoResolve): Test for reference type.
14268 * statement.cs (Using.ResolveExpression): Use
14269 ConvertImplicitRequired, not ConvertImplicit which reports an
14271 (Using.ResolveLocalVariableDecls): ditto.
14273 * expression.cs (Binary.ResolveOperator): Report errors in a few
14274 places where we had to.
14276 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14278 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14280 * expression.cs: Use StoreFromPtr instead of extracting the type
14281 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14283 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14284 an enumeration value to a System.Enum, but System.Enum is not a
14285 value type, but an class type, so we need to box.
14287 (Expression.ConvertExplicit): One codepath could return
14288 errors but not flag them. Fix this. Fixes #31853
14290 * parameter.cs (Resolve): Do not allow void as a parameter type.
14292 2002-10-06 Martin Baulig <martin@gnome.org>
14294 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14295 if it's a class type and not a struct. Fixes #31815.
14297 2002-10-06 Martin Baulig <martin@gnome.org>
14299 * statement.cs: Reworked the flow analysis code a bit to make it
14300 usable for dead code elimination.
14302 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14304 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14306 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14308 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14309 to fix the test 165, will investigate deeper.
14311 2002-10-04 Martin Baulig <martin@gnome.org>
14313 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14314 finally blocks actually work.
14315 (Try.Resolve): We don't need to create a sibling for `finally' if
14316 there is no finally block.
14318 2002-10-04 Martin Baulig <martin@gnome.org>
14320 * class.cs (Constructor.Define): The default accessibility for a
14321 non-default constructor is private, not public.
14323 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14325 * class.cs (Constructor): Make AllowedModifiers public, add
14328 * cs-parser.jay: Perform the modifiers test here, as the
14329 constructor for the Constructor class usually receives a zero
14330 because of the way we create it (first we create, later we
14331 customize, and we were never checking the modifiers).
14333 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14334 is a version of LookupTypeReflection that includes the type-name
14335 cache. This can be used as a fast path for functions that know
14336 the fully qualified name and are only calling into *.GetType() to
14337 obtain a composed type.
14339 This is also used by TypeManager.LookupType during its type
14342 (LookupType): We now also track the real type name, as sometimes
14343 we can get a quey for the real type name from things like
14344 ComposedCast. This fixes bug 31422.
14346 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14347 complete type fullname, it does not have to go through the type
14348 resolution system to obtain the composed version of the type (for
14349 obtaining arrays or pointers).
14351 (Conditional.Emit): Use the EmitBoolExpression to
14352 generate nicer code, as requested by Paolo.
14354 (ArrayCreation.CheckIndices): Use the patch from
14355 hwang_rob@yahoo.ca to validate the array initializers.
14357 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14359 * class.cs (ConstructorInitializer.Emit): simplify code by using
14360 Invocation.EmitCall, and at the same time, fix the bugs in calling
14361 parent constructors that took variable arguments.
14363 * ecore.cs (Expression.ConvertNumericExplicit,
14364 Expression.ImplicitNumericConversion): Remove the code that
14365 manually wrapped decimal (InternalTypeConstructor call is now gone
14368 * expression.cs (Cast.TryReduce): Also handle decimal types when
14369 trying to perform a constant fold on the type.
14371 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14373 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14374 that only turned off an error report, and did nothing else.
14376 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14378 * driver.cs: Handle and ignore /fullpaths
14380 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14382 * expression.cs (Binary.ResolveOperator): Catch the case where
14383 DoNumericPromotions returns true,
14385 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14387 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14389 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14392 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14394 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14395 conversion exists, but it is also required that the conversion be
14396 performed. This manifested in "(Type64Enum) 2".
14398 * class.cs (TypeManager.AddMethod): The fix is not to change
14399 AddEnum, because that one was using a fully qualified name (every
14400 DeclSpace derivative does), but to change the AddMethod routine
14401 that was using an un-namespaced name. This now correctly reports
14402 the duplicated name.
14404 Revert patch until I can properly fix it. The issue
14405 is that we have a shared Type space across all namespaces
14406 currently, which is wrong.
14408 Options include making the Namespace a DeclSpace, and merge
14409 current_namespace/current_container in the parser.
14411 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14413 * cs-parser.jay: Improve error reporting when we get a different
14414 kind of expression in local_variable_type and
14415 local_variable_pointer_type.
14417 Propagate this to avoid missleading errors being reported.
14419 * ecore.cs (ImplicitReferenceConversion): treat
14420 TypeManager.value_type as a target just like object_type. As
14425 Is valid, and needs to result in the int 1 being boxed before it
14426 is assigned to the value type v.
14428 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14429 to validate the enumeration name.
14431 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14432 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14433 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14435 * ecore.cs (TryImplicitIntConversion): When doing an
14436 implicit-enumeration-conversion, check if the type is 64-bits and
14437 perform a conversion before passing to EnumConstant.
14439 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14441 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14442 report ambiguous type references. Unlike the MS version, we
14443 report what the ambiguity is. Innovation at work ;-)
14445 (DeclSpace.FindType): Require a location argument to
14446 display when we display an ambiguous error.
14448 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14450 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14452 * expression.cs (EmitDynamicInitializers): Apply patch from
14453 hwang_rob@yahoo.ca that fixes the order in which we emit our
14456 2002-09-21 Martin Baulig <martin@gnome.org>
14458 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14459 delegate takes no arguments.
14461 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14463 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14466 * expression.cs: Extract the underlying type.
14468 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14470 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14472 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14474 * class.cs (TypeContainer.DefineType): We can not use the nice
14475 PackingSize with the size set to 1 DefineType method, because it
14476 will not allow us to define the interfaces that the struct
14479 This completes the fixing of bug 27287
14481 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14482 means also structs. This fixes part of the problem.
14483 (Expresion.ImplicitReferenceConversionExists): ditto.
14485 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14486 error if there were no errors reported during the type lookup
14487 process, to avoid duplicates or redundant errors. Without this
14488 you would get an ambiguous errors plus a type not found. We have
14489 beaten the user enough with the first error.
14491 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14494 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14495 during the resolution process, stop the lookup, this avoids
14496 repeated error reports (same error twice).
14498 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14500 * typemanager.cs (LookupType): Redo the type lookup code to match
14501 the needs of System.Reflection.
14503 The issue is that System.Reflection requires references to nested
14504 types to begin with a "+" sign instead of a dot. So toplevel
14505 types look like: "NameSpace.TopLevelClass", and nested ones look
14506 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14509 2002-09-19 Martin Baulig <martin@gnome.org>
14511 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14512 says that a method always returns or always throws an exception,
14513 don't report the CS0161.
14515 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14516 set `Returns = new_returns'.
14518 2002-09-19 Martin Baulig <martin@gnome.org>
14520 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14521 to an enum constant, check for a CS0176.
14523 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14525 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14526 for operators that must be in pairs and report errors.
14528 * ecore.cs (SimpleName.DoResolveType): During the initial type
14529 resolution process, when we define types recursively, we must
14530 check first for types in our current scope before we perform
14531 lookups in the enclosing scopes.
14533 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14535 (Invocation.VerifyArgumentsCompat): Call
14536 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14537 I thought we were supposed to always call this, but there are a
14538 few places in the code where we dont do it.
14540 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14542 * driver.cs: Add support in -linkres and -resource to specify the
14543 name of the identifier.
14545 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14547 * ecore.cs (StandardConversionExists): Sync with the conversion
14548 code: allow anything-* to void* conversions.
14550 (FindMostSpecificSource): Use an Expression argument
14551 instead of a Type, because we might be handed over a Literal which
14552 gets a few more implicit conversions that plain types do not. So
14553 this information was being lost.
14555 Also, we drop the temporary type-holder expression when not
14558 2002-09-17 Martin Baulig <martin@gnome.org>
14560 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14561 this is an explicit interface implementation.
14563 2002-09-17 Martin Baulig <martin@gnome.org>
14565 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14566 different `IndexerName' attributes.
14568 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14569 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14570 virtual CommonResolve().
14572 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14574 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14575 and convert that to the UnderlyingType.
14577 * statement.cs (Foreach.Resolve): Indexers are just like variables
14578 or PropertyAccesses.
14580 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14581 inside quoted strings, we were not doing this before.
14583 2002-09-16 Martin Baulig <martin@gnome.org>
14585 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14586 resolve it. This is needed for the definite assignment check of the
14587 instance expression, fixes bug #29846.
14588 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14590 2002-09-16 Nick Drochak <ndrochak@gol.com>
14592 * parameter.cs: Fix compile error. Cannot reference static member
14593 from an instance object. Is this an mcs bug?
14595 2002-09-14 Martin Baulig <martin@gnome.org>
14597 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14598 multiple times. Fixes bug #30295, added test-166.cs.
14600 2002-09-14 Martin Baulig <martin@gnome.org>
14602 * statement.cs (Block.Emit): Don't emit unreachable code.
14603 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14604 `break' statements.
14605 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14607 2002-09-14 Martin Baulig <martin@gnome.org>
14609 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14612 2002-09-14 Martin Baulig <martin@gnome.org>
14614 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14615 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14616 be false on the ms runtime.
14618 2002-09-13 Martin Baulig <martin@gnome.org>
14620 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14621 the CS0038 error message.
14623 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14625 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14626 constant inside, return it.
14628 2002-09-12 Martin Baulig <martin@gnome.org>
14630 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14631 implicit conversion can be done between enum types.
14633 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14634 check whether an implicit conversion to the current enum's UnderlyingType
14635 exists and report an error if not.
14637 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14638 without debugging support.
14640 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14641 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14643 2002-09-12 Martin Baulig <martin@gnome.org>
14645 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14647 * ecore.cs (IMemberExpr.DeclaringType): New property.
14648 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14649 nonstatic member of an outer type (CS0038).
14651 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14653 * driver.cs: Activate the using-error detector at warning level
14654 4 (at least for MS-compatible APIs).
14656 * namespace.cs (VerifyUsing): Small buglett fix.
14658 * pending.cs (PendingImplementation): pass the container pointer.
14660 * interface.cs (GetMethods): Allow for recursive definition. Long
14661 term, I would like to move every type to support recursive
14662 definitions, not the current ordering mechanism that we have right
14665 The situation is this: Attributes are handled before interfaces,
14666 so we can apply attributes to interfaces. But some attributes
14667 implement interfaces, we will now handle the simple cases
14668 (recursive definitions will just get an error).
14670 * parameter.cs: Only invalidate types at the end if we fail to
14673 2002-09-09 Martin Baulig <martin@gnome.org>
14675 * ecore.cs (PropertyExpr.Emit): Also check for
14676 TypeManager.system_int_array_get_length so this'll also work when
14677 compiling corlib. Fixes #30003.
14679 2002-09-09 Martin Baulig <martin@gnome.org>
14681 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14682 and throw an exception if we can't get the type's size. Fixed #30040,
14685 2002-09-09 Martin Baulig <martin@gnome.org>
14687 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14689 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14690 context. Fixes bug #30027.
14692 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14693 virtual functions. Fixes bug #30043, added test-164.cs.
14695 2002-09-08 Ravi Pratap <ravi@ximian.com>
14697 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14699 2002-09-08 Nick Drochak <ndrochak@gol.com>
14701 * driver.cs: Use an object to get the windows codepage since it's not a
14704 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14706 * statement.cs (For.Emit): for infinite loops (test == null)
14707 return whether there is a break inside, not always "true".
14709 * namespace.cs (UsingEntry): New struct to hold the name of the
14710 using definition, the location where it is defined, and whether it
14711 has been used in a successful type lookup.
14713 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14718 2002-09-06 Ravi Pratap <ravi@ximian.com>
14720 * attribute.cs : Fix incorrect code which relied on catching
14721 a NullReferenceException to detect a null being passed in
14722 where an object was expected.
14724 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14726 * statement.cs (Try): flag the catch variable as assigned
14728 * expression.cs (Cast): Simplified by using ResolveType instead of
14729 manually resolving.
14731 * statement.cs (Catch): Fix bug by using ResolveType.
14733 2002-09-06 Ravi Pratap <ravi@ximian.com>
14735 * expression.cs (BetterConversion): Special case for when we have
14736 a NullLiteral as the argument and we have to choose between string
14737 and object types - we choose string the way csc does.
14739 * attribute.cs (Attribute.Resolve): Catch the
14740 NullReferenceException and report error #182 since the Mono
14741 runtime no more has the bug and having this exception raised means
14742 we tried to select a constructor which takes an object and is
14745 2002-09-05 Ravi Pratap <ravi@ximian.com>
14747 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14748 message (1502, 1503) when we can't locate a method after overload
14749 resolution. This is much more informative and closes the bug
14752 * interface.cs (PopulateMethod): Return if there are no argument
14753 types. Fixes a NullReferenceException bug.
14755 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14756 expressions too. Previously we were checking only in one place for
14757 positional arguments leaving out named arguments.
14759 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14760 type to the enum type is not allowed. Remove code corresponding to
14763 (ConvertNumericExplicit): Allow explicit conversions from
14764 the underlying type to enum type. This precisely follows the spec
14765 and closes a bug filed by Gonzalo.
14767 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14770 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14772 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14774 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14775 it was important that we stored the right value after the
14776 reduction in `converted'.
14778 2002-09-04 Martin Baulig <martin@gnome.org>
14780 * location.cs (Location.SymbolDocument): Use full pathnames for the
14783 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14785 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14786 of the expression resolve mechanism, because that will catch the
14787 SimpleName error failures.
14789 (Conditional): If we can not resolve the
14790 expression, return, do not crash.
14792 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14795 (location): display token name instead of its number.
14797 2002-08-28 Martin Baulig <martin@gnome.org>
14799 * expression.cs (Binary.ResolveOperator): Don't silently return
14800 but return an error if an operator cannot be applied between two
14803 2002-08-28 Martin Baulig <martin@gnome.org>
14805 * class.cs (Constructor.Define): Set the permission attributes
14806 correctly instead of making all constructors public.
14808 2002-08-28 Martin Baulig <martin@gnome.org>
14810 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14811 for private members before reporting a CS0103; if we find anything,
14814 2002-08-28 Martin Baulig <martin@gnome.org>
14816 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14817 to check whether `closure_start_type == closure_invocation_type',
14818 we also need to check whether `m.DeclaringType == closure_invocation_type'
14819 before bypassing the permission checks. We might be accessing
14820 protected/private members from the base class.
14821 (TypeManager.RealMemberLookup): Only set private_ok if private
14822 members were requested via BindingFlags.NonPublic.
14824 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14826 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14827 MethodGroupExpr.IsExplicitImpl if appropriate.
14828 (Invocation.DoResolve): Don't report the CS0120 for explicit
14829 interface implementations.
14831 2002-08-27 Martin Baulig <martin@gnome.org>
14833 * expression.cs (Invocation.DoResolve): If this is a static
14834 method and we don't have an InstanceExpression, we must report
14837 2002-08-25 Martin Baulig <martin@gnome.org>
14839 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14840 `==' between a valuetype and an object.
14842 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14844 * ecore.cs (TypeExpr): Provide a ToString method.
14846 2002-08-24 Martin Baulig <martin@gnome.org>
14848 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14849 now called proggie.dbg and it's a binary file.
14851 2002-08-23 Martin Baulig <martin@gnome.org>
14853 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14855 2002-08-23 Martin Baulig <martin@gnome.org>
14857 * struct.cs (MyStructInfo.ctor): Make this work with empty
14858 structs; it's not allowed to use foreach() on null.
14860 2002-08-23 Martin Baulig <martin@gnome.org>
14862 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14863 writer the full pathname of the generated assembly.
14865 2002-08-23 Martin Baulig <martin@gnome.org>
14867 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14868 A `finally' block never returns or breaks; improved handling of
14871 2002-08-23 Martin Baulig <martin@gnome.org>
14873 * statement.cs (Throw.Resolve): Allow `throw null'.
14875 2002-08-23 Martin Baulig <martin@gnome.org>
14877 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14878 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14879 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
14880 MemberLookup would return a wrong event if this is an explicit
14881 interface implementation and the class has an event with the same
14884 2002-08-23 Martin Baulig <martin@gnome.org>
14886 * statement.cs (Block.AddChildVariableNames): New public method.
14887 (Block.AddChildVariableName): Likewise.
14888 (Block.IsVariableNameUsedInChildBlock): Likewise.
14889 (Block.AddVariable): Check whether a variable name has already
14890 been used in a child block.
14892 * cs-parser.jay (declare_local_variables): Mark all variable names
14893 from the current block as being used in a child block in the
14896 2002-08-23 Martin Baulig <martin@gnome.org>
14898 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14899 find the symbol writer.
14901 * driver.cs: csc also allows the arguments to /define being
14902 separated by commas, not only by semicolons.
14904 2002-08-23 Martin Baulig <martin@gnome.org>
14906 * interface.cs (Interface.GetMembers): Added static check for events.
14908 2002-08-15 Martin Baulig <martin@gnome.org>
14910 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14911 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14913 * ecore.cs (Expression.MemberLookup): Added documentation and explained
14914 why the MethodData.EmitDestructor() change was necessary.
14916 2002-08-20 Martin Baulig <martin@gnome.org>
14918 * class.cs (TypeContainer.FindMembers): Added static check for events.
14920 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14922 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14923 use Type.GetEvents(), not Type.FindMembers().
14925 2002-08-20 Martin Baulig <martin@gnome.org>
14927 * decl.cs (MemberCache): Added a special method cache which will
14928 be used for method-only searched. This ensures that a method
14929 search will return a MethodInfo with the correct ReflectedType for
14932 2002-08-20 Martin Baulig <martin@gnome.org>
14934 * decl.cs (DeclSpace.FindMembers): Made this public.
14936 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14938 * delegate.cs: fixed build on windows.
14939 [FIXME: Filed as bug #29150: MCS must report these errors.]
14941 2002-08-19 Ravi Pratap <ravi@ximian.com>
14943 * ecore.cs (StandardConversionExists): Return a false
14944 if we are trying to convert the void type to anything else
14945 since that is not allowed.
14947 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14948 we flag error 70 in the event an event is trying to be accessed
14949 directly from outside the declaring type.
14951 2002-08-20 Martin Baulig <martin@gnome.org>
14953 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14954 MemberCache from typemanager.cs to decl.cs.
14956 2002-08-19 Martin Baulig <martin@gnome.org>
14958 * class.cs (TypeContainer): Implement IMemberContainer.
14959 (TypeContainer.DefineMembers): Create the MemberCache.
14960 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14961 return public members if BindingFlags.Public was given, check
14962 whether members are static.
14964 2002-08-16 Martin Baulig <martin@gnome.org>
14966 * decl.cs (DeclSpace.Define): Splitted this in Define and
14967 DefineMembers. DefineMembers is called first and initializes the
14970 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14971 DefineMembers() on all our DeclSpaces.
14973 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14974 but call DefineMembers() on all nested interfaces. We call their
14975 Define() in our new Define() function.
14977 * interface.cs (Interface): Implement IMemberContainer.
14978 (Interface.Define): Moved all code except the attribute stuf to
14980 (Interface.DefineMembers): Initialize the member cache.
14982 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14983 need this anymore since we can use MemberCache.FindMembers directly.
14985 2002-08-19 Martin Baulig <martin@gnome.org>
14987 * typemanager.cs (MemberCache): When creating the cache for an
14988 interface type, add all inherited members.
14989 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14990 to `out bool used_cache' and documented it.
14991 (TypeManager.MemberLookup): If we already used the cache in the first
14992 iteration, we don't need to do the interfaces check.
14994 2002-08-19 Martin Baulig <martin@gnome.org>
14996 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
14997 here from IMemberFinder and don't implement this interface anymore.
14998 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15000 * typemanager.cs (IMemberFinder): This interface is now only used by
15001 classes which actually support the member cache.
15002 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15003 since we only put DeclSpaces into this Hashtable.
15004 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15005 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15007 2002-08-16 Martin Baulig <martin@gnome.org>
15009 * typemanager.cs (ICachingMemberFinder): Removed.
15010 (IMemberFinder.MemberCache): New property.
15011 (TypeManager.FindMembers): Merged this with RealFindMembers().
15012 This function will never be called from TypeManager.MemberLookup()
15013 so we can't use the cache here, just the IMemberFinder.
15014 (TypeManager.MemberLookup_FindMembers): Check whether the
15015 IMemberFinder has a MemberCache and call the cache's FindMembers
15017 (MemberCache): Rewrote larger parts of this yet another time and
15018 cleaned it up a bit.
15020 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15022 * driver.cs (LoadArgs): Support quoting.
15024 (Usage): Show the CSC-like command line arguments.
15026 Improved a few error messages.
15028 2002-08-15 Martin Baulig <martin@gnome.org>
15030 * typemanager.cs (IMemberContainer.Type): New property.
15031 (IMemberContainer.IsInterface): New property.
15033 The following changes are conditional to BROKEN_RUNTIME, which is
15034 defined at the top of the file.
15036 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15037 class'es members, but add all members from TypeHandle.ObjectType
15038 if we're an interface.
15039 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15040 is the current type.
15041 (MemberCache.CacheEntry.Container): Removed this field.
15042 (TypeHandle.GetMembers): Include inherited members.
15044 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15046 * typemanager.cs: fixed compilation and added a comment on a field that
15049 2002-08-15 Martin Baulig <martin@gnome.org>
15051 * class.cs (ConstructorInitializer.Resolve): In the
15052 Expression.MemberLookup call, use the queried_type as
15055 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15056 declared' attribute, it's always true.
15057 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15058 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15059 temporary wrapper for FindMembers which tells MemberLookup whether
15060 members from the base classes are included in the return value.
15061 This will go away soon.
15062 (TypeManager.MemberLookup): Use this temporary hack here; once the
15063 new MemberCache is completed, we don't need to do the DeclaredOnly
15064 looping here anymore since the MemberCache will take care of this.
15065 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15066 (MemberCache): When creating the MemberCache for a class, get
15067 members from the current class and all its base classes.
15068 (MemberCache.CacheEntry.Container): New field. This is a
15069 temporary hack until the Mono runtime is fixed to distinguish
15070 between ReflectedType and DeclaringType. It allows us to use MCS
15071 with both the MS runtime and the unfixed Mono runtime without
15072 problems and without accecting performance.
15073 (MemberCache.SearchMembers): The DeclaredOnly looping from
15074 TypeManager.MemberLookup is now done here.
15076 2002-08-14 Martin Baulig <martin@gnome.org>
15078 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15079 Type.GetFields on dynamic types but get the fields from the
15080 corresponding TypeContainer.
15081 (MyStructInfo.GetStructInfo): Added check for enum types.
15083 * typemanager.cs (MemberList.IsSynchronized): Implemented.
15084 (MemberList.SyncRoot): Implemented.
15085 (TypeManager.FilterWithClosure): No need to check permissions if
15086 closure_start_type == closure_invocation_type, don't crash if
15087 closure_invocation_type is null.
15089 2002-08-13 Martin Baulig <martin@gnome.org>
15091 Rewrote TypeContainer.FindMembers to use a member cache. This
15092 gives us a speed increase of about 35% for the self-hosting MCS
15093 build and of about 15-20% for the class libs (both on GNU/Linux).
15095 * report.cs (Timer): New class to get enhanced profiling. This
15096 whole class is "TIMER" conditional since it remarkably slows down
15099 * class.cs (MemberList): New class. This is an IList wrapper
15100 which we're now using instead of passing MemberInfo[]'s around to
15101 avoid copying this array unnecessarily.
15102 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15103 (ICachingMemberFinder, IMemberContainer): New interface.
15104 (TypeManager.FilterWithClosure): If `criteria' is null, the name
15105 has already been checked, otherwise use it for the name comparision.
15106 (TypeManager.FindMembers): Renamed to RealMemberFinder and
15107 provided wrapper which tries to use ICachingMemberFinder.FindMembers
15108 if possible. Returns a MemberList, not a MemberInfo [].
15109 (TypeHandle): New class, implements IMemberContainer. We create
15110 one instance of this class per type, it contains a MemberCache
15111 which is used to do the member lookups.
15112 (MemberCache): New class. Each instance of this class contains
15113 all members of a type and a name-based hash table.
15114 (MemberCache.FindMembers): This is our new member lookup
15115 function. First, it looks up all members of the requested name in
15116 the hash table. Then, it walks this list and sorts out all
15117 applicable members and returns them.
15119 2002-08-13 Martin Baulig <martin@gnome.org>
15121 In addition to a nice code cleanup, this gives us a performance
15122 increase of about 1.4% on GNU/Linux - not much, but it's already
15123 half a second for the self-hosting MCS compilation.
15125 * typemanager.cs (IMemberFinder): New interface. It is used by
15126 TypeManager.FindMembers to call FindMembers on a TypeContainer,
15127 Enum, Delegate or Interface.
15128 (TypeManager.finder_to_member_finder): New PtrHashtable.
15129 (TypeManager.finder_to_container): Removed.
15130 (TypeManager.finder_to_delegate): Removed.
15131 (TypeManager.finder_to_interface): Removed.
15132 (TypeManager.finder_to_enum): Removed.
15134 * interface.cs (Interface): Implement IMemberFinder.
15136 * delegate.cs (Delegate): Implement IMemberFinder.
15138 * enum.cs (Enum): Implement IMemberFinder.
15140 * class.cs (TypeContainer): Implement IMemberFinder.
15142 2002-08-12 Martin Baulig <martin@gnome.org>
15144 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15146 2002-08-12 Martin Baulig <martin@gnome.org>
15148 * ecore.cs (ITypeExpression): New interface for expressions which
15150 (TypeExpression): Renamed to TypeLookupExpression.
15151 (Expression.DoResolve): If we're doing a types-only lookup, the
15152 expression must implement the ITypeExpression interface and we
15153 call DoResolveType() on it.
15154 (SimpleName): Implement the new ITypeExpression interface.
15155 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15156 hack, the situation that we're only looking up types can't happen
15157 anymore when this method is called. Moved the type lookup code to
15158 DoResolveType() and call it.
15159 (SimpleName.DoResolveType): This ITypeExpression interface method
15160 is now doing the types-only lookup.
15161 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15162 (ResolveFlags): Added MaskExprClass.
15164 * expression.cs (MemberAccess): Implement the ITypeExpression
15166 (MemberAccess.DoResolve): Added support for a types-only lookup
15167 when we're called via ITypeExpression.DoResolveType().
15168 (ComposedCast): Implement the ITypeExpression interface.
15170 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15171 Expression.Resolve() with ResolveFlags.Type instead.
15173 2002-08-12 Martin Baulig <martin@gnome.org>
15175 * interface.cs (Interface.Define): Apply attributes.
15177 * attribute.cs (Attribute.ApplyAttributes): Added support for
15178 interface attributes.
15180 2002-08-11 Martin Baulig <martin@gnome.org>
15182 * statement.cs (Block.Emit): Only check the "this" variable if we
15183 do not always throw an exception.
15185 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15186 whether the property has a set accessor.
15188 2002-08-11 Martin Baulig <martin@gnome.org>
15190 Added control flow analysis support for structs.
15192 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15193 with control flow analysis turned off.
15194 (IVariable): New interface.
15195 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15196 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15197 (FieldExpr.DoResolve): Resolve the instance expression with flow
15198 analysis turned off and do the definite assignment check after the
15199 resolving when we know what the expression will resolve to.
15201 * expression.cs (LocalVariableReference, ParameterReference):
15202 Implement the new IVariable interface, only call the flow analysis
15203 code if ec.DoFlowAnalysis is true.
15204 (This): Added constructor which takes a Block argument. Implement
15205 the new IVariable interface.
15206 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15207 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15208 This does the definite assignment checks for struct members.
15210 * class.cs (Constructor.Emit): If this is a non-static `struct'
15211 constructor which doesn't have any initializer, call
15212 Block.AddThisVariable() to tell the flow analysis code that all
15213 struct elements must be initialized before control returns from
15216 * statement.cs (MyStructInfo): New public class.
15217 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15218 argument to this indexer. If non-zero, check an individual struct
15219 member, not the whole struct.
15220 (FlowBranching.CheckOutParameters): Check struct members.
15221 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15222 overloaded versions of these methods which take an additional
15223 `int field_idx' argument to check struct members.
15224 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15225 overloaded versions of these methods which take an additional
15226 `string field_name' argument to check struct member.s
15227 (VariableInfo): Implement the IVariable interface.
15228 (VariableInfo.StructInfo): New public property. Returns the
15229 MyStructInfo instance of the variable if it's a struct or null.
15230 (Block.AddThisVariable): New public method. This is called from
15231 Constructor.Emit() for non-static `struct' constructor which do
15232 not have any initializer. It creates a special variable for the
15233 "this" instance variable which will be checked by the flow
15234 analysis code to ensure that all of the struct's fields are
15235 initialized before control returns from the constructor.
15236 (UsageVector): Added support for struct members. If a
15237 variable/parameter is a struct with N members, we reserve a slot
15238 in the usage vector for each member. A struct is considered fully
15239 initialized if either the struct itself (slot 0) or all its
15240 members are initialized.
15242 2002-08-08 Martin Baulig <martin@gnome.org>
15244 * driver.cs (Driver.MainDriver): Only report an error CS5001
15245 if there were no compilation errors.
15247 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15248 `UnsafeContext' property to determine whether the parent is in
15249 unsafe context rather than checking the parent's ModFlags:
15250 classes nested in an unsafe class are unsafe as well.
15252 2002-08-08 Martin Baulig <martin@gnome.org>
15254 * statement.cs (UsageVector.MergeChildren): Distinguish between
15255 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15256 we return. Added test17() and test18() to test-154.cs.
15258 2002-08-08 Martin Baulig <martin@gnome.org>
15260 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15261 Family access, make sure the invoking type isn't a subclass of the
15262 queried type (that'd be a CS1540).
15264 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15265 this method which takes an additional `Type invocation_type'.
15267 * expression.cs (BaseAccess.DoResolve): Use the base type as
15268 invocation and query type.
15269 (MemberAccess.DoResolve): If the lookup failed and we're about to
15270 report a CS0122, try a lookup with the ec.ContainerType - if this
15271 succeeds, we must report a CS1540.
15273 2002-08-08 Martin Baulig <martin@gnome.org>
15275 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15276 (MethodGroupExpr): Implement the IMemberExpr interface.
15278 * expression (MemberAccess.ResolveMemberAccess): No need to have
15279 any special code for MethodGroupExprs anymore, they're now
15282 2002-08-08 Martin Baulig <martin@gnome.org>
15284 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15285 Family, FamANDAssem and FamORAssem permissions.
15286 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15288 2002-08-08 Martin Baulig <martin@gnome.org>
15290 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15291 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15294 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15296 * driver.cs: implemented /resource option to embed managed resources.
15298 2002-08-07 Martin Baulig <martin@gnome.org>
15300 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15301 (FieldBase.HasFieldInitializer): New public property.
15302 (FieldBase.GetInitializerExpression): New public method. Resolves and
15303 returns the field initializer and makes sure it is only resolved once.
15304 (TypeContainer.EmitFieldInitializers): Call
15305 FieldBase.GetInitializerExpression to get the initializer, this ensures
15306 that it isn't resolved multiple times.
15308 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15309 the resolving process (SimpleName/MemberLookup) that we're currently
15310 emitting a field initializer (which must not access any instance members,
15311 this is an error CS0236).
15313 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15314 argument, if the `IsFieldInitializer' flag is set, we must report and
15315 error CS0236 and not an error CS0120.
15317 2002-08-07 Martin Baulig <martin@gnome.org>
15319 * ecore.cs (IMemberExpr): New public interface.
15320 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15321 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15322 if the expression is an IMemberExpr.
15324 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15325 to be null, implicitly default to `this' if we're non-static in
15326 this case. Simplified the code a lot by using the new IMemberExpr
15327 interface. Also fixed bug #28176 here.
15329 2002-08-06 Martin Baulig <martin@gnome.org>
15331 * cs-parser.jay (SimpleLookup): Removed. We need to create
15332 ParameterReferences during semantic analysis so that we can do a
15333 type-only search when resolving Cast, TypeOf and SizeOf.
15334 (block): Pass the `current_local_parameters' to the Block's
15337 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15338 argument to the constructor.
15339 (ConstructorInitializer.Resolve): Create a temporary implicit
15340 block with the parameters.
15342 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15343 references here if we aren't doing a type-only search.
15345 * statement.cs (Block): Added constructor which takes a
15346 `Parameters parameters' argument.
15347 (Block.Parameters): New public property.
15349 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15350 to `Parameters' and made it public readonly.
15352 2002-08-06 Martin Baulig <martin@gnome.org>
15354 * ecore.cs (Expression.Warning): Made this public as well.
15356 * report.cs (Report.Debug): Print the contents of collections.
15358 2002-08-06 Martin Baulig <martin@gnome.org>
15360 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15361 used to tell Resolve() which kinds of expressions it may return.
15362 (Expression.Resolve): Added overloaded version of this method which
15363 takes a `ResolveFlags flags' argument. This can be used to tell
15364 Resolve() which kinds of expressions it may return. Reports a
15366 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15367 ResolveFlags.SimpleName.
15368 (Expression.Error118): Added overloaded version of this method which
15369 takes a `ResolveFlags flags' argument. It uses the flags to determine
15370 which kinds of expressions are allowed.
15372 * expression.cs (Argument.ResolveMethodGroup): New public method.
15373 Resolves an argument, but allows a MethodGroup to be returned.
15374 This is used when invoking a delegate.
15376 * TODO: Updated a bit.
15378 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15380 Fixed compilation with csc.
15382 * ecore.cs: Expression.Error made public. Is this correct? Should
15383 Warning be made public too?
15385 * expression.cs: use ea.Location instead of ea.loc.
15386 [FIXME: Filed as bug #28607: MCS must report these errors.]
15388 2002-08-06 Martin Baulig <martin@gnome.org>
15390 * ecore.cs (Expression.loc): Moved the location here instead of
15391 duplicating it in all derived classes.
15392 (Expression.Location): New public property.
15393 (Expression.Error, Expression.Warning): Made them non-static and
15394 removed the location argument.
15395 (Expression.Warning): Added overloaded version which takes an
15396 `int level' argument.
15397 (Expression.Error118): Make this non-static and removed the
15398 expression and location arguments.
15399 (TypeExpr): Added location argument to the constructor.
15401 * expression.cs (StaticCallExpr): Added location argument to
15403 (Indirection, PointerArithmetic): Likewise.
15404 (CheckedExpr, UnCheckedExpr): Likewise.
15405 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15406 (StringPtr): Likewise.
15409 2002-08-05 Martin Baulig <martin@gnome.org>
15411 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15413 * assign.cs (Assign.DoResolve): Check whether the source
15414 expression is a value or variable.
15416 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15417 while resolving the corresponding blocks.
15419 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15420 an error, don't silently return null.
15422 * statement.cs (Block.AddVariable): Do the error reporting here
15423 and distinguish between CS0128 and CS0136.
15424 (Block.DoResolve): Report all unused labels (warning CS0164).
15425 (LabeledStatement): Pass the location to the constructor.
15426 (LabeledStatement.HasBeenReferenced): New property.
15427 (LabeledStatement.Resolve): Set it to true here.
15429 * statement.cs (Return.Emit): Return success even after reporting
15430 a type mismatch error (CS0126 or CS0127), this is what csc does and
15431 it avoids confusing the users with any consecutive errors.
15433 2002-08-05 Martin Baulig <martin@gnome.org>
15435 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15437 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15439 * expression.cs (MemberAccess.DoResolve): Silently return if an
15440 error has already been reported.
15442 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15443 error has already been reported.
15445 2002-08-05 Martin Baulig <martin@gnome.org>
15447 * statement.cs (UsageVector): Only initialize the `parameters'
15448 vector if we actually have any "out" parameters.
15450 2002-08-05 Martin Baulig <martin@gnome.org>
15452 * expression.cs (Binary.ResolveOperator): When combining delegates,
15453 they must have the same type.
15455 2002-08-05 Martin Baulig <martin@gnome.org>
15457 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15458 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15459 work with the ms runtime and we also don't need it: if we're a
15460 PropertyBuilder and not in the `indexer_arguments' hash, then we
15461 are a property and not an indexer.
15463 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15464 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15465 since the latter one doesn't work with the ms runtime.
15467 2002-08-03 Martin Baulig <martin@gnome.org>
15469 Fixed bugs #27998 and #22735.
15471 * class.cs (Method.IsOperator): New public field.
15472 (Method.CheckBase): Report CS0111 if there's already a method
15473 with the same parameters in the current class. Report CS0508 when
15474 attempting to change the return type of an inherited method.
15475 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15476 and it's not marked abstract or extern.
15477 (PropertyBase): New abstract base class for Property and Indexer.
15478 (PropertyBase.CheckBase): Moved here from Property and made it work
15480 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15481 the same so we can reuse it there.
15482 (Property, Indexer): Derive from PropertyBase.
15483 (MethodSignature.inheritable_property_signature_filter): New delegate
15484 to find properties and indexers.
15486 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15487 argument and improved error reporting.
15489 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15490 EmptyReadOnlyParameters and made it a property.
15492 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15493 version of this method which takes a `PropertyInfo indexer'.
15494 (TypeManager.RegisterIndexer): New method.
15496 * class.cs: Added myself as author of this file :-)
15498 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15500 * class.cs: fixed compilation on windoze.
15502 2002-08-03 Martin Baulig <martin@gnome.org>
15504 * interface.cs (Interface.GetInterfaceBases): Check whether all
15505 base interfaces are at least as accessible than the current one.
15507 * class.cs (TypeContainer.GetClassBases): Check whether base types
15508 are at least as accessible than the current type.
15509 (TypeContainer.AsAccessible): Implemented and made non-static.
15510 (MemberBase.CheckParameters): Report errors if the accessibility
15513 * delegate.cs (Delegate.Delegate): The default visibility is
15514 internal for top-level types and private for nested types.
15515 (Delegate.Define): Report errors if the accessibility checks fail.
15517 * enum.cs (Enum.Enum): The default visibility is internal for
15518 top-level types and private for nested types.
15519 (Enum.DefineType): Compute the correct visibility.
15521 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15522 function which takes a `bool is_toplevel' instead of a TypeContainer.
15524 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15527 2002-08-02 Martin Baulig <martin@gnome.org>
15529 * expression.cs (LocalVariableReferenc): Added constructor which
15530 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15531 (LocalVariableReference.IsReadOnly): New property.
15532 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15533 variable is readonly, use our own readonly flag to do this; you can
15534 use the new constructor to get a writable reference to a read-only
15537 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15538 reference to the local variable.
15540 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15542 * rootcontext.cs (ResolveCore): Also include System.Exception
15544 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15545 we reach an EmptyStatement.
15547 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15550 * expression.cs (Binary.ResolveOperator): Check error result in
15553 use brtrue/brfalse directly and avoid compares to null.
15555 2002-08-02 Martin Baulig <martin@gnome.org>
15557 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15558 Fixes bug #28407, added test-155.cs.
15560 2002-08-01 Martin Baulig <martin@gnome.org>
15562 * class.cs (Event.EmitDefaultMethod): Make this work with static
15563 events. Fixes #28311, added verify-3.cs.
15565 2002-08-01 Martin Baulig <martin@gnome.org>
15567 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15568 `is_disposable' fields.
15569 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15570 `hm.is_disposable' if we're using the collection pattern.
15571 (Foreach.EmitCollectionForeach): Use the correct type for the
15572 enumerator's local variable, only emit the try/finally block if
15573 necessary (fixes #27713).
15575 2002-08-01 Martin Baulig <martin@gnome.org>
15577 * ecore.cs (Expression.report118): Renamed to Error118 and made
15580 * statement.cs (Throw.Resolve): Check whether the expression is of
15581 the correct type (CS0118) and whether the type derives from
15582 System.Exception (CS0155).
15583 (Catch.Resolve): New method. Do the type lookup here and check
15584 whether it derives from System.Exception (CS0155).
15585 (Catch.CatchType, Catch.IsGeneral): New public properties.
15587 * typemanager.cs (TypeManager.exception_type): Added.
15589 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15591 * driver.cs: Updated About function.
15593 2002-07-31 Martin Baulig <martin@gnome.org>
15595 Implemented Control Flow Analysis.
15597 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15598 (EmitContext.CurrentBranching): Added.
15599 (EmitContext.StartFlowBranching): Added.
15600 (EmitContext.EndFlowBranching): Added.
15601 (EmitContext.KillFlowBranching): Added.
15602 (EmitContext.IsVariableAssigned): Added.
15603 (EmitContext.SetVariableAssigned): Added.
15604 (EmitContext.IsParameterAssigned): Added.
15605 (EmitContext.SetParameterAssigned): Added.
15606 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15607 Added control flow analysis stuff here.
15609 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15610 resolve the expression as lvalue.
15611 (LocalVariableReference.DoResolve): Check whether the variable has
15612 already been assigned.
15613 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15614 the parameter as assigned here.
15615 (ParameterReference.DoResolve): Check whether the parameter has already
15617 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15618 expression as lvalue.
15620 * statement.cs (FlowBranching): New class for the flow analysis code.
15621 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15622 (LabeledStatement.IsDefined): New public property.
15623 (LabeledStatement.AddUsageVector): New public method to tell flow
15624 analyis that the label may be reached via a forward jump.
15625 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15627 (VariableInfo.Number): New public field. This is used by flow analysis
15628 to number all locals of a block.
15629 (Block.CountVariables): New public property. This is the number of
15630 local variables in this block (including the locals from all parent
15632 (Block.EmitMeta): Number all the variables.
15634 * statement.cs: Added flow analysis support to all classes.
15636 2002-07-31 Martin Baulig <martin@gnome.org>
15638 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15639 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15640 then use this argument.
15642 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15644 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15645 use this to specify /define options.
15647 2002-07-29 Martin Baulig <martin@gnome.org>
15649 * statement.cs (Fixed): Moved all code that does variable lookups
15650 and resolvings from Emit to Resolve.
15652 * statement.cs (For): Moved all code that does variable lookups
15653 and resolvings from Emit to Resolve.
15655 * statement.cs (Using): Moved all code that does variable lookups
15656 and resolvings from Emit to Resolve.
15658 2002-07-29 Martin Baulig <martin@gnome.org>
15660 * attribute.cs (Attribute.Resolve): Explicitly catch a
15661 System.NullReferenceException when creating the
15662 CustromAttributeBuilder and report a different warning message.
15664 2002-07-29 Martin Baulig <martin@gnome.org>
15666 * support.cs (ParameterData.ParameterName): Added method to
15667 get the name of a parameter.
15669 * typemanager.cs (TypeManager.IsValueType): New public method.
15671 2002-07-29 Martin Baulig <martin@gnome.org>
15673 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15674 is a flag which specifies that it's either ref or out.
15675 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15676 the out parameter to `out Parameter.Modifier mod', also set the
15677 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15679 * support.cs (InternalParameters.ParameterModifier): Distinguish
15680 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15681 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15683 * expression.cs (Argument.GetParameterModifier): 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 2002-07-29 Martin Baulig <martin@gnome.org>
15689 * expression.cs (ParameterReference.ParameterReference): Added
15690 `Location loc' argument to the constructor.
15692 * cs-parser.jay: Pass location to ParameterReference.
15694 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15696 * statement.cs (Try): Initialize the location.
15698 * cs-parser.jay: pass location to Try.
15700 * expression.cs (Unary.Reduce): Change the prototype to return
15701 whether a constant fold could be performed or not. The result is
15702 returned in an out parameters. In the case of Indirection and
15703 AddressOf, we want to perform the full tests.
15705 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15707 * statement.cs (Statement.Emit): Flag dead code.
15709 2002-07-27 Andrew Birkett <andy@nobugs.org>
15711 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15713 2002-07-27 Martin Baulig <martin@gnome.org>
15715 * class.cs (MethodData.Define): Put back call to
15716 TypeManager.AddMethod(), accidentally commented this out.
15718 * report.cs (Debug): New public method to print debugging information,
15719 this is `[Conditional ("DEBUG")]'.
15721 2002-07-26 Martin Baulig <martin@gnome.org>
15723 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15724 (switch_statement): Push the current_block to the switch_stack and
15725 pop it again when we're done with the switch.
15726 (switch_section): The new block is a child of the current_block.
15727 Fixes bug #24007, added test-152.cs.
15729 2002-07-27 Martin Baulig <martin@gnome.org>
15731 * expression.cs (Invocation.EmitArguments): When calling a varargs
15732 function with only its fixed arguments, we need to pass an empty
15735 2002-07-27 Martin Baulig <martin@gnome.org>
15737 Mono 0.13 has been released.
15739 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15741 * driver.cs: Rename --resource to --linkres, because that is what
15742 we do currently, we dont support --resource yet.
15744 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15746 2002-07-25 Martin Baulig <martin@gnome.org>
15748 * class.cs (MethodData): New public class. This is a `method builder'
15749 class for a method or one accessor of a Property/Indexer/Event.
15750 (MethodData.GetMethodFlags): Moved here from MemberBase.
15751 (MethodData.ApplyAttributes): Likewise.
15752 (MethodData.ApplyObsoleteAttribute): Likewise.
15753 (MethodData.ApplyConditionalAttribute): Likewise.
15754 (MethodData.ApplyDllImportAttribute): Likewise.
15755 (MethodData.CheckAbstractAndExternal): Likewise.
15756 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15757 (MethodData.Emit): Formerly known as Method.Emit().
15758 (MemberBase): Moved everything which was specific to a single
15759 accessor/method to MethodData.
15760 (Method): Create a new MethodData and call Define() and Emit() on it.
15761 (Property, Indexer, Event): Create a new MethodData objects for each
15762 accessor and call Define() and Emit() on them.
15764 2002-07-25 Martin Baulig <martin@gnome.org>
15766 Made MethodCore derive from MemberBase to reuse the code from there.
15767 MemberBase now also checks for attributes.
15769 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15770 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15772 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15773 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15774 (MemberBase.ApplyAttributes): New virtual method; applies the
15775 attributes to a method or accessor.
15776 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15777 (MemberBase.ApplyConditionalAttribute): Likewise.
15778 (MemberBase.ApplyDllImportAttribute): Likewise.
15779 (MemberBase.CheckAbstractAndExternal): Likewise.
15780 (MethodCore.ParameterTypes): This is now a property instead of a
15781 method, it's initialized from DoDefineParameters().
15782 (MethodCore.ParameterInfo): Removed the set accessor.
15783 (MethodCore.DoDefineParameters): New protected virtual method to
15784 initialize ParameterTypes and ParameterInfo.
15785 (Method.GetReturnType): We can now simply return the MemberType.
15786 (Method.GetMethodFlags): Override the MemberBase version and add
15787 the conditional flags.
15788 (Method.CheckBase): Moved some code from Define() here, call
15789 DoDefineParameters() here.
15790 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15791 here to avoid some larger code duplication.
15792 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15793 ensure that abstract and external accessors don't declare a body.
15795 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15796 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15797 lookup in the attribute's parent classes, so we need to abort as soon
15798 as we found the first match.
15799 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15800 the attribute has no arguments.
15802 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15805 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15807 * cs-parser.jay: reverted previous patch.
15809 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15811 * cs-parser.jay: fixed bug #22119.
15813 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15815 * attribute.cs: fixed compilation. The error was:
15816 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15817 be assigned to before control leaves the current method."
15818 [FIXME: Filed as bug #28186: MCS must report this error.]
15820 2002-07-25 Martin Baulig <martin@gnome.org>
15822 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15823 method to pull the condition name ouf of a Conditional attribute.
15824 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15825 the obsolete message and error flag out of an Obsolete attribute.
15827 * class.cs (Method.GetMethodFlags): New public method to get the
15828 TypeManager.MethodFlags for this method.
15829 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15831 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15832 if we're overriding a virtual function, set the new private variable
15833 `parent_method'; call the new TypeManager.AddMethod().
15835 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15836 the MethodBuilder and the Method in a PtrHashtable.
15837 (TypeManager.builder_to_method): Added for this purpose.
15838 (TypeManager.MethodFlags): Added IsObsoleteError.
15839 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15840 Obsolete and Conditional arguments in MethodBuilders. If we discover
15841 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15842 the message from the attribute.
15844 2002-07-24 Martin Baulig <martin@gnome.org>
15846 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15847 preprocessor directives, ensure that the argument to #define/#undef is
15848 exactly one identifier and that it's actually an identifier.
15850 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15853 2002-07-24 Martin Baulig <martin@gnome.org>
15855 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15856 initialize it to TypeManager.object_type in the constructor.
15857 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15858 of the `hm.get_current' method if we're using the collection pattern.
15859 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15860 for the explicit conversion to make it work when we're using the collection
15861 pattern and the `Current' property has a different return type than `object'.
15864 2002-07-24 Martin Baulig <martin@gnome.org>
15866 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15867 does not match, but don't report any errors. This method is called in
15868 order for all methods in a MethodGroupExpr until a matching method is
15869 found, so we don't want to bail out if the first method doesn't match.
15870 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15871 matches, report the 123. Fixes #28070.
15873 2002-07-24 Martin Baulig <martin@gnome.org>
15875 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15876 TypeManager.TypeToCoreType() to the top of the method so the
15877 following equality checks will work. Fixes #28107.
15879 2002-07-24 Martin Baulig <martin@gnome.org>
15881 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15882 operand is of type uint, and the other operand is of type sbyte,
15883 short or int, the operands are converted to type long." -
15884 Actually do what this comment already told us. Fixes bug #28106,
15887 2002-07-24 Martin Baulig <martin@gnome.org>
15889 * class.cs (MethodBase): New abstract class. This is now a base
15890 class for Property, Indexer and Event to avoid some code duplication
15891 in their Define() and DefineMethods() methods.
15892 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15893 generic methods for Define() and DefineMethods().
15894 (FieldBase): Derive from MemberBase, not MemberCore.
15895 (Property): Derive from MemberBase, not MemberCore.
15896 (Property.DefineMethod): Moved all the code from this method to the
15897 new MethodBase.DefineAccessor(), just call it with appropriate
15899 (Property.Define): Call the new Property.DoDefine(), this does some
15900 sanity checks and we don't need to duplicate the code everywhere.
15901 (Event): Derive from MemberBase, not MemberCore.
15902 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15903 accessors, this will also make them work with interface events.
15904 (Indexer): Derive from MemberBase, not MemberCore.
15905 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15906 (Indexer.Define): Use the new MethodBase functions.
15908 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15909 argument to the constructor.
15910 (Interface.FindMembers): Added support for interface events.
15911 (Interface.PopluateEvent): Implemented.
15913 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
15915 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15917 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15918 but this is required to check for a method name being the same as
15919 the containing class.
15923 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15925 * interface.cs: initialize variable.
15927 2002-07-23 Martin Baulig <martin@gnome.org>
15929 Implemented the IndexerName attribute in interfaces.
15931 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15932 name if this is an explicit interface implementation.
15933 (Indexer.InterfaceIndexerName): New public variable. If we're
15934 implementing an interface indexer, this is the IndexerName in that
15935 interface. Otherwise, it's the IndexerName.
15936 (Indexer.DefineMethod): If we're implementing interface indexer,
15937 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15938 and Pending.ImplementIndexer methods.
15939 (Indexer.Define): Also define the PropertyBuilder if we're
15940 implementing an interface indexer and this is neither an explicit
15941 interface implementation nor do the IndexerName match the one in
15944 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15945 If a method is defined here, then we always need to create a proxy
15946 for it. This is used when implementing interface indexers.
15947 (Pending.IsInterfaceIndexer): New public method.
15948 (Pending.ImplementIndexer): New public method.
15949 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15950 This is used when implementing interface indexers to define a proxy
15952 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15953 define a proxy if necessary.
15955 * interface.cs (Interface.IndexerName): New public variable.
15956 (Interface.PopulateIndexer): Set the IndexerName.
15957 (Interface.DefineIndexers): New private method. Populate all the
15958 indexers and make sure their IndexerNames match.
15960 * typemanager.cs (IndexerPropertyName): Added support for interface
15963 2002-07-22 Martin Baulig <martin@gnome.org>
15965 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15966 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15967 ret if HasReturnLabel.
15968 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15971 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15972 and set the ec.LoopBeginTryCatchLevel.
15973 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15974 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15975 the current ec.TryCatchLevel, the branch goes out of an exception
15976 block. In this case, we need to use Leave and not Br.
15978 2002-07-22 Martin Baulig <martin@gnome.org>
15980 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15981 block unless the block does not always return or it is contained in
15982 another try { ... } catch { ... } block. Fixes bug #26506.
15983 Added verify-1.cs to the test suite.
15985 2002-07-22 Martin Baulig <martin@gnome.org>
15987 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15988 then we do not always return. Fixes bug #24985.
15990 2002-07-22 Martin Baulig <martin@gnome.org>
15992 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15993 lookup on a per-class level; ie. walk up the class hierarchy until we
15994 found at least one applicable method, then choose the best among them.
15995 Fixes bug #24463 and test-29.cs.
15997 2002-07-22 Martin Baulig <martin@gnome.org>
15999 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16000 return types of the methods. The return type is not part of the
16001 signature and we must not check it to make the `new' modifier work.
16002 Fixes bug #27999, also added test-147.cs.
16003 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16005 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16006 on the method's return type.
16008 2002-07-21 Martin Baulig <martin@gnome.org>
16010 * assign.cs: Make this work if the rightmost source is a constant and
16011 we need to do an implicit type conversion. Also adding a few more tests
16012 to test-38.cs which should have caught this.
16014 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16015 target in the makefile for this. The makefile.gnu is primarily intended
16016 for end-users who don't want to debug the compiler.
16018 2002-07-21 Martin Baulig <martin@gnome.org>
16020 * assign.cs: Improved the Assign class so it can now handle embedded
16021 assignments (X = Y = Z = something). As a side-effect this'll now also
16022 consume less local variables. test-38.cs now passes with MCS, added
16023 a few new test cases to that test.
16025 2002-07-20 Martin Baulig <martin@gnome.org>
16027 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16028 instructions. Fixes bug #27977, also added test-146.cs.
16030 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16032 * cs-tokenizer.cs: fixed getHex ().
16034 2002-07-19 Martin Baulig <martin@gnome.org>
16036 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16037 not Type.GetType() to lookup the array type. This is needed when
16038 we're constructing an array of a user-defined type.
16039 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16040 single-dimensional arrays, but also for single-dimensial arrays of
16043 2002-07-19 Martin Baulig <martin@gnome.org>
16045 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16046 this function is called, it's not allowed to share LocalBuilders
16047 among ILGenerators.
16049 2002-07-19 Martin Baulig <martin@gnome.org>
16051 * expression.cs (Argument.Resolve): Report an error 118 when trying
16052 to pass a type as argument.
16054 2002-07-18 Martin Baulig <martin@gnome.org>
16056 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16057 Conv_R_Un for the signed `long' type.
16059 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16061 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16062 `expr' for the temporary result, as that will fail if we do
16063 multiple resolves on the same expression.
16065 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16067 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16068 ec.TypeContainer for looking up aliases.
16070 * class.cs (TypeContainer): Remove LookupAlias from here.
16072 * decl.cs (DeclSpace); Move here.
16074 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16076 * class.cs (FindMembers): Only call filter if the constructor
16077 bulider is not null.
16079 Also handle delegates in `NestedTypes' now. Now we will perform
16080 type lookups using the standard resolution process. This also
16083 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16084 This uses Expressions (the limited kind that can be parsed by the
16085 tree) instead of strings.
16087 * expression.cs (ComposedCast.ToString): Implement, used to flag
16088 errors since now we have to render expressions.
16090 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
16093 * ecore.cs (SimpleName.ToString): ditto.
16095 * cs-parser.jay: Instead of using strings to assemble types, use
16096 Expressions to assemble the type (using SimpleName, ComposedCast,
16097 MemberAccess). This should fix the type lookups in declarations,
16098 because we were using a different code path for this.
16100 * statement.cs (Block.Resolve): Continue processing statements
16101 even when there is an error.
16103 2002-07-17 Miguel de Icaza <miguel@ximian.com>
16105 * class.cs (Event.Define): Also remove the `remove' method from
16106 the list of pending items.
16108 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16109 generate more compact code.
16111 2002-07-17 Martin Baulig <martin@gnome.org>
16113 * const.cs (Const.LookupConstantValue): Add support for constant
16114 `unchecked' and `checked' expressions.
16115 Also adding test case test-140.cs for this.
16117 2002-07-17 Martin Baulig <martin@gnome.org>
16119 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16120 check whether mi.ReturnType implements the IEnumerator interface; the
16121 `==' and the IsAssignableFrom() will fail in this situation.
16123 2002-07-16 Ravi Pratap <ravi@ximian.com>
16125 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
16128 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16130 * expression.cs: fixed bug #27811.
16132 2002-07-14 Miguel de Icaza <miguel@ximian.com>
16134 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16135 Molaro: when we are a ref, the value already contains a pointer
16136 value, do not take the address of it.
16138 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16139 * removed mb-parser.jay and mb-tokenizer.cs
16141 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16143 * expression.cs: check against the building corlib void type.
16145 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16147 * ecore.cs: fix for valuetype static readonly fields: when
16148 initializing them, we need their address, not the address of a copy.
16150 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16152 * typemanager.cs: register also enum_type in corlib.
16154 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16156 * class.cs: allow calling this (but not base) initializers in structs.
16158 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16160 * ecore.cs: make sure we compare against the building base types
16163 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16165 * typemanager.cs: fix TypeToCoreType() to handle void and object
16166 (corlib gets no more typerefs after this change).
16168 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16170 * expression.cs (ArrayCreation.EmitArrayArguments): use
16171 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16173 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16174 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16175 array indexes, the runtime actually forbids them.
16177 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16178 for array arguments here.
16180 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16181 instead of the default for ValueTypes.
16183 (New.DoEmit): Use IsValueType instead of
16184 IsSubclassOf (value_type)
16185 (New.DoResolve): ditto.
16186 (Invocation.EmitCall): ditto.
16188 * assign.cs (Assign): ditto.
16190 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16191 Statements *are* currently doing part of their resolution during
16194 Expressions do always resolve during resolve, but statements are
16195 only required to propagate resolution to their children.
16197 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16199 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16201 (LoadAssembly): Do not add the dll if it is already specified
16203 (MainDriver): Add the System directory to the link path at the end,
16204 after all the other -L arguments.
16206 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16207 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16208 ldelem.u1) and using the opposite for sbytes.
16210 This fixes Digger, and we can finally run it.
16212 * driver.cs (UnixParseOption): Move the option parsing here.
16213 (CSCParseOption): Implement CSC-like parsing of options.
16215 We now support both modes of operation, the old Unix way, and the
16216 new CSC-like way. This should help those who wanted to make cross
16217 platform makefiles.
16219 The only thing broken is that /r:, /reference: and /lib: are not
16220 implemented, because I want to make those have the same semantics
16221 as the CSC compiler has, and kill once and for all the confussion
16222 around this. Will be doing this tomorrow.
16224 * statement.cs (Unsafe.Resolve): The state is checked during
16225 resolve, not emit, so we have to set the flags for IsUnsfe here.
16227 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16229 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16230 not catch the Error_ObjectRefRequired in SimpleName (as it is
16231 possible to have a class/instance variable name that later gets
16232 deambiguated), we have to check this here.
16234 2002-07-10 Ravi Pratap <ravi@ximian.com>
16236 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16237 make static and put into Expression.
16239 (Event.Define): Register the private field of the event with the
16240 TypeManager so that GetFieldFromEvent can get at it.
16242 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16243 keep track of the private field associated with an event which
16246 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16249 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16251 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16253 * expression.cs (Binary.EmitBranchable): this routine emits the
16254 Binary expression in a branchable context. This basically means:
16255 we need to branch somewhere, not just get the value on the stack.
16257 This works together with Statement.EmitBoolExpression.
16259 * statement.cs (Statement.EmitBoolExpression): Use
16262 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16264 * statement.cs (For): Reduce the number of jumps in loops.
16266 (For): Implement loop inversion for the For statement.
16268 (Break): We can be breaking out of a Try/Catch controlled section
16269 (foreach might have an implicit try/catch clause), so we need to
16270 use Leave instead of Br.
16272 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16273 now). If the instace expression supports IMemoryLocation, we use
16274 the AddressOf method from the IMemoryLocation to extract the
16275 address instead of emitting the instance.
16277 This showed up with `This', as we were emitting the instance
16278 always (Emit) instead of the Address of This. Particularly
16279 interesting when This is a value type, as we dont want the Emit
16280 effect (which was to load the object).
16282 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16284 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16286 * statement.cs (Checked): Set the CheckedState during the resolve
16287 process too, as the ConvCast operations track the checked state on
16288 the resolve process, and not emit.
16290 * cs-parser.jay (namespace_member_declaration): Flag that we have
16291 found a declaration when we do. This is used to flag error 1529
16293 * driver.cs: Report ok when we display the help only.
16295 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16297 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16299 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16301 * cs-tokenizer.cs (define): We also have to track locally the
16302 defines. AllDefines is just used for the Conditional Attribute,
16303 but we also need the local defines for the current source code.
16305 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16307 * statement.cs (While, For, Do): These loops can exit through a
16308 Break statement, use this information to tell whether the
16309 statement is the last piece of code.
16311 (Break): Flag that we break.
16313 * codegen.cs (EmitContexts): New `Breaks' state variable.
16315 2002-07-03 Martin Baulig <martin@gnome.org>
16317 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16318 modifiers in method declarations in structs. Otherwise, you won't
16319 be able to override things like Object.Equals().
16321 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16323 * class.cs (Method, Property, Indexer): Do not allow the public
16324 modifier to be used in explicit interface implementations.
16326 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16327 override modifiers in method declarations in structs
16329 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16331 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16332 integer or real overflow, report an error
16334 2002-07-02 Martin Baulig <martin@gnome.org>
16336 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16337 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16338 to tell the runtime about our newly created System.Object and
16339 System.ValueType types.
16341 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16343 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16344 struct instead of Ldarg/Starg.
16346 2002-07-02 Martin Baulig <martin@gnome.org>
16348 * expression.cs (Indirection.Indirection): Call
16349 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16351 2002-07-02 Martin Baulig <martin@gnome.org>
16353 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16354 ValueType, call TypeManager.TypeToCoreType() on it.
16355 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16356 the OpCodes.Newarr argument.
16358 2002-07-02 Martin Baulig <martin@gnome.org>
16360 * expression.cs (Invocation.EmitCall): When compiling corlib,
16361 replace all calls to the system's System.Array type to calls to
16362 the newly created one.
16364 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16365 System.Array methods.
16366 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16367 from the system's System.Array type which must be replaced.
16369 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16371 * typemanager.cs: load unverifiable_code_ctor so we can build
16372 corlib using the correct type. Avoid using GetTypeCode() with
16374 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16375 TypeManager.object_type to allow building corlib.
16377 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16379 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16381 2002-07-01 Martin Baulig <martin@gnome.org>
16383 * class.cs: Make the last change actually work, we need to check
16384 whether `ifaces != null' to avoid a crash.
16386 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16388 * class.cs: when we build structs without fields that implement
16389 interfaces, we need to add the interfaces separately, since there is
16390 no API to both set the size and add the interfaces at type creation
16393 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16395 * expression.cs: the dimension arguments to the array constructors
16396 need to be converted if they are a long.
16398 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16400 * class.cs: don't emit ldarg.0 if there is no parent constructor
16401 (fixes showstopper for corlib).
16403 2002-06-29 Martin Baulig <martin@gnome.org>
16405 MCS now compiles corlib on GNU/Linux :-)
16407 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16408 ie. check for MethodImplOptions.InternalCall.
16410 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16411 and TypeManager.attribute_type are null, so we must explicitly check
16412 whether parent is not null to find out whether it's an attribute type.
16413 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16414 and SetBuilder, not only if the property is neither abstract nor external.
16415 This is necessary to set the MethodImplOptions on the accessor methods.
16416 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16417 SetBuilder, see Property.Emit().
16419 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16420 populate "System.Object", "System.ValueType" and "System.Attribute" since
16421 they've already been populated from BootCorlib_PopulateCoreTypes().
16423 2002-06-29 Martin Baulig <martin@gnome.org>
16425 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16426 is the NullLiteral, we also need to make sure that target_type is not
16429 2002-06-29 Martin Baulig <martin@gnome.org>
16431 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16432 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16433 before calling BootstrapCorlib_ResolveDelegate ().
16435 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16437 * statement.cs: fixed build-breaker. All tests passed ok.
16439 2002-06-27 Martin Baulig <martin@gnome.org>
16441 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16442 for System.Decimal when compiling corlib.
16444 2002-06-27 Martin Baulig <martin@gnome.org>
16446 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16447 switch blocks which contain nothing but a default clause.
16449 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16451 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16453 2002-06-27 Martin Baulig <martin@gnome.org>
16455 * ecore.cs (PropertyExpr.PropertyExpr): Call
16456 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16458 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16459 is already a TypeBuilder.
16461 2002-06-27 Martin Baulig <martin@gnome.org>
16463 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16464 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16465 the "from an array-type to System.Array" case. This makes it work
16466 when compiling corlib.
16468 2002-06-27 Martin Baulig <martin@gnome.org>
16470 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16471 non-static PropertyExpr, set its InstanceExpression. This makes
16472 the `ICollection.Count' property work in System/Array.cs.
16474 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16476 * driver.cs: Made error handling more consistent. Errors now
16477 tracked by Report class, so many methods which used to return int
16478 now return void. Main() now prints success/failure and
16479 errors/warnings message.
16481 Renamed '--probe' compiler argument to '--expect-error'. Removed
16482 the magic number return values (123 and 124). Now, if the
16483 expected error occurs, the compiler exits with success (exit value
16484 0). If the compilation completes without seeing that particular
16485 error, the compiler exits with failure (exit value 1). The
16486 makefile in mcs/errors has been changed to handle the new behaviour.
16488 * report.cs: Made 'expected error' number a property and renamed
16489 it from 'Probe' to 'ExpectedError'.
16491 * genericparser.cs: Removed error handling support, since it is
16492 now all done by Report class.
16494 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16495 class, so parse() no longer returns an int.
16497 * namespace.cs: Use Report.Error instead of GenericParser.error
16499 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16501 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16502 TypeContainer.AddOperator): At the front of the list put the
16503 explicit implementations, so they get resolved/defined first.
16505 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16507 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16508 interface type is implemented by this TypeContainer. Used during
16509 explicit interface implementation.
16511 (Property.Define, Indexer.Define, Method.Define): Validate that
16512 the given interface in the explicit implementation is one of the
16513 base classes for the containing type.
16515 Also if we are explicitly implementing an interface, but there is
16516 no match in the pending implementation table, report an error.
16518 (Property.Define): Only define the property if we are
16519 not explicitly implementing a property from an interface. Use the
16520 correct name also for those properties (the same CSC uses,
16521 although that is really not needed).
16523 (Property.Emit): Do not emit attributes for explicitly implemented
16524 properties, as there is no TypeBuilder.
16526 (Indexer.Emit): ditto.
16528 Hiding then means that we do not really *implement* a pending
16529 implementation, which makes code fail.
16531 2002-06-22 Martin Baulig <martin@gnome.org>
16533 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16534 the return value of Object.GetType(). [FIXME: we need to do this whenever
16535 we get a type back from the reflection library].
16537 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16539 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16541 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16543 * attribute.cs: Return null if we can not look up the type.
16545 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16546 the interface types found.
16548 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16549 interface types found.
16551 * typemanager.cs (GetInterfaces): Make this routine returns alll
16552 the interfaces and work around the lame differences between
16553 System.Type and System.Reflection.Emit.TypeBuilder in the results
16554 result for GetInterfaces.
16556 (ExpandInterfaces): Given an array of interface types, expand and
16557 eliminate repeated ocurrences of an interface. This expands in
16558 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16561 2002-06-21 Martin Baulig <martin@gnome.org>
16563 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16566 2002-06-21 Martin Baulig <martin@gnome.org>
16568 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16569 and called with one of the core types, return the corresponding typebuilder for
16572 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16575 2002-06-21 Martin Baulig <martin@gnome.org>
16577 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16578 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16579 (Expression.ConvertReferenceExplicit): Likewise.
16581 * expression.cs (ElementAccess.DoResolve): Likewise.
16582 (ElementAccess.DoResolveLValue): Likewise.
16584 2002-06-10 Martin Baulig <martin@gnome.org>
16586 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16587 add the "value" parameter to the parameter list.
16589 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16592 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16594 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16595 the argument to an int, uint, long or ulong, per the spec. Also
16596 catch negative constants in array creation.
16598 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16600 * class.cs: do not allow the same interface to appear twice in
16601 the definition list.
16603 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16605 * ecore.cs: don't use ldlen with System.Array.
16607 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16609 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16611 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16613 * modifiers.cs: produce correct field attributes for protected
16614 internal. Easy fix so miguel can work on ther harder stuff:-)
16616 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16618 * pending.cs: New file. Move the code from class.cs here.
16619 Support clearning the pending flag for all methods (when not doing
16620 explicit interface implementation).
16622 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16624 * rootcontext.cs: added a couple more types needed to bootstrap.
16626 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16628 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16629 constructor in the type, instead of any constructor in the type
16630 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16631 a bug in the Mono runtime when applying the params attribute).
16633 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16634 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16636 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16638 * expression.cs (Unary.ResolveOperator): Use TypeManager
16639 to resolve the type.
16641 2002-06-13 Ravi Pratap <ravi@ximian.com>
16643 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16646 * enum.cs (AddEnumMember): Add support to store the attributes associated
16647 with each member too.
16649 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16650 field builders too - this takes care of the enum member case.
16652 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16654 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16655 address-of operator on both value types and pointers.
16657 2002-06-10 Martin Baulig <martin@gnome.org>
16659 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16660 PropertyBuilder to the `property_builders' list.
16662 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16663 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16664 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16665 find any indexers which are inherited from an interface.
16667 2002-06-09 Martin Baulig <martin@gnome.org>
16669 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16670 the same type as the constant if necessary. There's also a test-130.cs
16673 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16675 * typemanager.cs (TypeManager.ChangeType): Previously known as
16676 Enum.ChangeEnumType().
16678 2002-06-09 Martin Baulig <martin@gnome.org>
16680 * expression.cs (Cast.TryReduce): Added support for consts.
16682 2002-06-08 Ravi Pratap <ravi@ximian.com>
16684 * class.cs (Accessor): Hold attributes information so we can pass
16687 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16688 Modify to pass in attributes attached to the methods.
16690 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16692 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16693 to handle the Accessor kind :-)
16695 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16697 2002-06-08 Martin Baulig <martin@gnome.org>
16699 * expression.cs (Unary.TryReduceNegative): Added support for
16702 2002-06-08 Martin Baulig <martin@gnome.org>
16704 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16705 name can't be found in the `defined_names' - the caller will do a
16706 MemberLookup in this case and thus find methods in System.Enum
16707 such as Enum.IsDefined().
16709 2002-06-08 Martin Baulig <martin@gnome.org>
16711 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16712 Convert.ChangeType() which works with TypeBuilder created types.
16713 (Enum.LookupEnumValue, Enum.Define): Use it here.
16715 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16716 `TypeBuilder.BaseType != null' check.
16717 (TypeContainer.FindMembers): Only lookup parent members if we
16718 actually have a parent.
16719 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16720 (ConstructorInitializer.Resolve): Likewise.
16722 * interface.cs (Interface.FindMembers): Added
16723 `TypeBuilder.BaseType != null' check.
16725 * rootcontext.cs (RootContext.ResolveCore): Added
16726 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16727 classes_second_stage.
16729 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16730 debug_type and trace_type when compiling with --nostdlib.
16732 2002-06-07 Martin Baulig <martin@gnome.org>
16734 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16735 (AddField): Set it to true when adding a non-static field.
16736 (DefineType): Use `have_nonstatic_fields' to find out whether we
16737 have non-static fields, not `Fields != null'.
16739 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16741 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16742 dereferencing a null on the static-field code path)
16744 2002-05-30 Martin Baulig <martin@gnome.org>
16746 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16747 to take command line arguments. Use reflection to call the new
16748 custom `Initialize' function on the symbol writer and pass it the
16749 command line arguments.
16751 * driver.cs (--debug-args): New command line argument to pass command
16752 line arguments to the symbol writer.
16754 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16756 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16757 the target type for indexers and properties. Thanks to Joe for
16760 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16762 * typemanager.cs (MethodFlags): returns the method flags
16763 (Obsolete/ShouldIgnore) that control warning emission and whether
16764 the invocation should be made, or ignored.
16766 * expression.cs (Invocation.Emit): Remove previous hack, we should
16767 not do this on matching a base type, we should do this based on an attribute
16769 Only emit calls to System.Diagnostics.Debug and
16770 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16771 on the command line.
16773 * rootcontext.cs: Global settings for tracing and debugging.
16775 * cs-tokenizer.cs (define): New utility function to track
16776 defines. Set the global settings for TRACE and DEBUG if found.
16778 2002-05-25 Ravi Pratap <ravi@ximian.com>
16780 * interface.cs (Populate*): Pass in the TypeContainer as well as
16781 the DeclSpace as parameters so that we can create EmitContexts and
16782 then use that to apply attributes etc.
16784 (PopulateMethod, PopulateEvent, PopulateProperty)
16785 (PopulateIndexer): Apply attributes everywhere.
16787 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16790 (ApplyAttributes): Update accordingly.
16792 We now apply interface attributes for all members too.
16794 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16796 * class.cs (Indexer.Define); Correctly check if we are explicit
16797 implementation (instead of checking the Name for a ".", we
16798 directly look up if the InterfaceType was specified).
16800 Delay the creation of the PropertyBuilder.
16802 Only create the PropertyBuilder if we are not an explicit
16803 interface implementation. This means that explicit interface
16804 implementation members do not participate in regular function
16805 lookups, and hence fixes another major ambiguity problem in
16806 overload resolution (that was the visible effect).
16808 (DefineMethod): Return whether we are doing an interface
16811 * typemanager.cs: Temporary hack until we get attributes in
16812 interfaces (Ravi is working on that) and we get IndexerName
16813 support in interfaces.
16815 * interface.cs: Register the indexers as properties.
16817 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16818 warning, I have verified that this is a bug in the .NET runtime
16819 (JavaScript suffers of the same problem).
16821 * typemanager.cs (MemberLookup): When looking up members for
16822 interfaces, the parent of an interface is the implicit
16823 System.Object (so we succeed in searches of Object methods in an
16824 interface method invocation. Example: IEnumerable x; x.ToString
16827 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16829 * class.cs (Event): Events should also register if they do
16830 implement the methods that an interface requires.
16832 * typemanager.cs (MemberLookup); use the new GetInterfaces
16835 (GetInterfaces): The code used to lookup interfaces for a type is
16836 used in more than one place, factor it here.
16838 * driver.cs: Track the errors at the bottom of the file, we kept
16841 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16842 instance if the method we are calling is static!
16844 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16846 * attribute.cs (ApplyAttributes): Make this function filter out
16847 the IndexerName attribute (as that attribute in reality is never
16848 applied) and return the string constant for the IndexerName
16851 * class.cs (TypeContainer.Emit): Validate that all the indexers
16852 have the same IndexerName attribute, and if so, set the
16853 DefaultName attribute on the class.
16855 * typemanager.cs: The return value might contain other stuff (not
16856 only methods). For instance, consider a method with an "Item"
16857 property and an Item method.
16859 * class.cs: If there is a problem with the parameter types,
16862 2002-05-24 Ravi Pratap <ravi@ximian.com>
16864 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16865 looks at user defined conversion after making a call to
16866 StandardConversionExists - we need this for overload resolution.
16868 * expression.cs : Update accordingly the various method calls.
16870 This fixes 2 bugs filed against implicit user defined conversions
16872 2002-05-22 Miguel de Icaza <miguel@ximian.com>
16874 * statement.cs: Track the result of the assignment.
16876 2002-05-21 Miguel de Icaza <miguel@ximian.com>
16878 * expression.cs (MemberAccess): Improved error reporting for
16879 inaccessible members.
16881 2002-05-22 Martin Baulig <martin@gnome.org>
16883 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
16884 itself with debugging support.
16886 2002-05-22 Martin Baulig <martin@gnome.org>
16888 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16889 Removed, this isn't needed anymore.
16891 2002-05-20 Martin Baulig <martin@gnome.org>
16893 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16894 be underlying type for an enum.
16896 2002-05-20 Miguel de Icaza <miguel@ximian.com>
16898 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16899 that splits out the loading of just the core types.
16901 * rootcontext.cs (ResolveCore): Split the struct resolution in
16902 two, so we can load the enumeration underlying types before any
16905 * expression.cs (Is): Bandaid until we fix properly Switch (see
16906 bug #24985 for details).
16908 * typemanager.cs (ImplementsInterface): The hashtable will contain
16909 a null if there are no interfaces implemented.
16911 2002-05-18 Miguel de Icaza <miguel@ximian.com>
16913 * cs-parser.jay (indexer_declarator): It is fine to have array
16916 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16918 * typemanager.cs: (RegisterBuilder): New function used to register
16919 TypeBuilders that implement interfaces. Since
16920 TypeBuilder.GetInterfaces (as usual) does not work with lame
16922 (AddUserType): register interfaces.
16924 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16925 dealing with TypeBuilder. Also, arrays are showing up as
16926 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16927 methods can not be invoked on them!
16929 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16930 (ImplicitReferenceConversionExists): Split out from
16931 StandardConversionExists.
16933 * expression.cs (As): We were only implementing one of the three
16934 cases for the as operator. We now implement them all.
16935 (Is): Implement the various other cases for Is as well.
16937 * typemanager.cs (CACHE): New define used to control if we want or
16938 not the FindMembers cache. Seems to have a negative impact on
16939 performance currently
16941 (MemberLookup): Nested types have full acess to
16942 enclosing type members
16944 Remove code that coped with instance/static returns for events, we
16945 now catch this in RealFindMembers.
16947 (RealFindMembers): only perform static lookup if the instance
16948 lookup did not return a type or an event.
16950 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16952 * assign.cs (CompoundAssign): We pass more semantic information
16953 now to Compound Assignments than we did before: now we have all
16954 the information at hand, and now we resolve the target *before* we
16955 do the expression expansion, which allows the "CacheValue" method
16956 to have the effect we intended (before, a [x] += 1 would generate
16957 two differen ArrayAccess expressions from the ElementAccess,
16958 during the resolution process).
16960 (CompoundAssign.DoResolve): Resolve target and original_source here.
16962 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16964 * expression.cs (ArrayAccess): dropped debugging information.
16966 * typemanager.cs: Small bug fix: I was always returning i_members,
16967 instead of one of i_members or s_members (depending on which had
16970 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16971 method is invoked before any code generation takes place, and it
16972 is a mechanism to inform that the expression will be invoked more
16973 than once, and that the method should use temporary values to
16974 avoid having side effects
16976 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16978 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16981 * expression.cs (Indirection, ArrayAccess): Add support for
16982 CacheTemporaries in these two bad boys.
16984 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16985 ldobj or ldind_ref.
16986 (StoreFromPtr): Handle stobj as well.
16988 * expression.cs (UnaryMutator): Share more code.
16990 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16991 down: I was not tracking the Filter function as well, which
16992 was affecting the results of the cache.
16994 2002-05-15 Miguel de Icaza <miguel@ximian.com>
16996 * attribute.cs: Remove the hack to handle the CharSet property on
16999 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17001 * attribute.cs (DoResolve): More uglyness, we now only try to
17002 resolve the attribute partially, to extract the CharSet
17003 information (only if we are a StructLayout attribute). Otherwise
17005 (GetExtraTypeInfo): Add some code to conditionally kill in the
17006 future this. I am more and more convinced that the .NET
17007 framework has special code to handle the attribute setting on
17010 * expression.cs (IsParamsMethodApplicable): Revert my previous
17011 foreach change here, it was wrong.
17013 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17015 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17016 (pp_expr): do not abort on unknown input, just return.
17017 (eval): abort if there are pending chars.
17019 * attribute.cs (Attribute.Resolve): Positional parameters are
17020 optional. Deal with that case.
17022 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17023 the Ansi/Unicode/Auto information for the type.
17025 (TypeContainer.DefineType): instantiate the EmitContext here, as
17026 we will be using it during the type definition (to resolve
17027 attributes) and during the emit phase.
17029 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17030 to pull type information out of the attributes
17032 (Attribute.Resolve): track the constructor builder, and allow for
17033 multiple invocations (structs and classes will use this).
17035 * ecore.cs (MemberLookupFinal): new version with all the
17036 parameters customizable.
17038 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17039 constructors. Return if the result value is null (as the error
17040 would have been flagged already by MemberLookupFinal)
17042 Do not allow instances of abstract classes or interfaces to be
17045 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17046 We have to compare the assembly property here when dealing with
17047 FamANDAssem and Assembly access modifiers, because we might be
17048 creating an assembly from *modules* (that means that we are not
17049 getting TypeBuilders for types defined in other modules that are
17050 part of this assembly).
17052 (Method.Emit): If the method is marked abstract and has a body,
17055 (TypeContainer.DefineMembers): If both the defined member and the
17056 parent name match are methods, then do not emit any warnings: let
17057 the Method.Define routine take care of flagging warnings. But if
17058 there is a mismatch (method overrides something else, or method is
17059 overriwritten by something, then emit warning).
17061 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17062 set to null, this means `do not check for the return type on the
17065 (Method.Define): set the return type for the method signature to
17066 null, so that we get methods with the same name and parameters and
17067 different return types. This is used to flag warning 114 (you are
17068 hiding a method, and you probably want to use the new/override
17071 * typemanager.cs (MemberLookup): Implemented proper access
17072 control, closing a long standing set of bug reports. The problem
17073 was that the Framework only has two bits: Public and NonPublic,
17074 and NonPublic includes private and protected methods, but we need
17075 to enforce the FamANDAssem, FamOrAssem and Family.
17077 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17079 * statement.cs (GotoCase): Return true: Ammounts to giving up
17080 knowledge on whether we return or not, and letting the other case
17081 be responsible for it.
17083 2002-05-10 Miguel de Icaza <miguel@ximian.com>
17085 * driver.cs: Do not load directories for each file processed, only
17086 do it if there is a pattern.
17088 * ecore.cs: Report readonly assigns here as well, as we might have
17089 been resolved only by MemberAccess.
17091 (SimpleName.SimpleNameResolve): Also be useful for LValue
17092 resolution. We need this to propagate assign to local readonly variables
17094 * typemanager.cs: Use a ptrhashtable for the criteria, because we
17095 do not want to reuse potential criteria memory.
17097 * class.cs (MyEventBuilder): Set reflected_type;
17099 * ecore.cs (Constantify): Added support for constifying bools.
17101 (RootContext.LookupType): Added a cache for values looked up in
17102 the declaration space.
17104 * typemanager.cs (FindMembers): Now is a front-end to
17105 RealFindMembers, and provides a two-level hashtable-based cache to
17108 15% performance improvement: from 22.5 to 19.2 seconds.
17110 * expression.cs (IsParamsMethodApplicable): use foreach.
17111 (Invocation.DoResolve): ditto.
17112 (New.DoResolve): ditto.
17113 (ArrayCreation.DoResolve): ditto.
17115 * ecore.cs (FindMostEncompassingType): use foreach.
17117 * delegate.cs (NewDelegate.DoResolve): Use foreach
17119 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17120 (RemoveMethods): use foreach.
17122 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17123 nested foreach statements instead of for, and also break out of
17124 the inner loop once a match is found.
17126 (Invocation.OverloadResolve): Use foreach, simplify the code.
17128 2002-05-08 Miguel de Icaza <miguel@ximian.com>
17130 * cfold.cs (BinaryFold): During an enumeration evaluation context,
17131 we actually unwrap the expression to allow for extra information
17134 * expression.cs: Use Shr_Un on unsigned operations.
17136 2002-05-08 Ravi Pratap <ravi@ximian.com>
17138 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
17139 applicable operators was not being considered correctly. This closes
17140 the bug Miguel reported.
17142 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17144 * attribute.cs: check that the type derives from System.Attribute
17145 and report the correct error in that case (moved the duplicate code to
17146 its own method, too).
17148 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17150 * attribute.cs: lookup attribute type name as the spec says: first the
17151 bare attribute name and then name + "Attribute" (nant compiles with
17152 mcs after this fix).
17154 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17156 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17157 Because of the way we parse things, we should try to see if a
17158 UIntConstant can fit in an integer.
17160 2002-05-07 Ravi Pratap <ravi@ximian.com>
17162 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17163 when we are in an explicit context.
17165 (ConvertReferenceExplicit): When converting from Iface type S to Class
17166 T make sure the rules are implemented as an OR.
17168 * parameter.cs (ParameterType): Make it a property for now although the
17169 purpose really isn't anything immediate.
17171 * expression.cs (Is*Applicable): Do better checking on the parameter type
17172 of a ref/out parameter. The ones from the system assemblies are already
17173 marked with the correct type so we don't need to do any correction.
17175 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17176 the object type is standard too so include that.
17178 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17180 * ecore.cs (StandardConversionExists): Augment with missing code:
17181 deal with IntConstant, LongConstants and Enumerations.
17183 * assign.cs: Report the error, instead of failing silently
17185 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17186 typecontainer that they are declared, because the
17187 typecontainer/namespace will have the list of using clauses that
17188 need to be applied.
17190 Assembly Attributes were escaping the normal registration
17193 (EmitCode): Apply attributes within an EmitContext that represents
17194 the container they were declared on.
17196 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17198 2002-05-06 Ravi Pratap <ravi@ximian.com>
17200 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17201 Revamp completely - make much cleaner as we now operate only
17204 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17205 to implement the logic detailed in the spec more correctly.
17207 (UserDefinedConversion): Update accordingly.
17209 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17211 * statement.cs: Return flow analysis information up.
17213 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17216 (token): Do not consume an extra character before calling
17219 2002-05-06 Piers Haken <piersh@friskit.com>
17221 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17223 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17225 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17226 EmitContext during the instance constructor initializer
17227 resolution, to stop access to instance variables.
17229 This is mandated by the spec, last paragraph of the `constructor
17230 initializers' section.
17232 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17234 * cs-parser.jay, class.cs (Accessor): new class used to represent
17235 an accessor (get or set). In the past we used `null' to represent
17236 a missing accessor. But this is ambiguous because there was no
17237 way to tell in abstract indexers/properties if one of them was
17240 Now there is a way of addressing that.
17242 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17243 instead of FindMembers.
17245 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17246 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17248 * attribute.cs: Treat indexers and properties as the same in terms
17249 of applying attributes
17251 * ecore.cs (FindMostEncompassedType): Use statically initialized
17252 EmptyExpressions()s like we do elsewhere to avoid creating useless
17253 objects (and we take this out of the tight loop).
17255 (GetConversionOperators): Move the code to extract the actual
17256 operators to a separate routine to clean things up.
17258 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17260 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17261 events are always registered FieldBuilders.
17263 * class.cs (FieldBase): New class shared by Fields
17265 * delegate.cs: If we are a toplevel delegate, use our full name.
17266 If we are a nested delegate, then only use our tail name.
17268 2002-05-02 Ravi Pratap <ravi@ximian.com>
17270 * expression.cs (IsApplicable): Ensure that we add the "&" to
17271 ref/out types before comparing it with the type of the argument.
17273 (IsParamsMethodApplicable): Ditto.
17275 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17278 * delegate.cs : Handle the case when we have more than one applicable
17279 method. Flag an error only when we finish checking all.
17281 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17283 * expression.cs: Add support for boolean static initializers.
17285 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17287 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17289 * parameter.cs (ComputeParameterTypes,
17290 ComputeAndDefineParameterTypes): Better error handling: now we
17291 clear the `types' cache if we fail during any of the type lookups.
17292 We also return the status code correctly to our caller
17294 * delegate.cs: If we fail to define a delegate, abort the extra
17297 * expression.cs (Binary.ResolveOperator): for
17298 operator==(object,object) and operator !=(object, object) we also
17299 have to verify that there is an implicit conversion from one to
17302 (ArrayAccess.DoResolve): Array Access can operate on
17305 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17307 * assign.cs (CompoundAssign): A new class used as a "flag" that
17308 the assignment actually is happening as part of a compound
17309 assignment operator.
17311 During compound assignment, a few new rules exist to enable things
17318 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17319 to the type of x) if y is implicitly convertible to the type of x,
17320 and the operator is a builtin operator and the return type of the
17321 operator is explicitly convertible to the type of x.
17323 * rootcontext.cs: Reset warning level to 2. 4 catches various
17324 "interesting" features in mcs, we must clean this up at some
17325 point, but currently am trying to kill other bugs ;-)
17327 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17328 in container classes as well.
17330 * expression.cs (Binary.ResolveOperator): Handle string case
17331 before anything else (as operator overloading does emit an error
17332 before doing anything else).
17334 This code could go away when we move to a table driven model, but
17335 i could not come up with a good plan last night.
17337 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17339 * typemanager.cs (CSharpName): reimplementation using regex.
17340 * class.cs: added null check for fields in Emit
17341 * rootcontext.cs: set warninglevel to 4
17343 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17345 * typemanager.cs (CSharpName): reimplemented with Lupus
17348 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17350 * statement.cs (If): correclty implement Resolve, because we were
17351 not catching sem errors in there. The same process is needed
17353 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17356 (Statement.Warning_DeadCodeFound): Factorize code.
17357 (While): Report dead code here too.
17359 (Statement): Added Resolve virtual method to allow
17360 for resolution split from the emit code.
17362 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17364 * statement.cs (EmitBoolExpression): No longer try to resolve the
17366 (MakeBoolean): New utility function that resolve, implicitly
17367 converts to boolean and tags the expression.
17370 (If, Do): Implement dead code elimination.
17371 (While): Implement loop inversion
17373 (Do, While, For, If): Resolve the expression prior to calling our
17376 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17379 - added method Report28 (warning: program has more than one entry point)
17380 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17381 - modified method Method.Define, the part at the end of the method
17383 * rootcontext.cs: added static public Location EntryPointLocation;
17385 * ../errors/cs0028.cs : Add test case for the above warning.
17388 - modified method CSharpName to allow arrays of primitive type to
17389 be printed nicely (e.g. instead of System.Int32[][] it now prints
17391 - added method CSharpSignature: returns the signature of a method
17392 in string format to be used in reporting errors, warnings, etc.
17394 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17397 2002-04-26 Ravi Pratap <ravi@ximian.com>
17399 * delegate.cs (Define): Fix extremely silly bug where I was
17400 setting the type of the 'object' parameter of the BeginInvoke
17401 method to System.IAsyncResult instead of System.Object ;-)
17403 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17405 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17408 (Constructor.Emit): return if we fail to initialize the
17409 constructor. Another door closed!
17411 * expression.cs (New.DoResolve): Improve error message (from -6 to
17412 1501). Use DeclaredOnly lookup to find the exact constructor.
17414 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17415 loop. This is useful.
17417 * cs-parser.jay: Adjust the default parameters so that destructors
17418 have the proper signature.
17420 2002-04-26 Martin Baulig <martin@gnome.org>
17422 * driver.cs (LoadAssembly): If `assembly' contains any characters
17423 which are only valid in path names and not in assembly names
17424 (currently slash, backslash and point), use Assembly.LoadFrom ()
17425 instead of Assembly.Load () on the `assembly' (before iteration
17426 over the link_paths).
17428 2002-04-26 Martin Baulig <martin@gnome.org>
17430 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17432 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17434 * class.cs (Property): use the new typemanager.MemberLookup
17436 (TypeContainer.MemberLookup): Implement using the
17437 TypeManager.MemberLookup now.
17439 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17440 and return MemberInfos, so that these can be used without an
17441 EmitContext (what we had before).
17443 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17445 * expression.cs: Fix the case where the argument to params if the
17446 type of the params. I omitted handling this before. Fixed
17448 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17450 * driver.cs: Call BootCorlib_PopulateCoreType
17452 * class.cs (Property.CheckBase): Check for properties only, not
17455 * interface.cs: Temporary hack: try/catch around the
17456 CustomAttributeBuilder, because I am getting an exception that I
17459 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17460 types whose definitions are required to be there (attributes are
17461 defined before standard types).
17463 Compute definitions as we boot the various types, as they are used
17464 immediately (value_type class will need object_type, but if we do
17465 not initialize object_type, we will pass a null, which will let
17466 the runtime pick the System.Object from the existing corlib, which
17467 is not what we want).
17469 2002-04-22 Patrik Torstensson <totte@labs2.com>
17471 * cs-tokenizer.cs: fixed a number of trim() issues.
17473 2002-04-22 Ravi Pratap <ravi@ximian.com>
17475 * expression.cs (Argument.Type): Ensure that we return the correct
17476 type when we have out or ref parameters [in which case we
17479 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17481 * class.cs (Property, Indexer): Allow extern modifier in there.
17483 * typemanager.cs (InitBaseTypes): Initializes object_type and
17484 value_type, since those will be used early on during the bootstrap
17485 process to compile corlib.
17487 (InitCoreTypes): Move code from here to InitBaseTypes.
17489 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17491 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17492 single-dimension arrays as using the ldlen opcode.
17494 Daniel Lewis discovered this optimization.
17496 * typemanager.cs: Add signature for System.Array::get_Length
17498 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17500 * statement.cs: report the error when the foreach does not apply to an
17501 array nor a collection.
17503 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17505 * expression.cs: Add implicit conversions to the operator ~.
17507 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17509 * typemanager.cs: Locate the decimal constructor.
17511 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17513 * attribute.cs: use the new property of TypeOf.
17514 * expression.cs: added 'get' property around typearg.
17516 These changes fix a build breaker reported by NickD. Is this the
17517 correct way to fix? If not, please, revert my changes and make it
17520 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17522 * attribute.cs: Add support for typeof in attribute invocations.
17523 I am not sure that this is right though.
17525 2002-04-14 Duncan Mak <duncan@ximian.com>
17527 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17528 Binary.Operator.Division case.
17530 2002-04-13 Ravi Pratap <ravi@ximian.com>
17532 * class.cs (DefineType): Ensure that we do a proper check on
17533 attribute types and also register it with the TypeManager.
17535 (TypeContainer.Targets): The default for attribute types is
17536 AttributeTargets.All.
17538 * attribute.cs (ApplyAttributes): Registering the attribute type
17539 is done elsewhere, not when we discover we have a Usage attribute.
17541 2002-04-12 Ravi Pratap <ravi@ximian.com>
17543 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17544 and get rid of is_delegate parameter.
17546 * everywhere : update.
17548 2002-04-12 Ravi Pratap <ravi@ximian.com>
17550 * cs-parser.jay (compilation_unit): Revamp completely to use
17551 some new ideas that I got from Rhys' grammar to solve the problems
17552 with assembly level attributes.
17554 (outer_declaration): New grammar production.
17556 (attribute_sections): Add.
17558 (opt_attributes): Base on attribute_sections
17560 (namespace_declaration): Allow opt_attributes to tackle the case
17561 when we have assembly level attributes - we are clever in this
17564 * attribute.cs (ApplyAttributes): Do not worry about assembly
17565 attributes in the non-global context.
17567 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17568 instead of SetGlobalAttributes.
17570 * class.cs, rootcontext.cs : Ensure we define and generate
17571 attribute types before anything else.
17573 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17574 and flag the new error -20 for the case when the attribute type
17575 does not have valid targets specified. csc does not catch this.
17577 * ../errors/errors.txt : update for error # -20
17579 2002-04-11 Ravi Pratap <ravi@ximian.com>
17581 * support.cs (InternalParameters.ParameterModifier): Do some null
17582 checking and return sane values.
17584 * class.cs (Method.Define): If we are a PInvoke method, ensure
17585 that we are static and extern. Report error # 601
17587 * ../errors/cs0601.cs : Add test case for the above error.
17589 2002-04-07 Ravi Pratap <ravi@ximian.com>
17591 * rootcontext.cs (attribute_types): We need to keep type of
17592 all attribute types separately and emit code for them first.
17594 (RegisterAttribute) : Implement.
17596 * class.cs (DefineType): Check if the current Type is a custom
17597 attribute type and register it accordingly.
17599 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17600 adding the first attribute twice and rename to
17602 (SetGlobalAttributes): this.
17604 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17607 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17608 if we are processing global arguments. Hmm, I am unsure of this.
17610 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17612 * expression.cs: added static array of strings to avoid calling
17613 Enum.ToString () for Operator in Binary. Significant recover of
17616 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17618 * class.cs (FindMembers): Allow the Builders of the various
17619 members to be null. If they are skip them. This only happens
17620 during the PInvoke declaration.
17622 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17624 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17625 failure, so we do not keep going afterwards.
17627 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17628 wanted to pass `false' as the `is_delegate' argument. If this is
17629 the case, why not use delegate_type == null to mean `is_delegate =
17630 false' and anything else as is_delegate = true.
17632 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17634 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17635 code for the section, not the beginning of the tests.
17637 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17639 * cfold.cs: Handle operator + (Enum x, Underlying x)
17641 * expression.cs (Binary): same. Warn about errors where we have
17642 Enum/Enum in operator + as well.
17644 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17647 - added support for switch(bool)
17648 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17649 - add TableSwitchEmit() to handle table-based switch statements
17651 2002-04-05 Ravi Pratap <ravi@ximian.com>
17653 * expression.cs (Invocation.OverloadResolve): Factor out code which
17654 does parameter compatibility checking with arguments so that we can
17655 re-use the code even from Delegate.VerifyApplicability
17657 (VerifyArgumentsCompat): Move above code here.
17659 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17660 and instead make a call to the above method.
17662 2002-03-31 Ravi Pratap <ravi@ximian.com>
17664 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17665 We use it to keep track of classes which are attribute types.
17667 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17669 * delegate.cs (Delegate.Define): Correctly define the types in the
17670 presence of fixed and array parameters.
17672 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17675 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17676 include NonPublic after the first iteration.
17678 * class.cs (Indexer.CheckBase): Only check if both parents are
17681 * cs-parser.jay (accessor_body): If empty, set to null.
17683 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17684 same code path here to resolve constants names that we did have in
17685 MemberAccess.DoResolve. There is too much code duplicated here.
17687 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17689 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17691 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17694 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17695 tokens, numbers and strings.
17697 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17700 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17701 asyncronous parameters and the regular parameters.
17703 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17704 specify the target directory.
17706 * expression.cs: (This.DoResolve): Simplify
17707 (As.Emit): Optimize, do not generate IsInst if the expression is
17708 always of the given type.
17710 (Is.DoResolve): Bug fix, we were reporting both always/never for
17713 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17714 creating too many unnecessary arrays.
17716 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17718 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17719 fields instead of rolling our own initializer. Takes care of all
17720 implicit conversions, and drops unnecessary static checks/argument.
17722 2002-03-31 Dick Porter <dick@ximian.com>
17724 * driver.cs: use the GetDirectories() return values properly, and
17725 use "/" as path separator.
17727 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17729 * expression.cs (Unary): Optimize - - expr into expr.
17730 (Binary): Optimize a + (-b) into a -b.
17732 * codegen.cs (CodeGen): Made all methods static.
17734 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17738 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17739 TypeBuilder property.
17741 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17744 * tree.cs: Removed the various RecordXXXX, and replaced with a
17745 single RecordDecl. Removed all the accessor methods, and just
17746 left a single access point Type
17748 * enum.cs: Rename DefineEnum to DefineType.
17750 * decl.cs: New abstract method `DefineType' used to unify the
17751 Defines for Enumerations, Interfaces, TypeContainers and
17754 (FindType): Moved LookupInterfaceOrClass here. Moved the
17755 LookupBaseClasses method that used to live in class.cs and
17756 interface.cs here, and renamed to FindType.
17758 * delegate.cs: Implement DefineType. Take advantage of the
17759 refactored pattern for locating the parent builder without taking
17760 the parent_builder argument (which we know does not work if we are
17761 nested, and triggering a toplevel definition).
17763 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17765 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17766 accessibility of a member has changed during override and report
17769 * class.cs (Method.Define, Property.Define): Only complain on
17770 overrides if the method is private, any other accessibility is
17771 fine (and since we just checked the permission is the same, we are
17774 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17775 and elif are processed always. The other pre-processing
17776 directives are only processed if we are "taking" the path
17778 2002-03-29 Martin Baulig <martin@gnome.org>
17780 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17781 current location is not Null.
17783 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17784 a separate method so we can profile it.
17786 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17787 `span.Seconds' are just seconds, but no minutes or hours.
17788 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17790 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17792 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17793 Remove the gratuitous set of Final:
17795 // If an interface implementation, then we can set Final.
17796 if (((flags & MethodAttributes.Abstract) == 0) &&
17797 implementing.DeclaringType.IsInterface)
17798 flags |= MethodAttributes.Final;
17800 I do not know what I was smoking when I used that.
17803 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17804 step into fixing the name resolution issues for delegates and
17805 unifying the toplevel name resolution.
17807 2002-03-28 Martin Baulig <martin@gnome.org>
17809 * class.cs (Method.Emit): If we have a symbol writer, call its
17810 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17811 tell it about the current method.
17813 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17814 writer that we're going to emit the first byte of IL code for a new
17815 statement (a new source line).
17816 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17817 EmitContext.Mark() before emitting any code.
17819 * location.cs (SymbolDocument): Return null when we're Null.
17821 * statement.cs (Statement): Moved the `Location loc' variable here.
17822 (Statement.EmitBoolExpression): If we have a symbol writer, call
17823 ec.Mark() before emitting any code to tell it that we're at the
17824 beginning of a new statement.
17825 (StatementExpression): Added `Location' argument to the constructor.
17826 (Block): Added public readonly variable `StartLocation' and public
17827 variable `EndLocation'. The latter is to be set using SetEndLocation().
17828 (Block): Added constructor which takes a start and end location.
17829 (Block.SetEndLocation): New method. This sets the end location.
17830 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17831 local variables we create.
17832 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17833 each statement and do also mark the begin and end of the block.
17835 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17836 tell it the current lexer.Location, use Location.Null for the end of the
17838 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17839 current block, set its end location using SetEndLocation().
17840 (statement_expression): StatementExpression constructor now takes the
17841 lexer.Location as additional argument.
17842 (for_statement, declare_local_variables): Likewise.
17843 (declare_local_variables): When creating a new implicit block, use the
17844 new Block constructor and pass it the lexer.Location.
17846 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17848 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17849 members also on the parent interfaces recursively.
17851 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17853 * report.cs: Use new formats, since Gonzalo finished the missing
17856 * expression.cs (Binary.ResolveOperator): added missing operator|
17857 operator& and operator^ for bool/bool.
17859 * cs-parser.jay: CheckDef now takes a Location argument that is
17860 used to report errors more precisly (instead of reporting the end
17861 of a definition, we try to track something which is a lot closer
17862 to the source of the problem).
17864 * cs-tokenizer.cs: Track global token use, so we can properly flag
17865 the use of #define/#undef after the first token has been seen.
17867 Also, rename the reportXXXX to Error_DescriptiveName
17869 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17870 TypeContainer, so that Enum and Interface can use this too.
17872 * class.cs (TypeContainer.LookupInterfaceOrClass,
17873 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17874 `builder' argument. Typically this was used to pass the parent
17875 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17878 The problem is that a nested class could trigger the definition of
17879 a toplevel class, and the builder would be obviously wrong in that
17882 So we drop this argument, and we compute dynamically the
17883 TypeBuilder/ModuleBuilder (the correct information was available
17884 to us anyways from DeclSpace.Parent)
17886 * interface.cs (Interface.DefineInterface): Drop builder
17887 parameter cleanup like class.cs
17889 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
17892 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17895 (Try.Emit): Propagate the returns value from the statement.
17897 (Return.Emit): Even if we are leavning
17899 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17901 * modifiers.cs: Fix the computation of MethodAttributes flags.
17903 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17905 * driver.cs: allow compilation of files that start with '/'.
17906 Add a default case when checking the argument of --target.
17908 2002-03-25 Miguel de Icaza <miguel@ximian.com>
17910 * interface.cs: Implement the same search algorithm for types in
17911 the interface code.
17913 * delegate.cs: Do not allow multiple definition.
17915 * Recovered ChangeLog that got accidentally amputated
17917 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17919 * rootcontext.cs: Load manually enum to allow core classes to
17920 contain enumerations.
17922 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17923 Update to new static methods in TypeManager.
17925 * typemanager.cs (GetMethod, GetConstructor): Use our
17926 implementation of FindMembers to find the members, since during
17927 corlib compilation, the types are TypeBuilders and GetMethod and
17928 GetConstructor do not work.
17930 Make all methods in TypeManager static.
17932 (InitCodeHelpers): Split the functionality from
17933 the InitCodeTypes function.
17935 * driver.cs: Call InitCodeHelpers after we have populated the
17938 * cs-parser.jay (delegate_declaration): we did not used to compute
17939 the delegate name correctly for void delegates.
17941 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17943 * rootcontext.cs (RootContext): Init the interface_resolve_order
17944 and type_container_resolve_order always.
17946 (ResolveCore, BootstrapCorlib_ResolveClass,
17947 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17948 compiler when compiling with --nostdlib
17950 * class.cs (TypeContainer.DefineType): Check that our parent is
17951 not null. This test is most important when we are bootstraping
17954 * codegen.cs: Split out the symbol writing code.
17956 2002-03-25 Martin Baulig <martin@gnome.org>
17958 * driver.cs (-g): Made -g an alias for --debug.
17960 2002-03-24 Martin Baulig <martin@gnome.org>
17962 * codegen.cs (SymbolWriter): New public variable. Returns the
17963 current symbol writer.
17964 (CodeGen): Added `bool want_debugging_support' argument to the
17965 constructor. If true, tell the ModuleBuild that we want debugging
17966 support and ask it for the ISymbolWriter.
17967 (Save): If we have a symbol writer, call it's Close() method after
17968 saving the assembly.
17970 * driver.c (--debug): New command line argument to create a
17971 debugger information file.
17973 * location.cs (SymbolDocument): New public property. Returns an
17974 ISymbolDocumentWriter object for the current source file or null
17975 if we don't have a symbol writer.
17977 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17979 * driver.cs (LoadAssembly): Correctly return when all the paths
17980 have been tried and not before.
17982 * statement.cs (Switch.Emit): return the actual coverage for this
17983 statement (returns/not-returns)
17985 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17986 switch of the statement if we are the last switch section. That
17987 kills two problems: try/catch problems (we used to emit an empty
17988 nop at the end) and switch statements where all branches would
17991 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17993 * driver.cs: Add default assemblies (the equivalent to the
17994 Microsoft CSC.RSP file)
17996 * cs-tokenizer.cs: When updating `cols and setting it to zero,
17997 also update tokens_seen and set it to false.
17999 * driver.cs: Implement --recurse for Mike.
18001 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18002 correctly splitting out the paths.
18004 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18006 * interface.cs (Interface.PopulateProperty): Instead of using
18007 `parent' as the declaration space for the set parameters, use
18010 * support.cs (InternalParameters): InternalParameters constructor
18011 takes a DeclSpace instead of a TypeContainer.
18013 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18014 types are being initialized, load the address of it before calling
18017 (New): Provide a mechanism to disable the generation of local
18018 value type temporaries when the caller will be providing us with
18019 an address to store it.
18021 (ArrayCreation.EmitDynamicInitializers): Use it.
18023 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18025 * expression.cs (Invocation.EmitArguments): Only probe for array
18026 property if there is more than one argument. Sorry about that.
18028 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18029 empty param arrays.
18031 * class.cs (Method.LabelParameters): Fix incorrect code path that
18032 prevented the `ParamArrayAttribute' from being applied to the
18035 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18037 * support.cs (ReflectionParameters): Correctly compute whether the
18038 last argument is a params array. Fixes the problem with
18041 * typemanager.cs: Make the assemblies array always be non-null
18042 (empty, but non-null)
18044 * tree.cs (RecordDecl): New function that abstracts the recording
18045 of names. This reports error 101, and provides a pointer to the
18046 previous declaration. Fixes a crash in the compiler.
18048 * cs-parser.jay (constructor_declaration): Update to new grammar,
18049 and provide a constructor_body that can be empty.
18051 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18053 * driver.cs: Add support for --resources.
18055 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18056 Make all types for the various array helper methods be integer.
18058 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18059 CheckState to ConvCast.
18061 (ConvCast): Now it takes a `checked' state argument, to avoid
18062 depending on the emit context for the conversion, and just using
18063 the resolve time setting.
18065 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18066 instead of Invocation.EmitArguments. We do not emit the original
18067 arguments, instead we emit those which have been converted to
18068 unsigned int expressions.
18070 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18072 * codegen.cs: ditto.
18074 * expression.cs (LocalVariableReference): Drop the use of the
18075 Store function that depended on the variable index.
18077 * statement.cs (VariableInfo): Drop the `Idx' property from this
18078 class, as this is not taking into account the indexes for
18079 temporaries tat we generate during the execution, getting the
18082 * class.cs: First emit class initializers, then call the parent
18085 * expression.cs (Binary): Fix opcode emision.
18086 (UnaryMutator.EmitCode): Support checked code generation
18088 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18089 matches for events for both the Static and Instance scans,
18090 pointing to the same element. Fix that.
18092 2002-03-14 Miguel de Icaza <miguel@ximian.com>
18094 * rootcontext.cs (ResolveTree): Always set the
18095 interface_resolve_order, because nested interfaces will be calling
18098 * class.cs (GetInterfaceOrClass): Track the same resolution
18099 process used by TypeManager.LookupType. This fixes the nested
18100 type lookups in class declarations (separate path from
18103 (TypeContainer.DefineType): Also define nested interfaces.
18104 (TypeContainer.RegisterOrder): New public function used to
18105 register the order in which child interfaces need to be closed.
18107 Nested interfaces need to be closed after their parents have been
18110 * interface.cs (InterfaceAttr): Put all the logic for computing
18111 the interface attribute here.
18113 (DefineInterface): Register our interface order with the
18114 RootContext or with the TypeContainer depending on the case.
18116 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18118 * cs-parser.jay: rework foreach statement to work with the new
18119 changes to the policy on SimpleNames.
18121 * report.cs: support Stacktrace on warnings as well.
18123 * makefile: drop --unsafe and /unsafe from the compile.
18125 2002-03-13 Ravi Pratap <ravi@ximian.com>
18127 * ecore.cs (StandardConversionExists): Modify to take an Expression
18128 as the first parameter. Ensure we do null -> reference type conversion
18131 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18132 temporary Expression objects.
18134 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18136 * interface.cs: workaround bug in method overloading resolution
18137 (there is already a bugzilla bug for it).
18139 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18141 We could also solve this problem by having a separate path for
18142 performing type lookups, instead of DoResolve, we could have a
18143 ResolveType entry point, and only participating pieces of the
18144 production (simplename, deref, array) would implement this.
18146 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18147 signal SimpleName to only resolve type names and not attempt to
18148 resolve anything else.
18150 * expression.cs (Cast): Set the flag.
18152 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18154 * class.cs: Only report 108 if there is no `new' modifier.
18156 * cs-parser.jay: rework foreach statement to work with the new
18157 changes to the policy on SimpleNames.
18159 * report.cs: support Stacktrace on warnings as well.
18161 * makefile: drop --unsafe and /unsafe from the compile.
18163 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18165 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18166 lookups here, instead of doing that at parse time. This means
18167 that our grammar will not introduce `LocalVariableReferences' as
18168 expressions at this point. That solves the problem of code like
18172 static void Main ()
18176 This is only half the fix. The full fix requires parameters to
18177 also be handled in this way.
18179 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18180 makes the use more obvious of the DeclSpace. The
18181 ec.TypeContainer.TypeBuilder is now only used to pull the
18182 TypeBuilder for it.
18184 My theory is that I can get rid of the TypeBuilder completely from
18185 the EmitContext, and have typecasts where it is used (from
18186 DeclSpace to where it matters).
18188 The only pending problem is that the code that implements Aliases
18189 is on TypeContainer, and probably should go in DeclSpace.
18191 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18192 lookups here, instead of doing that at parse time. This means
18193 that our grammar will not introduce `LocalVariableReferences' as
18194 expressions at this point. That solves the problem of code like
18198 static void Main ()
18202 This is only half the fix. The full fix requires parameters to
18203 also be handled in this way.
18205 * class.cs (Property.DefineMethod): When implementing an interface
18206 method, set newslot, when implementing an abstract method, do not
18207 set the flag (before we tried never setting it, or always setting
18208 it, which is the difference).
18209 (Indexer.DefineMethod): same.
18210 (Method.DefineMethod): same.
18212 * ecore.cs: Only set the status used flag if we get back a Field.
18214 * attribute.cs: Temporary hack, so Paolo can keep working.
18216 2002-03-08 Ravi Pratap <ravi@ximian.com>
18218 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18219 the unmanaged type in the case we have a MarshalAs attribute.
18221 (Resolve): Handle the case when we are parsing the special MarshalAs
18222 attribute [we need to store the unmanaged type to use later]
18224 * typemanager.cs (marshal_as_attr_type): Built in type for the
18225 MarshalAs Attribute.
18227 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18228 on parameters and accordingly set the marshalling info.
18230 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18232 * class.cs: Optimizing slightly by removing redundant code after
18233 we switched to the `NoTypes' return value.
18234 (Property.DefineMethod): use NoTypes here too.
18236 This fixes the bug I introduced in my last batch of changes.
18238 2002-03-05 Ravi Pratap <ravi@ximian.com>
18240 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18242 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18243 Enums since those are types too.
18245 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18247 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18248 thanks to a call during the lookup process.
18250 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18252 * statement.cs (Foreach): Lots of work to accomodate a particular
18253 kind of foreach statement that I had not kept in mind. It is
18254 possible to have foreachs on classes that provide a GetEnumerator
18255 method that return objects that implement the "pattern" for using
18256 a foreach, there is no need to support GetEnumerator
18259 This is needed to compile nant.
18261 * decl.cs: Only report 114 if the member is not `Finalize' and if
18262 the warning level is at least 2.
18264 * class.cs: Moved the compare function from Method to
18267 (MethodSignature.InheritableMemberSignatureCompare): Add new
18268 filter function that is used to extract inheritable methods from a
18271 (Method.Define): Use the new `inheritable_method_signature_filter'
18274 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18277 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18279 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18281 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18283 * expression.cs: Pass location information to
18284 ConvertImplicitStandard.
18286 * class.cs: Added debugging code to track return values from
18289 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18291 * expression.cs (Is.DoResolve): If either side of the `is' is an
18292 interface, do not flag the warning.
18294 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18297 * report.cs: Allow for --fatal to be used with --probe.
18299 * typemanager.cs (NoTypes): Move the definition for the empty Type
18302 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18304 (TypeContainer.DefineProxy): New function used to proxy to parent
18305 implementations when implementing interfaces.
18306 (TypeContainer.ParentImplements): used to lookup if our parent
18307 implements a public function that is required by an interface.
18308 (TypeContainer.VerifyPendingMethods): Hook this up.
18310 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18311 `modules' and `assemblies' arraylists into arrays. We only grow
18312 these are the very early start up of the program, so this improves
18313 the speedof LookupType (nicely measured).
18315 * expression.cs (MakeByteBlob): Replaced unsafe code with
18316 BitConverter, as suggested by Paolo.
18318 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18319 folding of string concatenation, but if either side is a string,
18320 and the other is not, then return null, and let the runtime use
18321 the concatenation on the string plus the object (using
18322 `Object.ToString').
18324 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18326 Constant Folding has been implemented now.
18328 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18329 the error instead on types that are not supported in one's
18332 * constant.cs (Constant and all children): New set of functions to
18333 perform implict and explicit conversions.
18335 * ecore.cs (EnumConstant): Implement the new functions to perform
18336 conversion by proxying to the child expression.
18338 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18339 own separate setting that can not be turned off from the command
18340 line using --unchecked or --checked and is only controlled using
18341 the checked/unchecked statements and expressions. This setting is
18342 used by the constant folder to flag errors.
18344 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18345 ConstantCheckState as well.
18347 During Resolve, they also have to flag the state, because the
18348 constant folder runs completely in the Resolve phase.
18350 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18353 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18355 * cfold.cs: New file, this file contains the constant folder.
18357 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18358 argument to track whether we are using the resulting address to
18359 load or store a value and provide better error messages.
18361 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18362 new AddressOf arguments.
18364 * statement.cs (Foreach.EmitCollectionForeach): Update
18366 * expression.cs (Argument.Emit): Call AddressOf with proper
18367 arguments to track usage.
18369 (New.DoEmit): Call AddressOf with new arguments.
18371 (Unary.Emit): Adjust AddressOf call.
18373 2002-03-01 Ravi Pratap <ravi@ximian.com>
18375 * cs-parser.jay (member_access): Change the case for pre-defined types
18376 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18379 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18382 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18383 essentially like methods and apply attributes like MethodImplOptions to them too.
18385 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18388 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18389 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18392 * Update code everywhere accordingly.
18394 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18396 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18398 2002-02-28 Ravi Pratap <ravi@ximian.com>
18400 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18401 try performing lookups against those instead of jumping straight into using
18402 the 'using' clauses.
18404 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18406 (LookupType): Perform lookups in implicit parents too.
18408 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18409 sequence as RootContext.LookupType.
18411 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18412 the various cases of namespace lookups into this method.
18414 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18416 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18417 in positional arguments)
18419 * class.cs (Operator): Update the AllowedModifiers to contain
18422 * cs-parser.jay: Update operator declaration to allow for the
18423 operator body to be empty.
18425 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18428 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18430 * class.cs (Method.Emit): Label parameters.
18432 * driver.cs: Return 1 or 0 as the program exit code.
18434 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18436 * expression.cs: Special case the `null' object when trying to
18437 auto-compute the type, as anything can be explicitly converted to
18440 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18441 spotting this Paolo.
18443 (Expression.ImplicitNumericConversion): Perform comparissions of
18444 the type using the underlying type in the case of an enumeration
18445 rather than using the enumeration type for the compare.
18447 Cope with the underlying == type case, which is not possible to
18450 (Expression.ConvertNumericExplicit): Perform comparissions of
18451 the type using the underlying type in the case of an enumeration
18452 rather than using the enumeration type for the compare.
18454 * driver.cs: If the user does not supply an extension, assume .exe
18456 * cs-parser.jay (if_statement): Rewrote so that we can track the
18457 location for the if statement.
18459 * expression.cs (Binary.ConstantFold): Only concat strings when
18460 the operation is "+", not everything ;-)
18462 * statement.cs (Statement.EmitBoolExpression): Take a location
18464 (If, While, Do): Track location.
18466 * expression.cs (Binary.ResolveOperator): In the object + string
18467 case, I was missing a call to ConvertImplicit
18469 2002-02-25 Ravi Pratap <ravi@ximian.com>
18471 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18472 Location arguments. Ensure we use RootContext.LookupType to do our work
18473 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18475 * interface.cs (PopulateMethod): Handle the type of the parameter being
18478 * expression.cs (Invocation.BetterFunction): Handle the case when we
18479 have a params method with no fixed arguments and a call is made with no
18482 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18484 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18485 the verbatim-string-literal
18487 * support.cs (InternalParameters.ParameterModifier): handle null
18489 (InternalParameters.ParameterType): ditto.
18491 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18492 duplicating the name of the variable parameter.
18493 (GetParameterByName): Fix bug where we were not looking up array
18494 paramters if they were the only present (thanks Paolo!).
18495 (GetParameterInfo): We only have an empty set of types if both
18496 fixed and array are set to null.
18497 (GetParameterInfo-idx): Handle FixedParameter == null
18499 * cs-parser.jay: Handle the case where there is no catch
18500 statements (missing null test).
18502 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18504 * driver.cs (MainDriver): Be conservative on our command line
18507 Catch DirectoryNotFoundException when calling GetFiles.
18509 (SplitPathAndPattern): Used to split the input specification into
18510 a path and a pattern that we can feed to Directory.GetFiles.
18512 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18514 * statement.cs (Fixed): Implement the last case of the Fixed
18515 statement (string handling).
18517 * expression.cs (StringPtr): New class used to return a char * to
18518 a string; Used by the Fixed statement.
18520 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18522 * expression.cs (Binary.ResolveOperator): Remove redundant
18523 MemberLookup pn parent type.
18524 Optimize union call, we do not need a union if the types are the same.
18525 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18528 Specialize the use of MemberLookup everywhere, instead of using
18529 the default settings.
18531 (StackAlloc): Implement stackalloc keyword.
18533 * cs-parser.jay: Add rule to parse stackalloc.
18535 * driver.cs: Handle /h, /help, /?
18537 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18538 before we supported unsafe code.
18540 * makefile: add --unsafe to the self compilation of mcs.
18542 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18544 * expression.cs (PointerArithmetic): New class that is used to
18545 perform pointer arithmetic.
18546 (Binary.Resolve): Handle pointer arithmetic
18547 Handle pointer comparission.
18548 (ArrayPtr): Utility expression class that is used to take the
18549 address of an array.
18551 (ElementAccess): Implement array access for pointers
18553 * statement.cs (Fixed): Implement fixed statement for arrays, we
18554 are missing one more case before we are done.
18556 * expression.cs (Indirection): Implement EmitAssign and set the
18557 ExprClass to Variable. This allows pointer dereferences to be
18558 treated as variables, and to have values assigned to them.
18560 * ecore.cs (Expression.StoreFromPtr): New utility function to
18561 store values dereferencing.
18563 2002-02-20 Ravi Pratap <ravi@ximian.com>
18565 * expression.cs (Binary.ResolveOperator): Ensure that we are
18566 not trying to operate on a void type - this fixes the reported
18569 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18570 the parent implementation is sealed.
18572 * ../errors/cs0239.cs : Add.
18574 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18576 * typemanager.cs (unverifiable_code_type): Corresponds to
18577 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18578 which have unsafe code in them.
18580 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18583 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18585 * cs-tokenizer.cs: Add support for @"litreal strings"
18587 Make tokenizer accept pre-processor directives
18588 on any column (remove the old C-like limitation).
18590 * rootcontext.cs (EmitCode): Emit any global attributes.
18591 (AddGlobalAttributes): Used to keep track of assembly attributes.
18593 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18595 * cs-parser.jay: Add support for global attributes.
18597 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18599 * expression.cs (Indirection): New helper class. Unary will
18600 create Indirection classes to be able to implement the
18601 IMemoryLocation interface on it.
18603 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18605 * cs-parser.jay (fixed_statement): reference the right statement.
18607 * statement.cs (Fixed.Emit): Finish implementing the fixed
18608 statement for the &x case.
18610 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18612 * class.cs (Property.Define, Method.Define): Remove newslot when
18615 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18616 wrong. NewSlot should only be used if the `new' keyword is present.
18618 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18619 locating our system dir. Sorry about this.
18621 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18623 * driver.cs (GetSystemDir): Compute correctly the location of our
18624 system assemblies. I was using the compiler directory instead of
18625 the library directory.
18627 2002-02-13 Ravi Pratap <ravi@ximian.com>
18629 * expression.cs (BetterFunction): Put back in what Miguel commented out
18630 since it is the correct fix. The problem is elsewhere ;-)
18632 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18633 parameters of the parms method are themselves compatible or not !
18635 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18636 to check that a class implements an interface before saying that an implicit
18637 conversion was allowed. Use ImplementsInterface to do the checking.
18639 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18641 * class.cs (Method.Define): Track whether we are an explicit
18642 implementation or not. And only call DefineMethodOverride if we
18643 are an explicit implementation.
18645 (Property.DefineMethod): Ditto.
18647 2002-02-11 Ravi Pratap <ravi@ximian.com>
18649 * expression.cs (BetterFunction): Catch hideous bug which was
18650 preventing us from detecting ambiguous calls due to implicit casts i.e
18653 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18655 * support.cs (Pair): Remove un-needed method. I figured why I was
18656 getting the error in cs-parser.jay, the variable in a foreach loop
18657 is readonly, and the compiler does not really treat this as a variable.
18659 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18660 instead of EQUALS in grammar.
18662 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18664 * expression.cs (Unary.DoResolve): Check whether the argument is
18667 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18669 * support.cs: Api for Pair to set a value. Despite the fact that
18670 the variables are public the MS C# compiler refuses to compile
18671 code that accesses the field if the variable is part of a foreach
18674 * statement.cs (Fixed): Begin implementation of the fixed
18677 (Block.AddVariable): Return the VariableInfo on success and null
18678 on failure instead of true/false.
18680 * cs-parser.jay (foreach): Catch errors on variables already
18681 defined (we were ignoring this value before) and properly unwind
18682 the block hierarchy
18684 (fixed_statement): grammar for the fixed statement.
18686 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18688 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18689 pointer types to be incretemented.
18691 (SizeOf): Implement.
18693 * cs-parser.jay (pointer_member_access): Implement
18694 expr->IDENTIFIER production.
18696 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18697 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18700 (Unary): Implement indirection.
18702 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18703 use in non-unsafe context).
18705 (SimpleName.DoResolve): Check for pointers in field access on safe
18708 (Expression.LoadFromPtr): Factor the load-indirect code in this
18709 function. This was duplicated in UnboxCast and ParameterReference
18711 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18713 * expression.cs (ComposedCast): report an error if a pointer cast
18714 is used in a safe region.
18716 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18717 pointer type casts in unsafe context.
18719 * codegen.cs (EmitContext): Set up IsUnsafe.
18721 * cs-parser.jay (non_expression_type): Add productions for pointer
18724 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18725 code. We should not use force into static mode if the method is
18726 not virtual. Fixes bug in MIS
18728 * statement.cs (Do.Emit, While.Emit, For.Emit,
18729 Statement.EmitBoolExpression): Add support to Do and While to
18730 propagate infinite loop as `I do return' semantics.
18732 Improve the For case to also test for boolean constants.
18734 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18735 to the list of attributes we can add.
18737 Remove `EmitContext' argument.
18739 * class.cs (Method.Define): Apply parameter attributes.
18740 (Constructor.Define): Apply parameter attributes.
18741 (MethodCore.LabelParameters): Move here the core of labeling
18744 * support.cs (ReflectionParameters.ParameterModifier,
18745 InternalParameters.ParameterModifier): Use IsByRef on the type and
18746 only return the OUT bit for these parameters instead of in/out/ref
18749 This is because I miss-understood things. The ParameterInfo.IsIn
18750 and IsOut represent whether the parameter has the [In] and [Out]
18753 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18755 * ecore.cs (FieldExpr.Emit): Release temporaries.
18757 * assign.cs (LocalTemporary.Release): new function.
18759 * codegen.cs (EmitContext.GetTemporaryStorage,
18760 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18761 temporary storage. Now we can "put back" localbuilders when we
18764 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18766 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18767 need to make a copy of the variable to generate verifiable code.
18769 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18771 * driver.cs: Compute dynamically the system directory.
18773 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18774 Slower, but more generally useful. Used by the abstract
18775 registering implementation.
18777 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18778 the rules for the special rule on Type/instances. First check if
18779 we have the same name, and if so, try that special static path
18780 rather than the instance path.
18782 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18784 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18787 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18788 Enum, ValueType, Delegate or Array for non-corlib compiles.
18790 * cs-tokenizer.cs: Catch long identifiers (645)
18792 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18795 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18796 fix, we were returning too early, so we were not registering
18797 pending methods from abstract classes.
18799 Do not register pending methods if the class is abstract.
18801 * expression.cs (Conditional.DoResolve): Report circular implicit
18802 conversions when we neecd to compute it for conditional
18805 (Is.DoResolve): If the expression is always of the provided type,
18806 flag warning 183. If the expression can not ever be of the
18807 provided type flag warning 184.
18809 * class.cs: Catch 169 as well.
18811 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18814 2002-01-18 Nick Drochak <ndrochak@gol.com>
18816 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18818 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18820 * interface.cs: (PopulateMethod): Check for pointers being defined
18821 only if the unsafe context is active.
18822 (PopulateProperty): ditto.
18823 (PopulateIndexer): ditto.
18825 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18826 specified. If pointers are present, make sure that they are
18827 present in an unsafe context.
18828 (Constructor, Constructor.Define): ditto.
18829 (Field, Field.Define): ditto.
18830 (Property, Property.Define): ditto.
18831 (Event, Event.Define): ditto.
18833 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18834 hashtable if there are classes or structs defined.
18836 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18837 code, as the constant resolution moved.
18839 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18840 the metadata, so we can flag error 133.
18842 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18843 pointer is being declared in an unsafe context.
18845 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18847 * modifiers.cs (Modifiers.Check): Require a Location argument.
18848 Report error 227 for Unsafe use.
18850 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18852 * statement.cs (For.Emit): If the test is null, then report that
18853 we do `return', as we wont reach anything afterwards.
18855 (Switch.SwitchGoverningType): Track the expression that matched
18858 * driver.cs: Allow negative numbers as an error code to flag.
18860 * cs-parser.jay: Handle 1551.
18862 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18864 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18866 * cs-parser.jay: Report 1518 (type declaration can only contain
18867 class, struct, interface, enum or delegate)
18869 (switch_label): Report 1523 (keywords `case' or `default' must
18872 (opt_switch_sections): Report 1522 (empty switch)
18874 * driver.cs: Report 1515 (response file specified multiple times)
18875 Report 1516 (Source file specified multiple times).
18877 * expression.cs (Argument.Resolve): Signal 1510
18879 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18880 access not allowed in static code)
18882 2002-01-11 Ravi Pratap <ravi@ximian.com>
18884 * typemanager.cs (IsPointerType): Utility method which we are going
18887 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18888 the object type, so we take care of that.
18890 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18892 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18893 added to non-params parameters :-)
18895 * typemanager.cs (CSharpName): Include 'void' type too.
18897 (void_ptr_type): Include in the set of core types.
18899 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
18902 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
18905 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
18906 completely forgotten about it.
18908 2002-01-10 Ravi Pratap <ravi@ximian.com>
18910 * cs-parser.jay (pointer_type): Add. This begins our implementation
18911 of parsing rules for unsafe code.
18913 (unsafe_statement): Implement.
18915 (embedded_statement): Modify to include the above.
18917 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18919 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18920 if the current context is an unsafe one.
18922 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18923 are handled differently, we need separate rules for them.
18925 (local_variable_declaration): Update to use local_variable_pointer_type
18926 to allow variable declarations of unmanaged pointer types.
18928 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18929 in unsafe contexts.
18931 * ../errors/cs0214.cs : Add.
18933 2002-01-16 Nick Drochak <ndrochak@gol.com>
18935 * makefile: remove 'response' file when cleaning.
18937 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18939 * cs-parser.jay: Report 1524.
18941 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18943 * typemanager.cs (RegisterMethod): drop checking if we have
18944 registered this from here
18946 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18948 * class.cs (Method.EmitDestructor): Implement calling our base
18951 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18952 value of InFinally.
18954 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18955 this routine and will wrap the call in a try/catch block. Deal
18958 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18960 * ecore.cs (Expression.MemberLookup): instead of taking a
18961 parameter `same_type' that was used to tell whether we could
18962 access private members we compute our containing type from the
18965 (FieldExpr): Added partial support for volatile fields. This does
18966 not work for volatile fields exposed from assemblies, as I can not
18967 figure out how to extract the modreq from it.
18969 Updated all the source files to use this.
18971 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18972 because it is referenced by MemberLookup very often.
18974 2002-01-09 Ravi Pratap <ravi@ximian.com>
18976 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18977 TypeBuilder.GetCustomAttributes to retrieve what we need.
18979 Get rid of redundant default_member_attr_type as this is the same as
18980 default_member_type which already exists.
18982 * interface.cs, attribute.cs : Update accordingly.
18984 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18986 * typemanager.cs: Enable IndexerPropertyName again. It does not
18987 work for TYpeBuilders though. Ravi, can you please fix this?
18989 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18991 * expression.cs (Argument.Emit): Handle the case of ref objects
18992 being passed to ref functions;
18994 (ParameterReference.EmitLoad): Loads the content of the pointer
18995 without dereferencing.
18997 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18999 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19001 2002-01-08 Ravi Pratap <ravi@ximian.com>
19003 * class.cs (Indexer.DefineMethod): Incorporate the interface
19004 type in the name of the method if we are doing explicit interface
19007 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19009 (BetterConversion): Fix extremely trivial bug where we were referring to
19010 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19013 * ../errors/bug16.cs : Add although we have fixed it.
19015 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19017 * expression.cs (BaseIndexer): Begin implementation.
19019 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19021 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19022 production directly to remove a shift/reduce, and implement
19023 explicit interface implementation.
19025 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19026 after a floating point suffix.
19028 * expression.cs (DoNumericPromotions): Improved the conversion for
19029 uint/uint. If we have a constant, we avoid doing a typecast to a
19032 * class.cs (Indexer): Implement explicit interface implementation
19035 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19037 * class.cs: make the default instance constructor public and hidebysig.
19039 2001-01-03 Ravi Pratap <ravi@ximian.com>
19041 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19042 so we can call it from elsewhere.
19044 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19045 we emit it internally if the class has a defined indexer; otherwise the user
19046 emits it by decorating the class definition with the DefaultMemberAttribute.
19048 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19049 attribute is not used on a type which defines an indexer.
19051 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19052 character when we skip whitespace.
19054 * ../errors/cs0646.cs : Add.
19056 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19058 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19061 * makefile: Add practical target `mcs3.exe' which builds the third
19062 generation compiler.
19064 * expression.cs (New): Fix structures constructor calling.
19066 * class.cs (Property, Method, Indexer): Emit Final flag on the
19067 method if we are an interface implementation and we are not
19070 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19071 whether this property is referencing a `base' method.
19073 * expression.cs (Invocation.EmitCall): take an extra argument:
19074 is_base, this is used to determine whether the `call' or
19075 `callvirt' opcode should be used.
19078 * delegate.cs: update EmitCall.
19080 * class.cs (Method.Define): Set NewSlot for the cases where we are
19081 not implementing an interface method.
19083 (Property.Define): ditto.
19085 2002-01-02 Miguel de Icaza <miguel@ximian.com>
19087 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19088 'r'. Allows mcs to parse itself fully.
19090 2002-01-02 Ravi Pratap <ravi@ximian.com>
19092 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19093 of the number of initializers that require the InitializeArray method.
19095 (CheckIndices): Store the Expression in all cases - not the plain value. Also
19096 update the above field where necessary.
19098 (MakeByteBlob): Update accordingly.
19100 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
19103 (EmitDynamicInitializers): Update in accordance with the new optimization.
19105 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19106 same OpCode applies.
19108 * cs-parser.jay : Fix some glaring errors I introduced.
19110 2002-01-01 Ravi Pratap <ravi@ximian.com>
19112 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19113 so that we can check for name clashes there too.
19115 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19116 for interface indexers.
19118 * interfaces.cs (Define): Emit the default member attribute.
19120 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19121 variable was being referred to while setting the value ;-)
19123 2002-01-01 Miguel de Icaza <miguel@ximian.com>
19125 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19126 byte-by-byte information when we know the data is zero.
19128 Make the block always a multiple of 4, because
19129 DefineInitializedData has a bug.
19131 * assign.cs: Fix, we should assign from the temporary, not from
19134 * expression.cs (MakeByteBlob): Fix my incorrect code.
19136 2001-12-31 Miguel de Icaza <miguel@ximian.com>
19138 * typemanager.cs (EnumToUnderlying): This function is used to get
19139 the underlying type from an enumeration, because it does not
19142 * constant.cs: Use the I4_S form for values between -128 and 127.
19144 * statement.cs (Block.LookupLabel): Looks up a label.
19145 (Block): Drop support for labeled blocks.
19147 (LabeledStatement): New kind of statement that represents a label
19150 (Goto): Finally implement this bad boy.
19152 * cs-parser.jay: Update to reflect new mechanism to implement
19155 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19157 * codegen.cs (EmitContext.This): a codegen property that keeps the
19158 a single instance of this instead of creating many different this
19161 * delegate.cs (Delegate.DoResolve): Update to use the property;
19163 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19165 * expression.cs (BaseAccess.DoResolve): Ditto.
19167 2001-12-29 Ravi Pratap <ravi@ximian.com>
19169 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19170 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19172 (InitCoreTypes): Update accordingly.
19174 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19175 so we can quickly store the state.
19177 (ApplyAttributes): Set the correct implementation flags
19178 for InternalCall methods.
19180 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19182 * expression.cs (EmitCall): if a method is not virtual, then do
19183 not use callvirt on it.
19185 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19186 user defined stuff) requires the use of stobj, which takes an
19187 address on the stack instead of an array and an index. So emit
19188 the Ldelema operation for it.
19190 (EmitStoreOpcode): Use stobj for valuetypes.
19192 (UnaryMutator.EmitCode): Use the right 1 value depending on
19193 whether we are dealing with int64/uint64, float or doubles.
19195 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19196 constructors that I implemented last night.
19198 (Constructor.IsDefault): Fix to work properly for static
19201 * cs-parser.jay (CheckDef): report method signature errors.
19202 Update error number 103 to be 132.
19204 * decl.cs: New AdditionResult enumeration value: MethodExists.
19205 Although we do this check for methods later on in the semantic
19206 analysis, catching repeated default constructors is so easy that
19207 we catch these here.
19209 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19212 (ParameterReference.EmitAssign, Emit): handle
19215 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19216 (ArrayAccess.EmitStoreOpcode): ditto.
19218 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19220 * expression.cs (MakeByteBlob): Complete all the missing types
19221 (uint, short, ushort, byte, sbyte)
19223 * class.cs: Only init instance field initializers on instance
19226 Rename `constructors' to instance_constructors.
19228 (TypeContainer.AddConstructor): Only add constructors to the list
19229 if it is not static.
19231 Make sure that we handle default_static_constructor independently
19232 everywhere where we handle instance_constructors
19234 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19236 * class.cs: Do not lookup or create a base initializer for a
19237 static constructor.
19239 (ConstructorInitializer.Resolve): use the proper type to lookup
19242 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19244 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19247 * decl.cs: CloseType is now an virtual method, the default
19248 implementation just closes this type.
19250 2001-12-28 Ravi Pratap <ravi@ximian.com>
19252 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19253 to PreserveSig by default. Also emit HideBySig on such methods.
19255 Basically, set the defaults to standard values.
19257 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19258 argument, if candidate is better, it can't be worse than the best !
19260 (Invocation): Re-write bits to differentiate between methods being
19261 applicable in their expanded form and their normal form - for params
19264 Get rid of use_standard everywhere as only standard conversions are allowed
19265 in overload resolution.
19267 More spec conformance.
19269 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19271 * driver.cs: Add --timestamp, to see where the compiler spends
19274 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19275 `this' in static code.
19277 (SimpleName.DoResolve): Implement in terms of a helper function
19278 that allows static-references to be passed upstream to
19281 (Expression.ResolveWithSimpleName): Resolve specially simple
19282 names when called by MemberAccess to implement the special
19285 (Expression.ImplicitReferenceConversion): Handle conversions from
19286 Null to reference types before others, as Null's type is
19289 * expression.cs (Invocation.EmitCall): Handle the special case of
19290 calling methods declared on a reference type from a ValueType
19291 (Base classes System.Object and System.Enum)
19293 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19294 the left hand side is a TypeExpr, not on every enumeration.
19296 (Binary.Resolve): If types are reference types, then do a cast to
19297 object on operators != and == of both arguments.
19299 * typemanager.cs (FindMembers): Extract instance and static
19300 members if requested.
19302 * interface.cs (PopulateProperty): Use void_type instead of null
19303 as the return type for the setter method.
19305 (PopulateIndexer): ditto.
19307 2001-12-27 Ravi Pratap <ravi@ximian.com>
19309 * support.cs (ReflectionParameters): Fix minor bug where we
19310 were examining the wrong parameter for the ParamArray attribute.
19312 Cope with requests for the type of the parameter at position
19313 greater than the params parameter's. We now return the element
19314 type of the params array as that makes more sense.
19316 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19317 accordingly as we no longer have to extract the element type
19320 (Invocation.OverloadResolve): Update.
19322 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19324 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19325 against IEnumerator, test whether the return value is a descendant
19326 of the IEnumerator interface.
19328 * class.cs (Indexer.Define): Use an auxiliary method to implement
19329 the other bits of the method definition. Begin support for
19330 explicit interface implementation.
19332 (Property.DefineMethod): Use TypeManager.void_type instead of null
19333 for an empty return value.
19335 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19337 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19338 dealing with a FieldExpr which is composed of a FieldBuilder, in
19339 the code path we did extract the constant, but we should have
19340 obtained the underlying value to be able to cast it (otherwise we
19341 end up in an infinite loop, this is what Ravi was running into).
19343 (ArrayCreation.UpdateIndices): Arrays might be empty.
19345 (MemberAccess.ResolveMemberAccess): Add support for section
19346 14.5.4.1 that deals with the special case of E.I when E is a type
19347 and something else, that I can be a reference to a static member.
19349 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19350 handle a particular array type to create byte blobs, it is just
19351 something we dont generate byteblobs for.
19353 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19356 * location.cs (Push): remove the key from the hashtable that we
19357 are about to add. This happens for empty files.
19359 * driver.cs: Dispose files after we have parsed them.
19361 (tokenize): new function that only runs the tokenizer on its
19362 input, for speed testing.
19364 2001-12-26 Ravi Pratap <ravi@ximian.com>
19366 * class.cs (Event.Define): Define the private field only if there
19367 are no accessors defined.
19369 * expression.cs (ResolveMemberAccess): If there is no associated
19370 field with the event, that means we have an event defined with its
19371 own accessors and we should flag error cs0070 since transforming
19372 ourselves into a field is not valid in that case.
19374 * ecore.cs (SimpleName.DoResolve): Same as above.
19376 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19377 and charset to sane values.
19379 2001-12-25 Ravi Pratap <ravi@ximian.com>
19381 * assign.cs (DoResolve): Perform check on events only if they
19382 are being accessed outside the declaring type.
19384 * cs-parser.jay (event_declarations): Update rules to correctly
19385 set the type of the implicit parameter etc.
19387 (add_accessor, remove_accessor): Set current local parameters.
19389 * expression.cs (Binary): For delegate addition and subtraction,
19390 cast the return value from the method into the appropriate delegate
19393 2001-12-24 Ravi Pratap <ravi@ximian.com>
19395 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19396 of these as the workaround is unnecessary.
19398 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19399 delegate data - none of that is needed at all.
19401 Re-write bits to extract the instance expression and the delegate method
19404 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19407 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19408 of attaching attributes instead of duplicating code everywhere.
19410 * everywhere : Update code to do attribute emission using the above method.
19412 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19414 * expression.cs (IsParamsMethodApplicable): if there are not
19415 parameters, return immediately.
19417 * ecore.cs: The 0 literal can be implicity converted to an enum
19420 (SimpleName.DoResolve): First lookup the type, then lookup the
19423 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19424 want to get its address. If the InstanceExpression is not
19425 addressable, store the result in a temporary variable, then get
19428 * codegen.cs: Only display 219 errors on warning level or above.
19430 * expression.cs (ArrayAccess): Make it implement the
19431 IMemoryLocation interface.
19433 (Binary.DoResolve): handle the operator == (object a, object b)
19434 and operator != (object a, object b) without incurring into a
19435 BoxedCast (because 5 != o should never be performed).
19437 Handle binary enumerator operators.
19439 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19440 value type, otherwise use Ldelem_ref.
19442 Use precomputed names;
19444 (AddressOf): Implement address of
19446 * cs-parser.jay (labeled_statement): Fix recursive block
19447 addition by reworking the production.
19449 * expression.cs (New.DoEmit): New has a special case:
19451 If we are dealing with a ValueType, we have a few
19452 situations to deal with:
19454 * The target of New is a ValueType variable, that is
19455 easy, we just pass this as the variable reference
19457 * The target of New is being passed as an argument,
19458 to a boxing operation or a function that takes a
19461 In this case, we need to create a temporary variable
19462 that is the argument of New.
19465 2001-12-23 Ravi Pratap <ravi@ximian.com>
19467 * rootcontext.cs (LookupType): Check that current_type is not null before
19468 going about looking at nested types.
19470 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19471 not implement the IAssignMethod interface any more.
19473 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19474 where we tranform them into FieldExprs if they are being resolved from within
19475 the declaring type.
19477 * ecore.cs (SimpleName.DoResolve): Do the same here.
19479 * assign.cs (DoResolve, Emit): Clean up code considerably.
19481 * ../errors/bug10.cs : Add.
19483 * ../errors/cs0070.cs : Add.
19485 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19487 * assign.cs : Get rid of EventIsLocal everywhere.
19489 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19491 * ecore.cs (ConvertIntLiteral): finished the implementation.
19493 * statement.cs (SwitchLabel): Convert the value we are using as a
19494 key before looking up the table.
19496 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19498 * codegen.cs (EmitTopBlock): Require a Location argument now.
19500 * cs-parser.jay (constructor_declarator): We need to setup
19501 current_local_parameters before we parse the
19502 opt_constructor_initializer, to allow the variables to be bound
19503 to the constructor arguments.
19505 * rootcontext.cs (LookupType): First lookup nested classes in our
19506 class and our parents before we go looking outside our class.
19508 * expression.cs (ConstantFold): Extract/debox the values at the
19511 * rootcontext.cs (EmitCode): Resolve the constants first before we
19512 resolve the types. This is not really needed, but it helps debugging.
19514 * statement.cs: report location.
19516 * cs-parser.jay: pass location to throw statement.
19518 * driver.cs: Small bug fix.
19520 * report.cs: Updated format to be 4-zero filled digits.
19522 2001-12-22 Ravi Pratap <ravi@ximian.com>
19524 * expression.cs (CheckIndices): Fix minor bug where the wrong
19525 variable was being referred to ;-)
19527 (DoEmit): Do not call EmitStaticInitializers when the
19528 underlying type is System.Object.
19530 2001-12-21 Ravi Pratap <ravi@ximian.com>
19532 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19533 and do the usual workaround for SRE.
19535 * class.cs (MyEventBuilder.EventType): New member to get at the type
19536 of the event, quickly.
19538 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19540 * assign.cs (Assign.DoResolve): Handle the case when the target
19541 is an EventExpr and perform the necessary checks.
19543 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19546 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19548 (EventExpr): Set the type in the constructor itself since we
19549 are meant to be born fully resolved.
19551 (EventExpr.Define): Revert code I wrote earlier.
19553 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19554 instance expression is null. The instance expression is a This in that case
19555 or a null, depending on whether it is a static method or not.
19557 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19558 refers to more than one method.
19560 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19561 and accordingly flag errors.
19563 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19565 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19567 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19569 * location.cs (ToString): Provide useful rutine.
19571 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19573 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19574 objects, return the actual integral boxed.
19576 * statement.cs (SwitchLabel): define an ILLabel for each
19579 (Switch.CheckSwitch): If the value is a Literal, extract
19580 the underlying literal.
19582 Also in the unused hashtable we had, add the SwitchLabel so we can
19583 quickly look this value up.
19585 * constant.cs: Implement a bunch of new constants. Rewrite
19586 Literal based on this. Made changes everywhere to adapt to this.
19588 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19589 dereferencing array only once, and also copes with enumrations.
19591 bytes are two bytes wide, not one.
19593 (Cast): Perform constant conversions.
19595 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19596 wrappers to the literals here.
19598 * expression.cs (DoNumericPromotions): long literals can converted
19599 to ulong implicity (this is taken care of elsewhere, but I was
19600 missing this spot).
19602 * ecore.cs (Expression.Literalize): Make the return type Literal,
19603 to improve type checking.
19605 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19607 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19609 * literal.cs: Revert code from ravi that checked the bounds. The
19610 bounds are sane by the definition of the type itself.
19612 * typemanager.cs: Fix implementation of ImplementsInterface. We
19613 need to actually look up in our parent hierarchy for interfaces
19616 * const.cs: Use the underlying type for enumerations
19618 * delegate.cs: Compute the basename for the delegate creation,
19619 that should fix the delegate test case, and restore the correct
19620 Type Lookup semantics in rootcontext
19622 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19623 referencing a nested type with the Reflection API is using the "+"
19626 * cs-parser.jay: Do not require EOF token at the end.
19628 2001-12-20 Ravi Pratap <ravi@ximian.com>
19630 * rootcontext.cs (LookupType): Concatenate type names with
19631 a '.' instead of a '+' The test suite passes again.
19633 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19634 field of the enumeration.
19636 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19637 the case when the member is an EventExpr.
19639 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19640 static has an associated instance expression.
19642 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19644 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19646 * class.cs (Event.Define): Register event and perform appropriate checks
19649 We define the Add and Remove methods even if the use provides none because
19650 in that case, we provide default implementations ourselves.
19652 Define a private field of the type of the event. This is done by the CSC compiler
19653 and we should be doing it too ;-)
19655 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19656 More methods we use in code we generate.
19658 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19661 (InitCoreTypes): Update accordingly for the above.
19663 * class.cs (Event.Emit): Generate code for default accessors that we provide
19665 (EmitDefaultMethod): Do the job in the above.
19667 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19670 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19672 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19673 builders even if we were missing one.
19675 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19676 pass the Basename as our class name instead of the Name. The
19677 basename will be correctly composed for us.
19679 * parameter.cs (Paramters): Now takes a Location argument.
19681 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19682 make all the code call directly LookupType in RootContext and take
19683 this chance to pass the Location information everywhere.
19685 * Everywhere: pass Location information.
19687 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19689 * class.cs (Constructor.Define): Updated way of detecting the
19690 length of the parameters.
19692 (TypeContainer.DefineType): Use basename as the type name for
19695 (TypeContainer.Define): Do not recursively define types here, as
19696 definition is taken care in order by the RootContext.
19698 * tree.cs: Keep track of namespaces in a per-file basis.
19700 * parameter.cs (Parameter.ComputeSignature): Update to use
19703 (Parameters.GetSignature): ditto.
19705 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19706 instead of a TypeContainer.
19708 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19709 resolve names. Because we need to be resolve in our context, not
19712 * driver.cs: Implement response files.
19714 * class.cs (TypeContainer.DefineType): If we are defined, do not
19715 redefine ourselves.
19717 (Event.Emit): Emit the code for add/remove handlers.
19718 (Event.Define): Save the MethodBuilders for add/remove.
19720 * typemanager.cs: Use pair here too.
19722 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19723 DictionaryEntry requires the first argument to be non-null.
19725 (enum_declaration): Compute full name for registering the
19728 (delegate_declaration): Instead of using
19729 formal_parameter_list, use opt_formal_parameter_list as the list
19732 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19733 (EventParsing): New property that controls whether `add' and
19734 `remove' are returned as tokens or identifiers (for events);
19736 2001-12-19 Ravi Pratap <ravi@ximian.com>
19738 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19739 use MyEventBuilder only and let it wrap the real builder for us.
19741 (MyEventBuilder): Revamp constructor etc.
19743 Implement all operations that we perform on EventBuilder in precisely the same
19746 (FindMembers): Update to use the EventBuilder member.
19748 (Event.Emit): Update accordingly.
19750 2001-12-18 Ravi Pratap <ravi@ximian.com>
19752 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19753 by calling the appropriate methods.
19755 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19758 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19760 2001-12-17 Ravi Pratap <ravi@ximian.com>
19762 * delegate.cs (Delegate.Populate): Check that the return type
19763 and various parameters types are indeed accessible.
19765 * class.cs (Constructor.Define): Same here.
19767 (Field.Define): Ditto.
19769 (Event.Define): Ditto.
19771 (Operator.Define): Check that the underlying Method defined itself
19772 correctly - so it's MethodBuilder should not be null.
19774 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19775 expression happens to be null.
19777 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19778 members but as of now we don't seem to be able to do anything really useful with it.
19780 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19781 not the EventBuilder.
19783 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19785 * cs-tokenizer.cs: Add support for defines.
19786 Add support for #if, #elif, #else, #endif
19788 (eval_var): evaluates a variable.
19789 (eval): stubbed for evaluating functions.
19791 * cs-parser.jay: Pass the defines information
19793 * driver.cs: Add --define command line option.
19795 * decl.cs: Move MemberCore here.
19797 Make it the base class for DeclSpace. This allows us to catch and
19798 report 108 and 109 for everything now.
19800 * class.cs (TypeContainer.Define): Extract all the members
19801 before populating and emit the warning 108 (new keyword required
19802 to override) instead of having each member implement this.
19804 (MemberCore.Define): New abstract method, we will be using this in
19805 the warning reporting engine in Populate.
19807 (Operator.Define): Adjust to new MemberCore protocol.
19809 * const.cs (Const): This does not derive from Expression, it is a
19810 temporary object we use to create fields, it is a MemberCore.
19812 * class.cs (Method.Define): Allow the entry point to be in a
19815 * driver.cs: Rewrite the argument handler to clean it up a bit.
19817 * rootcontext.cs: Made it just an auxiliary namespace feature by
19818 making everything static.
19820 * driver.cs: Adapt code to use RootContext type name instead of
19823 * delegate.cs: Remove RootContext argument.
19825 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19828 * class.cs (Event.Define): The lookup can fail.
19830 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19832 * expression.cs: Resolve the this instance before invoking the code.
19834 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19836 * cs-parser.jay: Add a production in element_access that allows
19837 the thing to become a "type" reference. This way we can parse
19838 things like "(string [])" as a type.
19840 Note that this still does not handle the more complex rules of
19844 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19846 * ecore.cs: (CopyNewMethods): new utility function used to
19847 assemble the list of methods from running FindMembers.
19849 (MemberLookup): Rework FindMembers so that
19851 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19853 * class.cs (TypeContainer): Remove Delegates who fail to be
19856 * delegate.cs (Populate): Verify that we dont get null return
19857 values. TODO: Check for AsAccessible.
19859 * cs-parser.jay: Use basename to emit error 574 (destructor should
19860 have the same name as container class), not the full name.
19862 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19863 possible representation.
19865 Also implements integer type suffixes U and L.
19867 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19869 * expression.cs (ArrayCreation.DoResolve): We need to do the
19870 argument resolution *always*.
19872 * decl.cs: Make this hold the namespace. Hold the root context as
19874 (LookupType): Move here.
19876 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19878 * location.cs (Row, Name): Fixed the code, it was always returning
19879 references to the first file.
19881 * interface.cs: Register properties defined through interfaces.
19883 * driver.cs: Add support for globbing on the command line
19885 * class.cs (Field): Make it derive from MemberCore as well.
19888 2001-12-15 Ravi Pratap <ravi@ximian.com>
19890 * class.cs (Event::Define): Check that the type of the event is a delegate
19891 type else flag error #66.
19893 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19896 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19897 values of EntryPoint, CharSet etc etc.
19899 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19901 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19902 be null and we should ignore this. I am not sure if this is really clean. Apparently,
19903 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19904 which needs this to do its work.
19906 * ../errors/cs0066.cs : Add.
19908 2001-12-14 Miguel de Icaza <miguel@ximian.com>
19910 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19913 * class.cs: (MethodSignature.MethodSignature): Removed hack that
19914 clears out the parameters field.
19915 (MemberSignatureCompare): Cleanup
19917 (MemberCore): New base class used to share code between MethodCore
19920 (RegisterRequiredImplementations) BindingFlags.Public requires
19921 either BindingFlags.Instace or Static. Use instance here.
19923 (Property): Refactored code to cope better with the full spec.
19925 * parameter.cs (GetParameterInfo): Return an empty array instead
19928 * class.cs (Property): Abstract or extern properties have no bodies.
19930 * parameter.cs (GetParameterInfo): return a zero-sized array.
19932 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19933 method modifier validation to the typecontainer so we can reuse
19934 this on properties.
19936 (MethodCore.ParameterTypes): return an empty sized array of types.
19938 (Property.Define): Test property modifier validity.
19940 Add tests for sealed/override too.
19942 (Method.Emit): abstract or extern methods have no bodies.
19944 2001-12-14 Ravi Pratap <ravi@ximian.com>
19946 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19949 (Method::Define, ::Emit): Modify accordingly.
19951 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19953 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19955 * makefile: Pass in /unsafe.
19957 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19959 * class.cs (MakeKey): Kill routine.
19961 * class.cs (TypeContainer.Define): Correctly define explicit
19962 method implementations (they require the full interface name plus
19965 * typemanager.cs: Deply the PtrHashtable here and stop using the
19966 lame keys. Things work so much better.
19968 This of course broke everyone who depended on `RegisterMethod' to
19969 do the `test for existance' test. This has to be done elsewhere.
19971 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19972 the object stupid Equals method (because, that like fails all over
19973 the place). We still do not use it.
19975 * class.cs (TypeContainer.SetRequiredInterface,
19976 TypeContainer.RequireMethods): Killed these two routines and moved
19977 all the functionality to RegisterRequiredImplementations.
19979 (TypeContainer.RegisterRequiredImplementations): This routine now
19980 registers all the implementations required in an array for the
19981 interfaces and abstract methods. We use an array of structures
19982 which can be computed ahead of time to reduce memory usage and we
19983 also assume that lookups are cheap as most classes will not
19984 implement too many interfaces.
19986 We also avoid creating too many MethodSignatures.
19988 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19989 clear the "pending" bit if we find that there are problems with
19992 (TypeContainer.VerifyPendingMethods): Update to report errors of
19993 methods that look like implementations but are not.
19995 (TypeContainer.Define): Add support for explicit interface method
19998 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20000 * typemanager.cs: Keep track of the parameters here instead of
20001 being a feature of the TypeContainer.
20003 * class.cs: Drop the registration of parameters here, as
20004 InterfaceMethods are also interface declarations.
20006 * delegate.cs: Register methods with the TypeManager not only with
20007 the TypeContainer. This code was buggy.
20009 * interface.cs: Full registation here.
20011 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20013 * expression.cs: Remove reducer for binary expressions, it can not
20016 * const.cs: Put here the code that used to go into constant.cs
20018 * constant.cs: Put here the code for constants, this is a new base
20019 class for Literals.
20021 * literal.cs: Make Literal derive from Constant.
20023 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20025 * statement.cs (Return.Emit): Report error 157 if the user
20026 attempts to return from a finally block.
20028 (Return.Emit): Instead of emitting a return, jump to the end of
20031 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20032 LocalBuilder to store the result of the function. ReturnLabel is
20033 the target where we jump.
20036 2001-12-09 Radek Doulik <rodo@ximian.com>
20038 * cs-parser.jay: remember alias in current namespace
20040 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20043 * class.cs (LookupAlias): lookup alias in my_namespace
20045 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20047 (LookupAlias): lookup alias in this and if needed in parent
20050 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20054 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20055 making things static. I need this to avoid passing the
20056 TypeContainer when calling ParameterType.
20058 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20059 that did string manipulation to compute the type and then call
20060 GetType. Use Parameter.ParameterType instead.
20062 * cs-tokenizer.cs: Consume the suffix for floating values.
20064 * expression.cs (ParameterReference): figure out whether this is a
20065 reference parameter or not. Kill an extra variable by computing
20066 the arg_idx during emission.
20068 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20069 function that returns whether a parameter is an out/ref value or not.
20071 (Parameter.ParameterType): The type of the parameter (base,
20072 without ref/out applied).
20074 (Parameter.Resolve): Perform resolution here.
20075 (Parameter.ExternalType): The full type (with ref/out applied).
20077 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20078 support for expressions on the using statement.
20080 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20082 * statement.cs (Using.EmitLocalVariableDecls): Split the
20083 localvariable handling of the using statement.
20085 (Block.EmitMeta): Keep track of variable count across blocks. We
20086 were reusing slots on separate branches of blocks.
20088 (Try.Emit): Emit the general code block, we were not emitting it.
20090 Check the type of the declaration to be an IDisposable or
20091 something that can be implicity converted to it.
20093 Emit conversions if required.
20095 * ecore.cs (EmptyExpression): New utility class.
20096 (Expression.ImplicitConversionExists): New utility function.
20098 2001-12-06 Miguel de Icaza <miguel@ximian.com>
20100 * statement.cs (Using): Implement.
20102 * expression.cs (LocalVariableReference): Support read only variables.
20104 * statement.cs: Remove the explicit emit for the Leave opcode.
20105 (VariableInfo): Add a readonly field.
20107 2001-12-05 Miguel de Icaza <miguel@ximian.com>
20109 * ecore.cs (ConvCast): new class used to encapsulate the various
20110 explicit integer conversions that works in both checked and
20111 unchecked contexts.
20113 (Expression.ConvertNumericExplicit): Use new ConvCast class to
20114 properly generate the overflow opcodes.
20116 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20118 * statement.cs: The correct type for the EmptyExpression is the
20119 element_type, not the variable type. Ravi pointed this out.
20121 2001-12-04 Ravi Pratap <ravi@ximian.com>
20123 * class.cs (Method::Define): Handle PInvoke methods specially
20124 by using DefinePInvokeMethod instead of the usual one.
20126 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20127 above to do the task of extracting information and defining the method.
20129 2001-12-04 Ravi Pratap <ravi@ximian.com>
20131 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20132 of the condition for string type.
20134 (Emit): Move that here.
20136 (ArrayCreation::CheckIndices): Keep string literals in their expression
20139 (EmitDynamicInitializers): Handle strings appropriately.
20141 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20143 * codegen.cs (EmitContext): Replace multiple variables with a
20144 single pointer to the current Switch statement.
20146 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20149 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20153 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20156 (Foreach.Emit): Foreach on arrays was not setting
20157 up the loop variables (for break/continue).
20159 (GotoCase): Semi-implented.
20161 2001-12-03 Ravi Pratap <ravi@ximian.com>
20163 * attribute.cs (CheckAttribute): Handle system attributes by using
20164 Attribute.GetAttributes to examine information we need.
20166 (GetValidPlaces): Same here.
20168 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20170 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20172 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20174 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20176 (Method::Emit): Handle the case when we are a PInvoke method.
20178 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20180 * expression.cs: Use ResolveWithSimpleName on compound names.
20182 2001-12-02 Ravi Pratap <ravi@ximian.com>
20184 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20185 before trying to reduce it.
20187 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20189 * constant.cs (LookupConstantValue): Implement.
20191 (EmitConstant): Use the above in emitting the constant.
20193 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20194 that are user-defined by doing a LookupConstantValue on them.
20196 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20199 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20201 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20203 (BaseAccess.DoResolve): Implement.
20205 (MemberAccess.DoResolve): Split this routine into a
20206 ResolveMemberAccess routine that can be used independently
20208 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20210 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20211 As that share bits of the implementation. Is returns a boolean,
20212 while As returns the Type that is being probed.
20214 2001-12-01 Ravi Pratap <ravi@ximian.com>
20216 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20217 instead of a Literal - much easier.
20219 (EnumInTransit): Remove - utterly useless :-)
20221 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20223 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20225 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20226 chain when we have no associated expression.
20228 2001-11-30 Ravi Pratap <ravi@ximian.com>
20230 * constant.cs (Define): Use Location while reporting the errror.
20232 Also emit a warning when 'new' is used and there is no inherited
20235 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20238 (LookupEnumValue): Implement to lookup an enum member's value and define it
20241 (Populate): Re-write accordingly to use the above routine.
20243 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20245 * expression.cs (This): Fix prototype for DoResolveLValue to
20246 override the base class DoResolveLValue.
20248 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20251 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20252 (we need to load the address of the field here). This fixes
20255 (FieldExpr.DoResolveLValue): Call the DoResolve
20256 function to initialize the Instance expression.
20258 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20259 correctly the GetEnumerator operation on a value type.
20261 * cs-parser.jay: Add more simple parsing error catches.
20263 * statement.cs (Switch): Add support for string switches.
20264 Handle null specially.
20266 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20268 2001-11-28 Ravi Pratap <ravi@ximian.com>
20270 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20272 (declare_local_constant): New helper function.
20274 * statement.cs (AddConstant): Keep a separate record of constants
20276 (IsConstant): Implement to determine if a variable is a constant.
20278 (GetConstantExpression): Implement.
20280 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20282 * statement.cs (IsVariableDefined): Re-write.
20284 2001-11-27 Ravi Pratap <ravi@ximian.com>
20286 * class.cs (TypeContainer::FindMembers): Look for constants
20287 in the case when we are looking for MemberTypes.Field
20289 * expression.cs (MemberAccess::DoResolve): Check that in the
20290 case we are a FieldExpr and a Literal, we are not being accessed
20291 by an instance reference.
20293 * cs-parser.jay (local_constant_declaration): Implement.
20295 (declaration_statement): Implement for constant declarations.
20297 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20299 * statement.cs (Switch): Catch double defaults.
20301 (Switch): More work on the switch() statement
20302 implementation. It works for integral values now, need to finish
20306 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20308 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20309 integer literals into other integer literals. To be used by
20312 2001-11-24 Ravi Pratap <ravi@ximian.com>
20314 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20317 (EmitDynamicInitializers): Cope with the above since we extract data
20318 directly from ArrayData now.
20320 (ExpectInitializers): Keep track of whether initializers are mandatory
20323 (Bounds): Make it a hashtable to prevent the same dimension being
20324 recorded for every element in that dimension.
20326 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20329 Also fix bug which was causing the indices to be emitted in the reverse
20332 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20334 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20335 unfinished. They do not work, because the underlying code is
20338 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20340 * cs-parser.jay: Remove bogus fixme.
20342 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20343 on Switch statement.
20345 2001-11-23 Ravi Pratap <ravi@ximian.com>
20347 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20350 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20351 parameter. Apparently, any expression is allowed.
20353 (ValidateInitializers): Update accordingly.
20355 (CheckIndices): Fix some tricky bugs thanks to recursion.
20357 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20358 I was being completely brain-dead.
20360 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20361 and re-write acordingly.
20363 (DelegateInvocation): Re-write accordingly.
20365 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20367 (MakeByteBlob): Handle types more correctly.
20369 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20370 initialization from expressions but it is incomplete because I am a complete
20373 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20375 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20376 on If. Basically, we have to return `true' (ie, we do return to
20377 our caller) only if both branches of the if return.
20379 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20380 short-circuit operators, handle them as short circuit operators.
20382 (Cast.DoResolve): Resolve type.
20383 (Cast.Cast): Take an expression as the target type.
20385 * cs-parser.jay (cast_expression): Remove old hack that only
20386 allowed a limited set of types to be handled. Now we take a
20387 unary_expression and we resolve to a type during semantic
20390 Use the grammar productions from Rhys to handle casts (this is
20391 not complete like Rhys syntax yet, we fail to handle that corner
20392 case that C# has regarding (-x), but we will get there.
20394 2001-11-22 Ravi Pratap <ravi@ximian.com>
20396 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20397 field which is an array type.
20399 * cs-parser.jay (declare_local_variables): Support array initialization too.
20401 * typemanager.cs (MakeKey): Implement.
20403 (everywhere): Use the above appropriately.
20405 * cs-parser.jay (for_statement): Update for array initialization while
20406 declaring variables.
20408 * ecore.cs : The error message was correct, it's the variable's names that
20409 were misleading ;-) Make the code more readable.
20411 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20412 the correct type etc.
20414 (ConvertExplicit): Handle Enum types by examining the underlying type.
20416 2001-11-21 Ravi Pratap <ravi@ximian.com>
20418 * parameter.cs (GetCallingConvention): Always return
20419 CallingConventions.Standard for now.
20421 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20423 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20424 and `r' after calling DoNumericPromotions.
20426 * ecore.cs: Fix error message (the types were in the wrong order).
20428 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20429 BindingFlags.Instance as well
20431 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20432 implicit int literal conversion in an empty cast so that we
20433 propagate the right type upstream.
20435 (UnboxCast): new class used to unbox value types.
20436 (Expression.ConvertExplicit): Add explicit type conversions done
20439 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20440 the target type before applying the implicit LongLiterals to ULong
20443 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20445 * cs-parser.jay (for_statement): Reworked the way For works: now
20446 we declare manually any variables that are introduced in
20447 for_initializer to solve the problem of having out-of-band code
20448 emition (that is what got for broken).
20450 (declaration_statement): Perform the actual variable declaration
20451 that used to be done in local_variable_declaration here.
20453 (local_variable_declaration): Do not declare anything, just pass
20454 the information on a DictionaryEntry
20456 2001-11-20 Ravi Pratap <ravi@ximian.com>
20458 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20459 re-write of the logic to now make it recursive.
20461 (UpdateIndices): Re-write accordingly.
20463 Store element data in a separate ArrayData list in the above methods.
20465 (MakeByteBlob): Implement to dump the array data into a byte array.
20467 2001-11-19 Ravi Pratap <ravi@ximian.com>
20469 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20472 * constant.cs (Define): Implement.
20474 (EmitConstant): Re-write fully.
20476 Pass in location info.
20478 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20481 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20482 DictionaryEntry since we need location info too.
20484 (constant_declaration): Update accordingly.
20486 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20487 code into another method : UpdateIndices.
20489 2001-11-18 Ravi Pratap <ravi@ximian.com>
20491 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20492 some type checking etc.
20494 2001-11-17 Ravi Pratap <ravi@ximian.com>
20496 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20497 bits to provide dimension info if the user skips doing that.
20499 Update second constructor to store the rank correctly.
20501 2001-11-16 Ravi Pratap <ravi@ximian.com>
20503 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20504 and try to implement.
20506 * ../errors/cs0150.cs : Add.
20508 * ../errors/cs0178.cs : Add.
20510 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20512 * statement.cs: Implement foreach on multi-dimensional arrays.
20514 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20515 name of the params argument.
20517 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20518 initializing the array.
20520 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20521 we can use this elsewhere.
20523 * statement.cs: Finish implementation of foreach for single
20526 * cs-parser.jay: Use an out-of-band stack to pass information
20527 around, I wonder why I need this.
20529 foreach_block: Make the new foreach_block the current_block.
20531 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20532 function used to return a static Parameters structure. Used for
20533 empty parameters, as those are created very frequently.
20535 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20537 2001-11-15 Ravi Pratap <ravi@ximian.com>
20539 * interface.cs : Default modifier is private, not public. The
20540 make verify test passes again.
20542 2001-11-15 Ravi Pratap <ravi@ximian.com>
20544 * support.cs (ReflectionParameters): Fix logic to determine
20545 whether the last parameter is a params one. Test 9 passes again.
20547 * delegate.cs (Populate): Register the builders we define with
20548 RegisterParameterForBuilder. Test 19 passes again.
20550 * cs-parser.jay (property_declaration): Reference $6 instead
20551 of $$ to get at the location.
20553 (indexer_declaration): Similar stuff.
20555 (attribute): Ditto.
20557 * class.cs (Property): Register parameters for the Get and Set methods
20558 if they exist. Test 23 passes again.
20560 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20561 call to EmitArguments as we are sure there aren't any params arguments.
20562 Test 32 passes again.
20564 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20565 IndexOutOfRangeException.
20567 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20568 Test 33 now passes again.
20570 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20572 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20573 broke a bunch of things. Will have to come up with a better way
20574 of tracking locations.
20576 * statement.cs: Implemented foreach for single dimension arrays.
20578 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20580 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20581 an error. This removes the lookup from the critical path.
20583 * cs-parser.jay: Removed use of temporary_loc, which is completely
20586 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20588 * support.cs (ReflectionParameters.ParameterModifier): Report
20589 whether the argument is a PARAMS argument or not.
20591 * class.cs: Set the attribute `ParamArrayAttribute' on the
20592 parameter argument.
20594 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20595 and cons_param_array_attribute (ConstructorInfo for
20596 ParamArrayAttribute).,
20598 * codegen.cs: Emit the return using the `Return' statement, that
20599 way we can report the error correctly for missing return values.
20601 * class.cs (Method.Emit): Clean up.
20603 * expression.cs (Argument.Resolve): Take another argument: the
20604 location where this argument is used. Notice that this is not
20605 part of the "Argument" class as to reduce the size of the
20606 structure (we know the approximate location anyways).
20608 Test if the argument is a variable-reference, if not, then
20609 complain with a 206.
20611 (Argument.Emit): Emit addresses of variables.
20613 (Argument.FullDesc): Simplify.
20615 (Invocation.DoResolve): Update for Argument.Resolve.
20617 (ElementAccess.DoResolve): ditto.
20619 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20620 method should be virtual, as this method is always virtual.
20622 (NewDelegate.DoResolve): Update for Argument.Resolve.
20624 * class.cs (ConstructorInitializer.DoResolve): ditto.
20626 * attribute.cs (Attribute.Resolve): ditto.
20628 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20630 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20632 * expression.cs (ParameterReference): Drop IStackStorage and implement
20633 IAssignMethod instead.
20635 (LocalVariableReference): ditto.
20637 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20638 IAssignMethod instead.
20640 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20642 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20643 enumerations that are used in heavily used structures derive from
20644 byte in a laughable and pathetic attempt to reduce memory usage.
20645 This is the kind of pre-optimzations that you should not do at
20646 home without adult supervision.
20648 * expression.cs (UnaryMutator): New class, used to handle ++ and
20649 -- separatedly from the other unary operators. Cleans up the
20650 code, and kills the ExpressionStatement dependency in Unary.
20652 (Unary): Removed `method' and `Arguments' from this class, making
20653 it smaller, and moving it all to SimpleCall, so I can reuse this
20654 code in other locations and avoid creating a lot of transient data
20655 strucutres when not required.
20657 * cs-parser.jay: Adjust for new changes.
20659 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20661 * enum.cs (Enum.Populate): If there is a failure during
20664 * cs-parser.jay (opt_enum_base): we used to catch type errors
20665 here, but this is really incorrect. The type error should be
20666 catched during semantic analysis.
20668 2001-12-11 Ravi Pratap <ravi@ximian.com>
20670 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20671 current_local_parameters as expected since I, in my stupidity, had forgotten
20674 * attribute.cs (GetValidPlaces): Fix stupid bug.
20676 * class.cs (Method::Emit): Perform check on applicability of attributes.
20678 (Constructor::Emit): Ditto.
20680 (Field::Emit): Ditto.
20682 (Field.Location): Store location information.
20684 (Property, Event, Indexer, Operator): Ditto.
20686 * cs-parser.jay (field_declaration): Pass in location for each field.
20688 * ../errors/cs0592.cs : Add.
20690 2001-11-12 Ravi Pratap <ravi@ximian.com>
20692 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20694 (InitCoreTypes): Update accordingly.
20696 (RegisterAttrType, LookupAttr): Implement.
20698 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20699 info about the same.
20701 (Resolve): Update to populate the above as necessary.
20703 (Error592): Helper.
20705 (GetValidPlaces): Helper to the above.
20707 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20709 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20711 2001-11-12 Ravi Pratap <ravi@ximian.com>
20713 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20715 * ../errors/cs0617.cs : Add.
20717 2001-11-11 Ravi Pratap <ravi@ximian.com>
20719 * enum.cs (Emit): Rename to Populate to be more consistent with what
20720 we expect it to do and when exactly it is called.
20722 * class.cs, rootcontext.cs : Update accordingly.
20724 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20725 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20727 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20729 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20730 of a fieldinfo using the above, when dealing with a FieldBuilder.
20732 2001-11-10 Ravi Pratap <ravi@ximian.com>
20734 * ../errors/cs0031.cs : Add.
20736 * ../errors/cs1008.cs : Add.
20738 * ../errrors/cs0543.cs : Add.
20740 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20743 (FindMembers): Implement.
20745 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20746 enums and delegates too.
20748 (enum_types): Rename to builder_to_enum.
20750 (delegate_types): Rename to builder_to_delegate.
20752 * delegate.cs (FindMembers): Implement.
20754 2001-11-09 Ravi Pratap <ravi@ximian.com>
20756 * typemanager.cs (IsEnumType): Implement.
20758 * enum.cs (Emit): Re-write parts to account for the underlying type
20759 better and perform checking etc.
20761 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20762 of the underlying type.
20764 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20767 * enum.cs (error31): Helper to report error #31.
20769 * cs-parser.jay (enum_declaration): Store location of each member too.
20771 * enum.cs (member_to_location): New hashtable.
20773 (AddEnumMember): Update location hashtable.
20775 (Emit): Use the location of each member while reporting errors.
20777 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20779 * cs-parser.jay: A for_initializer if is a
20780 local_variable_declaration really ammount to have an implicit
20781 block with the variable declaration and no initializer for for.
20783 * statement.cs (For.Emit): Cope with null initializers.
20785 This fixes the infinite loop on for initializers.
20787 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20789 * enum.cs: More cleanup.
20791 * ecore.cs: Remove dead code.
20793 * class.cs (Property.Emit): More simplification.
20794 (Event.Emit): ditto.
20796 Reworked to have less levels of indentation.
20798 2001-11-08 Ravi Pratap <ravi@ximian.com>
20800 * class.cs (Property): Emit attributes.
20810 * enum.cs (Emit): Ditto.
20812 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20815 * class.cs (Field, Event, etc.): Move attribute generation into the
20816 Emit method everywhere.
20818 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20819 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20820 as we had no way of defining nested enums !
20822 * rootcontext.cs : Adjust code accordingly.
20824 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20826 2001-11-07 Ravi Pratap <ravi@ximian.com>
20828 * expression.cs (EvalConstantExpression): Move into ecore.cs
20830 * enum.cs (Enum): Rename some members and make them public and readonly
20831 according to our convention.
20833 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20836 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20838 (Enum::Emit): Write a simple version for now which doesn't try to compute
20839 expressions. I shall modify this to be more robust in just a while.
20841 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20843 (TypeContainer::CloseType): Create the Enum types too.
20845 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20847 * expression.cs (EvalConstantExpression): Get rid of completely.
20849 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20850 user-defined values and other cases.
20852 (IsValidEnumLiteral): Helper function.
20854 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20855 out there in the case we had a literal FieldExpr.
20857 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20859 (Literalize): Revamp a bit to take two arguments.
20861 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20863 2001-11-06 Ravi Pratap <ravi@ximian.com>
20865 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20867 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20869 (Resolve): Use the above to ensure we have proper initializers.
20871 2001-11-05 Ravi Pratap <ravi@ximian.com>
20873 * expression.cs (Expression::EvalConstantExpression): New method to
20874 evaluate constant expressions.
20876 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20878 2001-11-07 Miguel de Icaza <miguel@ximian.com>
20880 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20883 (Binary.ResolveOperator): Handle operator != (object a, object b)
20884 and operator == (object a, object b);
20886 (Binary.DoNumericPromotions): Indicate whether the numeric
20887 promotion was possible.
20889 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20892 Made the ArrayAccess implement interface IAssignMethod instead of
20893 IStackStore as the order in which arguments are passed reflects
20896 * assign.cs: Instead of using expr.ExprClass to select the way of
20897 assinging, probe for the IStackStore/IAssignMethod interfaces.
20899 * typemanager.cs: Load InitializeArray definition.
20901 * rootcontext.cs (RootContext.MakeStaticData): Used to define
20902 static data that can be used to initialize arrays.
20904 2001-11-05 Miguel de Icaza <miguel@ximian.com>
20906 * expression.cs: Handle operator== and operator!= for booleans.
20908 (Conditioal.Reduce): Implement reducer for the ?: operator.
20910 (Conditional.Resolve): Implement dead code elimination.
20912 (Binary.Resolve): Catch string literals and return a new
20913 concatenated string.
20915 (Unary.Reduce): Implement reduction of unary expressions.
20917 * ecore.cs: Split out the expression core handling here.
20919 (Expression.Reduce): New method used to perform constant folding
20920 and CSE. This is needed to support constant-expressions.
20922 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20923 targets, and optimize for !x.
20925 2001-11-04 Ravi Pratap <ravi@ximian.com>
20927 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20928 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20929 set custom atttributes.
20931 * literal.cs (Literal::GetValue): New abstract method to return the actual
20932 value of the literal, cast as an object.
20934 (*Literal): Implement GetValue method.
20936 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20937 expressions to the arraylist but objects of type Argument.
20939 * class.cs (TypeContainer::Emit): Emit our attributes too.
20941 (Method::Emit, Constructor::Emit): Ditto.
20943 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20944 to be ignoring earlier.
20946 2001-11-03 Ravi Pratap <ravi@ximian.com>
20948 * attribute.cs (AttributeSection::Define): Implement to do the business
20949 of constructing a CustomAttributeBuilder.
20951 (Attribute): New trivial class. Increases readability of code.
20953 * cs-parser.jay : Update accordingly.
20955 (positional_argument_list, named_argument_list, named_argument): New rules
20957 (attribute_arguments): Use the above so that we are more correct.
20959 2001-11-02 Ravi Pratap <ravi@ximian.com>
20961 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20962 to perform all checks for a method with a params parameter.
20964 (Invocation::OverloadResolve): Update to use the above method and therefore
20965 cope correctly with params method invocations.
20967 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20970 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20971 constructors in our parent too because we can't afford to miss out on
20974 * attribute.cs (AttributeSection): New name for the class Attribute
20976 Other trivial changes to improve readability.
20978 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20979 use the new class names.
20981 2001-11-01 Ravi Pratap <ravi@ximian.com>
20983 * class.cs (Method::Define): Complete definition for params types too
20985 (Indexer::Define): Ditto.
20987 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20988 Cope everywhere with a request for info about the array parameter.
20990 2001-11-01 Ravi Pratap <ravi@ximian.com>
20992 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20994 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20995 local_variable_type to extract the string corresponding to the type.
20997 (local_variable_type): Fixup the action to use the new helper method.
20999 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21002 * expression.cs : Clean out code which uses the above.
21004 2001-10-31 Ravi Pratap <ravi@ximian.com>
21006 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21007 and bale out if necessary by returning a false.
21009 (RegisterProperty): Ditto.
21011 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21012 and print out appropriate error messages.
21014 * interface.cs (everywhere): Ditto.
21016 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21017 location to constructor.
21019 * class.cs (Property, Event, Indexer): Update accordingly.
21021 * ../errors/cs111.cs : Added.
21023 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21024 of a method, as laid down by the spec.
21026 (Invocation::OverloadResolve): Use the above method.
21028 2001-10-31 Ravi Pratap <ravi@ximian.com>
21030 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21031 now take a TypeContainer and a Parameters object.
21033 (ParameterData): Modify return type of ParameterModifier method to be
21034 Parameter.Modifier and not a string.
21036 (ReflectionParameters, InternalParameters): Update accordingly.
21038 * expression.cs (Argument::GetParameterModifier): Same here.
21040 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21041 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21042 symbol in it at all so maybe this is only for now.
21044 2001-10-30 Ravi Pratap <ravi@ximian.com>
21046 * support.cs (InternalParameters): Constructor now takes an extra argument
21047 which is the actual Parameters class.
21049 (ParameterDesc): Update to provide info on ref/out modifiers.
21051 * class.cs (everywhere): Update call to InternalParameters to pass in
21052 the second argument too.
21054 * support.cs (ParameterData): Add ParameterModifier, which is a method
21055 to return the modifier info [ref/out etc]
21057 (InternalParameters, ReflectionParameters): Implement the above.
21059 * expression.cs (Argument::ParameterModifier): Similar function to return
21060 info about the argument's modifiers.
21062 (Invocation::OverloadResolve): Update to take into account matching modifiers
21065 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21066 a new SetFormalParameters object which we pass to InternalParameters.
21068 2001-10-30 Ravi Pratap <ravi@ximian.com>
21070 * expression.cs (NewArray): Merge into the ArrayCreation class.
21072 2001-10-29 Ravi Pratap <ravi@ximian.com>
21074 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21075 NewUserdefinedArray into one as there wasn't much of a use in having
21078 * expression.cs (Argument): Change field's name to ArgType from Type.
21080 (Type): New readonly property which returns the proper type, taking into
21081 account ref/out modifiers.
21083 (everywhere): Adjust code accordingly for the above.
21085 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21086 whether we are emitting for a ref or out parameter.
21088 * expression.cs (Argument::Emit): Use the above field to set the state.
21090 (LocalVariableReference::Emit): Update to honour the flag and emit the
21093 * parameter.cs (Attributes): Set the correct flags for ref parameters.
21095 * expression.cs (Argument::FullDesc): New function to provide a full desc.
21097 * support.cs (ParameterData): Add method ParameterDesc to the interface.
21099 (ReflectionParameters, InternalParameters): Implement the above method.
21101 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21104 (Invocation::FullMethodDesc): Ditto.
21106 2001-10-29 Miguel de Icaza <miguel@ximian.com>
21108 * cs-parser.jay: Add extra production for the second form of array
21111 * expression.cs (ArrayCreation): Update to reflect the above
21114 * Small changes to prepare for Array initialization.
21116 2001-10-28 Miguel de Icaza <miguel@ximian.com>
21118 * typemanager.cs (ImplementsInterface): interface might be null;
21119 Deal with this problem;
21121 Also, we do store negative hits on the cache (null values), so use
21122 this instead of calling t.GetInterfaces on the type everytime.
21124 2001-10-28 Ravi Pratap <ravi@ximian.com>
21126 * typemanager.cs (IsBuiltinType): New method to help determine the same.
21128 * expression.cs (New::DoResolve): Get rid of array creation code and instead
21129 split functionality out into different classes.
21131 (New::FormArrayType): Move into NewBuiltinArray.
21133 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21136 (NewBuiltinArray): New class to handle creation of built-in arrays.
21138 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21139 account creation of one-dimensional arrays.
21141 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21143 (NewUserdefinedArray::DoResolve): Implement.
21145 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21147 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21148 we maintain inside the TypeManager. This is necessary to perform lookups on the
21151 (LookupType): Update to perform GetType on the module builders too.
21153 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21155 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21157 2001-10-23 Ravi Pratap <ravi@ximian.com>
21159 * expression.cs (New::DoResolve): Implement guts of array creation.
21161 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21163 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21165 * expression.cs: Fix bug I introduced lsat night that broke
21168 (Expression.Resolve): Report a 246 error (can not resolve name)
21169 if we find a SimpleName in the stream.
21171 (Expression.ResolveLValue): Ditto.
21173 (Expression.ResolveWithSimpleName): This function is a variant of
21174 ResolveName, this one allows SimpleNames to be returned without a
21175 warning. The only consumer of SimpleNames is MemberAccess
21177 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21179 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21180 might arrive here. I have my doubts that this is correct.
21182 * statement.cs (Lock): Implement lock statement.
21184 * cs-parser.jay: Small fixes to support `lock' and `using'
21186 * cs-tokenizer.cs: Remove extra space
21188 * driver.cs: New flag --checked, allows to turn on integer math
21191 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21192 Threading.Monitor.Exit
21194 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21196 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21197 Expression Class to be IndexerAccess.
21199 Notice that Indexer::DoResolve sets the eclass to Value.
21201 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21203 * class.cs (TypeContainer::Emit): Emit code for indexers.
21205 * assign.cs (IAssignMethod): New interface implemented by Indexers
21206 and Properties for handling assignment.
21208 (Assign::Emit): Simplify and reuse code.
21210 * expression.cs (IndexerAccess, PropertyExpr): Implement
21211 IAssignMethod, clean up old code.
21213 2001-10-22 Ravi Pratap <ravi@ximian.com>
21215 * typemanager.cs (ImplementsInterface): New method to determine if a type
21216 implements a given interface. Provides a nice cache too.
21218 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21221 (ConvertReferenceExplicit): Ditto.
21223 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21224 various methods, with correct names etc.
21226 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21227 Operator.UnaryNegation.
21229 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21230 we have a unary plus or minus operator.
21232 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21235 * everywhere : update accordingly.
21237 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21240 * class.cs (Method::Define): For the case where we are implementing a method
21241 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21242 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21244 2001-10-21 Ravi Pratap <ravi@ximian.com>
21246 * interface.cs (FindMembers): Implement to work around S.R.E
21249 * typemanager.cs (IsInterfaceType): Implement.
21251 (FindMembers): Update to handle interface types too.
21253 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21254 use IsAssignableFrom as that is not correct - it doesn't work.
21256 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21257 and accordingly override EmitStatement.
21259 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21260 using the correct logic :-)
21262 2001-10-19 Ravi Pratap <ravi@ximian.com>
21264 * ../errors/cs-11.cs : Add to demonstrate error -11
21266 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21268 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21269 then pass this as a hint to ResolveLValue.
21271 * expression.cs (FieldExpr): Add Location information
21273 (FieldExpr::LValueResolve): Report assignment to readonly
21276 (Expression::ExprClassFromMemberInfo): Pass location information.
21278 (Expression::ResolveLValue): Add new method that resolves an
21281 (Expression::DoResolveLValue): Default invocation calls
21284 (Indexers): New class used to keep track of indexers in a given
21287 (IStackStore): Renamed from LValue, as it did not really describe
21288 what this did. Also ResolveLValue is gone from this interface and
21289 now is part of Expression.
21291 (ElementAccess): Depending on the element access type
21293 * typemanager.cs: Add `indexer_name_type' as a Core type
21294 (System.Runtime.CompilerServices.IndexerNameAttribute)
21296 * statement.cs (Goto): Take a location.
21298 2001-10-18 Ravi Pratap <ravi@ximian.com>
21300 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21301 if two delegates are compatible.
21303 (NewDelegate::DoResolve): Update to take care of the case when
21304 we instantiate a delegate from another delegate.
21306 * typemanager.cs (FindMembers): Don't even try to look up members
21307 of Delegate types for now.
21309 2001-10-18 Ravi Pratap <ravi@ximian.com>
21311 * delegate.cs (NewDelegate): New class to take care of delegate
21314 * expression.cs (New): Split the delegate related code out into
21315 the NewDelegate class.
21317 * delegate.cs (DelegateInvocation): New class to handle delegate
21320 * expression.cs (Invocation): Split out delegate related code into
21321 the DelegateInvocation class.
21323 2001-10-17 Ravi Pratap <ravi@ximian.com>
21325 * expression.cs (New::DoResolve): Implement delegate creation fully
21326 and according to the spec.
21328 (New::DoEmit): Update to handle delegates differently.
21330 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21331 because of which we were printing out arguments in reverse order !
21333 * delegate.cs (VerifyMethod): Implement to check if the given method
21334 matches the delegate.
21336 (FullDelegateDesc): Implement.
21338 (VerifyApplicability): Implement.
21340 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21341 delegate invocations too.
21343 (Invocation::Emit): Ditto.
21345 * ../errors/cs1593.cs : Added.
21347 * ../errors/cs1594.cs : Added.
21349 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21351 2001-10-16 Ravi Pratap <ravi@ximian.com>
21353 * typemanager.cs (intptr_type): Core type for System.IntPtr
21355 (InitCoreTypes): Update for the same.
21357 (iasyncresult_type, asynccallback_type): Ditto.
21359 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21362 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21365 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21366 the builders for the 4 members of a delegate type :-)
21368 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21371 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21373 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21375 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21377 * statement.cs (Break::Emit): Implement.
21378 (Continue::Emit): Implement.
21380 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21381 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21382 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21383 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21386 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21387 properties that track the label for the current loop (begin of the
21388 loop and end of the loop).
21390 2001-10-15 Ravi Pratap <ravi@ximian.com>
21392 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21393 use of emitting anything at all.
21395 * class.cs, rootcontext.cs : Get rid of calls to the same.
21397 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21399 (Populate): Define the constructor correctly and set the implementation
21402 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21405 (AddDelegateType): Implement.
21407 (IsDelegateType): Implement helper method.
21409 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21411 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21412 and accordingly handle it.
21414 * delegate.cs (Populate): Take TypeContainer argument.
21415 Implement bits to define the Invoke method. However, I still haven't figured out
21416 how to take care of the native int bit :-(
21418 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21419 Qualify the name of the delegate, not its return type !
21421 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21424 (StandardConversionExists): Checking for array types turns out to be recursive.
21426 (ConvertReferenceExplicit): Implement array conversion.
21428 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21430 2001-10-12 Ravi Pratap <ravi@ximian.com>
21432 * cs-parser.jay (delegate_declaration): Store the fully qualified
21433 name as it is a type declaration.
21435 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21438 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21439 as TypeContainer::DefineType.
21441 (Populate): Method in which all the definition of the various methods (Invoke)
21444 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21447 (CloseDelegate): Finally creates the delegate.
21449 * class.cs (TypeContainer::DefineType): Update to define delegates.
21450 (Populate, Emit and CloseType): Do the same thing here too.
21452 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21453 delegates in all these operations.
21455 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21457 * expression.cs: LocalTemporary: a new expression used to
21458 reference a temporary that has been created.
21460 * assign.cs: Handle PropertyAccess back here, so that we can
21461 provide the proper semantic access to properties.
21463 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21464 a few more explicit conversions.
21466 * modifiers.cs: `NEW' modifier maps to HideBySig.
21468 * expression.cs (PropertyExpr): Make this into an
21469 ExpressionStatement, and support the EmitStatement code path.
21471 Perform get/set error checking, clean up the interface.
21473 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21474 them into toplevel access objects.
21476 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21478 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21481 * typemanager.cs: Keep track here of our PropertyBuilders again to
21482 work around lameness in SRE.
21484 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21486 * expression.cs (LValue::LValueResolve): New method in the
21487 interface, used to perform a second resolution pass for LValues.
21489 (This::DoResolve): Catch the use of this in static methods.
21491 (This::LValueResolve): Implement.
21493 (This::Store): Remove warning, assigning to `this' in structures
21496 (Invocation::Emit): Deal with invocation of
21497 methods on value types. We need to pass the address to structure
21498 methods rather than the object itself. (The equivalent code to
21499 emit "this" for structures leaves the entire structure on the
21500 stack instead of a pointer to it).
21502 (ParameterReference::DoResolve): Compute the real index for the
21503 argument based on whether the method takes or not a `this' pointer
21504 (ie, the method is static).
21506 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21507 value types returned from functions when we need to invoke a
21508 method on the sturcture.
21511 2001-10-11 Ravi Pratap <ravi@ximian.com>
21513 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21514 defining the type in the Modulebuilder or Typebuilder. This is to take
21515 care of nested types which need to be defined on the TypeBuilder using
21516 DefineNestedMethod.
21518 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21519 methods in RootContext, only ported to be part of TypeContainer.
21521 (TypeContainer::GetInterfaceOrClass): Ditto.
21523 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21525 * interface.cs (Interface::DefineInterface): New method. Does exactly
21526 what RootContext.CreateInterface did earlier, only it takes care of nested types
21529 (Interface::GetInterfaces): Move from RootContext here and port.
21531 (Interface::GetInterfaceByName): Same here.
21533 * rootcontext.cs (ResolveTree): Re-write.
21535 (PopulateTypes): Re-write.
21537 * class.cs (TypeContainer::Populate): Populate nested types too.
21538 (TypeContainer::Emit): Emit nested members too.
21540 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21541 instead just use the name argument passed in as it is already fully
21544 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21545 to TypeContainer mapping to see if a type is user-defined.
21547 * class.cs (TypeContainer::CloseType): Implement.
21549 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21550 the default constructor.
21552 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21555 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21557 * interface.cs (CloseType): Create the type here.
21559 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21562 Remove all the methods which are now in TypeContainer.
21564 2001-10-10 Ravi Pratap <ravi@ximian.com>
21566 * delegate.cs (Define): Re-write bits to define the delegate
21569 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21571 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21573 * expression.cs (ImplicitReferenceConversion): handle null as well
21574 as a source to convert to any reference type.
21576 * statement.cs (Return): Perform any implicit conversions to
21577 expected return type.
21579 Validate use of return statement.
21581 * codegen.cs (EmitContext): Pass the expected return type here.
21583 * class.cs (Method, Constructor, Property): Pass expected return
21584 type to EmitContext.
21586 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21588 * expression.cs: Make DoResolve take an EmitContext instead of a
21591 Replaced `l' and `location' for `loc', for consistency.
21593 (Error, Warning): Remove unneeded Tc argument.
21595 * assign.cs, literal.cs, constant.cs: Update to new calling
21598 * codegen.cs: EmitContext now contains a flag indicating whether
21599 code is being generated in a static method or not.
21601 * cs-parser.jay: DecomposeQI, new function that replaces the old
21602 QualifiedIdentifier. Now we always decompose the assembled
21603 strings from qualified_identifier productions into a group of
21606 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21608 * rootcontext.cs: Deal with field-less struct types correctly now
21609 by passing the size option to Define Type.
21611 * class.cs: Removed hack that created one static field.
21613 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21615 * statement.cs: Moved most of the code generation here.
21617 2001-10-09 Ravi Pratap <ravi@ximian.com>
21619 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21622 (ElementAccess): Remove useless bits for now - keep checks as the spec
21625 2001-10-08 Ravi Pratap <ravi@ximian.com>
21627 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21628 and start performing checks according to the spec.
21630 2001-10-07 Ravi Pratap <ravi@ximian.com>
21632 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21633 rank_specifiers instead.
21635 (rank_specifiers): Change the order in which the rank specifiers are stored
21637 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21639 * expression.cs (ElementAccess): Implement the LValue interface too.
21641 2001-10-06 Ravi Pratap <ravi@ximian.com>
21643 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21644 except that user defined conversions are not included.
21646 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21647 perform the conversion of the return type, if necessary.
21649 (New::DoResolve): Check whether we are creating an array or an object
21650 and accordingly do the needful.
21652 (New::Emit): Same here.
21654 (New::DoResolve): Implement guts of array creation.
21656 (New::FormLookupType): Helper function.
21658 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21660 * codegen.cs: Removed most of the code generation here, and move the
21661 corresponding code generation bits to the statement classes.
21663 Added support for try/catch/finalize and throw.
21665 * cs-parser.jay: Added support for try/catch/finalize.
21667 * class.cs: Catch static methods having the flags override,
21668 virtual or abstract.
21670 * expression.cs (UserCast): This user cast was not really doing
21671 what it was supposed to do. Which is to be born in fully resolved
21672 state. Parts of the resolution were being performed at Emit time!
21676 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21678 * expression.cs: Implicity convert the result from UserCast.
21680 2001-10-05 Ravi Pratap <ravi@ximian.com>
21682 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21683 prevented it from working correctly.
21685 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21686 merely ConvertImplicit.
21688 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21690 * typemanager.cs: Make the LookupTypeContainer function static,
21691 and not per-instance.
21693 * class.cs: Make static FindMembers (the one that takes a Type
21696 * codegen.cs: Add EmitForeach here.
21698 * cs-parser.jay: Make foreach a toplevel object instead of the
21699 inline expansion, as we need to perform semantic analysis on it.
21701 2001-10-05 Ravi Pratap <ravi@ximian.com>
21703 * expression.cs (Expression::ImplicitUserConversion): Rename to
21704 UserDefinedConversion.
21706 (Expression::UserDefinedConversion): Take an extra argument specifying
21707 whether we look for explicit user conversions too.
21709 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21711 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21713 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21714 with the appropriate arguments.
21716 * cs-parser.jay (cast_expression): Record location too.
21718 * expression.cs (Cast): Record location info.
21720 (Expression::ConvertExplicit): Take location argument.
21722 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21723 to determine if we are doing explicit conversions.
21725 (UserCast::Emit): Update accordingly.
21727 (Expression::ConvertExplicit): Report an error if everything fails.
21729 * ../errors/cs0030.cs : Add.
21731 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21733 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21734 virtual and newslot bits.
21736 * class.cs (TypeContainer::RegisterRequiredImplementations):
21737 Record methods we need.
21739 (TypeContainer::MakeKey): Helper function to make keys for
21740 MethodBases, since the Methodbase key is useless.
21742 (TypeContainer::Populate): Call RegisterRequiredImplementations
21743 before defining the methods.
21745 Create a mapping for method_builders_to_methods ahead of time
21746 instead of inside a tight loop.
21748 (::RequireMethods): Accept an object as the data to set into the
21749 hashtable so we can report interface vs abstract method mismatch.
21751 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21753 * report.cs: Make all of it static.
21755 * rootcontext.cs: Drop object_type and value_type computations, as
21756 we have those in the TypeManager anyways.
21758 Drop report instance variable too, now it is a global.
21760 * driver.cs: Use try/catch on command line handling.
21762 Add --probe option to debug the error reporting system with a test
21765 * report.cs: Add support for exiting program when a probe
21766 condition is reached.
21768 2001-10-03 Ravi Pratap <ravi@ximian.com>
21770 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21771 we do a forcible conversion regardless of type, to check if
21772 ForceConversion returns a null.
21774 (Binary::error19): Use location to report error.
21776 (Unary::error23): Use location here too.
21778 * ../errors/cs0019.cs : Check in.
21780 * ../errors/cs0023.cs : Check in.
21782 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21783 case of a non-null MethodInfo object with a length of 0 !
21785 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21786 an applicable member - according to the spec :-)
21787 Also fix logic to find members in base types.
21789 (Unary::ResolveOperator): Same here.
21791 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21792 as I was getting thoroughly confused between this and error19 :-)
21794 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21795 (::FindMostEncompassedType): Implement.
21796 (::FindMostEncompassingType): Implement.
21797 (::StandardConversionExists): Implement.
21799 (UserImplicitCast): Re-vamp. We now need info about most specific
21800 source and target types so that we can do the necessary conversions.
21802 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21803 mathematical union with no duplicates.
21805 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21807 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21808 in order from base classes to child classes, so that we can in
21809 child classes look up in our parent for method names and
21810 attributes (required for handling abstract, virtual, new, override
21811 constructs: we need to instrospect our base class, and if we dont
21812 populate the classes in order, the introspection might be
21813 incorrect. For example, a method could query its parent before
21814 the parent has any methods and would determine that the parent has
21815 no abstract methods (while it could have had them)).
21817 (RootContext::CreateType): Record the order in which we define the
21820 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21822 * class.cs (TypeContainer::Populate): Also method definitions can
21823 fail now, keep track of this.
21825 (TypeContainer::FindMembers): Implement support for
21826 DeclaredOnly/noDeclaredOnly flag.
21828 (Constructor::Emit) Return the ConstructorBuilder.
21830 (Method::Emit) Return the MethodBuilder.
21831 Check for abstract or virtual methods to be public.
21833 * rootcontext.cs (RootContext::CreateType): Register all the
21834 abstract methods required for the class to be complete and the
21835 interface methods that must be implemented.
21837 * cs-parser.jay: Report error 501 (method requires body if it is
21838 not marked abstract or extern).
21840 * expression.cs (TypeOf::Emit): Implement.
21842 * typemanager.cs: runtime_handle_type, new global type.
21844 * class.cs (Property::Emit): Generate code for properties.
21846 2001-10-02 Ravi Pratap <ravi@ximian.com>
21848 * expression.cs (Unary::ResolveOperator): Find operators on base type
21849 too - we now conform exactly to the spec.
21851 (Binary::ResolveOperator): Same here.
21853 * class.cs (Operator::Define): Fix minor quirk in the tests.
21855 * ../errors/cs0215.cs : Added.
21857 * ../errors/cs0556.cs : Added.
21859 * ../errors/cs0555.cs : Added.
21861 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21863 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21864 single integer which is really efficient
21866 2001-10-01 Ravi Pratap <ravi@ximian.com>
21868 * expression.cs (Expression::ImplicitUserConversion): Use location
21869 even in the case when we are examining True operators.
21871 * class.cs (Operator::Define): Perform extensive checks to conform
21872 with the rules for operator overloading in the spec.
21874 * expression.cs (Expression::ImplicitReferenceConversion): Implement
21875 some of the other conversions mentioned in the spec.
21877 * typemanager.cs (array_type): New static member for the System.Array built-in
21880 (cloneable_interface): For System.ICloneable interface.
21882 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21883 we start resolving the tree and populating types.
21885 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21887 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21889 * expression.cs (Expression::ExprClassFromMemberInfo,
21890 Expression::Literalize): Create literal expressions from
21891 FieldInfos which are literals.
21893 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21894 type casts, because they were wrong. The test suite in tests
21897 (ImplicitNumericConversion): ushort to ulong requires a widening
21900 Int32 constant to long requires widening cast as well.
21902 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21903 for integers because the type on the stack is not i4.
21905 2001-09-30 Miguel de Icaza <miguel@ximian.com>
21907 * expression.cs (report118): require location argument.
21909 * parameter.cs: Do not dereference potential null value.
21911 * class.cs: Catch methods that lack the `new' keyword when
21912 overriding a name. Report warnings when `new' is used without
21913 anything being there to override.
21915 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21917 * class.cs: Only add constructor to hashtable if it is non-null
21918 (as now constructors can fail on define).
21920 (TypeManager, Class, Struct): Take location arguments.
21922 Catch field instance initialization in structs as errors.
21924 accepting_filter: a new filter for FindMembers that is static so
21925 that we dont create an instance per invocation.
21927 (Constructor::Define): Catch errors where a struct constructor is
21930 * cs-parser.jay: Pass location information for various new
21933 * delegate.cs (Delegate): take a location argument.
21935 * driver.cs: Do not call EmitCode if there were problesm in the
21936 Definition of the types, as many Builders wont be there.
21938 * decl.cs (Decl::Decl): Require a location argument.
21940 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21941 into integers, and find the most appropiate integer for it.
21943 * literal.cs: Implement ULongLiteral.
21945 * rootcontext.cs: Provide better information about the location of
21946 failure when CreateType fails.
21948 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21950 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21953 * expression.cs (Binary::CheckShiftArguments): Add missing type
21955 (Binary::ResolveOperator): Add type to the logical and and logical
21956 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21959 (Binary::DoNumericPromotions): In the case where either argument
21960 is ulong (and most signed types combined with ulong cause an
21961 error) perform implicit integer constant conversions as well.
21963 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21965 * expression.cs (UserImplicitCast): Method should always be
21967 (Invocation::BetterConversion): Simplified test for IntLiteral.
21969 (Expression::ImplicitNumericConversion): Split this routine out.
21970 Put the code that performs implicit constant integer conversions
21973 (Expression::Resolve): Become a wrapper around DoResolve so we can
21974 check eclass and type being set after resolve.
21976 (Invocation::Badness): Remove this dead function
21978 (Binary::ResolveOperator): Do not compute the expensive argumnets
21979 unless we have a union for it.
21981 (Probe::Emit): Is needs to do an isinst and then
21982 compare against null.
21984 (::CanConvert): Added Location argument. If the Location argument
21985 is null (Location.Null), then we do not report errors. This is
21986 used by the `probe' mechanism of the Explicit conversion. We do
21987 not want to generate an error for something that the user
21988 explicitly requested to be casted. But the pipeline for an
21989 explicit cast first tests for potential implicit casts.
21991 So for now, if the Location is null, it means `Probe only' to
21992 avoid adding another argument. Might have to revise this
21995 (ClassCast): New class used to type cast objects into arbitrary
21996 classes (used in Explicit Reference Conversions).
21998 Implement `as' as well.
22000 Reverted all the patches from Ravi below: they were broken:
22002 * The use of `level' as a mechanism to stop recursive
22003 invocations is wrong. That was there just to catch the
22004 bug with a strack trace but not as a way of addressing
22007 To fix the problem we have to *understand* what is going
22008 on and the interactions and come up with a plan, not
22009 just get things going.
22011 * The use of the type conversion cache that I proposed
22012 last night had an open topic: How does this work across
22013 protection domains. A user defined conversion might not
22014 be public in the location where we are applying the
22015 conversion, a different conversion might be selected
22016 (ie, private A->B (better) but public B->A (worse),
22017 inside A, A->B applies, but outside it, B->A will
22020 * On top of that (ie, even if the above is solved),
22021 conversions in a cache need to be abstract. Ie, `To
22022 convert from an Int to a Short use an OpcodeCast', not
22023 `To convert from an Int to a Short use the OpcodeCast on
22024 the variable 5' (which is what this patch was doing).
22026 2001-09-28 Ravi Pratap <ravi@ximian.com>
22028 * expression.cs (Invocation::ConversionExists): Re-write to use
22029 the conversion cache
22031 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22032 cache all conversions done, not just user-defined ones.
22034 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22035 to determine if a conversion exists instead of acutually trying to
22036 perform the conversion. It's faster too.
22038 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22039 and only then attempt the implicit conversion.
22041 2001-09-28 Ravi Pratap <ravi@ximian.com>
22043 * expression.cs (ConvertImplicit): Use a cache for conversions
22044 already found. Check level of recursion and bail out if necessary.
22046 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22048 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22049 Export standard methods that we expect for string operations.
22051 * statement.cs (Block::UsageWarning): Track usage of variables and
22052 report the errors for not used variables.
22054 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22057 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22059 * codegen.cs: remove unnneded code
22061 * expression.cs: Removed BuiltinTypeAccess class
22063 Fix the order in which implicit conversions are
22066 The previous fixed dropped support for boxed conversions (adding a
22067 test to the test suite now)
22069 (UserImplicitCast::CanConvert): Remove test for source being null,
22070 that code is broken. We should not feed a null to begin with, if
22071 we do, then we should track the bug where the problem originates
22072 and not try to cover it up here.
22074 Return a resolved expression of type UserImplicitCast on success
22075 rather than true/false. Ravi: this is what I was talking about,
22076 the pattern is to use a static method as a "constructor" for
22079 Also, do not create arguments until the very last minute,
22080 otherwise we always create the arguments even for lookups that
22081 will never be performed.
22083 (UserImplicitCast::Resolve): Eliminate, objects of type
22084 UserImplicitCast are born in a fully resolved state.
22086 * typemanager.cs (InitCoreTypes): Init also value_type
22087 (System.ValueType).
22089 * expression.cs (Cast::Resolve): First resolve the child expression.
22091 (LValue): Add new method AddressOf to be used by
22094 Change the argument of Store to take an EmitContext instead of an
22095 ILGenerator, because things like FieldExpr need to be able to call
22096 their children expression to generate the instance code.
22098 (Expression::Error, Expression::Warning): Sugar functions for
22101 (Expression::MemberLookup): Accept a TypeContainer instead of a
22102 Report as the first argument.
22104 (Expression::ResolvePrimary): Killed. I still want to improve
22105 this as currently the code is just not right.
22107 (Expression::ResolveMemberAccess): Simplify, but it is still
22110 (Unary::Resolve): Catch errors in AddressOf operators.
22112 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22113 index to a byte for the short-version, or the compiler will choose
22114 the wrong Emit call, which generates the wrong data.
22116 (ParameterReference::Emit, ::Store): same.
22118 (FieldExpr::AddressOf): Implement.
22120 * typemanager.cs: TypeManager: made public variable instead of
22123 * driver.cs: document --fatal.
22125 * report.cs (ErrorMessage, WarningMessage): new names for the old
22126 Error and Warning classes.
22128 * cs-parser.jay (member_access): Turn built-in access to types
22129 into a normal simplename
22131 2001-09-27 Ravi Pratap <ravi@ximian.com>
22133 * expression.cs (Invocation::BetterConversion): Fix to cope
22134 with q being null, since this was introducing a bug.
22136 * expression.cs (ConvertImplicit): Do built-in conversions first.
22138 2001-09-27 Ravi Pratap <ravi@ximian.com>
22140 * expression.cs (UserImplicitCast::Resolve): Fix bug.
22142 2001-09-27 Ravi Pratap <ravi@ximian.com>
22144 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22145 I had introduced long ago (what's new ?).
22147 * expression.cs (UserImplicitCast::CanConvert): Static method to do
22148 the work of all the checking.
22149 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22150 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22152 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22153 that is the right way.
22155 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22156 overloading resolution. Use everywhere instead of cutting and pasting code.
22158 (Binary::ResolveOperator): Use MakeUnionSet.
22160 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22161 we have to convert to bool types. Not complete yet.
22163 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22165 * typemanager.cs (TypeManager::CSharpName): support ushort.
22167 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22168 to provide an expression that performsn an implicit constant int
22169 conversion (section 6.1.6).
22170 (Expression::ConvertImplicitRequired): Reworked to include
22171 implicit constant expression conversions.
22173 (Expression::ConvertNumericExplicit): Finished.
22175 (Invocation::Emit): If InstanceExpression is null, then it means
22176 that we perform a call on this.
22178 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22180 * expression.cs (Unary::Emit): Remove some dead code.
22181 (Probe): Implement Resolve and Emit for `is'.
22182 (Expression::ConvertImplicitRequired): Attempt to do constant
22183 expression conversions here. Maybe should be moved to
22184 ConvertImplicit, but I am not sure.
22185 (Expression::ImplicitLongConstantConversionPossible,
22186 Expression::ImplicitIntConstantConversionPossible): New functions
22187 that tell whether is it possible to apply an implicit constant
22188 expression conversion.
22190 (ConvertNumericExplicit): Started work on explicit numeric
22193 * cs-parser.jay: Update operator constants.
22195 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22196 (Parameters::GetSignature): Hook up VerifyArgs here.
22197 (Parameters::VerifyArgs): Verifies that no two arguments have the
22200 * class.cs (Operator): Update the operator names to reflect the
22201 ones that the spec expects (as we are just stringizing the
22204 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22205 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22206 previous usage did only work for our methods.
22207 (Expression::ConvertImplicit): Handle decimal implicit numeric
22208 conversions as well.
22209 (Expression::InternalTypeConstructor): Used to invoke constructors
22210 on internal types for default promotions.
22212 (Unary::Emit): Implement special handling for the pre/post
22213 increment/decrement for overloaded operators, as they need to have
22214 the same semantics as the other operators.
22216 (Binary::ResolveOperator): ditto.
22217 (Invocation::ConversionExists): ditto.
22218 (UserImplicitCast::Resolve): ditto.
22220 2001-09-26 Ravi Pratap <ravi@ximian.com>
22222 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22223 operator, return after emitting body. Regression tests pass again !
22225 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22226 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22227 (Invocation::OverloadResolve): Ditto.
22228 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22230 * everywhere : update calls to the above methods accordingly.
22232 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22234 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22236 * expression.cs (ExpressionStatement): New base class used for
22237 expressions that can appear in statements, so that we can provide
22238 an alternate path to generate expression that do not leave a value
22241 (Expression::Emit, and all the derivatives): We no longer return
22242 whether a value is left on the stack or not. Every expression
22243 after being emitted leaves a single value on the stack.
22245 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22246 facilties of ExpressionStatement if possible.
22248 * cs-parser.jay: Update statement_expression.
22250 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22252 * driver.cs: Change the wording of message
22254 2001-09-25 Ravi Pratap <ravi@ximian.com>
22256 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22257 the type of the expression to the return type of the method if
22258 we have an overloaded operator match ! The regression tests pass again !
22259 (Unary::ResolveOperator): Ditto.
22261 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22262 to find "op_Implicit", not "implicit" ;-)
22263 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22264 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22266 * everywhere : Correct calls to the above accordingly.
22268 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22269 (ConvertImplicit): Do user-defined conversion if it exists.
22271 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22273 * assign.cs: track location.
22274 (Resolve): Use implicit conversions on assignment.
22276 * literal.cs: Oops. Not good, Emit of short access values should
22277 pass (Bytes) or the wrong argument will be selected.
22279 * expression.cs (Unary::Emit): Emit code for -expr.
22281 (Unary::ResolveOperator): Handle `Substract' for non-constants
22282 (substract from zero from the non-constants).
22283 Deal with Doubles as well.
22285 (Expression::ConvertImplicitRequired): New routine that reports an
22286 error if no implicit conversion exists.
22288 (Invocation::OverloadResolve): Store the converted implicit
22289 expressions if we make them
22291 2001-09-24 Ravi Pratap <ravi@ximian.com>
22293 * class.cs (ConstructorInitializer): Take a Location argument.
22294 (ConstructorBaseInitializer): Same here.
22295 (ConstructorThisInitializer): Same here.
22297 * cs-parser.jay : Update all calls accordingly.
22299 * expression.cs (Unary, Binary, New): Take location argument.
22300 Update accordingly everywhere.
22302 * cs-parser.jay : Update all calls to the above to take a location
22305 * class.cs : Ditto.
22307 2001-09-24 Ravi Pratap <ravi@ximian.com>
22309 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22310 (Invocation::BetterConversion): Same here
22311 (Invocation::ConversionExists): Ditto.
22313 (Invocation::ConversionExists): Implement.
22315 2001-09-22 Ravi Pratap <ravi@ximian.com>
22317 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22318 Also take an additional TypeContainer argument.
22320 * All over : Pass in TypeContainer as argument to OverloadResolve.
22322 * typemanager.cs (CSharpName): Update to check for the string type and return
22325 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22328 2001-09-21 Ravi Pratap <ravi@ximian.com>
22330 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22331 (Invocation::BetterFunction): Implement.
22332 (Invocation::BetterConversion): Implement.
22333 (Invocation::ConversionExists): Skeleton, no implementation yet.
22335 Okay, things work fine !
22337 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22339 * typemanager.cs: declare and load enum_type, delegate_type and
22342 * expression.cs (Expression::Emit): Now emit returns a value that
22343 tells whether a value is left on the stack or not. This strategy
22344 might be reveted tomorrow with a mechanism that would address
22345 multiple assignments.
22346 (Expression::report118): Utility routine to report mismatches on
22349 (Unary::Report23): Report impossible type/operator combination
22352 (Unary::IsIncrementableNumber): Whether the type can be
22353 incremented or decremented with add.
22354 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22356 (Unary::ResolveOperator): Implement ++, !, ~,
22358 (Invocation::Emit): Deal with new Emit convetion.
22360 * All Expression derivatives: Updated their Emit method to return
22361 whether they leave values on the stack or not.
22363 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22364 stack for expressions that are statements.
22366 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22368 * expression.cs (LValue): New interface. Must be implemented by
22370 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22373 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22374 interface for generating code, simplifies the code.
22376 2001-09-20 Ravi Pratap <ravi@ximian.com>
22378 * expression.cs (everywhere): Comment out return statements in ::Resolve
22379 methods to avoid the warnings.
22381 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22383 * driver.cs (parse): Report error 2001 if we can not open the
22386 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22389 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22392 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22393 otherwise nested blocks end up with the same index.
22395 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22397 * expression.cs: Instead of having FIXMEs in the Resolve
22398 functions, throw exceptions so it is obvious that we are facing a
22401 * cs-parser.jay (invocation_expression): Pass Location information.
22403 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22404 Use a basename for those routines because .NET does not like paths
22407 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22410 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22412 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22413 are loading the correct data types (throws an exception if not).
22414 (TypeManager::InitCoreTypes): Use CoreLookupType
22416 * expression.cs (Unary::ResolveOperator): return the child
22417 expression for expressions which are just +expr.
22418 (Unary::ResolveOperator): Return negative literals for -LITERAL
22419 expressions (otherwise they are Unary {Literal}).
22420 (Invocation::Badness): Take into account `Implicit constant
22421 expression conversions'.
22423 * literal.cs (LongLiteral): Implement long literal class.
22424 (IntLiteral): export the `Value' of the intliteral.
22426 2001-09-19 Ravi Pratap <ravi@ximian.com>
22428 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22430 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22431 instead of 'Operator'
22433 * expression.cs (Binary::ResolveOperator): Update accordingly.
22434 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22437 * cs-parser.jay (unary_expression): Update to use the new names.
22439 * gen-treedump.cs (GetUnary): Same here.
22441 * expression.cs (Unary::Resolve): Implement.
22442 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22443 operators are found instead of making noise ;-)
22444 (Unary::ResolveOperator): New method to do precisely the same thing which
22445 Binary::ResolveOperator does for Binary expressions.
22446 (Unary.method, .Arguments): Add.
22447 (Unary::OperName): Implement.
22448 (Unary::ForceConversion): Copy and Paste !
22450 * class.cs (Operator::Define): Fix a small bug for the case when we have
22453 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22454 for the inbuilt operators. Only overloading works for now ;-)
22456 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22458 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22459 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22461 * expression.cs (This::Emit): Implement.
22462 (This::Resolve): Implement.
22463 (TypeOf:Resolve): Implement.
22464 (Expression::ResolveSimpleName): Add an implicit this to instance
22466 (MemberAccess::Resolve): Deal with Parameters and Fields.
22467 Bind instance variable to Field expressions.
22468 (FieldExpr::Instance): New field used to track the expression that
22469 represents the object instance.
22470 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22472 (FieldExpr::Emit): Implement.
22474 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22475 the last instruction contains a return opcode to avoid generating
22476 the last `ret' instruction (this generates correct code, and it is
22477 nice to pass the peverify output).
22479 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22480 initializer for static and instance variables.
22481 (Constructor::Emit): Allow initializer to be null in the case of
22482 static constructors. Only emit initializer for instance
22485 (TypeContainer::FindMembers): Return a null array if there are no
22488 Also fix the code for the MemberTypes.Method branch, as it was not
22489 scanning that for operators (or tried to access null variables before).
22491 * assign.cs (Assign::Emit): Handle instance and static fields.
22495 * driver.cs: Stop compilation if there are parse errors.
22497 * cs-parser.jay (constructor_declaration): Provide default base
22498 initializer for non-static constructors.
22499 (constructor_declarator): Do not provide a default base
22500 initializers if none was specified.
22501 Catch the fact that constructors should not have parameters.
22503 * class.cs: Do not emit parent class initializers for static
22504 constructors, that should be flagged as an error.
22506 2001-09-18 Ravi Pratap <ravi@ximian.com>
22508 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22509 Move back code into TypeContainer::Populate.
22511 2001-09-18 Ravi Pratap <ravi@ximian.com>
22513 * class.cs (TypeContainer::AddConstructor): Fix the check to
22514 compare against Name, not Basename.
22515 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22517 * cs-parser.jay : Update accordingly.
22519 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22520 for methods, don't forget to look into the operators too.
22521 (RegisterMethodBuilder): Helper method to take care of this for
22522 methods, constructors and operators.
22523 (Operator::Define): Completely revamp.
22524 (Operator.OperatorMethod, MethodName): New fields.
22525 (TypeContainer::Populate): Move the registering of builders into
22526 RegisterMethodBuilder.
22527 (Operator::Emit): Re-write.
22529 * expression.cs (Binary::Emit): Comment out code path to emit method
22530 invocation stuff for the case when we have a user defined operator. I am
22531 just not able to get it right !
22533 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22535 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22538 (Expression::MemberLookup): Provide a version that allows to
22539 specify the MemberTypes and BindingFlags.
22541 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22542 so it was not fetching variable information from outer blocks.
22544 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22545 Beforefieldinit as it was buggy.
22547 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22548 that Ravi put here.
22550 * class.cs (Constructor::Emit): Only emit if block is not null.
22551 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22552 deal with this by semantically definining it as if the user had
22555 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22556 constructors as we now "emit" them at a higher level.
22558 (TypeContainer::DefineDefaultConstructor): Used to define the
22559 default constructors if none was provided.
22561 (ConstructorInitializer): Add methods Resolve and Emit.
22563 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22565 2001-09-17 Ravi Pratap <ravi@ximian.com>
22567 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22568 the default constructor builder with our hashtable for methodbuilders
22571 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22572 and argument_count is 0 in which case we have a match.
22573 (Binary::ResolveOperator): More null checking and miscellaneous coding
22576 2001-09-17 Ravi Pratap <ravi@ximian.com>
22578 * rootcontext.cs (IsNameSpace): Compare against null.
22580 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22582 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22583 and Unary::Operator.
22585 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22588 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22589 we have overloaded operators.
22590 (Binary::ResolveOperator): Implement the part which does the operator overload
22593 * class.cs (Operator::Emit): Implement.
22594 (TypeContainer::Emit): Emit the operators we have too.
22596 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22597 the case when we have a user-defined operator.
22599 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22601 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22603 2001-09-16 Ravi Pratap <ravi@ximian.com>
22605 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22606 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22607 (Constructor::Emit): Implement.
22608 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22609 if we have no work to do.
22610 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22613 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22614 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22616 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22619 2001-09-15 Ravi Pratap <ravi@ximian.com>
22621 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22623 (Tree::RecordNamespace): Method to do what the name says ;-)
22624 (Tree::Namespaces): Property to get at the namespaces hashtable.
22626 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22629 * rootcontext.cs (IsNamespace): Fixed it :-)
22631 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22633 * class.cs (TypeContainer::FindMembers): Add support for
22635 (MethodCore): New class that encapsulates both the shared aspects
22636 of a Constructor and a Method.
22637 (Method, Constructor): Factored pieces into MethodCore.
22639 * driver.cs: Added --fatal which makes errors throw exceptions.
22640 Load System assembly as well as part of the standard library.
22642 * report.cs: Allow throwing exceptions on errors for debugging.
22644 * modifiers.cs: Do not use `parent', instead use the real type
22645 container to evaluate permission settings.
22647 * class.cs: Put Ravi's patch back in. He is right, and we will
22648 have to cope with the
22650 2001-09-14 Ravi Pratap <ravi@ximian.com>
22652 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22653 FamORAssem, not FamANDAssem.
22655 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22657 * driver.cs: Added --parse option that only parses its input files
22660 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22661 incorrect. IsTopLevel is not used to tell whether an object is
22662 root_types or not (that can be achieved by testing this ==
22663 root_types). But to see if this is a top-level *class* (not
22664 necessarly our "toplevel" container).
22666 2001-09-14 Ravi Pratap <ravi@ximian.com>
22668 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22669 parent instead of a direct call to GetType.
22671 2001-09-14 Ravi Pratap <ravi@ximian.com>
22673 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22674 Modifiers.TypeAttr. This should just be a call to that method.
22676 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22677 object so that we can determine if we are top-level or not.
22679 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22682 * enum.cs (Enum::Define): Ditto.
22684 * modifiers.cs (FieldAttr): Re-write.
22686 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22687 (TypeContainer::HaveStaticConstructor): New property to provide access
22688 to precisely that info.
22690 * modifiers.cs (MethodAttr): Re-write.
22691 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22693 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22694 of top-level types as claimed.
22696 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22698 * expression.cs (MemberLookup): Fruitless attempt to lookup
22699 constructors. Maybe I need to emit default constructors? That
22700 might be it (currently .NET emits this for me automatically).
22701 (Invocation::OverloadResolve): Cope with Arguments == null.
22702 (Invocation::EmitArguments): new function, shared by the new
22703 constructor and us.
22704 (Invocation::Emit): Handle static and instance methods. Emit
22705 proper call instruction for virtual or non-virtual invocations.
22706 (New::Emit): Implement.
22707 (New::Resolve): Implement.
22708 (MemberAccess:Resolve): Implement.
22709 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22710 to track instances.
22711 (FieldExpr::Resolve): Set type.
22713 * support.cs: Handle empty arguments.
22715 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22716 SimpleLookup): Auxiliary routines to help parse a qualifier
22719 Update qualifier_identifier rule.
22721 * codegen.cs: Removed debugging messages.
22723 * class.cs: Make this a global thing, this acts just as a "key" to
22724 objects that we might have around.
22726 (Populate): Only initialize method_builders_to_methods once.
22728 * expression.cs (PropertyExpr): Initialize type from the
22731 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22732 Resolve pattern. Attempt to implicitly convert value to boolean.
22735 * expression.cs: Set the type for the int32/int32 argument case.
22736 (Binary::ResolveOperator): Set the return type to boolean for
22737 comparission operators
22739 * typemanager.cs: Remove debugging print code.
22741 (Invocation::Resolve): resolve type.
22743 * class.cs: Allocate a MemberInfo of the correct size, as the code
22744 elsewhere depends on the test to reflect the correct contents.
22746 (Method::) Keep track of parameters, due to System.Reflection holes
22748 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22751 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22752 of the exact size and return that.
22754 (Class::LookupMethodByBuilder): New function that maps
22755 MethodBuilders to its methods. Required to locate the information
22756 on methods because System.Reflection bit us again.
22758 * support.cs: New file, contains an interface ParameterData and
22759 two implementations: ReflectionParameters and InternalParameters
22760 used to access Parameter information. We will need to grow this
22763 * expression.cs (Invocation::GetParameterData): implement a cache
22764 and a wrapper around the ParameterData creation for methods.
22765 (Invocation::OverloadResolve): Use new code.
22767 2001-09-13 Ravi Pratap <ravi@ximian.com>
22769 * class.cs (TypeContainer::EmitField): Remove and move into
22770 (Field::Define): here and modify accordingly.
22771 (Field.FieldBuilder): New member.
22772 (TypeContainer::Populate): Update accordingly.
22773 (TypeContainer::FindMembers): Implement.
22775 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22777 * statement.cs: (VariableInfo::VariableType): New field to be
22778 initialized with the full type once it is resolved.
22780 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22782 * parameter.cs (GetParameterInfo): Use a type cache to compute
22783 things only once, and to reuse this information
22785 * expression.cs (LocalVariableReference::Emit): Implement.
22786 (OpcodeCast::Emit): fix.
22788 (ParameterReference::Resolve): Implement.
22789 (ParameterReference::Emit): Implement.
22791 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22792 that are expressions need to stay as Expressions.
22794 * typemanager.cs (CSharpName): Returns the C# name of a type if
22797 * expression.cs (Expression::ConvertImplicit): New function that
22798 implements implicit type conversions.
22800 (Expression::ImplicitReferenceConversion): Implements implicit
22801 reference conversions.
22803 (EmptyCast): New type for transparent casts.
22805 (OpcodeCast): New type for casts of types that are performed with
22806 a sequence of bytecodes.
22808 (BoxedCast): New type used for casting value types into reference
22809 types. Emits a box opcode.
22811 (Binary::DoNumericPromotions): Implements numeric promotions of
22812 and computation of the Binary::Type.
22814 (Binary::EmitBranchable): Optimization.
22816 (Binary::Emit): Implement code emission for expressions.
22818 * typemanager.cs (TypeManager): Added two new core types: sbyte
22821 2001-09-12 Ravi Pratap <ravi@ximian.com>
22823 * class.cs (TypeContainer::FindMembers): Method which does exactly
22824 what Type.FindMembers does, only we don't have to use reflection. No
22825 implementation yet.
22827 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22828 typecontainer objects as we need to get at them.
22829 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22831 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22832 typecontainer object.
22834 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22835 of just a Report object.
22837 2001-09-11 Ravi Pratap <ravi@ximian.com>
22839 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22841 (TypeContainer::Populate): Now define the delegates of the type too.
22842 (TypeContainer.Delegates): Property to access the list of delegates defined
22845 * delegates.cs (Delegate::Define): Implement partially.
22847 * modifiers.cs (TypeAttr): Handle more flags.
22849 2001-09-11 Ravi Pratap <ravi@ximian.com>
22851 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22853 (Operator::Define): Re-write logic to get types by using the LookupType method
22854 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22855 (Indexer::Define): Ditto.
22856 (Event::Define): Ditto.
22857 (Property::Define): Ditto.
22859 2001-09-10 Ravi Pratap <ravi@ximian.com>
22861 * class.cs (TypeContainer::Populate): Now define operators too.
22862 (TypeContainer.Operators): New property to access the list of operators
22864 (Operator.OperatorMethodBuilder): New member to hold the method builder
22865 for the operator we are defining.
22866 (Operator::Define): Implement.
22868 2001-09-10 Ravi Pratap <ravi@ximian.com>
22870 * class.cs (Event::Define): Make the prefixes of the accessor methods
22871 addOn_ and removeOn_
22873 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22874 of the location being passed in too. Ideally, this should go later since all
22875 error reporting should be done through the Report object.
22877 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22878 (Populate): Iterate thru the indexers we have and define them too.
22879 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22880 for the get and set accessors.
22881 (Indexer::Define): Implement.
22883 2001-09-09 Miguel de Icaza <miguel@ximian.com>
22885 * expression.cs (Binary::Resolve): Beginning of it. I scratched
22886 my previous implementation, did not work.
22888 * typemanager.cs: Add a couple of missing types (the longs).
22890 * literal.cs: Use TypeManager.bool_type instead of getting it.
22892 * expression.cs (EventExpr): New kind of expressions.
22893 (Expressio::ExprClassFromMemberInfo): finish
22895 2001-09-08 Miguel de Icaza <miguel@ximian.com>
22897 * assign.cs: Emit stores to static fields differently.
22899 2001-09-08 Ravi Pratap <ravi@ximian.com>
22901 * Merge in changes and adjust code to tackle conflicts. Backed out my
22902 code in Assign::Resolve ;-)
22904 2001-09-08 Ravi Pratap <ravi@ximian.com>
22906 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22907 instead Report.Error and also pass in the location.
22908 (CSharpParser::Lexer): New readonly property to return the reference
22909 to the Tokenizer object.
22910 (declare_local_variables): Use Report.Error with location instead of plain
22914 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22915 (Operator.CheckBinaryOperator): Ditto.
22917 * cs-parser.jay (operator_declarator): Update accordingly.
22919 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22920 (CheckBinaryOperator): Same here.
22922 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22923 on the name without any prefixes of namespace names etc. This is because we
22924 already might have something already fully qualified like
22925 'System.Console.WriteLine'
22927 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22929 2001-09-07 Ravi Pratap <ravi@ximian.com>
22931 * cs-tokenizer.cs (location): Return a string which also contains
22934 * expression.cs (ElementAccess): New class for expressions of the
22935 type 'element access.'
22936 (BaseAccess): New class for expressions of the type 'base access.'
22937 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22940 * cs-parser.jay (element_access): Implement action.
22941 (base_access): Implement actions.
22942 (checked_expression, unchecked_expression): Implement.
22944 * cs-parser.jay (local_variable_type): Correct and implement.
22945 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22947 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22949 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22950 name and the specifiers.
22952 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22954 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22955 making them all public ;-)
22957 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22960 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22962 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22964 (FieldExpr, PropertyExprs): New resolved expressions.
22965 (SimpleName::MemberStaticCheck): Perform static checks for access
22966 to non-static fields on static methods. Maybe this should be
22967 generalized for MemberAccesses.
22968 (SimpleName::ResolveSimpleName): More work on simple name
22971 * cs-parser.jay (primary_expression/qualified_identifier): track
22972 the parameter index.
22974 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22975 (EmitContext::EmitBoolExpression): Chain to expression generation
22976 instead of temporary hack.
22977 (::EmitStatementExpression): Put generic expression code generation.
22979 * assign.cs (Assign::Emit): Implement variable assignments to
22980 local variables, parameters and fields.
22982 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22984 * statement.cs (Block::GetVariableInfo): New method, returns the
22985 VariableInfo for a variable name in a block.
22986 (Block::GetVariableType): Implement in terms of GetVariableInfo
22988 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22989 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22991 2001-09-06 Ravi Pratap <ravi@ximian.com>
22993 * cs-parser.jay (operator_declaration): Continue on my quest : update
22994 to take attributes argument.
22995 (event_declaration): Ditto.
22996 (enum_declaration): Ditto.
22997 (indexer_declaration): Ditto.
22999 * class.cs (Operator::Operator): Update constructor accordingly.
23000 (Event::Event): Ditto.
23002 * delegate.cs (Delegate::Delegate): Same here.
23004 * enum.cs (Enum::Enum): Same here.
23006 2001-09-05 Ravi Pratap <ravi@ximian.com>
23008 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23010 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23012 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23013 being passed around as an arraylist.
23014 (Attributes::AddAttribute): Method to add attribute sections.
23016 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23017 (struct_declaration): Update accordingly.
23018 (constant_declaration): Update.
23019 (field_declaration): Update.
23020 (method_header): Update.
23021 (fixed_parameter): Update.
23022 (parameter_array): Ditto.
23023 (property_declaration): Ditto.
23024 (destructor_declaration): Ditto.
23026 * class.cs (Struct::Struct): Update constructors accordingly.
23027 (Class::Class): Ditto.
23028 (Field::Field): Ditto.
23029 (Method::Method): Ditto.
23030 (Property::Property): Ditto.
23031 (TypeContainer::OptAttribute): update property's return type.
23033 * interface.cs (Interface.opt_attributes): New member.
23034 (Interface::Interface): Update to take the extra Attributes argument.
23036 * parameter.cs (Parameter::Parameter): Ditto.
23038 * constant.cs (Constant::Constant): Ditto.
23040 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23041 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23042 the attributes as a parameter.
23043 (InterfaceProperty): Update constructor call.
23044 (InterfaceEvent): Ditto.
23045 (InterfaceMethod): Ditto.
23046 (InterfaceIndexer): Ditto.
23048 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23049 pass the attributes too.
23050 (interface_event_declaration): Ditto.
23051 (interface_property_declaration): Ditto.
23052 (interface_method_declaration): Ditto.
23053 (interface_declaration): Ditto.
23055 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23057 * class.cs (Method::Define): Track the "static Main" definition to
23058 create an entry point.
23060 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23061 EntryPoint if we find it.
23063 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23064 (EmitContext::ig): Make this variable public.
23066 * driver.cs: Make the default output file be the first file name
23067 with the .exe extension.
23069 Detect empty compilations
23071 Handle various kinds of output targets. Handle --target and
23072 rename -t to --dumper.
23074 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23075 methods inherited from Expression return now an Expression. This
23076 will is used during the tree rewriting as we resolve them during
23079 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23080 the spec. Missing entirely is the information about
23081 accessability of elements of it.
23083 (Expression::ExprClassFromMemberInfo): New constructor for
23084 Expressions that creates a fully initialized Expression based on
23085 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23088 (Invocation::Resolve): Begin implementing resolution of invocations.
23090 * literal.cs (StringLiteral): Implement Emit.
23092 2001-09-05 Ravi Pratap <ravi@ximian.com>
23094 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23097 2001-09-04 Ravi Pratap <ravi@ximian.com>
23099 * cs-parser.jay (attribute_arguments): Implement actions.
23100 (attribute): Fix bug in production. Implement action.
23101 (attribute_list): Implement.
23102 (attribute_target): Implement.
23103 (attribute_target_specifier, opt_target_specifier): Implement
23104 (CheckAttributeTarget): New method to check if the attribute target
23106 (attribute_section): Implement.
23107 (opt_attributes): Implement.
23109 * attribute.cs : New file to handle attributes.
23110 (Attribute): Class to hold attribute info.
23112 * cs-parser.jay (opt_attribute_target_specifier): Remove production
23113 (attribute_section): Modify production to use 2 different rules to
23114 achieve the same thing. 1 s/r conflict down !
23115 Clean out commented, useless, non-reducing dimension_separator rules.
23117 * class.cs (TypeContainer.attributes): New member to hold list
23118 of attributes for a type.
23119 (Struct::Struct): Modify to take one more argument, the attribute list.
23120 (Class::Class): Ditto.
23121 (Field::Field): Ditto.
23122 (Method::Method): Ditto.
23123 (Property::Property): Ditto.
23125 * cs-parser.jay (struct_declaration): Update constructor call to
23126 pass in the attributes too.
23127 (class_declaration): Ditto.
23128 (constant_declaration): Ditto.
23129 (field_declaration): Ditto.
23130 (method_header): Ditto.
23131 (fixed_parameter): Ditto.
23132 (parameter_array): Ditto.
23133 (property_declaration): Ditto.
23135 * constant.cs (Constant::Constant): Update constructor similarly.
23136 Use System.Collections.
23138 * parameter.cs (Parameter::Parameter): Update as above.
23140 2001-09-02 Ravi Pratap <ravi@ximian.com>
23142 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23143 (TypeContainer.delegates): New member to hold list of delegates.
23145 * cs-parser.jay (delegate_declaration): Implement the action correctly
23146 this time as I seem to be on crack ;-)
23148 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23150 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23151 tell whether an identifier represents a namespace.
23153 * expression.cs (NamespaceExpr): A namespace expression, used only
23154 temporarly during expression resolution.
23155 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23156 utility functions to resolve names on expressions.
23158 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23160 * codegen.cs: Add hook for StatementExpressions.
23162 * class.cs: Fix inverted test for static flag in methods.
23164 2001-09-02 Ravi Pratap <ravi@ximian.com>
23166 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23167 to make it coincide with MS' number.
23168 (Operator::CheckBinaryOperator): Ditto.
23170 * ../errors/errors.txt : Remove error numbers added earlier.
23172 * ../errors/cs1019.cs : Test case for error # 1019
23174 * ../errros/cs1020.cs : Test case for error # 1020
23176 * cs-parser.jay : Clean out commented cruft.
23177 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23178 used anywhere - non-reducing rule.
23179 (namespace_declarations): Non-reducing rule - comment out.
23181 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23182 with TypeContainer::AddEnum.
23184 * delegate.cs : New file for delegate handling classes.
23185 (Delegate): Class for declaring delegates.
23187 * makefile : Update.
23189 * cs-parser.jay (delegate_declaration): Implement.
23191 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23193 * class.cs (Event::Define): Implement.
23194 (Event.EventBuilder): New member.
23196 * class.cs (TypeContainer::Populate): Update to define all enums and events
23198 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23199 readonly fields for all these cases ?
23201 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23203 * class.cs (Property): Revamp to use the convention of making fields readonly.
23204 Accordingly modify code elsewhere.
23206 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23207 the Define method of the Property class.
23209 * class.cs : Clean up applied patch and update references to variables etc. Fix
23211 (TypeContainer::Populate): Update to define all the properties we have. Also
23212 define all enumerations.
23214 * enum.cs (Define): Implement.
23216 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23218 * cs-parser.jay (overloadable_operator): The semantic value is an
23219 enum of the Operator class.
23220 (operator_declarator): Implement actions.
23221 (operator_declaration): Implement.
23223 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23224 validity of definitions.
23225 (Operator::CheckBinaryOperator): Static method to check for binary operators
23226 (TypeContainer::AddOperator): New method to add an operator to a type.
23228 * cs-parser.jay (indexer_declaration): Added line to actually call the
23229 AddIndexer method so it gets added ;-)
23231 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23232 already taken care of by the MS compiler ?
23234 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23236 * class.cs (Operator): New class for operator declarations.
23237 (Operator::OpType): Enum for the various operators.
23239 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23241 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23242 ostensibly handle this in semantic analysis.
23244 * cs-parser.jay (general_catch_clause): Comment out
23245 (specific_catch_clauses, specific_catch_clause): Ditto.
23246 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23247 (catch_args, opt_catch_args): New productions.
23248 (catch_clause): Rewrite to use the new productions above
23249 (catch_clauses): Modify accordingly.
23250 (opt_catch_clauses): New production to use in try_statement
23251 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23252 and re-write the code in the actions to extract the specific and
23253 general catch clauses by being a little smart ;-)
23255 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23256 Hooray, try and catch statements parse fine !
23258 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23260 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23261 string from the hashtable of variables.
23263 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23264 I end up making that mistake ;-)
23265 (catch_clauses): Fixed gross error which made Key and Value of the
23266 DictionaryEntry the same : $1 !!
23268 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23270 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23272 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23273 when the add and remove accessors are specified.
23275 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23277 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23278 information about indexer_declarator.
23279 (indexer_declarator): Implement actions.
23280 (parsing_indexer): New local boolean used to keep track of whether
23281 we are parsing indexers or properties. This is necessary because
23282 implicit_parameters come into picture even for the get accessor in the
23283 case of an indexer.
23284 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23286 * class.cs (Indexer): New class for indexer declarations.
23287 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23288 (TypeContainer::indexers): New member to hold list of indexers for the
23291 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23293 * cs-parser.jay (add_accessor_declaration): Implement action.
23294 (remove_accessor_declaration): Implement action.
23295 (event_accessors_declaration): Implement
23296 (variable_declarators): swap statements for first rule - trivial.
23298 * class.cs (Event): New class to hold information about event
23300 (TypeContainer::AddEvent): New method to add an event to a type
23301 (TypeContainer::events): New member to hold list of events.
23303 * cs-parser.jay (event_declaration): Implement actions.
23305 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23307 * cs-parser.jay (dim_separators): Implement. Make it a string
23308 concatenating all the commas together, just as they appear.
23309 (opt_dim_separators): Modify accordingly
23310 (rank_specifiers): Update accordingly. Basically do the same
23311 thing - instead, collect the brackets here.
23312 (opt_rank_sepcifiers): Modify accordingly.
23313 (array_type): Modify to actually return the complete type string
23314 instead of ignoring the rank_specifiers.
23315 (expression_list): Implement to collect the expressions
23316 (variable_initializer): Implement. We make it a list of expressions
23317 essentially so that we can handle the array_initializer case neatly too.
23318 (variable_initializer_list): Implement.
23319 (array_initializer): Make it a list of variable_initializers
23320 (opt_array_initializer): Modify accordingly.
23322 * expression.cs (New::NType): Add enumeration to help us
23323 keep track of whether we have an object/delegate creation
23324 or an array creation.
23325 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23326 members to hold data about array creation.
23327 (New:New): Modify to update NewType
23328 (New:New): New Overloaded contructor for the array creation
23331 * cs-parser.jay (array_creation_expression): Implement to call
23332 the overloaded New constructor.
23334 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23336 * class.cs (TypeContainer::Constructors): Return member
23337 constructors instead of returning null.
23339 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23341 * typemanager.cs (InitCoreTypes): Initialize the various core
23342 types after we have populated the type manager with the user
23343 defined types (this distinction will be important later while
23344 compiling corlib.dll)
23346 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23347 on Expression Classification. Now all expressions have a method
23348 `Resolve' and a method `Emit'.
23350 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23351 generation from working. Also add some temporary debugging
23354 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23356 * codegen.cs: Lots of code generation pieces. This is only the
23357 beginning, will continue tomorrow with more touches of polish. We
23358 handle the fundamentals of if, while, do, for, return. Others are
23359 trickier and I need to start working on invocations soon.
23361 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23364 * codegen.cs (EmitContext): New struct, used during code
23365 emission to keep a context. Most of the code generation will be
23368 * cs-parser.jay: Add embedded blocks to the list of statements of
23369 this block. So code generation proceeds in a top down fashion.
23371 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23373 * statement.cs: Add support for multiple child blocks.
23375 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23377 * codegen.cs (EmitCode): New function, will emit the code for a
23378 Block of code given a TypeContainer and its ILGenerator.
23380 * statement.cs (Block): Standard public readonly optimization.
23381 (Block::Block constructors): Link children.
23382 (Block::Child): Child Linker.
23383 (Block::EmitVariables): Emits IL variable declarations.
23385 * class.cs: Drop support for MethodGroups here, delay until
23387 (Method::): Applied the same simplification that I did before, and
23388 move from Properties to public readonly fields.
23389 (Method::ParameterTypes): Returns the parameter types for the
23390 function, and implements a cache that will be useful later when I
23391 do error checking and the semantic analysis on the methods is
23393 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23394 and made a method, optional argument tells whether this is a class
23395 or a structure to apply the `has-this' bit.
23396 (Method::GetCallingConvention): Implement, returns the calling
23398 (Method::Define): Defines the type, a second pass is performed
23399 later to populate the methods.
23401 (Constructor::ParameterTypes): implement a cache similar to the
23402 one on Method::ParameterTypes, useful later when we do semantic
23405 (TypeContainer::EmitMethod): New method. Emits methods.
23407 * expression.cs: Removed MethodGroup class from here.
23409 * parameter.cs (Parameters::GetCallingConvention): new method.
23411 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23413 * class.cs (TypeContainer::Populate): Drop RootContext from the
23416 (Constructor::CallingConvention): Returns the calling convention.
23417 (Constructor::ParameterTypes): Returns the constructor parameter
23420 (TypeContainer::AddConstructor): Keep track of default constructor
23421 and the default static constructor.
23423 (Constructor::) Another class that starts using `public readonly'
23424 instead of properties.
23426 (Constructor::IsDefault): Whether this is a default constructor.
23428 (Field::) use readonly public fields instead of properties also.
23430 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23431 track of static constructors; If none is used, turn on
23432 BeforeFieldInit in the TypeAttributes.
23434 * cs-parser.jay (opt_argument_list): now the return can be null
23435 for the cases where there are no arguments.
23437 (constructor_declarator): If there is no implicit `base' or
23438 `this', then invoke the default parent constructor.
23440 * modifiers.cs (MethodAttr): New static function maps a set of
23441 modifiers flags into a MethodAttributes enum
23442 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23443 MethodAttr, TypeAttr to represent the various mappings where the
23444 modifiers are used.
23445 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23447 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23449 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23452 * interface.cs (PopulateIndexer): Implemented the code generator
23453 for interface indexers.
23455 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23457 * interface.cs (InterfaceMemberBase): Now we track the new status
23460 (PopulateProperty): Implement property population. Woohoo! Got
23461 Methods and Properties going today.
23463 Removed all the properties for interfaces, and replaced them with
23464 `public readonly' fields.
23466 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23468 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23469 initialize their hashtables/arraylists only when they are needed
23470 instead of doing this always.
23472 * parameter.cs: Handle refs and out parameters.
23474 * cs-parser.jay: Use an ArrayList to construct the arguments
23475 instead of the ParameterCollection, and then cast that to a
23478 * parameter.cs: Drop the use of ParameterCollection and use
23479 instead arrays of Parameters.
23481 (GetParameterInfo): Use the Type, not the Name when resolving
23484 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23486 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23487 and instead use public readonly fields.
23489 * class.cs: Put back walking code for type containers.
23491 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23493 * class.cs (MakeConstant): Code to define constants.
23495 * rootcontext.cs (LookupType): New function. Used to locate types
23498 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23500 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23501 this System.Reflection code is. Kudos to Microsoft
23503 * typemanager.cs: Implement a type cache and avoid loading all
23504 types at boot time. Wrap in LookupType the internals. This made
23505 the compiler so much faster. Wow. I rule!
23507 * driver.cs: Make sure we always load mscorlib first (for
23508 debugging purposes, nothing really important).
23510 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23511 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23513 * rootcontext.cs: Lookup types on their namespace; Lookup types
23514 on namespaces that have been imported using the `using' keyword.
23516 * class.cs (TypeContainer::TypeAttr): Virtualize.
23517 (Class::TypeAttr): Return attributes suitable for this bad boy.
23518 (Struct::TypeAttr): ditto.
23519 Handle nested classes.
23520 (TypeContainer::) Remove all the type visiting code, it is now
23521 replaced with the rootcontext.cs code
23523 * rootcontext.cs (GetClassBases): Added support for structs.
23525 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23527 * interface.cs, statement.cs, class.cs, parameter.cs,
23528 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23529 Drop use of TypeRefs, and use strings instead.
23531 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23535 * class.cs (Struct::Struct): set the SEALED flags after
23536 checking the modifiers.
23537 (TypeContainer::TypeAttr): new property, returns the
23538 TypeAttributes for a class.
23540 * cs-parser.jay (type_list): Oops, list production was creating a
23541 new list of base types.
23543 * rootcontext.cs (StdLib): New property.
23544 (GetInterfaceTypeByName): returns an interface by type name, and
23545 encapsulates error handling here.
23546 (GetInterfaces): simplified.
23547 (ResolveTree): Encapsulated all the tree resolution here.
23548 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23551 * driver.cs: Add support for --nostdlib, to avoid loading the
23552 default assemblies.
23553 (Main): Do not put tree resolution here.
23555 * rootcontext.cs: Beginning of the class resolution.
23557 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23559 * rootcontext.cs: Provide better error reporting.
23561 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23563 * rootcontext.cs (CreateInterface): Handle the case where there
23564 are no parent interfaces.
23566 (CloseTypes): Routine to flush types at the end.
23567 (CreateInterface): Track types.
23568 (GetInterfaces): Returns an array of Types from the list of
23569 defined interfaces.
23571 * typemanager.c (AddUserType): Mechanism to track user types (puts
23572 the type on the global type hash, and allows us to close it at the
23575 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23577 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23578 RecordInterface instead.
23580 * cs-parser.jay: Updated to reflect changes above.
23582 * decl.cs (Definition): Keep track of the TypeBuilder type that
23583 represents this type here. Not sure we will use it in the long
23584 run, but wont hurt for now.
23586 * driver.cs: Smaller changes to accomodate the new code.
23588 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23591 * rootcontext.cs (CreateInterface): New method, used to create
23592 the System.TypeBuilder type for interfaces.
23593 (ResolveInterfaces): new entry point to resolve the interface
23595 (CodeGen): Property, used to keep track of the code generator.
23597 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23599 * cs-parser.jay: Add a second production for delegate_declaration
23602 (enum_body): Put an opt_comma here instead of putting it on
23603 enum_body or enum_member_declarations so we can handle trailing
23604 commas on enumeration members. Gets rid of a shift/reduce.
23606 (type_list): Need a COMMA in the middle.
23608 (indexer_declaration): Tell tokenizer to recognize get/set
23610 * Remove old targets.
23612 * Re-add the parser target.
23614 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23616 * cs-parser.jay: Add precendence rules for a number of operators
23617 ot reduce the number of shift/reduce conflicts in the grammar.
23619 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23621 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23624 Get rid of old crufty code.
23626 * rootcontext.cs: Use this to keep track of the parsed
23627 representation and the defined types available to the program.
23629 * gen-treedump.cs: adjust for new convention.
23631 * type.cs: Split out the type manager, and the assembly builder
23634 * typemanager.cs: the type manager will live here now.
23636 * cil-codegen.cs: And the code generator here.
23638 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23640 * makefile: Fixed up for easy making.
23642 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23644 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23647 (unary_expression): Expand pre_increment_expression and
23648 post_decrement_expression to reduce a shift/reduce.
23650 2001-07-11 Simon Cozens
23652 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23654 Improve allow_keyword_as_indent name.
23656 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23658 * Adjustments for Beta2.
23660 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23662 * decl.cs: Added `Define' abstract method.
23663 (InTransit): new property, used to catch recursive definitions.
23665 * interface.cs: Implement `Define'.
23667 * modifiers.cs: Map Modifiers.constants to
23668 System.Reflection.TypeAttribute flags.
23670 * class.cs: Keep track of types and user-defined types.
23671 (BuilderInit): New method for creating an assembly
23672 (ResolveType): New function to launch the resolution process, only
23673 used by interfaces for now.
23675 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23676 that are inserted into the name space.
23678 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23680 * ARGH. I have screwed up my tree so many times due to the use of
23681 rsync rather than using CVS. Going to fix this at once.
23683 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23686 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23688 * Experiment successful: Use System.Type rather that our own
23691 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23693 * cs-parser.jay: Removed nsAliases from here.
23695 Use new namespaces, handle `using XXX;'
23697 * namespace.cs: Reimplemented namespace handling, use a recursive
23698 definition of the class. Now we can keep track of using clauses
23699 and catch invalid using clauses.
23701 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23703 * gen-treedump.cs: Adapted for all the renaming.
23705 * expression.cs (Expression): this class now has a Type property
23706 which returns an expression Type.
23708 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23709 `Type', as this has a different meaning now in the base
23711 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23713 * interface.cs, class.cs: Removed from all the sources the
23714 references to signature computation, as we can not do method
23715 signature computation during the parsing time, as we are not
23716 trying to solve at that point distinguishing:
23720 void a (NS.Blah x) {}
23723 Which depending on the context might be valid or not, as we do not
23724 know if Blah is the same thing as NS.Blah at that point.
23726 * Redid everything so the code uses TypeRefs now instead of
23727 Types. TypeRefs are just temporary type placeholders, that need
23728 to be resolved. They initially have a pointer to a string and the
23729 current scope in which they are used. This is used later by the
23730 compiler to resolve the reference to an actual Type.
23732 * DeclSpace is no longer a CIR.Type, and neither are
23733 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23734 are all DeclSpaces, but no Types.
23736 * type.cs (TypeRefManager): This implements the TypeRef manager,
23737 which keeps track of all the types that need to be resolved after
23738 the parsing has finished.
23740 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23742 * ARGH. We are going to have to store `foreach' as a class rather
23743 than resolving it, as we need to verify error 1579 after name
23744 resolution. *OR* we could keep a flag that says `This request to
23745 IEnumerator comes from a foreach statement' which we can then use
23746 to generate the error.
23748 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23750 * class.cs (TypeContainer.AddMethod): we now add methods to the
23751 MethodGroup instead of the method hashtable.
23753 * expression.cs: Add MethodGroup abstraction, which gets us one
23754 step closer to the specification in the way we handle method
23757 * cs-parser.jay (primary_expression): qualified_identifier now
23758 tried to match up an identifier to a local variable reference or
23759 to a parameter reference.
23761 current_local_parameters is now a parser global variable that
23762 points to the current parameters for the block, used during name
23765 (property_declaration): Now creates an implicit `value' argument to
23768 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23770 * parameter.cs: Do not use `param' arguments as part of the
23771 signature, per the spec.
23773 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23775 * decl.cs: Base class for classes, structs and interfaces. This
23776 is the "Declaration Space"
23778 * cs-parser.jay: Use CheckDef for checking declaration errors
23779 instead of having one on each function.
23781 * class.cs: Factor out some code for handling error handling in
23782 accordance to the "Declarations" section in the "Basic Concepts"
23783 chapter in the ECMA C# spec.
23785 * interface.cs: Make all interface member classes derive from
23786 InterfaceMemberBase.
23788 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23790 * Many things: all interfaces are parsed and generated in
23791 gen-treedump. Support for member variables, constructors,
23792 destructors, properties, constants is there.
23794 Beginning of the IL backend, but very little done, just there for
23797 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23799 * cs-parser.jay: Fix labeled statement.
23801 * cs-tokenizer.cs (escape): Escape " and ' always.
23802 ref_line, ref_name: keep track of the line/filename as instructed
23803 by #line by the compiler.
23806 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23808 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23809 to match the values in System.CodeDOM.
23811 Divid renamed to Divide.
23813 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23815 (Statements.set): remove.
23817 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23820 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23821 falseStatements always have valid values.
23823 * cs-parser.jay: Use System.CodeDOM now.