1 2006-09-19 Martin Baulig <martin@ximian.com>
3 * expression.cs: Completely merged with the gmcs version.
5 2006-09-19 Martin Baulig <martin@ximian.com>
7 * expression.cs (Invocation): Merged with the gmcs version.
8 (ArrayAccess.GetStoreOpcode): Likewise.
10 2006-09-19 Martin Baulig <martin@ximian.com>
13 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
14 (TypeManager.IsGenericMethodDefinition): Likewise.
16 2006-09-19 Martin Baulig <martin@ximian.com>
19 (TypeManager.IsEqual): Moved the gmcs implementation here.
20 (TypeManager.DropGenericTypeArguments): Likewise.
21 (TypeManager.DropGenericMethodArguments): Likewise.
22 (TypeManager.GetTypeArguments): Moved here from gmcs.
23 (TypeManager.HasGenericArguments): Likewise.
25 2006-09-19 Martin Baulig <martin@ximian.com>
27 * expression.cs (Binary): Merged with the gmcs version.
29 2006-09-19 Martin Baulig <martin@ximian.com>
31 * expression.cs (Probe, As, Is): Merged with the gmcs version.
33 2006-09-19 Martin Baulig <martin@ximian.com>
35 * typemanager.cs: Merged with the gmcs version.
37 2006-09-16 Raja R Harinath <rharinath@novell.com>
39 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
40 * driver.cs: Likewise.
42 2006-09-16 Marek Safar <marek.safar@seznam.cz>
45 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
46 only if parent type is class.
47 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
50 2006-09-15 Marek Safar <marek.safar@seznam.cz>
53 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
55 * typemanager.cs(CSharpName): Converts NullType to null.
57 2006-09-15 Martin Baulig <martin@ximian.com>
60 (TypeManager.GetMethodName): Added mcs implementation.
61 (TypeManager.IsEqual): Likewise.
64 (SimpleName.RemoveGenericArity): Added dummy implementation.
66 * pending.cs: Merged with the gmcs version.
68 2006-09-15 Martin Baulig <martin@ximian.com>
70 * statement.cs: Merge with the gmcs version.
72 2006-09-15 Martin Baulig <martin@ximian.com>
74 * statement.cs (Switch): Merge with the gmcs implementation
75 (without nullables), which is newer.
77 2006-09-15 Martin Baulig <martin@ximian.com>
79 * statement.cs (Block.Variables): Make this public.
80 (ToplevelBlock.Parameters): Make this a property.
81 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
83 2006-09-15 Martin Baulig <martin@ximian.com>
85 * namespace.cs: Merge with the gmcs version.
87 2006-09-15 Martin Baulig <martin@ximian.com>
89 * decl.cs (MemberName): Minor code cleanups.
91 2006-09-15 Martin Baulig <martin@ximian.com>
93 * parameter.cs: Merge with the gmcs version.
95 2006-09-15 Martin Baulig <martin@ximian.com>
97 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
100 2006-09-15 Martin Baulig <martin@ximian.com>
102 * flowanalysis.cs: Merged from GMCS; added the generics code into
103 a `GMCS_SOURCE' conditional so we can share this file.
105 2006-09-08 Martin Baulig <martin@ximian.com>
107 * typemanager.cs (TypeManager.interlocked_type): New public field.
108 (TypeManager.int_interlocked_compare-exchange): New public field.
109 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
110 enumerator types here and call InitGenericCoreTypes().
111 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
112 after calling InitEnumUnderlyingTypes().
115 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
116 `classes_second_stage'.
118 2006-09-14 Marek Safar <marek.safar@seznam.cz>
120 * assign.cs, ecore.cs, expression.cs: Share error message text.
121 * class.cs (FieldMember.Define): Check for varible of static type.
122 * driver.cs (LoadAssembly): Uses error output for errors.
123 * statement.cs: Updated.
125 2006-09-08 Marek Safar <marek.safar@seznam.cz>
127 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
130 2006-09-07 Martin Baulig <martin@ximian.com>
133 (MainDriver): Revert r62663 from Marek; see #70506 for details.
135 2006-08-29 Miguel de Icaza <miguel@novell.com>
137 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
139 2006-08-17 Miguel de Icaza <miguel@novell.com>
141 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
142 #52019 and #79064, the use of the \uXXXX sequence in source code
143 to represent unicode characters.
145 2006-08-15 Marek Safar <marek.safar@seznam.cz>
147 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
149 * class.cs, ecore.cs, statement.cs: Merged to one error message.
151 2006-08-13 Miguel de Icaza <miguel@novell.com>
153 * assign.cs: Catch attempts to assign to a method groups in += and
156 2006-08-13 Marek Safar <marek.safar@seznam.cz>
159 * cs-parser.jay: Don't destroy current array type by typeof of array's.
161 2006-08-12 Marek Safar <marek.safar@seznam.cz>
163 * class.cs (Method.Define): Issue a warning when generic method looks like
165 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
168 2006-08-09 Marek Safar <marek.safar@seznam.cz>
170 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
172 * decl.cs (MemberCache.FindMembers): When container is interface we need to
173 search all base interfaces as a member can be ambiguous.
174 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
175 Constructor member type filter.
176 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
177 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
178 reporting for returned memberinfos.
179 * report.cs: Updated.
180 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
181 version to work on all runtimes.
182 (TypeManager.RealMemberLookup): Removed members filtering.
184 2006-08-08 Raja R Harinath <rharinath@novell.com>
186 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
187 (PropertyExpr.EmitAssign): Likewise.
188 * expression.cs (Indirection.EmitAssign): Likewise.
189 (LocalVariableReference.EmitAssign): Likewise.
190 (ParameterReference.EmitAssign): Likewise.
191 (Invocation.EmitArguments): Likewise.
192 (ArrayAccess.EmitAssign): Likewise.
193 (IndexerAccess.EmitAssign): Likewise.
194 (This.EmitAssign): Likewise.
195 (ConditionalLogicalOperator.Emit): Likewise.
198 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
199 instead of ArrayList. If the hashtable has a LocalBuilder, don't
200 leave it in after returning it.
201 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
203 2006-08-06 Marek Safar <marek.safar@seznam.cz>
205 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
208 2006-08-03 Raja R Harinath <rharinath@novell.com>
210 Fix cs0146-3.cs and cs0146-4.cs.
211 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
212 enclosing types don't depend on the current type.
214 2006-08-02 Raja R Harinath <rharinath@novell.com>
217 * class.cs (TypeContainer.DoDefineMembers): Use
218 FindBaseMemberWithSameName on Parent, since we're interested in
219 whether we hide inherited members or not.
220 (FindBaseMemberWithSameName): Make slightly more robust.
222 Fix the non-generic testcase from #77396
223 * decl.cs (DeclSpace.DeclContainer): Remove override.
225 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
226 declspaces for doppelgangers too.
227 (UsingEntry): Implement IResolveContext.
228 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
229 'this' as the resolve context.
230 (LocalAliasEntry): Likewise.
232 Implement parts of #77403
233 * roottypes.cs (RootDeclSpace): New. Used to represent the
234 toplevel declaration space. Each namespace declaration introduces
235 a "partial" root declaretion space.
236 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
237 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
238 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
239 from 'current_namespace.SlaveDeclSpace'.
240 (namespace_declaration): Likewise.
241 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
242 check. It can't happen now.
243 * decl.cs (DeclSpace.LookupType): Likewise.
244 * driver.cs (MainDriver): Sanity check.
246 2006-08-01 Raja R Harinath <rharinath@novell.com>
248 * decl.cs (DeclSpace.FindNestedType): Remove.
249 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
250 LookupTypeContainer to get the container of the nested type.
251 * class.cs (TypeContainer.FindNestedType): Make non-override.
253 2006-07-31 Raja R Harinath <rharinath@novell.com>
255 * decl.cs (DeclSpace.PartialContainer): Move field from ...
256 * class.cs (TypeContainer.PartialContainer): ... here.
257 (TypeContainer.AddBasesForPart): New helper.
258 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
260 * cs-parser.jay (current_class): Convert to DeclSpace.
261 (struct_declaration, interface_declaration, class_declaration):
262 Use AddBasesForPart instead of .Bases directly.
263 * const.cs, iterators.cs: Update to changes.
265 2006-07-28 Raja R Harinath <rharinath@novell.com>
267 * class.cs (TypeContainer.AddMemberType): Rename from
269 (TypeContainer.AddMember): Rename from AddToMemberContainer.
270 (AddTypeContainer): New. Combine AddClassOrStruct and
272 (AddPartial): Update. Add 'is_partial' argument.
273 * roottypes.cs: Update to changes.
274 * cs-parser.jay (push_current_class): New helper for handling
275 current_container and current_class.
276 (struct_declaration, interface_declaration, class_declaration):
279 2006-07-26 Raja R Harinath <rharinath@novell.com>
281 * roottypes.cs: Rename from tree.cs.
283 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
284 * tree.cs (Tree, ITreeDump): Remove types.
285 * rootcontext.cs (tree, Tree): Remove fields.
286 (root, ToplevelTypes): New.
287 * *.cs: Update to rename.
289 * tree.cs (Tree.RecordDecl): Remove.
290 (RootTypes.AddToTypeContainer): Record the toplevel type in its
292 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
294 2006-07-23 Raja R Harinath <harinath@gmail.com>
296 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
297 DoFlowAnalysis and OmitStructFlowAnalysis here.
298 (ec.With): Rename from WithUnsafe and generalize.
299 (ec.WithCheckState): Remove. All users can be handled by 'With'.
300 (ec.WithFlowAnalyis): New.
301 * ecore.cs, expression.cs, statement.cs: Update.
303 2006-07-22 Raja R Harinath <harinath@gmail.com>
305 * statement.cs (Block.ResolveMeta): Simplify slightly.
307 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
308 multiple boolean fields. Convert InUnsafe, constant_check_state,
309 check_state to flags.
310 (CheckState, ConstantCheckState): Update.
311 (InUnsafe): New read-only property.
312 (FlagsHandle): Rename from CheckStateHandle and convert to handle
314 (WithUnsafe): New helper similar to WithCheckState.
315 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
316 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
318 2006-07-21 Raja R Harinath <rharinath@novell.com>
320 Make comparisons use the same IL irrespective of whether they're
321 in a 'checked' or 'unchecked' context: one of the issues in #78899
322 * codegen.cs (EmitContext.CheckState): Make read-only property.
323 (EmitContext.ConstantCheckState): Likewise.
324 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
325 helper that implement a save/restore stack for CheckState
326 values. This is the only way to change check-state.
327 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
328 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
329 (CheckedExpr.EmitBranchable): New forwarding method.
330 (UnCheckedExpr): Likewise.
331 * statement.cs (Block.ResolveMeta): Use WithCheckState.
332 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
333 (Checked.Resolve, checked.DoEmit): Likewise.
335 2006-07-20 Miguel de Icaza <miguel@novell.com>
337 * anonymous.cs: Cache the resolved anonymous delegate, and return
338 this so that the ResolveTopBlock is only triggered once, not
341 Currently we trigger ResolvetopBlock twice due to a first pass of
342 argument check compatibility, and a second pass that does the
345 2006-07-15 Marek Safar <marek.safar@seznam.cz>
347 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
349 * rootcontext.cs (Reset): Add helper_classes.
351 2006-07-15 Marek Safar <marek.safar@seznam.cz>
354 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
357 2006-07-13 Miguel de Icaza <miguel@novell.com>
359 * statement.cs (Lock): Handle expressions of type
360 TypeManager.null_type specially. Fixes #78770
362 2006-07-08 Marek Safar <marek.safar@seznam.cz>
364 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
367 2006-07-08 Marek Safar <marek.safar@seznam.cz>
369 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
370 for accessors as well.
371 * ecore.cs (EventExpr): Add AccessorTable.
373 2006-07-01 Marek Safar <marek.safar@seznam.cz>
376 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
377 for CS0122 where appropriate.
378 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
380 (Filter): Assembly can be null in the case of top level attributes.
382 2006-06-25 Marek Safar <marek.safar@seznam.cz>
386 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
387 is done at global level.
389 2006-06-24 Marek Safar <marek.safar@seznam.cz>
391 A fix for #77002, Implemented TypeForwarder support.
393 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
394 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
395 * typemanager.cs (): Add type_forwarder_attr_type.
397 2006-06-24 Marek Safar <marek.safar@seznam.cz>
399 * report.cs: Add CS0469 warning.
401 2006-06-21 Martin Baulig <martin@ximian.com>
403 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
404 the `try'-block, so we also report CS0016 etc. there.
406 2006-06-21 Martin Baulig <martin@ximian.com>
409 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
411 2006-06-21 Martin Baulig <martin@ximian.com>
413 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
414 also report CS1686 for parameters.
416 2006-06-21 Martin Baulig <martin@ximian.com>
418 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
419 instead of an error if the value is not implicitly convertible to
420 the switch types; fixes #77964.
422 2006-06-21 Raja R Harinath <rharinath@novell.com>
425 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
426 FieldBuilder is null.
429 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
430 'left' and 'right' before error-checking.
432 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
434 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
436 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
437 (FieldExpr.DoResolve): likewise.
438 (PropertyExpr.InstanceResolve): likewise.
439 (EventExpr.InstanceResolve): likewise.
441 2006-06-04 Marek Safar <marek.safar@seznam.cz>
443 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
444 attribute applicable tests for attribute argument.
446 2006-06-02 Raja R Harinath <rharinath@novell.com>
449 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
450 (Binary.OverloadResolve_PredefinedIntegral): New.
451 (Binary.OverloadResolve_PredefinedFloating): New.
452 (Binary.OverloadResolve_PredefinedString): New.
453 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
454 Follow the standard more closely, and treat numeric promotions in
455 terms of overload resolution.
456 (Binary.CheckShiftArguments): Simplify.
458 2006-06-01 Raja R Harinath <rharinath@novell.com>
460 * flowanalysis.cs (MyBitVector): Simplify representation.
461 (MyBitVector.Clone): Avoid allocating BitArray.
462 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
463 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
464 (*): Update. Change all references to MyBitVector.And and
465 MyBitVector.Or to &= and |=.
467 2006-05-29 Raja R Harinath <rharinath@novell.com>
470 * cs-parser.jay (formal_parameter_list): Extend the pattern below
471 to param arguments too.
473 2006-05-26 Miguel de Icaza <miguel@novell.com>
475 * cs-parser.jay: Catch another parsing form for arglist being
476 followed by other arguments. Fixes #78313.
478 2006-05-24 Raja R Harinath <rharinath@novell.com>
480 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
481 checking of out parameters to ...
482 (FlowBranchingToplevel.Merge): ... here.
483 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
484 set, propagate the origin upward, and only complain if there was
486 (FlowBranchingException.AddContinueOrigin): Likewise.
487 (FlowBranchingException.AddReturnOrigin): Likewise.
488 (FlowBranchingException.AddGotoOrigin): Likewise.
490 2006-05-23 Raja R Harinath <rharinath@novell.com>
492 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
493 unreachable, skip it.
494 (FlowBranchingException.Merge): Always propagate jumps, even if
495 the finally block renders subsequent code unreachable.
497 2006-05-18 Raja R Harinath <rharinath@novell.com>
500 * statement.cs (Goto.Resolve): Move responsibility for resolving
501 'goto' to FlowBranching.AddGotoOrigin.
502 (Goto.SetResolvedTarget): New. Callback to set the
503 LabeledStatement that's the target of the goto.
504 (Goto.DoEmit): Use Leave instead of Br when crossing an
505 unwind-protect boundary.
506 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
507 LookupLabel and adjust to new semantics.
508 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
509 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
510 Goto.SetResolvedTarget to update target.
511 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
512 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
513 AddBreakOrigin & co. Delay propagation until ...
514 (FlowBranchingException.Merge): ... this.
516 * statement.cs (Block.Resolve): Always depend on flow-branching to
517 determine unreachability. Kill workaround that originally emitted
518 only one statement after an "unreachable" label (see infloop in
521 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
522 This is still "wrong", but anything better would probably need a
523 multi-pass algorithm.
524 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
525 usage vector. Force current usage vector to be reachable, to
526 optimistically signify backward jumps.
527 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
529 (FlowBranchingLabeled.Merge): New. If no backward jump was
530 detected, return the original salted-away usage vector instead,
531 updated with appropriate changes. Print unreachable warning if
533 * statement.cs (Block.Resolve): Don't print unreachable warning on
536 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
538 * driver.cs: Pass filename without path to AssemblyBuilder's
539 AddResourceFile. Fixes bug #78407.
541 2006-05-17 Raja R Harinath <rharinath@novell.com>
543 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
544 * flowanalysis.cs (FlowBranchingLabeled): ... here.
545 (FlowBranching.MergeChild): Overwrite
546 reachability information from Labeled branchings too.
548 2006-05-16 Raja R Harinath <rharinath@novell.com>
550 * statement.cs (Goto.Resolve): Merge jump origins here ...
551 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
553 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
554 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
555 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
556 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
558 * statement.cs (Goto.Resolve): ... not here.
559 (Goto.Emit): Remove CS1632 check.
561 2006-05-14 Marek Safar <marek.safar@seznam.cz>
563 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
566 2006-05-11 Raja R Harinath <rharinath@novell.com>
568 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
569 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
570 (FlowBranchingException.Label): Likewise.
572 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
574 (MyBitVector.Or): Use it to avoid losing information (Count).
575 (FlowBranching.MergeOrigins): Likewise.
577 * flowanalysis.cs (UsageVector.IsDirty): Remove.
578 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
579 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
580 (UsageVector.ToString): Simplify.
581 (UsageVector.MergeSiblings): Move here from ...
582 (FlowBranching.Merge): ... here.
583 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
586 2006-05-10 Raja R Harinath <rharinath@novell.com>
588 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
589 null bitvector is treated as all-true.
591 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
592 (MyBitVector): Rationalize invariants. 'vector != null' implies
593 that we have our own copy of the bitvector. Otherwise,
594 'InheritsFrom == null' implies all inherited bits are true.
596 2006-05-09 Marek Safar <marek.safar@seznam.cz>
598 * statement.cs (LocalInfo): Add IsConstant.
599 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
600 local variable for constants.
602 2006-05-09 Raja R Harinath <rharinath@novell.com>
604 * flowanalysis.cs (MyBitVector.Empty): New.
605 (MyBitVector): Don't allow InheritedFrom to be null.
606 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
607 (UsageVector, FlowBranching): Update to changes.
609 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
610 recursion. The 'Parent == null' condition isn't sufficient for
612 (FlowBranching.AddBreakOrigin): Likewise.
613 (FlowBranching.AddContinueOrigin): Likewise.
614 (FlowBranching.AddReturnOrigin): Likewise.
615 (FlowBranching.StealFinallyClauses): Likewise.
616 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
617 (FlowBranching.CheckOutParameters): Likewise.
618 (FlowBranchingToplevel): Terminate all the above recursions here.
619 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
620 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
622 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
624 (FlowBranchingToplevel): New. Empty for now.
625 (FlowBranching.MergeTopBlock): Update.
626 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
627 branching for the anonymous delegate.
628 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
630 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
631 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
632 information at the start of the merge. Reorganize.
634 2006-05-07 Marek Safar <marek.safar@seznam.cz>
636 * class.cs (MethodData.Define): Method cannot implement interface accessor.
638 2006-05-07 Marek Safar <marek.safar@seznam.cz>
640 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
641 to newly introduced ctor.
643 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
644 message to one place.
645 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
648 2006-05-07 Marek Safar <marek.safar@seznam.cz>
650 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
652 * ecore.cs (Expression.ResolveAsConstant): Updated.
654 * statement.cs (ResolveMeta): Updated.
656 2006-05-06 Marek Safar <marek.safar@seznam.cz>
658 * cs-parser.jay: __arglist cannot be used in initializer.
660 2006-05-06 Marek Safar <marek.safar@seznam.cz>
663 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
666 2006-05-05 Raja R Harinath <rharinath@novell.com>
668 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
669 (LabeledStatement): Add 'name' parameter.
670 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
671 (Block.AddLabel): Update to changes.
672 * cs-parser.jay (labeled_statement): Likewise.
674 * flowanalysis.cs (BranchingType.Labeled): New.
675 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
676 (FlowBranchingLabeled): New. Does nothing for now, but will
677 eventually handle 'goto' flows.
678 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
679 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
680 that's terminated ...
681 (Block.Resolve): ... here.
683 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
684 (UsageVector.MergeFinallyOrigins): Likewise.
685 (FlowBranching.InTryOrCatch): Likewise.
686 (FlowBranching.AddFinallyVector): Likewise.
687 (FlowBranchingException): Update to changes.
690 * statement.cs (Return.Resolve): Move error checking to ...
691 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
692 (FlowBranchingException): Handle return origins like break and
694 (FlowBranching.UsageVector.CheckOutParameters): Remove.
696 2006-05-04 Marek Safar <marek.safar@seznam.cz>
699 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
702 2006-05-04 Marek Safar <marek.safar@seznam.cz>
705 * class.cs (MethodData.Define): Do public accessor check only when method
706 implements an interface.
708 2006-05-04 Raja R Harinath <rharinath@novell.com>
710 Remove special handling of 'break'
711 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
712 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
713 (UsageVector.Break): Remove.
714 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
716 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
718 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
719 UsageVector.Breaks (). Don't set NeedsReturnLabel.
721 2006-05-03 Marek Safar <marek.safar@seznam.cz>
724 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
725 be the interface member.
727 2006-05-03 Marek Safar <marek.safar@seznam.cz>
730 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
731 for emitting small (int) values.
733 2006-05-03 Raja R Harinath <rharinath@novell.com>
736 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
737 control-flow passes through the 'finally' after merging-in all the
738 control-flows from 'try' and the 'catch' clauses.
740 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
741 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
742 always true at the only non-recursive entry point.
743 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
744 FlowBranchingBreakable.
745 (FlowBranchingLoop): Remove.
746 * statement.cs (Return.DoResolve): Update to changes.
749 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
750 (FlowBranching.CreateBranching): Handle it: create a
751 FlowBranchingContinuable.
752 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
753 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
754 except that it handles the 'continue' command.
755 (FlowBranching.UsageVector.MergeOrigins): Rename from
757 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
758 except that it overrides AddContinueOrigin.
759 (FlowBranchingException): Override AddContinueOrigin, similar to
761 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
762 Create a new branching around the embedded statement.
763 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
764 control flow after the embedded statement.
765 (Continue.Resolve): Move all error checking to AddContinueOrigin.
767 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
768 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
769 FlowBranchingBreakable.
770 (FlowBranchingSwitch): Remove.
773 * statement.cs (Break.Resolve): Simplify. Move responsibility for
774 error reporting to ...
775 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
776 Rename from 'AddBreakVector'. Add new location argument. Return
777 a bool indicating whether the 'break' crosses an unwind-protect.
778 (FlowBranchingException.AddBreakOrigin): Add.
779 (FlowBranchingException.Merge): Propagate 'break's to surrounding
780 flowbranching after updating with the effects of the 'finally'
782 (FlowBranchingBreakable): New common base class for
783 FlowBranchingLoop and FlowBranchingSwitch.
785 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
787 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
789 2006-05-02 Raja R Harinath <rharinath@novell.com>
791 * statement.cs (Do.Resolve): If the loop is infinite, set the
793 (While.Resolve, For.Resolve): Set a barrier after the embedded
794 statement. There's no direct control flow that goes from the end
795 of the embedded statement to the end of the loop.
796 * flowanalysis.cs (FlowBranching.Infinite): Remove.
797 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
798 above ensure that the reachability is correctly computed.
800 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
801 (UsageVector.MergeBreakOrigins): If the current path is
802 unreachable, treat it as if all parameters/locals are initialized.
803 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
804 infinite loops before merging-in break origins.
806 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
807 (Reachability.Reachable): Split part into ...
808 (Reachability.Unreachable): ... this. Simplify.
809 (Reachability.IsUnreachable): Use 'Unreachable' instead.
811 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
812 (Reachability.SetThrowsSometimes): Likewise.
813 (FlowBranchingBlock.MergeTopBlock): Don't compare against
814 TriState.Always, use corresponding property.
815 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
816 (Block.Resolve): Likewise. Remove some redundant checks.
818 2006-05-02 Raja R Harinath <harinath@gmail.com>
820 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
821 (Reachability.Meet): Don't bother checking AlwaysThrows --
822 barrier is always set.
823 (FlowBranchingBlock.Merge): Likewise.
825 2006-05-01 Raja R Harinath <harinath@gmail.com>
827 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
828 checks for unreachable.
830 2006-05-01 Marek Safar <marek.safar@seznam.cz>
833 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
835 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
836 whether field is really assigned.
838 2006-04-30 Raja R Harinath <harinath@gmail.com>
840 * flowanalysis.cs (Reachability): Make 4-argument constructor
842 (Reachability.Meet): Rename from 'And'. Remove static variant.
843 (Reachability.Always): Rename from the highly misleading
844 'Reachability.Never'.
845 (FlowBranching.Merge): Update to changes. Mark an impossible
846 situation with a 'throw'.
847 (*): Update to changes.
849 2006-04-29 Raja R Harinath <harinath@gmail.com>
851 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
853 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
854 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
855 (*): Update to changes.
856 * statement.cs: Update to changes.
858 2006-04-28 Marek Safar <marek.safar@seznam.cz>
861 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
863 2006-04-28 Raja R Harinath <harinath@gmail.com>
865 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
868 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
869 argument to two arguments: an usage-vector and a bool. Move call
870 to FlowBranching.Merge () ...
871 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
873 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
874 handling of loop and switch reachability to ...
875 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
877 2006-04-27 Raja R Harinath <harinath@gmail.com>
879 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
880 handling to FlowBranchingLoop.InLoop.
881 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
883 2006-04-26 Marek Safar <marek.safar@seznam.cz>
886 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
887 anonymous method is allowed from AnonymousContainer here.
889 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
891 2006-04-24 Raja R Harinath <rharinath@novell.com>
894 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
896 2006-04-23 Marek Safar <marek.safar@seznam.cz>
899 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
900 (DoubleConstant.Reduce): Ditto.
902 2006-04-23 Raja R Harinath <rharinath@novell.com>
904 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
905 Remove 'lvalue_right_side' argument. Move parts to ...
906 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
907 (LocalVariable.DoResolveLValue): ... these.
909 2006-04-21 Raja R Harinath <rharinath@novell.com>
912 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
913 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
914 (LocalVariableReference.DoResolveBase): Use it to implement new
916 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
917 (Argument.Resolve): Simplify. Move CS1510 check ...
918 * ecore.cs (Expression.ResolveLValue): ... here.
919 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
920 (PropertyExpr.DoResolveLValue): Likewise.
921 (FieldExpr.Report_AssignToReadonly): Likewise.
922 (FieldExpr.DoResolve): Add 'out_access' argument. Use
923 LValueMemberAccess or LValueMemberOutAccess on instance depending
925 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
926 DoResolve as appropriate.
928 2006-04-20 Raja R Harinath <rharinath@novell.com>
931 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
932 implicit conversions on 'out' and 'ref' arguments.
934 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
935 improve clarity. Remove dead code.
938 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
939 (Catch.Resolve): Resolve VarBlock if it exists.
941 2006-04-19 Miguel de Icaza <miguel@novell.com>
943 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
944 twice, this was some residual code, the enumerator was emitted
945 properly in the two branche of if later.
947 2006-04-19 Raja R Harinath <rharinath@novell.com>
949 * expression.cs (Cast.ResolveLValue): Remove. The result of a
950 cast is never an lvalue.
951 (Cast.DoResolve, Cast.ResolveRest): Combine.
952 (Argument.Emit): Simplify slightly. Move 'Expr is
953 IMemoryLocation' check ...
954 (Argument.Resolve): ... here.
955 (Argument.Error_LValueRequired): Remove. Inline into only user.
957 Simplifications. Fix cs0191-2.cs
958 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
959 CS1649 and CS1651 to ...
960 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
961 the actual selection of the error code and message to a lookup
962 table. Add a dummy return value to simplify callsites.
963 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
964 readonly fields of other instances of the same type. Move CS0197
966 * expression.cs (Argument.Resolve): ... here. Simplify code.
967 Ensure that ec.InRefOutArgumentResolving is only set during LValue
968 resolution of an out or ref argument. The code simplification
969 above uses this invariant.
971 2006-04-18 Raja R Harinath <rharinath@novell.com>
973 Possibly fix #77752. Fix cs1690-[4-7].cs.
974 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
975 CheckMarshallByRefAccess. Drop parameter.
976 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
978 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
980 * report.cs (AllWarnings): Add CS1690.
981 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
983 (LocalVariableReference.DoResolveBase): Update.
985 2006-04-09 Marek Safar <marek.safar@seznam.cz>
987 * class.cs (MethodOrOperator): Moved common parts from method class.
988 detect obsolete attributes.
989 (Method.Define): Simplified as it reuses code from base.
990 (Constructor.ValidAttributeTargets): Fixed issue found during
992 (Destructor.ValidAttributeTargets): Fixed issue found during
994 (Operator): Finished refactoring set off by #78020. Operator class is now
995 ordinary method class.
997 * anonymous.cs: Updated.
999 * decl.cs (DeclSpace): Add IsGeneric
1001 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1003 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1005 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1007 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1008 detect obsolete attributes.
1009 (Method.CreateEmitContext): Moved to MethodOrOperator.
1011 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1014 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1015 customized exception to make crash detection easier.
1016 (MethodOrOperator): Started to work on new base class for methods and
1018 (Method): Derives from MethodOrOperator.
1019 (Constructor.Emit): Emits its own attributes.
1020 (AbstractPropertyEventMethod.Emit): Ditto.
1021 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1023 (Operator.Emit): It's temporary more tricky than should be.
1025 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1027 * report.cs (InternalErrorException): Add ctor with inner exception.
1029 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1032 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1035 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1038 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1041 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1043 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1044 attribute is present and Guid not.
1045 (Interface.ApplyAttributeBuilder): Ditto.
1047 * attribute.cs: Add error message.
1049 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1053 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1054 sources (it's composite) so hold them in extra array as they are used in
1055 Emit phase only. It worked in the previous versions by mistake.
1056 (Attribute.Emit): Emit attribute for more owners when exist.
1058 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1059 it has now different behaviour.
1061 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1063 * constant.cs (Constant.IsDefaultInitializer): New method.
1065 * class.cs: Updated.
1067 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1068 re-initialize default values. It saves KBs almost for every assembly.
1069 Thanks Zoltan for the idea.
1070 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1071 (ArrayCreation.DoResolve): Resolve only once.
1072 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1073 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1075 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1077 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1080 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1082 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1083 in an embedded statement too.
1085 2006-04-01 Raja R Harinath <rharinath@novell.com>
1088 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1090 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1094 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1097 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1099 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1101 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1104 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1105 LocalTemporary change.
1107 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1109 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1110 initializers optimization.
1111 (ClassOrStruct.TypeAttr): Moved from modifiers.
1112 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1113 (FieldBase.ResolveInitializer): Resolves initializer.
1114 (FieldBase.HasDefaultInitializer): New property.
1116 * cs-parser.jay: Removed message.
1118 * expression.cs (CompilerGeneratedThis): New specialization.
1120 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1122 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1124 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1126 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1128 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1129 be now EnumConstants only.
1131 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1133 * attribute.cs, driver.cs: Reset more caches.
1135 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1137 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1139 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1141 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1142 for easier reuse. Updated all overrides.
1143 (IntegralConstant): New base class for all integral constants.
1144 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1145 of the constant range, report custom error.
1146 (UIntConstant.Reduce): Fixed uint conversion.
1148 * ecore.cs, literal.cs: Reduce updates.
1150 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1154 * class.cs (Constructor.Define): Removed extra if for default ctors.
1155 A patch from Atsushi Enomoto.
1157 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1159 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1160 GetAttributableValue.
1162 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1165 * convert.cs (ImplicitConversionRequired): Error message moved to
1168 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1169 automatic implicit conversion of an output value.
1170 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1172 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1174 (TypeOf.GetAttributableValue): Add extra handling for object type.
1176 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1177 special error message.
1179 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1181 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1183 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1184 compatible with MS runtime.
1186 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1188 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1189 attribute arguments here.
1191 * class.cs (Indexer.Define): The check was moved to attribute class.
1193 2006-03-22 Marek Safar <marek.safar@seznam.cz>
1195 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1196 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1199 2006-03-22 Raja R Harinath <rharinath@novell.com>
1201 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1202 mcs to keep code differences small.
1203 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1204 * typemanager.cs (parameter_default_value_attribute_type): New.
1205 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1208 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1210 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1212 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1214 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1216 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1219 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1221 * doc-bootstrap.cs : fix build.
1223 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1225 * expression.cs (StringConcat.Append): Issue a warning when empty string
1228 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1230 * assign.cs (CompoundAssign.ResolveSource): Removed.
1232 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1235 * class.cs (TypeContainer.FindMethods): Removed.
1236 (TypeContainer.CheckMemberUsage): Made static.
1238 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1240 * constant.cs (CheckRange): Removed unused type argument.
1241 (CheckUnsigned): Removed unused type argument.
1243 * cs-parser.jay: Updated after MemberAccess clean up.
1244 Uses Length for empty string test.
1246 * cs-tokenizer.cs: Uses Length for empty string test.
1247 (IsCastToken): Made static.
1248 (is_hex): Made static.
1249 (real_type_suffix): Made static.
1251 * decl.cs (SetupCache): Made static.
1252 (OnGenerateDocComment): Removed unused ds argument.
1254 * delegate.cs (VerifyDelegate): Removed unused argument.
1256 * doc.cs: Uses Length for empty string test.
1258 * driver.cs: Uses Length for empty string test.
1260 * enum.cs (IsValidEnumType): Made static
1262 * expression.cs (EnumLiftUp): Removed unused argument.
1263 (ResolveMethodGroup): Ditto.
1264 (BetterConversion): Ditto.
1265 (GetVarargsTypes): Ditto.
1266 (UpdateIndices): Ditto.
1267 (ValidateInitializers): Ditto.
1268 (MemberAccess.ctor): Ditto.
1269 (GetIndexersForType): Ditto.
1271 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1273 * iterators.cs: Updated after MemberAccess clean up.
1275 * location.cs: Uses Length for empty string test.
1277 * namespace.cs: Uses Length for empty string test.
1279 * report.cs (CheckWarningCode): Made static.
1281 * statement.cs (LabeledStatement): Removed unused argument.
1283 * typemanager.cs (FilterNone): Removed.
1285 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1287 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1290 * class.cs: Updated.
1292 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1294 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1296 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1300 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1301 reporting, it's more tricky than I thought.
1303 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1307 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1309 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1310 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1311 Add more error reporting; Fixed issue with params.
1313 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1315 * cs-parser.jay: AnonymousMethod requires host container.
1317 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1319 2006-03-18 Raja R Harinath <harinath@gmail.com>
1321 * class.cs: Change 'TypeContainer ds' constructor argument to
1322 'DeclSpace parent'. Some classes were missed below due to
1323 different naming convention.
1325 * class.cs (MemberCore.Parent): Delete. This makes the
1326 ParentContainer changes below enforceable by the compiler.
1328 Treat pointers to enclosing declaration space as 'DeclSpace', not
1330 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1331 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1333 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1335 (Block.AddThisVariable): Likewise.
1336 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1337 (AbstractPropertyEventMethod.Emit): Likewise.
1338 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1339 (GetMethod.Define, SetMethod.Define): Likewise.
1340 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1341 (DelegateMethod.EmitMethod): Likewise.
1343 Fix regression test-partial-13.cs.
1344 Rationalize use of PartialContainer. Ensure that the partial
1345 class semantics can be tied to type-correctness, i.e., any
1346 violation will cause a compile error.
1347 * class.cs, const.cs: Access all fields that belong to class
1348 TypeContainer via ParentContainer. Arguments of EmitContexts and
1349 Resolve()-like functions still use 'Parent'.
1351 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1352 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1353 (PropertyMethod.CheckModifiers): Remove unused argument.
1354 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1357 2006-03-17 Raja R Harinath <harinath@gmail.com>
1359 Make semantics of PartialContainer simpler.
1360 * decl.cs (DeclSpace.IsPartial): Remove.
1361 * class.cs (TypeContainer.IsPartial): Likewise.
1362 (TypeContainer..ctor): Set PartialContainer to point to self.
1363 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1364 (TypeContainer.FindNestedType): Likewise.
1365 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1367 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1369 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1371 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1373 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1376 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1378 * class.cs (Operator.Define): An error for base conversion was not
1381 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1383 * iterator.cs : yield break is allowed in try statement which has
1384 catch clauses. Fixed bug #77767.
1386 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1388 A fix for #77593, #77574.
1390 * class.cs (MethodCore.CheckBase): Another if for operator.
1392 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1394 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1397 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1398 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1401 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1404 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1405 Updated after another emitcontext usage was clean up. It should help us to
1406 synchronize with gmcs easier.
1408 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1412 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1413 (Event.Define): ditto
1414 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1416 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1417 Removed redundant code and set NewSlot for Invoke method too.
1419 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1420 (Parameters.MergeGenerated): New method. Use this method when you merge
1421 compiler generated argument with user arguments.
1423 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1425 * attribute.cs (ResolveAsTypeTerminal): Removed.
1427 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1428 specialization for predefined types; 30% speed up.
1429 Finally placed obsolete check to right place.
1430 (Expression.ResolveType): Removed.
1432 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1433 Updated after ResolveType was removed.
1435 * expression.cs (Cast.ctor): Check void cast.
1436 (Binary.ResolveAsTypeTerminal): Is never type.
1437 (Conditional.ResolveAsTypeTerminal): Is never type.
1439 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1441 2006-03-01 Raja R Harinath <rharinath@novell.com>
1444 * expression.cs (ParameterReference.DoResolveBase): Change return
1446 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1450 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1453 * typemanager.cs (GetFullNameSignature): Don't nullref on
1454 protected accessors.
1456 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1458 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1459 these two separated members to simplify the code.
1460 (Attribute.Resolve): Refactored to use new fields and methods.
1461 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1462 implemented obsolete attribute checking.
1463 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1464 implemented obsolete checking again. It look line never ending quest ;-)
1465 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1467 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1469 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1471 *class.cs (Property.Define): Add RegisterProperty call.
1473 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1474 argument groups (only 2).
1476 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1477 encoding expression to arguments.
1478 (Expression.ExprClassToResolveFlags): Just turned to property.
1480 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1481 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1482 optimized as well as implemented support for zero-length attributes.
1484 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1485 Add caching of PropertyInfo's.
1487 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1489 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1490 error multiple times.
1492 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1494 New partial class implementation.
1495 A fix for #77027, #77029, #77403
1497 * attribute.cs (Attributable): Made attributes protected.
1499 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1500 the replacements of ClassPart and PartialContainer.
1501 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1502 (TypeContainer.AddInterface): Ditto.
1503 (TypeContainer.AddPartial): The main method for partial classes. It checks
1504 for errors and merges ModFlags and attributes. At the end class is added to
1506 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1508 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1509 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1510 from the rest of partial classes.
1511 (TypeContainer.GetClassBases): Simplified.
1512 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1514 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1515 (TypeContainer.HasExplicitLayout): Uses Flags now.
1516 (PartialContainer): Removed.
1517 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1518 (StaticClass): Was merged with Class.
1519 (Class.GetClassBases): class and static class bases are verified here.
1520 (Class.TypeAttr): Added static attributes when class is static.
1521 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1522 (MemberBase): In some cases we need to call parent container for partial
1523 class. It should be eliminated but it's not easy now.
1525 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1527 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1528 partial classed to accumulate class comments.
1529 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1531 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1533 * driver.cs (MainDriver): Tree.GetDecl was removed.
1535 * modifiers.cs (Modifiers): Add partial modifier.
1537 * tree.cs (Tree.decl): Removed.
1538 (RootTypes): Started to use this class more often for root types
1541 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1545 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1546 external interface does not have an attribute.
1548 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1550 Another prerequisites for new partial classs implementation.
1552 * attribute.cs (Attribute.Equal): Implemented.
1553 (Attribute.Emit): Changed as attributes can be applied more than twice.
1554 (Attributes.Emit): Check for duplicate attributes here.
1556 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1557 as a parameter, clean-up.
1559 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1563 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1564 contains obsolete attribute check which can in some cases look for base
1565 type of current class which is not initialized yet.
1566 (TypeContainer.BaseType): Replacement of ptype.
1568 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1570 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1572 First of prerequisites for new partial classs implemention.
1574 * attribute.cs (Attributable): Extended by ResolveContext;
1575 Attributes finally have correct context for resolving in all cases.
1576 (AttachTo): Attribute owner is assigned here.
1578 * codegen.cs (IResolveContext): Introduce new interface to hold
1579 all information needed in resolving phase.
1580 (EmitContext): Implements IResolveContext; more clean-up needed here.
1582 * decl.cs (MemberCore): Implemented IResolveContext.
1584 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1585 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1586 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1587 Refactored to use new IResolveContext instead of EmitContext; cleanup
1589 2006-02-06 Miguel de Icaza <miguel@novell.com>
1591 * codegen.cs (EmitScopeInitFromBlock): check here the
1592 capture_context, there is no need to make two calls to the
1595 * anonymous.cs: Add some debugging messages that might help me
1596 track other instances of this problem in the future (the
1597 regression of test 467).
1599 * cs-parser.jay: track the variable block, as we need to initalize
1600 any captured variables declared in this block for the "catch"
1601 portion of the "Try" statement.
1603 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1604 scope initialization for captured variables.
1606 Also, move the emit for the variables after the block location has
1609 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1611 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1613 2006-02-02 Miguel de Icaza <miguel@novell.com>
1615 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1616 commit yesterday, the initialization for the roots is necessary.
1617 What is not necessary is the scope activation.
1619 2006-02-02 Raja R Harinath <rharinath@novell.com>
1621 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1622 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1624 (Argument.Resolve): Remove CS0206 checks.
1626 2006-02-01 Miguel de Icaza <miguel@novell.com>
1628 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1629 scopes for all the roots, the scopes will now be emitted when the
1630 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1632 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1633 code. This reduces a lot of existing cruft.
1635 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1636 that the ScopeInfo is generated as we enter the scope, not at the
1637 time of use, which is what we used to do before.
1639 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1640 every time a Block is about to be emitted if we have a
1643 2006-02-01 Raja R Harinath <rharinath@novell.com>
1645 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1647 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1649 * typemanager.cs (cons_param_array_attribute): Make private.
1650 (Reset): Set it to null.
1651 (InitCoreHelpers): Don't initialize it.
1652 (ConsParamArrayAttribute): New. Initialize it as needed.
1653 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1655 2006-01-31 Miguel de Icaza <miguel@novell.com>
1657 * expression.cs: There might be errors reported during the
1658 selection of applicable methods. If there are errors, do not
1659 continue execution as it will lead the compiler to crash.
1661 2006-01-30 Miguel de Icaza <miguel@novell.com>
1663 * expression.cs: Member access is not allowed on anonymous
1664 methods. Fixes #77402.
1666 2006-01-30 Raja R Harinath <rharinath@novell.com>
1669 * cs-parser.jay (VariableDeclaration): Don't set
1670 current_array_type to null.
1671 (field_declaration, event_declaration, declaration_statement):
1672 Set it to null here.
1674 2006-01-28 Raja R Harinath <harinath@gmail.com>
1676 * typemanager.cs (GenericParameterPosition): New.
1679 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1681 * doc.cs : To process "include" elements, first we should create
1682 another list than XmlNodeList, because it could result in node
1683 removal, which could result in that the XmlNodeList gives up
1686 (Also made code identical to gmcs again.)
1688 2006-01-25 Miguel de Icaza <miguel@novell.com>
1690 * ecore.cs: Introduce an error report that we were not catching
1691 before, if not silent, we must report the error. Gonzalo ran into
1694 2006-01-23 Miguel de Icaza <miguel@novell.com>
1696 A fix for bug: #76957
1698 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1699 ComputeMethodHost before creating the method, this is a new
1702 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1703 that this method references (RegisterScope). The actual scope
1704 where the method is hosted is computed with the ComputeMethodHost
1705 before we create the method.
1707 Moved the Deepest routine here.
1709 (AnonymousContainer.ComputeMethodHost): New routine used to
1710 compute the proper ScopeInfo that will host the anonymous method.
1712 (ScopeInfo): Deal with multiple roots. The problem was that we
1713 did not have a unique root where all ScopeInfos could be hanged
1714 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1717 Remove AdjustMethodScope which is now computed at the end. Remove
1718 LinkScope which did a partial link, instead link all ScopeInfos
1719 before code generation from the new "LinkScopes" routine.
1721 Simplify all the Add* routines as they no longer need to maintain
1722 the tree, they just need to record that they are using variables
1725 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1726 routines to produce the forest of ScopeInfo trees.
1728 * class.cs (TypeContainer.AppendMethod): This is just like
1729 AddMethod, but ensures that an interface implementation method
1730 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1731 methods, but at the end.
1733 We use this functionality to ensure that the generated MoveNext
1734 method in the iterator class is resolved/emitted before the
1735 enumerator methods created.
1737 This is required because the MoveNext method computes the right
1738 ScopeInfo for the method. And the other methods will eventually
1739 need to resolve and fetch information computed from the anonymous
1742 2006-01-21 Raja R Harinath <harinath@gmail.com>
1743 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1746 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1748 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1749 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1751 2006-01-18 Raja R Harinath <rharinath@novell.com>
1753 Fix #76656, cs0231-2.cs.
1754 * cs-parser.jay (formal_parameter_list): Make error case catch
1756 (parenthesized_expression_0): Add CS1026 check.
1757 (invocation_expression): Remove unused { $$ = lexer.Location }.
1759 2006-01-17 Raja R Harinath <rharinath@novell.com>
1762 * cs-parser.jay (statement_expression): Don't list out the
1763 individual statement-expressions. Convert syntax error into
1766 2006-01-16 Raja R Harinath <rharinath@novell.com>
1769 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1770 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1771 CheckIntermediateModification.
1772 (FieldExpr.DoResolve): Add new two-argument version that
1773 allows us to resolve the InstanceExpression as an lvalue.
1774 The one-argument variant is now just a wrapper.
1775 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1776 Resolve the lhs as an lvalue if the it has a value type.
1777 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1778 from Assign.DoResolve.
1779 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1780 resolved as an lvalue.
1781 (PropertyExpr.DoResolve): Update.
1782 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1783 has a value type. Move CS1612 check here from
1784 CheckIntermediateModification.
1785 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1786 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1787 'right_side' of a ResolveLValue on an 'out' argument.
1788 (EmptyExpression.LValueMemberAccess): New. Used as the
1789 'right_side' of a propagated ResolveLValue on a value type.
1790 (LocalVariableReference.DoResolveBase): Recognize
1791 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1793 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1794 EmptyExpression.Null.
1796 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1798 * typemanager.cs : added IsGenericParameter(). In mcs it always
1800 * doc.cs : for generic parameters, use GenericParameterPosition,
1803 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1805 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1807 2006-01-12 Miguel de Icaza <miguel@novell.com>
1809 This fixes the problem where we used ldfld instead of ldflda to
1810 load the "THIS" pointer on captured parameters, when THIS is a
1811 value type. See bug #77205.
1813 * iterators.cs (CapturedThisReference.Emit): Pass false to
1814 EmitThis (we do not need the address).
1816 * codegen.cs (EmitThis): it needs to know whether we need the
1817 address of `this' or not. This is used by value types.
1819 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1820 every other call passes false.
1822 2006-01-12 Raja R Harinath <rharinath@novell.com>
1825 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1827 * expression.cs (Invocation.OverloadResolve): Update.
1828 (Invocation.DoResolve): Avoid double resolution of invocation.
1830 2006-01-11 Raja R Harinath <rharinath@novell.com>
1833 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1834 unary negation of floating point types as 0-expr; negation cannot
1835 overflow in floating point types.
1838 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1839 on operands of 'void' type.
1842 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1843 and ExclusiveOr for boolean constants too.
1845 2006-01-09 Raja R Harinath <rharinath@novell.com>
1848 * expression.cs (Invocation.OverloadResolve): Replace reflected
1849 override methods with their base virtual methods, rather than
1851 * typemanager.cs (TypeManager.GetOverride): New.
1853 2006-01-05 Jb Evain <jbevain@gmail.com>
1855 * class.cs (Property.Define, Indexer.Define): do not tag the
1856 properties as SpecialName | RTSpecialName.
1858 2006-01-04 Miguel de Icaza <miguel@novell.com>
1860 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1861 doing a low-level comparission of parameter types. It was lacking
1862 a check for __argslist.
1864 2005-12-30 Miguel de Icaza <miguel@novell.com>
1866 * expression.cs (ParameterReference.DoResolveBase): Allow
1867 reference parameters if they are local to this block.
1869 This allows the ref and out parameters of a delegate to be used in
1870 an anonymous method, for example:
1872 delegate void set (out int x);
1874 set s = delegate (out int x){
1878 This is used by functionality introduced late in the C# language.
1880 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1881 method that take ref and out parameters.
1883 Fixes #77119 which was a late change in the spec.
1885 2005-12-23 Miguel de Icaza <miguel@novell.com>
1887 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1888 parent if its the same scope. Fixes #77060.
1890 2005-12-21 Miguel de Icaza <miguel@novell.com>
1892 * driver.cs: Report the case of no source files and no -out:
1895 2005-12-20 Raja R Harinath <rharinath@novell.com>
1898 * expression.cs (ComposedCast.GetSignatureForError): Define.
1900 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1904 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1905 ListDictionary, to contain the ExternAliasEntry entries (in
1906 addition to the NamespaceEntry.aliases hashtable). This field is
1907 shared between the original entry and its doppelganger (bodyless
1909 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1910 extern_aliases field.
1911 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1912 lookup in extern_aliases.
1914 2005-12-16 Raja R Harinath <rharinath@novell.com>
1917 * class.cs (TypeContainer.Mark_HasEquals): New.
1918 (TypeContainer.Mark_HasGetHashCode): New.
1919 (ClassPart): Override them.
1920 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1923 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1924 'parent' argument to the base constructor.
1926 Remove all mention of TypeContainer from decl.cs.
1927 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1928 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1929 (DeclSpace.DeclSpace): Likewise.
1930 (DeclSpace.DefineMembers): Remove unused argument.
1931 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1932 debugging check -- we don't care if the debug code throws an
1933 InvalidCastException instead of an InternalErrorException.
1934 * class.cs (TypeContainer.DefineMembers): Update to changes.
1935 (TypeContainer.DoDefineMembers): Likewise.
1936 (TypeContainer.GetMethods): Likewise.
1937 (PropertyMember.Define): Likewise.
1938 (MemberBase.Parent): New property that forwards to
1939 MemberCore.Parent, but ensures that we get a TypeContainer.
1940 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1941 (RootContext.PopulateTypes): Likewise. Remove special case code
1942 for !RootContext.StdLib: DefineMembers is idempotent.
1944 2005-12-14 Miguel de Icaza <miguel@novell.com>
1946 * convert.cs (ExplicitConversionCore): Check the return value from
1947 ExplicitConversionCore which can return null on failure. Fixes #76914
1949 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1951 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1953 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1955 * doc.cs : The search for referenced namespace was insufficient to
1956 get global one as it used to do. Fixed bug #76965.
1958 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1960 * doc.cs : check name in cref in the last phase that whether it is
1963 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1965 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1968 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1970 * doc.cs : so it turned out that we cannot skip override check for
1971 interface members. Fixed bug #76954.
1973 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1975 * cs-tokenizer.cs : fixed bug #75984:
1976 - #warning and #error should not be handled when the source line
1978 - #line is not checked strictly when the source line is disabled.
1979 - #define and #undef is on the other hand checked strictly at any
1982 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1984 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1987 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1989 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1991 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1993 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1994 (FieldBase.Initializer): Initializer is now optional.
1995 (EventField.Define): Only event field can have initializer.
1997 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1999 * const.cs (Const): Reuse initializer.
2001 * cs-parser.jay: Updated after FieldBase changes.
2002 Added current_array_type to simplify array initializers.
2004 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2006 * expression.cs, iterators.cs: Updated.
2008 * namespace.cs (NamespaceEntry): Made UsingFound private.
2010 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2012 * parameterCollection.cs: Obsolete, removed.
2013 * parser.cs: Obsolete, removed.
2015 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2018 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2020 * enum.cs (Enum.Define): Set obsolete context here.
2022 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2025 - FindDocumentedMember() now expects 1) paramList as null
2026 when "we don't have to check the number of parameters" and
2027 2) Type.EmptyTypes when "there is no arguments".
2028 - Introduced FoundMember struct to hold the exact type which was
2029 used to find the documented member (the above change broke
2030 test-xml-044; it might be better just to use DeclaringType than
2031 what MS does, like this change does, but it depends on usage.)
2033 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2035 * doc.cs : documented member might be from DeclaringType for nested
2036 types. Fixed bug #76782.
2038 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2040 * anonymous.cs: Have the param code handle leaving copies on the
2041 stack etc. Allows anonymous params to take part in the assignment
2042 code (++, +=, etc). Fixes bug #76550
2044 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2045 it down to the anon code.
2047 * iterators.cs: Use dummy var here
2049 * codegen.cs: Handle new vars
2051 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2054 * class.cs (MethodData.Define): Set proper Obsolete context.
2056 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2058 (FieldExpr.DoResolve): Ditto.
2060 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2063 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2064 parent is not obsolete.
2066 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2068 * doc.cs : (FindDocumentedMember) find parameterless members first
2069 and get CS0419 in the early stage. Fixed first case of bug #76727.
2071 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2074 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2075 no error was reported.
2077 *expression.cs (Binary.DoResolve): left can be null.
2079 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2082 * class.cs (MethodData.Emit): Parameters should be labeled first.
2084 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2087 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2089 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2091 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2093 * class.cs (MethodCore): Parameter clean up.
2094 (IMethodData): Added ParameterInfo.
2095 (MethodData): Parameter clean up.
2096 (Indexer.Define): Parameter clean up.
2108 * typemanager.cs: Parameter clean up.
2110 * delegate.cs (Define): Get rid of duplicated code.
2112 * expression.cs (ParameterReference): Removed useless parameters
2114 (Invocation): Ditto.
2116 * parameter.cs (ParamsParameter): New class, params specialization.
2117 (ArglistParameter): Attemp to separate arglist.
2118 (Parameter): Refactored to be reusable and faster.
2119 (Parameter.Modifier): Made understandable.
2120 (Parameters): Changed to be used as a class for `this' assembly
2121 parameters. Refactored to use new specialized classes.
2123 * support.cs (ParameterData): Added Types property.
2124 (InternalParameters): Deleted.
2126 2005-08-20 Martin Baulig <martin@ximian.com>
2128 Merging this patch from GMCS to fix #75867.
2130 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2131 scope if we don't already have it.
2133 2005-11-17 Martin Baulig <martin@ximian.com>
2136 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2137 inherit the scope from our parent. Fixes #76653.
2139 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2141 * doc.cs : the previous patch does not actually fix the bug.
2142 PropertyInfo override check is now implemented and really fixed it.
2143 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2145 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2147 * doc.cs : apply "override filter" also to properties.
2150 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2152 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2153 no need to check overrides. For classes, omit those results from
2154 interfaces since they must exist in the class. Fixed bug #76726.
2156 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2158 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2159 with different parameters. Fixed the second problem in #76685.
2161 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2163 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2164 get expected 'protected' access in CheckValidFamilyAccess()).
2167 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2169 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2170 Fixed bug #76705. CS1569 was incorrectly commented out.
2172 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2174 * doc.cs : use Invocation.IsOverride() to do real override check.
2175 * expression.cs : made Invocation.IsOverride() internal.
2177 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2179 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2180 TypeBuilder.FindMembers() and filter overriden base members out.
2183 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2185 * doc.cs : ref/out parameters are represented as '@' (instead of
2186 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2188 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2190 * doc.cs : when there was no '.' in cref to methods in doc comment,
2191 then parameters were missing in the output. Fixed bug #76691.
2193 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2195 * driver.cs : don't output docs when there is an error.
2198 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2201 Now it should detect indexers. Fixed primary concern in bug #76685.
2202 Fixed CS0419 message to not show the identical member signature in
2205 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2207 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2208 instead of Type.FindMembers() since it does not handle events.
2211 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2213 * codegen.cs: Fixed typo (speficied -> specified).
2215 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2218 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2220 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2222 * attribute.cs: Changed error message.
2224 * cs-tokenizer.cs: One more check.
2226 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2228 * statement.cs (Block.Resolve): Ignore empty statement.
2230 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2232 * report.cs: Made error/warning methods more strict to avoid
2235 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2236 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2237 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2238 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2240 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2242 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2243 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2245 * class.cs (TypeContainer.IsComImport): New property.
2246 (Constructor.Define): Create proper ctor for ComImport types.
2248 * expression.cs (New.CheckComImport): Fixed.
2250 2005-11-07 Miguel de Icaza <miguel@novell.com>
2252 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2253 that a parameter has been captured does not mean that we do not
2254 have to do the rest of the processing. This fixes the second part
2255 of #76592. If there was another anonymous method capturing
2256 values in the past, the Scope would never be set for the second
2257 method that captured the same parameter.
2259 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2260 properly manipulate the stack. Second part of fix for #76592.
2262 * expression.cs (New): Add support for invoking "new" on
2263 interfaces that have been flagged with the ComImport attribute and
2264 the CoClass. Fixes #76637
2266 * statement.cs (Try.DoEmit): When a variable is captured, do not
2267 try to emit the vi.LocalBuilder variable as it has been captured.
2268 Create a temporary variable and store the results on the
2269 FieldBuilder. Fixes #76642
2271 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2273 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2275 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2277 * expression.cs (Binary.DoResolve): Added && optimalization.
2279 * typemanager.cs (AddUserType): Removed useless argument.
2281 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2283 * statement.cs (Block.variables): Uses ListDictionary.
2285 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2288 * class.cs (PartialContainer.EmitType): Customized to emit
2289 security attributes.
2290 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2291 for partial classes.
2293 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2296 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2297 access has to be fixed.
2299 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2301 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2304 * ecore.cs (NullCast.Reduce): Implemented.
2306 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2309 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2311 (Foreach.Resolve): Catch null properly.
2313 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2315 * cs-tokenizer.cs: Warning text fix.
2317 * driver.cs: AllWarningNumbers exposed on public interface.
2319 * report.cs (): Reviewed warning numbers.
2320 (IsValidWarning): Use binary search.
2322 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2324 * driver.cs: Implemeted resource visibility.
2325 (Resources): New class for code sharing between /res: and
2328 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2331 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2334 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2337 * ecore.cs (NullCast): Child is contant only.
2339 * literal.cs (NullLiteral.Reduce): null can be converted to any
2342 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2344 * driver.cs: Use Encoding.Default as default code page instead
2347 2005-10-27 Raja R Harinath <rharinath@novell.com>
2350 * expression.cs (Invocation.Error_InvalidArguments): Handle
2351 __arglist parameters.
2352 (Invocation.VerifyArgumentsCompat): Likewise.
2353 * support.cs (ReflectionParameters.GetSignatureForError): Print
2354 __arglist parameters.
2355 (InternalParamters.GetSignatureForError): Likewise.
2356 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2358 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2360 * attribute.cs (GetPropertyValue): Made public.
2362 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2364 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2366 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2369 * driver.cs: Reflect method name change.
2371 * statement.cs (Try.Resolve): Warn when try has both general
2374 * typemanager.cs: runtime_compatibility_attr_type new predefined
2377 2005-10-26 Raja R Harinath <harinath@gmail.com>
2380 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2381 treat it as an empty parameter list.
2383 2005-10-26 Raja R Harinath <rharinath@novell.com>
2386 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2387 ResolveAsTypeStep silent.
2388 * statement.cs (Block.AddConstant): Mark block as used.
2389 (Block.ResolveMeta): Avoid piling on error messages
2390 if a constant initializer resolution fails.
2392 2005-10-25 Raja R Harinath <rharinath@novell.com>
2394 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2396 (NamespaceEntry.VerifyAllUsing): New.
2397 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2398 behaviour. Delegates actual resolution of alias to ...
2399 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2400 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2402 * driver.cs (Driver.MainDriver): Update.
2404 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2405 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2407 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2409 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2410 RootNamespace.DefineNamespacesForAll.
2412 2005-10-24 Raja R Harinath <harinath@gmail.com>
2414 * typemanager.cs (assemblies, external_aliases, modules)
2415 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2416 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2417 overhead. Move resposibility ...
2418 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2419 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2421 2005-10-23 Raja R Harinath <harinath@gmail.com>
2423 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2424 cached_namespaces. Improve usage.
2425 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2426 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2427 Move from GlobalRootNamespace and simplify.
2428 (RootNamespace.Global): Make instance variable.
2429 (RootNamespace.RootNamespace): Add "alias name" parameter.
2430 (GlobalRootNamespace): Simplify drastically.
2431 (Namespace.Lookup): Don't use GetNamespace.
2432 * typemanager.cs (GetRootNamespace): Rename from
2433 ComputeNamespaceForAlias.
2434 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2436 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2438 * anonymous.cs (AnonymousContainer): Don't crash when container
2441 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2443 * expression.cs (Binary.DoResolve): Warn when comparing same
2446 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2449 * expression.cs (Binary.DoResolve): It looks like there are no
2450 convetsion rules in enum context.
2452 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2454 Add support for extern alias qualifiers.
2455 * typemanager.cs: Move some LookupTypeReflection code
2456 to namespace.cs, to have cleaner code. Added some methods
2457 to help us keep track of the extern aliased references.
2458 * driver.cs: Add suport for extern alias assemblies on command
2459 line and check for their warnings/errors. Also keep track of the
2460 extern aliased assemblies.
2461 * namespace.cs: Move the global functionality of Namespace
2462 to GlobalRootNamespace/RootNamespace. Now the global namespace
2463 is GlobalRootNamespace.Globa. Also the code moved from
2464 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2465 Finally added LocalAliasEntry (AliasEntry before) and
2466 ExternAliasEntry, to handle alias statements.
2467 * cs-parser.jay: Add support in the grammar for extern alias
2469 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2470 Update callings to Namespace (now in GlobalRootNamespace).
2472 2005-10-18 Raja R Harinath <rharinath@novell.com>
2475 * class.cs (TypeContainer.DefineType): Move updating of
2476 topological sort earlier in the code.
2477 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2479 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2482 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2484 * constant.cs (Constant.TryReduce): Moved from Cast class.
2485 (Reduce): Made little bit more OO and fixed missing conversions.
2487 * ecore.cs (Reduce): Implemented.
2488 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2490 * literal.cs (Reduce): Implemented.
2492 * class.cs: Reverted Miguel's wrong commit.
2494 2005-10-14 Miguel de Icaza <miguel@novell.com>
2496 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2498 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2500 * cs-parser.jay, expression.cs : CS0214 was missing error location
2501 for constants. Fixed bug #76404.
2503 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2506 * convert.cs (ExplicitConversionCore): Fixed object->enum
2509 2005-10-10 Raja R Harinath <rharinath@novell.com>
2511 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2513 (PropertyExpr.EmitCall): Likewise.
2514 * expression.cs (Invocation.EmitArguments): Handle case where
2516 (Invocation.EmitCall): Avoid allocating temporary variable if
2517 there are no arguments.
2519 2005-10-07 Raja R Harinath <rharinath@novell.com>
2522 * convert.cs (ImplicitConversionStandard): Move conversion of
2523 void* to arbitrary pointer types ...
2524 (ExplicitConversionStandard): .. here.
2525 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2526 error to always print typenames.
2528 2005-10-07 Raja R Harinath <rharinath@novell.com>
2530 * convert.cs (GetConversionOperator): Rename from
2531 GetConversionOperators. Move operator selection code from ...
2532 (UserDefinedConversion): ... here.
2534 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2536 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2539 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2541 * assign.cs (Assign.DoResolve): Error method changed.
2543 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2545 * const.cs (ResolveValue): Reset in_transit immediately.
2547 * constant.cs: Error method changed.
2549 * convert.cs: Removed useless location parameter.
2550 (ExplicitNumericConversion): Don't do double enum check.
2551 (ExplicitConversionCore): Renamed from ExplicitConversion.
2552 (ExplicitUnsafe): Extracted from ExplicitConversion.
2553 (ExplicitConversion): Uses for error reporting.
2555 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2557 (ResolveBoolean): Uses common error method.
2558 (CastToDecimal): Get rid of ec.
2559 (CastFromDecimal): Optimized.
2560 (ConvCast): Get rid of ec.
2562 * enum.cs (ResolveValue): Reset in_transit immediately.
2563 (Emit): Return after first error.
2565 * expression.cs: Convert changes.
2567 * literal.cs: Error method changed.
2569 * statement.cs: Error method changed.
2571 2005-10-03 Raja R Harinath <rharinath@novell.com>
2573 * support.cs (SeekableStreamReader.Position): Don't error out when
2574 the requested position is just beyond the end of the current
2577 2005-09-28 Raja R Harinath <rharinath@novell.com>
2579 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2580 try to keep in sync with the byte count of the underlying Stream.
2581 However, this limits us to a window size of 2048 characters: i.e.,
2582 the maximum lookahead of our lexer/parser can be 2048 characters.
2584 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2587 * driver.cs: Fix compilation files with full root path.
2589 2005-09-25 Miguel de Icaza <miguel@novell.com>
2591 * report.cs (SymbolRelatedToPreviousError): Format the output so
2592 it does not use an open parenthesis that is never closed.
2594 * driver.cs: Follow coding guidelines
2596 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2599 * const.cs (Const.ResolveValue): Check for assigning non-null
2600 value to reference type.
2602 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2604 * anonymous.cs: Implemented ExprClassName.
2606 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2609 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2612 * class.cs (StaticClass.DefineContainerMembers): Report protected
2615 * codegen.cs: if(ed) PRODUCTION.
2617 * convert.cs (Error_CannotImplicitConversion): Better error
2620 * cs-parser.jay: More error checks.
2622 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2624 * driver.cs (CSCParseOption): Enabled wrong option check.
2626 * ecore.cs (Expression.ExprClassName): Turned to property.
2627 (MemberExpr.CheckIntermediateModification): For checking boxed
2628 value types modification.
2630 * statement.cs (Fixed.Resolve): Expression type must be
2631 convertible to fixed type.
2632 (CollectionForeach.GetEnumeratorFilter,TryType):
2633 Small refactoring for easier error checking.
2635 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2637 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2640 * class.cs (GeneratedBaseInitializer): New class for customization
2641 compiler generated initializers.
2642 (MemberBase.DoDefine): Check Obsolete attribute here.
2643 (FieldMember.DoDefine): Ditto.
2645 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2648 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2649 (MemberCore.GetObsoleteAttribute): Removed argument.
2650 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2651 (MemberCore.CheckObsoleteType): New helper.
2655 * statement.cs: Updates after MemberCore changes.
2657 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2658 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2660 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2661 obsolete attribute for compiler construct.
2662 (As.DoResolve): Cache result.
2664 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2666 2005-09-26 Raja R Harinath <rharinath@novell.com>
2669 * expression.cs (This.VerifyFixed): In a value type T, the type of
2670 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2671 value type R, 'this' is treated as a value parameter.
2673 2005-09-22 Miguel de Icaza <miguel@novell.com>
2675 * statement.cs (Lock): Use the TemporaryVariable class instead of
2676 manually using local variables as those do not work when variables
2679 * ecore.cs: Moved the TemporaryVariable class from being a nested
2680 class inside Foreach to be a public class that can be employed in
2683 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2685 * cs-parser.jay: interface_accessors replaced by
2686 accessor_declarations.
2688 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2691 * statement.cs (GotoCase.Resolve): Convert null constant to
2693 (SwitchLabel.ResolveAndReduce): Ditto.
2694 (SwitchLabel.NullStringCase): Custom null stamp.
2695 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2697 typemanager.cs (CSharpSignature): Don't skip first argument
2700 2005-09-18 Miguel de Icaza <miguel@novell.com>
2702 * driver.cs: Set InEmacs based on the environment variable EMACS.
2704 * location.cs (InEmacs): in this mode, do not report column
2705 location as it confuses Emacs.
2707 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2709 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2710 expression.cs, iterators.cs, literal.cs: Store constants and
2713 * class.cs (MemberBase.ShortName): Pass location.
2715 * cs-parser.jay: Some location fixes.
2717 * ecore.cs (Expression.Location): Made virtual.
2719 2005-09-05 Miguel de Icaza <miguel@novell.com>
2721 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2722 if the underlying types are the same, otherwise we need to produce
2723 code that will do the proper cast.
2725 This was exposed by Marek's constant rewrite which produced
2726 invalid code for the call site:
2729 void Method (X v) {}
2733 This fixes test-49.cs
2735 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2737 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2738 Type/Object should be allowed as well. Fixed bug #75968.
2740 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2742 * expression.cs : (Binary.DoResolve): when one is enum constant and
2743 another is constant 0, then return enum one *as enum type*.
2746 2005-09-02 Raja R Harinath <rharinath@novell.com>
2748 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2752 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2753 flow-branching for LocalVariableReferences in case we were invoked
2754 from a MemberAccess.
2755 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2757 (LocalVariableReference.DoResolveBase): ... this.
2758 (MemberAccess.Resolve): Do the check that was disabled during
2761 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2764 (PartialContainer.Create): check abstract/sealed/static strictly
2765 but abstract/sealed can exist only at one side. Fixed bug #75883.
2767 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2770 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2771 specified, don't default to UnmanagedType.I4.
2773 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2775 * expression.cs : conditional operator should check possibly
2776 incorrect assign expression. Fixed bug #75946.
2778 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2780 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2781 Reverting the change. gmcs is much complex than mcs on this matter.
2783 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2785 * cs-tokenizer.cs : To read another token ahead of the actual
2786 consumption, use new SavedToken and cache token instead of moving
2787 back the stream with SeekableStreamReader (it seemed problematic).
2789 driver.cs : Thus use StreamReader directly.
2790 * support.cs : Thus removed SeekableStreamReader.
2792 2005-08-30 Raja R Harinath <rharinath@novell.com>
2795 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2796 (ScopeInfo.EmitScopeType): Use it to construct field names from
2797 names of captured locals.
2800 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2801 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2802 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2803 (ExplicitConversion): Remove enum cases already handled by
2804 implicit conversion. Move implicit conversion check to the beginning.
2805 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2806 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2807 Don't treat System.Enum as a struct.
2809 2005-08-30 Jb Evain <jbevain@gmail.com>
2811 * attribute.cs: handles as expression in parameters.
2813 2005-08-30 Raja R Harinath <rharinath@novell.com>
2816 * class.cs (TypeContainer.VerifyClsName): Don't use a
2817 PartialContainer when verifying CLS compliance.
2818 (AbstractPropertyEventMethod): Set Parent here, ...
2819 (PropertyMethod): ... not here.
2821 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2823 * attribute.cs : escaped attribute name should not be allowed to be
2824 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2826 2005-08-29 Raja R Harinath <rharinath@novell.com>
2829 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2830 when converting a long constant to unsigned long.
2831 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2832 detect where IsApplicable and VerifyArgumentsCompat disagree.
2834 2005-08-29 Raja R Harinath <rharinath@novell.com>
2835 and Carlos Alberto Cortez <carlos@unixmexico.org>
2838 * class.cs (TypeContainer.CanElideInitializer): New helper.
2839 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2840 can safely emitting the initializer of a field.
2842 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2844 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2845 allowed inside a switch (without loop). Fixed bug #75433.
2847 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2849 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2850 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2852 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2854 * driver.cs : kinda reverting the default encoding changes (not exact
2855 revert since I noticed that "codepage:reset" might not work fine).
2857 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2859 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2860 Location. Now getter and setter store location correctly.
2861 (errors/cs0111-12.cs now reports the expected location.)
2863 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2865 * driver.cs : Use default encoding on the environment.
2866 Removed (now that) extra parameter for SeekableStreamReader.
2867 * support.cs : (SeekableStreamReader) third .ctor() argument for
2868 StreamReader is not required (always true). preamble size could
2869 be acquired in simpler and safe way.
2871 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2873 * cs-parser.jay: report CS0642 at warning level 3
2874 and report CS0642 for an if else statement also
2875 fixes bug #74745. Patch by John Luke (and a bit
2877 Removed extra CS0642 warning check for "while",
2879 * statement.cs: In Block.Resolve(), CS0642 check
2880 is reimplemented to check a sequence of an empty
2881 statement and a block.
2883 Both fix bug #66777.
2885 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2887 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2888 detection until I fix it.
2890 * cs-tokenizer.cs: Changed error message.
2892 * cs-parser.jay: Fixed 2 error locations.
2894 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2895 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2898 * enum.cs (GetSignatureForError): Fixed.
2900 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2904 * typemanager.cs (RegisterProperty): Removed.
2906 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2908 2005-08-24 Raja R Harinath <rharinath@novell.com>
2911 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2912 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2914 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2916 * expression.cs : tiny fix is required for not warning positive ulong.
2919 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2921 * expression.cs : add CS0652 check for constant and integral
2922 expression. Fixed bug #53974.
2924 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2926 * expression.cs : in DoNumericPromotions(), check if there is implicit
2927 conversion overload for string (to check CS0034). Fixed bug #52492.
2929 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2931 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2933 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2935 * ecore.cs : report location when it is *not* Null.
2937 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2943 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2944 correctly. Fixed bug #75721.
2946 2005-08-23 Raja R Harinath <rharinath@novell.com>
2948 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2949 loop that performs 'min (pos, char_count)'.
2952 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2953 converted value in Operator.OnesComplement.
2955 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2957 * anonymous.cs: If the anon method is pulled into a helper class,
2958 it needs to be `internal' not `private'. Fixes runtime behavior on
2961 2005-08-20 Martin Baulig <martin@ximian.com>
2963 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2964 scope if we don't already have it.
2966 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2967 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2970 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2973 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2976 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2978 The big constants rewrite
2979 Fix #75746, #75685 and more
2980 As a side effect saved 1MB for MWF ;-)
2982 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2983 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2984 enum based for corlib compilation.
2986 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2989 * class.cs (FixedField.Define): Use ResolveAsConstant.
2991 * const.cs (IConstant): Interface constants and enums.
2992 (Const.ResolveValue): New method for constant resolvning.
2993 (ExternalConstant): Constants from imported assemblies.
2995 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2996 conversion; like enums.
2997 (Constant.ToType): Converts this constant to different type.
2998 (Constant.Increment): Adds 1.
3000 * convert.cs (ImplicitConversionRequired): Simplified.
3002 * cs-parser.jay: Create EnumMember directly.
3004 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3006 * doc.cs (GenerateEnumDocComment): Removed.
3008 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3009 (ConvertIntLiteral): Removed.
3010 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3012 * enum.cs (EnumMember): Implement IConstant.
3013 (Enum.IsValidEnumConstant): Removed.
3014 (Enum.GetNextDefaultValue): Removed.
3015 (Enum.FindMembers): Updated.
3016 (Enum.GenerateDocComment): Iterate enum members.
3018 * expression.cs (Cast.TryReduce): Handle enums correctly.
3019 (New.Constantify): Made public.
3020 (MemberAccess.DoResolve): Removed contant specific if(s).
3022 * literal.cs (NullLiteral): Implement new abstract methods.
3024 * statement.cs (GotoCase.Resolve): Use new constant methods.
3025 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3027 * typemanager.cs (LookupEnum): Removed.
3028 (IsEnumType): Fixed to work with corlib.
3029 (RegisterConstant): Removed.
3030 (LookupConstant): Removed.
3031 (GetConstant): Changed to work with IConstant.
3033 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3035 * location.cs : Fixed overflown (>255) column number.
3037 2005-08-03 Raja R Harinath <rharinath@novell.com>
3039 First cut of the qualified-alias-member feature.
3040 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3042 * cs-parser.jay (DOUBLE_COLON): New token.
3043 (namespace_or_type_name): Add rule for recognizing
3044 qualified-alias-members.
3045 (primary_expression): Likewise.
3046 (element_access): Allow QualifiedAliasMember as a possible
3047 type-bearing expression.
3048 (local_variable_type, local_variable_pointer_type): Likewise.
3049 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3050 aliases in the current and enclosing namespace declarations.
3051 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3052 * decl.cs (MemberName.is_double_colon): New.
3053 (MemberName.MemberName): Add new constructor for alias-member.
3054 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3055 * expression.cs (QualifiedAliasMember): New expression type.
3057 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3059 * location.cs : it borked when no argument was specified.
3061 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3063 * location.cs : tiny ToString() format fix.
3065 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3067 * statement.cs : oops, it was missing.
3069 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3071 A set of fixes for precise line/column location.
3074 "token" field now holds a file/line "delta", a line number offset
3075 from the segment, and a column number. See also:
3076 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3077 December/009508.html
3078 Removed static IsNull. Use instance IsNull property instead.
3080 For some tokens it stores Location. For Identifier it stores
3081 LocatedToken which is a pair of string name and location.
3082 Column numbers are adjusted only at getChar().
3084 Use Location.ToString() for reporting (it now contains column).
3086 Largely modified to use LocatedToken instead of
3087 string (IDENTIFIER), and to acquire Location from some tokens.
3088 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3089 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3091 Now MemberName holds Location. DeclSpace.ctor() receives Location
3092 as a parameter. Removed extra parameters to all derived classes.
3093 Replaced Location.IsNull() with instance property.
3094 * assign.cs, expression.cs :
3095 Added .ctor() overload that omits Location.
3097 Added "nameEscaped" flag that indicates the identifier was escaped
3098 in the source file. This fixes bug #57047.
3100 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3102 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3103 New method, looking for lo-case imported cls type.
3105 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3108 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3110 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3112 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3114 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3116 Optimized to save 3.5 MB for SWF compilation.
3118 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3120 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3121 (PartialContainer.Create): Moved logic AddToContainer.
3122 (PartialContainer.MarkForDuplicationCheck): Shares name.
3124 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3127 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3129 (Namespace.GetSignatureForError): New method.
3131 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3132 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3134 2005-08-01 Raja R Harinath <rharinath@novell.com>
3137 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3138 member lookup rather than qualifier_type, since qualifier_type can
3141 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3143 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3146 2005-07-31 Miguel de Icaza <miguel@novell.com>
3148 * statement.cs: Copy the local exception into the exception
3149 captured local. Fixes 75674
3151 2005-07-31 Raja R Harinath <harinath@gmail.com>
3154 * expression.cs (Invocation.OverloadResolve): Don't report error
3155 CS1501 if error CS1502 has been reported.
3156 (New.DoResolve): Delegate CS1501 reporting to
3157 Invocation.OverloadResolve.
3160 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3161 invariant-meaning-in-block property in an enclosing block if
3164 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3166 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3167 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3168 (Switch.CheckSwitch): Just save 50kb for SWF.
3170 2005-07-27 Martin Baulig <martin@ximian.com>
3172 * anonymous.cs (CaptureContext.AddField): Added
3173 `AnonymousContainer am' argument; compute its toplevel scope if
3174 it's not already computed. Fixes #75649.
3176 2005-07-26 Raja R Harinath <rharinath@novell.com>
3179 * class.cs (Constructor.Emit): Reset block to null if the block
3182 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3184 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3186 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3188 * class.cs (MethodData.Define): Check whether accessor implementing
3189 interface is public.
3191 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3193 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3196 * namespace.cs (LookupType): Moved same type check to...
3198 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3201 2005-07-21 Raja R Harinath <rharinath@novell.com>
3203 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3204 already found a typebuilder.
3205 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3206 MemberNames, not strings.
3208 * const.cs (Error_ExpressionMustBeConst):
3209 Rename from Error_EpressionMustBeConst.
3210 * const.cs, class.cs, statement.cd: Update.
3212 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3216 * const.cs (Const.LookupConstantValue): Report missing contant expression
3218 (Error_EpressionMustBeConstant): Only one error method.
3220 * class.cs, statement.c: Updated.
3222 2005-07-20 Raja R Harinath <rharinath@novell.com>
3224 * statement.cs (Block.Flags): Add back HasVarargs.
3225 (Block.flags): Make protected.
3226 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3228 * typemanager.cs (types, typecontainers, user_types): Remove.
3229 (UserTypes, TypeContainers): Likewise.
3230 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3231 (CleanUp, Reset): Update.
3232 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3233 (GetNestedType): Use Type.GetNestedType.
3234 (CoreLookupType): Take two arguments, the namespace and the
3235 basename of the type. Update to use the Namespace.Lookup
3237 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3238 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3239 string concatenation and substring matches.
3240 * class.cs, enum.cs, delegate.cs: Update to changes.
3242 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3244 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3245 Expression and made virtual.
3247 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3248 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3250 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3252 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3255 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3258 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3261 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3262 AssemblyCultureAttribute is not used on executable.
3265 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3267 2005-07-16 Raja R Harinath <rharinath@novell.com>
3270 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3271 New. Reports CS0252/CS0253.
3272 Mostly taken from preliminary patch by Duncak Mak.
3273 (Binary.DoResolveOperator): Store results of operator lookup.
3274 Use them to detect if we need to warn about unintended reference
3277 2005-07-15 Raja R Harinath <rharinath@novell.com>
3280 * namespace.cs (Namespace.Lookup): Add back location parameter.
3281 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3282 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3284 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3285 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3286 (Namespace.LookupType): ... this.
3287 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3289 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3290 purported to handle pointers.
3291 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3294 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3296 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3299 2005-07-15 Raja R Harinath <rharinath@novell.com>
3301 * namespace.cs (Namespace.Lookup): Drop location parameter.
3302 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3303 (NamespaceEntry.Lookup): ... this.
3304 (NamespaceEntry.Error_AmbiguousTypeReference):
3305 Move here from DeclSpace.
3306 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3308 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3309 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3310 Move to NamespaceEntry.
3311 * delegate.cs, expression.cs: Update to changes.
3313 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3315 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3316 CheckAttributeType and refactored.
3317 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3318 ResolveAsTypeTerminal error handling.
3319 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3321 (GetSignatureForError): Print errors in same way.
3324 * codegen.cs: Reflect attribute GetSignatureForError change.
3327 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3329 * namespace.cs (UsingEntry): Refactored to make fields private.
3332 statement.cs: Error_UnexpectedKind has extra parameter.
3334 2005-07-14 Raja R Harinath <rharinath@novell.com>
3336 * ecore.cs (IAlias): Remove.
3337 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3338 that implement the interface.
3339 * namespace.cs (Namespace): Likewise.
3340 (Namespace.declspaces): Renamed from 'defined_names'.
3341 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3342 DeclSpace instead of an IAlias.
3343 * tree.cs (Tree.AddDecl): Update.
3345 2005-07-12 Raja R Harinath <rharinath@novell.com>
3347 * statement.cs (Block.Flags); Remove HasVarargs.
3348 (Block.HasVarargs): Move to ToplevelBlock.
3349 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3350 (Block.Variables): Make protected. Initialize variable hashtable
3352 (Block.AddVariable): Update.
3353 (Block.Resolve): Update to changes.
3354 (ToplevelBlock.HasVarargs): New boolean.
3355 (ToplevelBlock.ThisVariable): Move here from Block.
3356 (ToplevelBlock.AddThisVariable): Likewise.
3357 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3358 * expression.cs (This.ResolveBase): Update to changes.
3359 (ArglistAccess.DoResolve): Likewise.
3361 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3364 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3366 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3367 not used and not used & assigned.
3368 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3370 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3373 * expression.cs (Is.DoResolve): null is never provided type.
3375 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3378 * cs-parser.jay: Less strict event error rule to catch more errors.
3380 2005-07-08 Martin Baulig <martin@ximian.com>
3382 Fix test-iter-10.cs - distinguish whether we `yield' in a property
3383 gettter (allowed) or setter (not allowed).
3385 * class.cs (Accessor): Implement IIteratorContainer.
3386 (Accessor.Yields): New public field.
3387 (PropertyBase.PropertyMethod.Define): Handle iterators on a
3391 (get_accessor_declaration, set_accessor_declaration): Set the
3392 `yields' flag on the accessor, not the property.
3393 (property_declaration): Do the iterators check on a per-accessor
3394 basis and not for the whole property.
3396 2005-07-08 Martin Baulig <martin@ximian.com>
3398 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3399 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3401 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3404 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3405 (ExtractSecurityPermissionSet): Cope with self referencing security
3406 attributes properly.
3408 * driver.cs (SetOutputFile): Made public property OutputFile.
3410 2005-07-07 Raja R Harinath <rharinath@novell.com>
3413 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3414 has_nonstatic_fields. Make into a FieldBase pointer.
3415 (TypeContainer.AddField): Add CS0282 check.
3416 (TypeContainer.EmitType): Update.
3418 2005-07-06 Miguel de Icaza <miguel@novell.com>
3420 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3421 compare if they start with __.
3423 2005-07-06 Raja R Harinath <rharinath@novell.com>
3425 * statement.cs (Switch.SwitchGoverningType): Only look at
3426 UserCasts that don't need implicit standard conversions to one of
3427 the allowed switch types (Fixes test-322.cs).
3428 (LocalInfo.Resolve): Re-enable sanity-test.
3430 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3432 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3434 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3436 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3438 2005-07-06 Raja R Harinath <rharinath@novell.com>
3441 * ecore.cs (SimpleName.GetSignatureForError): Add.
3442 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3443 (MemberAccess.GetSignatureForError): Add.
3445 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3447 The big error and warning messages review.
3477 * typemanager.cs: Updated.
3479 * class.cs: (MethodCore.SetYields): Moved here to share.
3480 (PropertyMethod.Define): Moved iterator setup here.
3482 * iterators.cs: Add orig_method to have full access to parent
3485 2005-07-05 Raja R Harinath <rharinath@novell.com>
3487 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3488 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3489 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3490 variable of struct type.
3491 * expression.cs (Unary.ResolveOperator): Update to change.
3492 (Indirection.VerifyFixed): Likewise.
3493 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3494 (ParameterReference.VerifyFixed): Value parameters are fixed.
3495 (This.VerifyFixed): Treat 'this' as a value parameter.
3496 * statement.cs (LocalInfo.IsFixed): Remove.
3498 2005-07-01 Martin Baulig <martin@ximian.com>
3500 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3501 `ec.EmitThis ()' to get the correct scope.
3503 2005-07-01 Martin Baulig <martin@ximian.com>
3505 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3506 instance is a ParameterReference; fixes #75299.
3508 2005-07-01 Martin Baulig <martin@ximian.com>
3510 Reverted Marek's latest patch (r46725):
3511 - it contains structural changes which are neither mentioned in
3512 the ChangeLog nor explained anywhere; for example the additional
3513 argument of EmitContext's and Iterator's .ctor's and the
3514 TypeContainer.DefineMembers() change.
3515 - structural changes like this should go in in seperate patches
3516 and not be hidden in a huge patch which just seems to affect
3517 warnings and errors.
3518 a big and hard to understand patch.
3519 - it breaks iterators and causes regressions, for instance in
3522 2005-06-30 Raja R Harinath <rharinath@novell.com>
3525 * expression.cs (Indexers.map): Remove.
3526 (Indexers.Append): Filter out inaccessible setters and getters.
3527 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3530 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3532 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3533 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3534 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3535 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3537 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3540 * class.cs (FieldBase.GetInitializerExpression): One more field
3543 2005-06-28 Miguel de Icaza <miguel@novell.com>
3545 * pending.cs: Do not define a proxy if the base method is virtual,
3546 it will be picked up by the runtime (bug 75270).
3548 2005-06-08 Martin Baulig <martin@ximian.com>
3550 The big Iterators rewrite :-)
3552 * iterators.cs: Rewrite this to use the anonymous methods framework.
3554 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3555 before the TypeContainers; see 2test-21.cs.
3558 (TypeContainer.DefineType): Don't create a new EmitContext if we
3559 already have one (this only happens if we're an Iterator).
3560 (TypeContainer.Define): Also call Define() on all our iterators.
3561 (Method.CreateEmitContext): Added support for iterators.
3564 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3565 (AnonymousContainer.CreateMethodHost): Moved here from
3566 AnonymousMethod and made abstract.
3567 (AnonymousContainer.CreateScopeType): New abstract method.
3568 (AnonymousContainer.IsIterator): New public property.
3569 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3570 get the ScopeTypeBuilder rather than manually defining it here.
3571 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3574 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3575 before RootContext.DefineTypes().
3577 * codegen.cs (EmitContext.RemapToProxy): Removed.
3578 (EmitContext.CurrentAnonymousMethod): Changed type from
3579 AnonymousMethod -> AnonymousContainer.
3580 (EmitContext.ResolveTopBlock): Protect from being called twice.
3581 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3582 (EmitContext.EmitThis): Removed the iterators hacks; use the
3583 anonymous methods framework for that.
3586 (ToplevelBlock.Container): Make this a property, not a field.
3587 (ToplevelBlock.ReParent): New public method; move the
3588 ToplevelBlock into a new container.
3589 (Foreach.TemporaryVariable): Simplify.
3591 2005-06-05 Martin Baulig <martin@ximian.com>
3593 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3594 (Block.AddTemporaryVariable): New public method; creates a new
3595 `LocalInfo' for a temporary variable.
3596 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3598 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3599 non-iterator variables.
3601 2005-06-05 Martin Baulig <martin@ximian.com>
3603 * statement.cs (Foreach.TemporaryVariable): Create the
3604 LocalBuilder in the Emit phase and not in Resolve since in some
3605 situations, we don't have an ILGenerator during Resolve; see
3606 2test-19.cs for an example.
3608 2005-06-04 Martin Baulig <martin@ximian.com>
3610 **** Merged r45395 from GCS ****
3612 The big Foreach rewrite - Part II.
3614 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3615 with `PropertyInfo ienumerator_getcurrent'.
3617 * codegen.cs (VariableStorage): Removed.
3620 (Foreach): Derive from Statement, not ExceptionStatement.
3621 (Foreach.CollectionForeach): New nested class. Moved all the code
3622 dealing with collection foreach here.
3623 (Foreach.ForeachHelperMethods): Removed.
3624 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3626 2005-05-23 Martin Baulig <martin@ximian.com>
3628 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3629 don't need to. Fix #75014.
3631 2005-05-20 Martin Baulig <martin@ximian.com>
3633 Merged r44808 from GMCS.
3635 * class.cs (TypeContainer.CircularDepException): Removed.
3636 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3637 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3638 (CS0146) and interface (CS0529) dependencies here.
3640 2005-06-21 Raja R Harinath <rharinath@novell.com>
3642 * expression.cs (Invocation.EmitCall): Fix initialization
3643 'this_call' to reflect current behaviour. Fix indentation.
3645 * convert.cs (FindMostEncompassedType): Add two trivial special
3646 cases (number_of_types == 0 || number_of_types == 1).
3647 (FindMostEncompasingType): Likewise.
3649 2005-06-17 Raja R Harinath <rharinath@novell.com>
3651 Some cleanups preparing for the fix of #75283.
3652 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3654 (EventExpr.InstanceResolve): Likewise.
3655 (EventExpr.DoResolve): Remove redundant checks.
3657 2005-06-10 Duncan Mak <duncan@novell.com>
3659 * cs-tokenizer.cs (process_directives): New flag for controlling
3660 the processing of preprocessor directives.
3661 (x_token): After seeing a '#', return Token.NONE instead of going
3662 to handle_preprocessing_directive() when not processing
3663 directives. This avoids unnecessary processing during the token peek in
3668 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3669 the existing error reporting methods instead of Report.Error.
3671 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3672 after Raja's rewrite.
3674 2005-06-08 Miguel de Icaza <miguel@novell.com>
3676 * class.cs: Small fix.
3678 2005-06-08 Raja R Harinath <rharinath@novell.com>
3681 * class.cs (GetPartialBases): Fix return value check of
3684 2005-06-07 Raja R Harinath <rharinath@novell.com>
3686 Ensure that partial classes are registered in their enclosing
3687 namespace. Initial part of fix of #75160.
3688 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3689 Register declspace with namespace here, not in
3690 DeclSpace.RecordDecl.
3691 * cs-parser.jay: Pass namespace to RecordDecl.
3692 * class.cs (PartialContainer.Create): Likewise.
3693 (ClassPart.DefineType): New sanity-check. Throws an exception if
3695 * decl.cs (Declspace.RecordDecl): Remove.
3696 * namespace.cs (NamespaceEntry.DefineName): Remove.
3698 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3700 * rootcontext.cs: Reset TargetExt as well.
3702 2005-06-03 Raja R Harinath <rharinath@novell.com>
3704 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3707 2005-06-02 Raja R Harinath <rharinath@novell.com>
3709 Fix #75080, cs0119.cs.
3710 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3712 (Expression.Resolve): ... this. Use it. Remove bogus code
3713 allowing ExprClass.Type and ExprClass.Namespace for
3714 ResolveFlags.VariableOrValue.
3715 (Expression.Resolve) [1-argument variant]: Change default resolve
3716 flags based on language version.
3717 (Expression.Error_UnexpectedKind): Use a simple string array
3718 rather than an ArrayList.
3719 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3721 (TypeOfVoid.DoResolve): Likewise.
3722 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3723 flags argument -- it always has the same value.
3725 2005-05-31 Raja R Harinath <rharinath@novell.com>
3728 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3729 Use it in the error message.
3730 * assign.cs, expression.cs, statement.cs: Update.
3732 2005-05-30 Raja R Harinath <rharinath@novell.com>
3735 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3736 the "almostMatchedMember" case too.
3737 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3738 that failed the accessibility checks to 'almost_match'.
3740 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3742 * attribute.cs: Use internal MethodBuilder methods to set
3743 ExactSpelling and SetLastError on PInvoke methods, instead
3744 of passing them via charset. Fixes #75060.
3746 2005-05-27 Raja R Harinath <rharinath@novell.com>
3748 * parameter.cs (Parameter): Remove TODO comment.
3749 (Parameter.DefineParameter): Remove Location parameter.
3750 (Parameters.LabelParameters): Likewise.
3751 * class.cs (Constructor.Emit): Update to change.
3752 (MethodData.Emit): Likewise.
3753 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3754 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3756 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3759 Removed Parameters.Location and added Parameter.Location instead.
3760 Removed Location parameter from Emit() and GetSignature().
3767 Modified all related calls.
3769 2005-05-26 Raja R Harinath <rharinath@novell.com>
3771 Improve user-defined conversion handling.
3772 * convert.cs (GetConversionOperators): Rewrite. Return only the
3773 applicable operators.
3774 (AddConversionOperators): New. Helper for GetConversionOperators.
3775 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3776 there is only one most encompassed/encompassing type.
3777 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3778 "applicable operator" handling.
3779 (UserConversion): Move cache here from GetConversionOperators.
3780 Directly cache the chosen operator, rather than the whole
3782 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3783 case. Allow conversion of decimal to sbyte and byte too.
3784 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3785 New static methods. Used to avoid allocating EmptyExpressions in
3788 2005-05-24 Duncan Mak <duncan@novell.com>
3790 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3791 another class, used in Convert.ExplicitNumericConversion.
3792 (CastToDecimal): New class, similar to above, but casts to
3793 System.Decimal, used in Convert.ImplicitNumericConversion and also
3794 in explicit convesion from double/float to decimal.
3796 * convert.cs (ImplicitNumericConversion): Handle implicit
3797 conversions to System.Decimal.
3798 (ExplicitNumericConversion): handle explicit conversions to
3803 2005-05-20 Miguel de Icaza <miguel@novell.com>
3805 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3806 know the type at this stage, just break through. Fixes #75008
3808 2005-05-19 Martin Baulig <martin@ximian.com>
3811 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3812 to disable error reporting.
3814 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3815 here since we don't want to report an error; see the new test-336.cs.
3817 2005-05-19 Raja R Harinath <rharinath@novell.com>
3819 * statement.cs (ToplevelBlock.GetParameterReference)
3820 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3821 Move here from class Block.
3822 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3823 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3825 2005-05-18 Martin Baulig <martin@ximian.com>
3830 (FlowBranching.Reachability): Add non-static public And() and Or()
3832 (FlowBranchingSwitch): New class; do the `break_origins' thing
3833 like in FlowBranchingLoop.
3834 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3835 reachability, not just locals and parameters.
3836 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3837 switch; MergeBreakOrigins() now takes care of that.
3839 2005-05-18 Martin Baulig <martin@ximian.com>
3841 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3842 a loop and may leave it, reset the barrier; fixes #74974.
3844 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3846 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3849 * cs-parser.jay: Catch more lexical errors.
3851 * report.cs: Add one more Error method.
3854 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3856 2005-05-17 Martin Baulig <martin@ximian.com>
3858 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3861 2005-05-16 Raja R Harinath <rharinath@novell.com>
3863 Fix test-382.cs. Emit values of decimal constants.
3864 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3866 (TypeContainer.AddField): ... this.
3867 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3868 with initializers to include 'Const's.
3869 (ClassPart.RegisterFieldForInitialization): Forward to
3871 * const.cs (Const.Const): Pass initializer to base class.
3872 (Const.Define): In case of decimal constants, register them for
3873 initialization in a static constructor.
3875 2005-05-14 Martin Baulig <martin@ximian.com>
3877 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3878 do not call ResolveUnreachable() on unreachable statements in
3879 here, see the comment in the source code.
3881 2005-05-13 Raja R Harinath <rharinath@novell.com>
3884 * expression.cs (BinaryResolveOperator): If one of the operands of
3885 an equality comparison is 'null' and the other is a pointer type,
3886 convert the null to a NullPointer.
3887 * convert.cs (ImplicitReferenceConversion): If the expression is a
3888 NullLiteral and the target type is a pointer type, return a
3889 NullPointer instead.
3890 (ImplicitConversionStandard): Likewise.
3892 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3894 * cs-parser.jay: Set readonly context based on special constructs.
3896 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3897 readonly variable error handling.
3899 * rootcontext.cs (EmitCode): Don't verify members when error
3902 * statement.cs (LocalInfo): Add reaodnly context information.
3903 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3905 2005-05-13 Raja R Harinath <rharinath@novell.com>
3907 * statement.cs (Block.Resolve): Revert change below. Modify fix
3908 for #74041 to initialize 'resolved' to false only for explicit
3909 blocks. Fixes #74873.
3911 2005-05-12 Raja R Harinath <harinath@gmail.com>
3914 * typemanager.cs (unmanaged_enclosing_types): New.
3915 (IsUnmanagedType): Avoid infloops by using
3916 'unmanaged_enclosing_types' to talk with recursive invocations.
3918 2005-05-13 Martin Baulig <martin@ximian.com>
3920 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3921 instance variable, not a local. Fix #74873.
3922 (Block.ResolveUnreachable): Set it to true here.
3924 2005-05-11 Duncan Mak <duncan@novell.com>
3926 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3927 continuing to process for 'arg'.
3928 (handle_preprocessing_directive): Check the argument of the #endif
3929 directive and report error CS1025 if there are any trailing
3932 According to the C# spec, having even whitespace after the #endif
3933 directive is illegal; however, because we call arg.TrimEnd ()
3934 beforehand, we have the same behavior as csc, allowing whitespace
3935 after the directive.
3939 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3943 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3944 (Constructor.GetObsoleteAttribute): Implemented correctly.
3946 2005-05-10 Martin Baulig <martin@ximian.com>
3948 * support.cs (ReflectionParameters.ParameterModifier): Use
3949 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3950 and `ParameterAttributes.In'. Fixes #74884.
3952 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3954 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3956 * expression.cs (Argument.GetParameterModifier): Turned to property.
3957 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3959 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3962 2005-05-09 Raja R Harinath <rharinath@novell.com>
3965 * decl.cs (MemberCache.AddMethods): Register override methods,
3966 rather than non-override methods.
3967 * typemanager.cs (RegisterOverride): New.
3968 (IsOverride): Update.
3970 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3974 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3975 recursive declaration.
3977 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3979 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3981 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3983 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3985 2005-05-05 Raja R Harinath <rharinath@novell.com>
3988 * decl.cs (DeclSpace.FamilyAccessible):
3989 Use TypeManager.IsNestedFamilyAccessible.
3991 Fix reopened #64812.
3992 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3995 2005-05-04 Raja R Harinath <rharinath@novell.com>
3996 Abin Thomas <projectmonokochi@rediffmail.com>
3997 Anoob V E <projectmonokochi@rediffmail.com>
3998 Harilal P R <projectmonokochi@rediffmail.com>
4001 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4002 allow access to all static members.
4004 2005-05-04 Martin Baulig <martin@ximian.com>
4006 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4008 2005-05-04 Martin Baulig <martin@ximian.com>
4012 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4013 section at the end; make things work if `default' is not the last
4016 2005-05-04 Martin Baulig <martin@ximian.com>
4020 * statement.cs (Switch): Replaced the `got_default' field with a
4021 `default_section' one.
4022 (Switch.CheckSwitch): Set `default_section' here.
4023 (Switch.Resolve): If we're a constant switch and the constant is
4024 not found, use the default section.
4026 2005-05-03 Martin Baulig <martin@ximian.com>
4028 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4030 * statement.cs (Foreach.ArrayForeach): New nested class.
4031 (Foreach.TemporaryVariable): New nested class.
4032 (Foreach.EmitArrayForeach): Removed; this is now in the new
4035 2005-05-03 Raja R Harinath <rharinath@novell.com>
4037 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4039 (VerifyPendingMethods): Revert change below.
4041 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4042 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4043 that used to trigger warning -28. Remove warning -28.
4044 * expression.cs (Invocation.OverloadResolve): Use
4045 TypeManager.IsOverride to distinguish override methods.
4048 * pending.cs (VerifyPendingMethods): If a base type implements the
4049 requested interface, don't bother checking individual methods of
4050 the base type. As a side-effect, this prevents the creation of
4051 unnecessary proxies.
4053 2005-05-02 Martin Baulig <martin@ximian.com>
4057 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4058 Also `And' the locals if the old vector is null.
4059 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4060 null; in this case we basically reset all the variables.
4062 2005-05-02 Martin Baulig <martin@ximian.com>
4066 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4067 Added `FlowBranching branching' argument; always `and' the
4068 variables instead of `or'ing them unless we're an infinite loop.
4070 * statement.cs (While.Resolve): Create a new sibling unless we're
4073 2005-05-02 Martin Baulig <martin@ximian.com>
4077 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4078 arguments; use it instead of creating a new TopLevelBlock.
4079 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4080 our ConstructorInitializer.
4083 (TopLevelBlock.TopLevelBranching): New public property.
4084 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4085 and create our `TopLevelBranching'.
4087 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4088 anonymous method host, use `block.TopLevelBranching' rather than
4089 creating a new branching.
4091 2005-04-20 Miguel de Icaza <miguel@novell.com>
4093 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4094 a ScopeInfo, if any of the current children is a child of the new
4095 entry, move those children there.
4097 2005-04-30 Martin Baulig <martin@ximian.com>
4099 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4100 at the beginning of a SwitchSection. Fix #73335.
4102 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4105 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4107 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4108 (FieldExpr.DoResolve): Obsolete members are ignored for field
4111 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4113 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4114 of arrays detection.
4116 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4118 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4120 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4123 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4125 * cs-parser.jay: Use the prefered version of -unsafe in error
4128 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4130 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4133 2005-04-20 John Luke <john.luke@gmail.com>
4135 * driver.cs: fix typo in error message, --outout to --output
4137 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4139 * codegen.cs (InRefOutArgumentResolving): New field.
4141 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4142 fields outside contructor.
4144 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4146 2005-04-19 Miguel de Icaza <miguel@novell.com>
4148 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4149 parameter code was not completed ever, so it was not as up-to-date
4150 as local variables. Must finish it.
4152 The bug fix was to compare the Toplevel of the block, not the
4153 current block. Thanks for Ben for pointing this out.
4155 2005-04-19 Raja R Harinath <rharinath@novell.com>
4157 * decl.cs (AddMethods): Use the declaring type of the problem
4158 method to determine if we want to squash a warning.
4160 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4162 * attribute.cs: Removed debug output.
4164 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4166 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4169 2005-04-18 Raja R Harinath <rharinath@novell.com>
4172 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4173 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4174 all null comparisons against reference types.
4176 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4179 * class.cs (TypeContainer.CircularDepException) New nested
4181 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4182 (TypeContainer.DefineType): Removed error, reset InTransit before
4184 (Class.DefineType): Throw exception when is in Transit.
4185 Catch exception and report error.
4186 (Struct.DefineType): Throw exception when is in Transit.
4187 Catch exception and report error.
4188 (Interface.DefineType): Throw exception when is in Transit.
4189 Catch exception and report error.
4191 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4192 handle nested exception handlers.
4194 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4197 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4198 InFinally and InCatch storage.
4200 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4201 (Catch.Resolve): Set and Restore ec.InCatch.
4202 (Try.Resolve): Set and Restore ec.InFinally.
4203 (Try.HasCatch): True when try has catch.
4205 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4207 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4208 for the same event member, so exclude such cases from warning 419.
4211 2005-04-16 Miguel de Icaza <miguel@novell.com>
4213 * expression.cs (Binary.ResolveOperator): Apply patch from John
4214 Luke to fix bug 59864: operators &, | and ^ on enumerations
4215 require that the same enum type on both sides.
4217 * driver.cs: Add warnings to old flag usage, this is to assist
4218 people who produce Makefiles and hope that the Makefiles will be
4221 * class.cs (TypeContainer.EmitType): Moved the definition of the
4222 special $PRIVATE$ field from the resolve phase to the Emit phase.
4223 During resolve we do not know if we are a struct with
4224 HasExplicitLayout, we know this only after the attributes for the
4227 Set the FieldOffset to zero on the dummy field that we create for
4228 the class. Fixes 74590.
4230 2005-04-16 Raja R Harinath <rharinath@novell.com>
4233 * ecore.cs (PropertyExpr.resolved): New.
4234 (DoResolve): Use it to handle a case of double resolution here.
4235 Handle a case of identical-name-and-type-name.
4236 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4237 resolution by storing the results of expression resolution back
4238 into the "probes" array.
4240 2005-04-15 Raja R Harinath <rharinath@novell.com>
4242 Fix cs0208-7.cs and cs0208-8.cs.
4243 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4244 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4245 error reporting to point out the reason a struct is not unmanaged.
4247 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4249 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4250 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4252 2005-04-13 Raja R Harinath <rharinath@novell.com>
4255 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4256 IdenticalNameAndTypeName here.
4257 (EventExpr.InstanceResolve): Likewise.
4259 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4261 C# 2.0 DefaultCharSetAttribute implementation
4263 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4264 which allows us to set GlobalNamespace for every resolve.
4265 (Attribute.ResolveArguments): Cut from Resolve.
4266 (Attribute.GetCharSetValue): Returns CharSet named argument.
4267 (Attribute.DefinePInvokeMethod): Gets default charset from
4269 (GlobalAttribute.ResolveAsTypeStep): Override.
4270 (GlobalAttribute.ResolveArguments): Override.
4272 * class.cs (TypeAttr): Is protected.
4274 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4275 (ModuleClass.DefaultCharSetType): New memeber.
4276 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4278 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4279 charset from module.
4281 * delegate.cs (TypeAttr): Override.
4282 (Delegate.DefineType): Use this TypeAttr.
4284 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4285 at very early stage (before types are defined) to resolve model
4286 module attributes. It will probably not work with corlib but it
4289 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4290 charset from module.
4292 * typemanager.cs (default_charset_type): New type.
4294 2005-04-13 Raja R Harinath <rharinath@novell.com>
4296 * decl.cs (MemberCache.AddMethods): Don't warn if
4297 System.Object.Finalize has buggy MethodAttributes.
4299 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4302 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4304 * doc.cs : detect ambiguous reference to overloaded members.
4305 Fixed bug #71603. MS 1.1 csc does not detect it.
4307 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4309 * doc.cs : delegates must not be referenced with parameters.
4312 2005-04-12 Miguel de Icaza <miguel@novell.com>
4314 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4316 2005-04-10 Miguel de Icaza <miguel@novell.com>
4318 * driver.cs (MainDriver): Stop processing if the CLS stage found
4321 (CompilerCallableEntryPoint.InvokeCompiler): Always
4322 reset after execution; Take a TextWriter argument for the
4325 * report.cs: Use the error stream instead of hardcoding stderr.
4327 2005-04-09 Miguel de Icaza <miguel@novell.com>
4329 * class.cs: Reduce code paths to test, too small of an
4330 optimization to make it worth the extra testing. Always perform
4333 2005-04-08 Raja R Harinath <rharinath@novell.com>
4336 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4337 operators that had errors reported on them.
4339 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4341 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4343 (Attribute.Resolve): Add named argument type checking.
4345 * class.cs (FixedField.Define): Use IsPrimitiveType
4347 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4349 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4350 unsafe parameter types.
4352 * statement.cs (Using.ResolveExpression): Add better error description.
4354 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4356 2005-04-08 Raja R Harinath <rharinath@novell.com>
4359 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4360 AttributeUsageAttribute in the emitcontext of the attribute class,
4361 not in the emitcontext of the attributable entity it was attached to.
4362 * cs-parser.jay: Use 'current_class', not 'current_container',
4363 when creating a GlobalAttribute.
4365 2005-04-08 Alp Toker <alp@atoker.com>
4367 * pending.cs: The fix to #58413 failed to compile methods implementing
4368 interfaces with/without params modifiers and vice versa, even though
4369 params modifiers aren't part of the signature. Make the modifier check
4370 less strict as in csc.
4372 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4373 Anoob V E <projectmonokochi@rediffmail.com>
4374 Harilal P R <projectmonokochi@rediffmail.com>
4377 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4378 modifiers of pending methods.
4379 (PendingImplementation.PendingImplementation): Initialize it.
4380 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4381 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4382 with ParameterData. Add check for modifiers.
4383 * class.cs (MethodData.Define): Update to changes.
4385 2005-04-07 Raja R Harinath <rharinath@novell.com>
4387 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4389 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4391 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4394 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4397 * typemanager.cs: Registered RequiredAttributeAttribute.
4399 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4401 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4402 Warning CS0169 is back at level 3.
4403 (IMethodData.SetMemberIsUsed): New method.
4405 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4406 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4408 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4410 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4412 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4415 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4418 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4419 to avoid the problems with nested types.
4421 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4422 Anoob V.E <projectmonokochi@rediffmail.com>
4423 Harilal P.R <projectmonokochi@rediffmail.com>
4424 Raja R Harinath <rharinath@novell.com>
4427 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4429 * typemanager (GetConstructor): Make public.
4431 2005-04-05 John Luke <john.luke@gmail.com>
4432 Raja R Harinath <rharinath@novell.com>
4435 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4436 struct too. Return false quicker in a few cases.
4437 (VerifyUnManaged): Use it.
4439 2005-04-05 Raja R Harinath <rharinath@novell.com>
4442 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4443 not 'unreachable_seen'.
4445 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4447 * attribute.cs (Attribute.GetValue): Removed unused.
4449 * codegen.cs (CodeGen.TrimExt): Removed unused.
4451 * cs-parser.jay (output): Removed unused.
4453 * cs-tokenizer.cs (hex_digits): Removed unused.
4455 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4457 * expression.cs (Indirection.LoadExprValue): Removed unused.
4458 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4460 * iterators.cs (Iterator.param_types): Removed unused.
4462 * statement.cs (Goto.block): Removed unused.
4463 (ToplevelBlock.did): Removed unused.
4464 (Switch.ResolveConstantSwitch): Removed unused.
4466 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4468 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4471 2005-04-01 Raja R Harinath <rharinath@novell.com>
4473 Fix #74232 and cs0208-3.cs.
4474 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4475 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4476 unmanaged type. Don't use FieldBuilders when 't' is a
4477 TypeBuilder. Use ModFlags and MemberType fields.
4478 * class.cs (MemberBase.member_type): Rename from MemberType.
4479 (MemberBase.MemberType): New property. Determines member_type on
4481 (MemberBase.DoDefine): Don't initialize MemberType here.
4482 (FieldMember.Define): Likewise.
4484 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4487 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4488 Attributes are emitted there.
4490 2005-04-01 Raja R Harinath <rharinath@novell.com>
4492 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4493 keyword in 'partial enum' too.
4494 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4496 Report from Kamil Skalski <nazgul@omega.pl>.
4499 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4500 have partial containers too.
4502 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4503 in block' checks to Block.CheckInvariantMeaningInBlock.
4504 * statement.cs (Block.GetKnownVariableInfo): Make private.
4505 (Block.IsVariableUsedInChildBlock): Remove.
4506 (Block.IsVariableUsedInBlock): Likewise.
4507 (Block.CheckInvariantMeaningInBlock): New. Show location of
4508 conflicting declaration.
4509 (Block.AddVariable): Make error messages less long-winded and more
4510 specific. Show location of conflicting declaration.
4511 * parameter.cs (Parameters.Location): New readonly property.
4513 2005-03-31 Raja R Harinath <rharinath@novell.com>
4515 Clean up semantics of invoking ResolveMemberAccess.
4516 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4517 can have an instance, ensure that we pass in a non-TypeExpression
4518 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4519 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4520 argument. Update to changes and simplify.
4521 (FieldExpr.Emitinstance): Remove CS0120 check.
4522 (PropertyExpr.EmitInstance): Likewise.
4523 * expression.cs (Argument.Resolve): Likewise.
4524 (Invocation.DoResolve): Update to changes in semantics of
4527 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4530 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4533 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4535 2005-03-31 Raja R Harinath <rharinath@novell.com>
4537 Fix difference in behaviour with commandline invocation.
4538 * driver.cs (Driver.Reset): New.
4539 (CompilerCallableEntryPoint): Call it.
4541 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4542 variable" warnings if the boolean expression failed to resolve.
4544 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4546 * attribute.cs: Fix the union of several permissions when some of them
4547 are unrestricted (so the result isn't an unrestricted permission set).
4550 2005-03-30 Raja R Harinath <rharinath@novell.com>
4552 * ecore.cs (MemberExpr): New class. Convert from interface
4554 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4555 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4557 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4558 (MethodGroupExpr.IsExplicitImpl): Remove.
4559 (Expression.GetFieldFromEvent): Remove.
4560 (SimpleName.MemberStaticCheck): Remove.
4561 (SimpleName.DoSimpleNameResolve): Update to changes.
4562 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4563 (MemberAccess.IdenticalNameAndTypeName): Remove.
4564 (MemberAccess.error176): Move to MemberExpr.
4565 (MemberAccess.DoResolve): Update to changes.
4566 (BaseAccess.DoResolve): Likewise.
4568 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4570 C# 2.0 Conditional attribute class implementation
4572 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4573 Analyzes class whether it has attribute which has ConditionalAttribute
4574 and its condition is not defined.
4576 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4577 (Class.IsExcluded): New method. Search for at least one defined
4578 condition in ConditionalAttribute of attribute class.
4580 2005-03-30 Raja R Harinath <rharinath@novell.com>
4582 * ecore.cs (PropertyExpr): Derive from Expression, not
4583 ExpressionStatement.
4584 (PropertyExpr.EmitStatement): Remove.
4586 2005-03-29 Raja R Harinath <rharinath@novell.com>
4589 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4590 internal field "value__" of an enum be private. The examples for
4591 "value__" that I found on MSDN all used FieldAttributes.Private.
4593 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4594 Don't mention IL method attribute names.
4596 Fix #47991. Remove a TODO.
4597 * statement.cs (Block.Toplevel): Make into a field.
4598 (Block.Parameters): Move into ToplevelBlock.
4599 (Block.known_variables): Rename from child_variable_names.
4600 (Block.Block): Remove variants that take Parameters. Initialize
4601 'Toplevel' with the immediately surrounding toplevel block.
4602 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4603 LocalInfo parameter.
4604 (Block.GetKnownVariableInfo): New.
4605 (Block.IsVariableNameUsedInChildBlock): Update.
4606 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4607 the block, even though it may not be in scope.
4608 (Block.AddVariable): Remove Parameters parameter. Use
4609 Toplevel.Parameters instead.
4610 (Block.AddConstant): Remove Parameters parameter.
4611 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4612 (Block.IsParamaterReference): Likewise.
4613 (Block.IsLocalParameter): Likewise. Simplify a lot.
4614 (ToplevelBlock.Parameters): New. Moved from Block.
4615 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4616 initialize Parameters to a non-null value.
4617 * cs-parser.jay: Update to changes.
4618 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4619 simple names that mean different things in the same block. Use
4620 Block.IsVariableNameUsedInBlock.
4622 2005-03-28 Raja R Harinath <rharinath@novell.com>
4624 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4625 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4626 GetTypeHandle. It is possible for a reflected type to derive from
4627 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4628 System.Array during mscorlib compilation).
4629 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4630 contain a method_hash, don't create one either. Don't create a
4631 deep copy of the base cache's method_hash.
4632 (MemberCache.SetupCache): Rename back from DeepCopy.
4633 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4634 already initialized. If we see an override function, add its
4635 underlying base virtual function to the member_hash too.
4637 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4639 2005-03-26 Raja R Harinath <harinath@acm.org>
4642 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4643 fails to resolve, ensure that the LHS is still resolved as an
4646 2005-03-25 Raja R Harinath <harinath@acm.org>
4648 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4650 (Enum.current_ec): Remove.
4651 (Enum.LookupEnumValue): Remove EmitContext argument.
4652 Just uses the one created during DefineType.
4653 (Enum.FindMembers): Update.
4654 * expression.cs (MemberAccess.DoResolve): Update.
4656 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4658 * assign.cs (Assign.DoResolve): Check for CS1717 when
4659 source and target are same (uses Equals).
4661 * expression.cs (LocalVariableReference, ParameterReference,
4662 This): Implemented Equals, GetHashCode.
4664 * statement.cs (Block.GetParameterReference): Removed useless
4667 2005-03-22 Raja R Harinath <rharinath@novell.com>
4670 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4671 blocks before deciding whether the error is cs0136 or cs0128.
4673 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4674 (using_alias_directive, using_namespace_directive): Pass
4675 MemberName, not an expression to Namespace.UsingAlias and
4677 (MakeName): Use the MemberName of the namespace.
4678 * namespace.cs (Namespace.MemberName): New.
4679 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4680 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4682 * decl.cs (MemberName.Name): Make readonly.
4683 (MemberName.FromDotted): New "constructor".
4684 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4685 (MemberCore.Name): Compute from MemberName on demand.
4686 (MemberCore.SetMemberName): Provide a way to change the
4688 (MemberCore.AddToContainer): Don't take a fullname parameter.
4689 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4690 fully qualified name of the container to the member name.
4691 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4692 only if the type is a member of the root container.
4693 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4694 MemberName.Left rather than searching for an embedded ".".
4695 (PartialContainer.CreatePart): Update to changes in RootContext.
4696 (MemberBase.ShortName): Turn into a property. Use
4697 MemberCore.SetMemberName.
4698 (MemberBase.ExplicitInterfaceName): Remove.
4699 (MemberBase.UpdateMemberName): Remove.
4700 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4701 (PropertyBase.SetMemberName): New override.
4702 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4703 (Tree.GetDecl): New.
4704 (Tree.AllDecls): Rename from Decls.
4705 * attribute.cs, enum.cs, report.cs: Update to changes.
4706 * driver.cs (MainDriver): Use MemberName.FromDotted on
4707 RootContext.MainClass.
4709 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4711 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4714 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4716 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4718 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4719 property accessor modifiers.
4721 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4722 fixed buffer attribute (CS1716).
4723 (PropertyMethod.HasCustomAccessModifier): When property accessor
4724 has custom modifier.
4726 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4728 (PropertyExpr.DoResolveLValue): Add CS0272.
4730 2005-03-17 Miguel de Icaza <miguel@novell.com>
4732 * convert.cs: When converting to a pointer, use the proper Conv.U
4733 or Conv.I depending on the source data type.
4735 * cs-tokenizer.cs: Make the size for large decimal constants,
4738 2005-03-17 Martin Baulig <martin@ximian.com>
4740 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4741 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4743 2005-03-17 Martin Baulig <martin@ximian.com>
4745 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4746 to bool so we can return an error condition.
4747 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4750 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4752 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4755 2005-03-16 Raja R Harinath <rharinath@novell.com>
4757 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4758 Refactor to avoid traversing the list of assemblies, and to avoid
4759 string concatenation.
4760 * typemanager.cs (guid_attr_type): Remove.
4761 (negative_hits, pointers, references): Remove hashes.
4763 (GetConstructedType): New. Uses type_hash to handle constructed
4764 types (arrays, references, pointers).
4765 (GetReferenceType, GetPointerType): Use it.
4766 (GetNestedType): New. Uses type_hash to handle nested types of
4768 (LookupType, LookupTypeDirect): Remove.
4769 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4770 'types' hash and LookupTypeReflection directly.
4771 (params_string, params_object): Use GetConstructedType.
4772 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4774 (Namespace.Lookup): Use cached_types.
4775 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4776 provided by old TypeManager.LookupType.
4777 * rootcontext.cs (MakeFQN): Remove.
4778 * decl.cs (DeclSpace.MakeFQN): Likewise.
4779 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4780 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4781 TypeManager.GetConstructedType.
4782 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4784 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4786 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4789 * cs-parser.jay: Reports CS1527 for any namespace element.
4791 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4794 * expression.cs (ParameterReference.IsAssigned): Changed error to
4796 (Error_WrongNumArguments): Moved CS0245 detection here.
4798 * statement.cs (Return.Resolve): Add CS1622 report.
4800 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4802 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4804 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4806 * attribute.cs expression.cs: Get rid of some allocations.
4808 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4810 * doc.cs : just eliminate the latest change.
4812 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4814 * doc.cs : commented out the latest change. It breaks xml-030.cs
4816 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4818 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4819 fail. So invoke CreateType() in FindDocumentedType().
4821 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4823 * cs-tokenizer.cs : added IsKeyword().
4824 * doc.cs : Detect keyword incorrectly used as identifier.
4825 Allow identifiers prefixed by @.
4827 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4829 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4830 It caused exception in namespace resolving (again!).
4832 * class.cs (Class.ctor): Removed exit.
4833 (PropertyMethod.ctor): ditto.
4835 * codegen.cs (Codegen.Reset): Reset static data.
4836 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4838 * cs-tokenizer.cs (Cleanup): Removed.
4840 * driver.cs (GetSystemDir): Rewrote to one line command.
4841 It caused problem with unloaded dynamic modules.
4842 (UnixParseOption): Removed Exit.
4843 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4844 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4845 Now can be mcs used as library.
4847 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4850 * location.cs (Reset): Reset static data.
4852 * namespace.cs (Reset): Reset static data.
4854 * report.cs (Report.Reset): Reset static data.
4856 * rootcontext.cs (RootContext.Reset): Reset static data.
4858 * tree.cs (RootTypes.ctor): Use Location.Null
4860 * typemanager.cs (TypeManager.Reset): Reset static data.
4861 (CoreLookupType): Removed Exit.
4862 (TypeHandle.Reset): Reset static data.
4864 2005-03-10 Raja R Harinath <rharinath@novell.com>
4867 * typemanager.cs (ComputeNamespaces): Import namespaces from
4868 referenced modules too.
4870 2005-03-09 Raja R Harinath <rharinath@novell.com>
4872 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4875 2005-03-09 Raja R Harinath <rharinath@novell.com>
4877 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4878 enclosing DeclSpace. This ensures that a name-lookup populates
4879 more caches and there are fewer 'TypeExpression's. Carve out
4880 nested type lookup into ...
4881 (LookupNestedTypeInHierarchy): ... this.
4883 2005-03-09 Raja R Harinath <rharinath@novell.com>
4885 Clean up a few partial-class semantics.
4886 Fixes test-357.cs and cs1618-2.cs.
4887 * cs-parser.jay (struct_declaration): Use 'current_class' as
4888 parent of newly-created struct. Remove call to Register ().
4889 Use 'pop_current_class' to complete handing the current struct.
4890 (interface_declaration): Likewise.
4891 (class_declaration): Likewise.
4892 (enum_declaration): Use 'current_class' as parent of newly created
4894 (delegate_declaration): Likewise.
4895 (pop_current_class): New function. This is used to handle closing
4896 up the 'current_class' and 'current_container', and pointing them
4897 to the enclosing class/container.
4898 (CSharpParser): Initialize 'current_class' too.
4899 * decl.cs (MemberCore): Add check for invariant: a partial
4900 container is not a parsed entity, and thus does not enclose any
4902 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4903 (DeclSpace.BaseTypeExpr): Use it.
4904 (DeclSpace.LookupType): Add check for invariant.
4905 * class.cs (TypeContainer): Add check for invariant: a nested
4906 class should have the same NamespaceEntry as its enclosing class.
4907 (TypeContainer.EmitFieldInitializers): Make virtual.
4908 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4910 (TypeContainer.Register): Remove.
4911 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4912 null. Use TypeResolveEmitContext for resolving base types and
4913 interfaces. Move initialization of Parts.TypeBuilder here from
4915 (TypeContainer.DefineNestedTypes): ... here.
4916 (PartialContainer): Take a Namespace not a NamespaceEntry.
4917 (PartialContainer.Create): Don't use Register. Call the
4918 appropriate Add... function directly.
4919 (ClassPart): Take both the PartialContainer and the enclosing
4920 class as constructor arguments.
4921 (ClassPart.EmitFieldInitializers): Override.
4922 (ClassPart.PartFindNestedTypes): Remove.
4923 (FieldBase.GetInitializerExpression): Resolve the initializer
4924 expression in the emit context of the enclosing class.
4925 * tree.cs (RootTypes): Remove Register ().
4927 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4929 * cs-parser.jay: Removed CS0134.
4931 * driver.cs: Removed CS1901.
4933 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4934 for predefined types.
4936 2005-03-07 Duncan Mak <duncan@novell.com>
4938 * codegen.cs (Save): Catch UnauthorizedAccessException as
4939 well. Fixes bug #73454.
4941 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4943 * cs-tokenizer.cs (xtoken): Add CS1035.
4945 * class.cs (MethodData.Define): Add CS0683.
4946 (FieldMember.ctor): Add CS0681.
4948 2005-03-07 Raja R Harinath <rharinath@novell.com>
4950 * ecore.cs (SimpleName.DoResolve): Rename from
4951 SimpleName.DoResolveAllowStatic.
4952 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4953 Pass 'intermediate' flag to MemberStaticCheck.
4954 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4955 of "intermediate" lookups via MemberAccess.
4956 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4957 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4959 2005-03-07 Raja R Harinath <rharinath@novell.com>
4962 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4963 slipped in because of variable names that are identical to a
4964 builtin type's BCL equivalent ('string String;', 'int Int32;').
4965 (PropertyExpr.EmitInstance): Likewise.
4967 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4969 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4971 * report.cs (warning_ignore_table): Made public.
4973 2005-03-04 Raja R Harinath <rharinath@novell.com>
4976 * class.cs (MethodData.Emit): Pass 'container' to
4977 container.GetObsoleteAttribute instead of 'container.Parent'.
4979 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4981 * cs-parser.jay: Add 1534 error test.
4983 * iterators.cs (Yield.CheckContext): Add error 1629.
4984 (Iterator.ctor): Save unsafe modifier.
4985 (MoveNextMethod.DoEmit): Restore unsafe context.
4987 * namespace.cs (UsingAlias): Better error message.
4989 2005-03-03 Dan Winship <danw@novell.com>
4991 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4992 the warning message [#73219]
4994 2005-03-03 Raja R Harinath <rharinath@novell.com>
4996 Fix compile with MCS 1.0.0.0.
4997 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4998 w_restore to not depend on string constant folding.
5000 2005-03-03 Raja R Harinath <rharinath@novell.com>
5002 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5003 CS0246 check to users who passed 'silent = false'.
5004 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5006 (SimpleName.SimpleNameResolve): Update.
5007 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5008 (MemberAccess.IdenticalNameAndTypeName): Update.
5009 * doc.cs (FindDocumentedTypeNonArray): Update.
5011 2005-03-03 Raja R Harinath <rharinath@novell.com>
5013 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5014 * parameters.cs (ComputeAndDefineParameters): Remove.
5015 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5016 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5017 Use GetParameterInfo.
5019 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5021 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5023 2005-03-02 Raja R Harinath <rharinath@novell.com>
5025 Unify DeclSpace.LookupType and DeclSpace.FindType.
5026 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5027 is in charge of defining nested types on demand.
5028 (DeclSpace.LookupType): Use it when the current_type is a
5029 TypeBuilder. Use LookupTypeDirect for reflected types.
5030 (DeclSpace.FindType): Remove.
5031 (DeclSpace.LookupInterfaceOrClass): Likewise.
5032 (DeclSpace.DefineTypeAndParents): Likewise.
5033 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5034 DeclSpace.LookupType.
5035 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5036 * typemanager.cs (LookupType): Simplify.
5037 (AddUserType): Remove type from negative_hits.
5038 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5039 * class.cs (TypeContainer.FindMembers): Move handling of nested
5041 (TypeContainer.FindMembers_NestedTypes): ... here.
5042 (TypeContainer.FindNestedType): Implement override.
5043 (ClassPart.FindNestedType): Delegate to PartialContainer.
5044 (ClassPart.PartFindNestedType): Looks up the nested types of the
5047 2005-03-02 Martin Baulig <martin@ximian.com>
5049 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5050 static constructor in static classes.
5052 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5054 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5055 sizeParamIndex is not specified.
5057 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5060 * report.cs (WarningMessage.IsEnabled): Missing null check.
5062 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5064 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5065 in the fields and not in the properties.
5067 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5069 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5072 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5074 * attribute.cs: Small refactoring (improved robustness).
5075 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5076 (ValidateGuid): Removed.
5077 (Resolve): Removed referenced to above mentioned.
5078 (GetAttributeUsage): Made private and changed to work without
5080 (GetIndexerAttributeValue): Don't crash.
5081 (GetConditionalAttributeValue): Ditto.
5082 (GetClsCompliantAttributeValue): Ditto.
5083 (ExtractSecurityPermissionSet): All attributes exceptions are
5085 (GetPropertyValue): New helper.
5086 (GetMethodImplOptions): New method.
5087 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5088 some missing properties.
5090 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5091 (Method.ApplyAttributeBuilder): Updated.
5093 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5096 2005-02-28 Raja R Harinath <rharinath@novell.com>
5099 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5100 non-simple types (array, pointer, reference).
5102 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5104 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5106 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5108 (Method.CheckBase): Catch wrong destructor here.
5109 (MethodData.Define): Add errors 550, 668.
5111 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5113 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5115 * pending.cs (VerifyPendingMethods): Add error 551.
5117 * typemanager.cs (CSharpName): Next error report helper.
5119 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5121 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5122 attributes. Removed useless attribute double check.
5123 It saves almost 2MBs for corlib.
5125 2005-02-25 Raja R Harinath <rharinath@novell.com>
5128 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5129 called twice in case of error.
5131 2005-02-23 Chris Toshok <toshok@ximian.com>
5133 Fix compiler portions of #72827.
5134 * statement.cs (Block.Emit): call Begin/EndScope on the
5135 EmitContext instead of the ILGenerator.
5137 * codegen.cs (EmitContext.BeginScope): new method, call
5138 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5140 (EmitContext.BeginScope): same, but EndScope and CloseScope
5142 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5143 offset and call the superclass's OpenScope(int) with it.
5144 (SymbolWriter.CloseScope): get the current il
5145 offset and call superclass's CloseScope(int) with it.
5147 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5149 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5150 CS1677 for out and ref as well.
5152 * class.cs (Method.Define): Add error CS1599 detection.
5154 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5156 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5158 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5160 * support.cs.cs (ModifierDesc): New helper method.
5162 2005-02-23 Raja R Harinath <rharinath@novell.com>
5163 Abin Thomas <projectmonokochi@rediffmail.com>
5164 Anoob V E <projectmonokochi@rediffmail.com>
5165 Harilal P R <projectmonokochi@rediffmail.com>
5168 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5169 MemberLookup (used for error reporting) actually returns a result.
5170 Fix error report number (122, not 112).
5172 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5173 Anoob V E <projectmonokochi@rediffmail.com>
5174 Harilal P R <projectmonokochi@rediffmail.com>
5177 * pending.cs (PendingImplementation.GetAbstractMethods):
5178 Find NonPublic members too.
5180 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5182 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5185 * class.cs (MethodCore.CheckMethodAgainstBase):
5186 Add error 239 report.
5188 2005-02-21 Raja R Harinath <rharinath@novell.com>
5191 * expression.cs (Invocation.IsApplicable): Make public.
5192 (Invocation.IsParamsMethodApplicable): Likewise.
5193 * delegate.cs (Delegate.VerifyApplicability): Don't use
5194 Invocation.VerifyArgumentCompat for parameter applicability
5195 testing. Use Invocation.IsApplicable and
5196 Invocation.IsParamsMethodApplicable.
5198 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5200 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5202 * class.cs (Operator.Define): Add error 217 report.
5204 2005-02-21 Raja R Harinath <rharinath@novell.com>
5206 * namespace.cs (UsingEntry.Resolve): Undo change below.
5208 2005-02-21 Raja R Harinath <rharinath@novell.com>
5211 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5212 disable the error message when the extended MemberLookup also
5214 (Expression.MemberLookupFinal): Update.
5215 (SimpleName.DoSimpleNameResolve): Update.
5216 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5217 Don't use MemberLookupFinal.
5218 (New.DoResolve): Update.
5219 (BaseAccess.CommonResolve): Update.
5221 2005-02-21 Raja R Harinath <rharinath@novell.com>
5224 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5225 occured previously, don't resolve again.
5227 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5230 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5231 argument. Call ResolveAttributeUsage for unresolved.
5232 when types doesn't match ctor arguments.
5234 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5235 for nested attribute classes.
5236 (Class.attribute_usage): Removed.
5237 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5238 for attribute class.
5240 * ecore.cs (IsAttribute): Removed.
5242 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5244 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5246 (attribute_types): Removed.
5247 (EmitCode): Global attributes are emited as the latest.
5249 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5251 * class.cs (EmitFieldInitializers): Don't emit field initializer
5252 for default values when optimilization is on.
5254 * constant.cs (Constant.IsDefaultValue): New property.
5256 * driver.cs: Add /optimize handling.
5260 * literal.cs: Implement new IsDefaultValue property.
5262 * rootcontext.cs (Optimize): New field, holds /optimize option.
5264 2005-02-18 Raja R Harinath <rharinath@novell.com>
5266 Fix crasher in re-opened #72347.
5267 * namespace.cs (Namespace.Lookup): Return null if
5268 DeclSpace.DefineType returns null.
5271 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5273 2005-02-18 Raja R Harinath <rharinath@novell.com>
5275 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5276 now returns null if it cannot resolve to an lvalue.
5277 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5278 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5279 returned null. Remove check for SimpleName.
5280 (EventExpr.DoResolveLValue): New.
5281 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5282 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5284 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5286 (Unary.ResolveOperator): Move CS0211 check ...
5287 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5289 (Unary.DoResolveLValue): Simplify.
5290 (AddressOf.DoResolveLValue): New.
5291 (ArrayAccess.DoResolveLValue): New.
5293 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5295 * attribute.cs (Attribute.Resolve): Add arguments casting for
5296 when types doesn't match ctor arguments.
5298 2005-02-16 Raja R Harinath <rharinath@novell.com>
5300 Fix parts of #63202.
5301 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5302 lookup of operator in base type. Ensure that all checks happen
5303 when the operator resolves to an "op_..." method.
5305 2005-02-15 Raja R Harinath <rharinath@novell.com>
5308 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5309 'ignore_cs0104' parameter. Pass it to ...
5310 (NamespaceEntry.Lookup): ... this.
5311 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5312 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5313 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5314 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5315 Update. Request that cs0104 errors be ignored.
5316 (ComposedCast.ResolveAsTypeStep): Update.
5318 2005-02-14 Raja R Harinath <rharinath@novell.com>
5321 * expression.cs (Invocation.BetterFunction): Remove support for
5322 comparing virtual functions and their overrides.
5323 (Invocation.IsOverride): New.
5324 (Invocation.OverloadResolve): Don't consider 'override' functions
5325 during candidate selection. Store them in a lookaside list.
5326 If the selected method is a 'virtual' function, use the list to
5327 find any overrides that are closer to the LHS type.
5329 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5331 * expression.cs (New.DoResolve): Add complex core type reduction.
5332 (New.Constantify): Converts complex core type syntax like 'new int ()'
5335 2005-02-14 Raja R Harinath <rharinath@novell.com>
5337 * decl.cs (EntryType.EntryType): New constructor to create an
5338 updated copy of a cache entry.
5339 (MemberCache.AddMethods): Use it.
5340 (MemberCache.ClearDeclaredOnly): Remove.
5341 (MemberCache.MemberCache): Update.
5343 2005-02-11 Miguel de Icaza <miguel@novell.com>
5345 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5346 variable. This one is represents the actual low-level declaration
5347 of the method, as opposed to the semantic level `IsStatic'.
5349 An anonymous method which is hosted into a static method might be
5350 actually an instance method. IsStatic would reflect the
5351 container, while MethodIsStatic represents the actual code
5354 * expression.cs (ParameterReference): Use the new MethodIsStatic
5355 instead of IsStatic.
5357 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5358 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5359 set on the current EmitContext.
5361 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5362 resolve our casted expression as an LValue. This triggers the
5363 proper LValue processing that is later required by Assign.
5367 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5369 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5371 C# 2.0 Fixed buffer implementation
5373 * anonymous.cs: Update after RegisterHelperClass renaming.
5375 * attribute.cs (AttributeTester.fixed_buffer_cache):
5376 Cache of external fixed buffers.
5377 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5378 implementation if field is fixed buffer else null.
5381 (TypeContainer.AddField): Accept FieldMember instead of Field.
5382 (FieldBase.IsFieldClsCompliant): Extracted code from
5383 VerifyClsCompliance descendant customization.
5384 (FixedField): New class handles fixed buffer fields.
5385 (FixedFieldExternal): Keeps information about imported fixed
5387 (IFixedField): Make access to internal or external fixed buffer
5390 * cs-parser.jay: Add fixed buffer parsing.
5392 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5395 * expression.cs (Indirection): Extended implementation to accept
5397 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5398 (ElementAccess.MakePointerAccess): Get type as parameter.
5399 (DoResolve): Add fixed buffer field expression conversion.
5400 (DoResolveLValue): Ditto.
5401 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5402 (ArrayPtr): Derives from FixedBufferPtr.
5403 (ArrayPtr.Emit): Add extra emit for array elements.
5405 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5407 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5408 for compiler generated types.
5409 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5411 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5412 and consume less memory.
5413 (Fixed.Resolve): Add fixed buffer case.
5415 * typemanager.cs (compiler_generated_attr_ctor,
5416 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5417 (HasElementType): Add our own implementation to work on every
5420 2005-02-11 Miguel de Icaza <miguel@novell.com>
5422 * anonymous.cs (CaptureContext): Track whether `this' has been
5425 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5426 only captured `this' if it was implicitly done (instance
5427 methods/variables were used).
5429 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5430 `this' must be captured.
5432 2005-01-30 Miguel de Icaza <miguel@novell.com>
5434 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5435 is null it means that there has been no need to capture anything,
5436 so we just create a sibling.
5438 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5440 Just a partial fix. The other half is fairly elusive.
5442 2005-02-10 Raja R Harinath <rharinath@novell.com>
5444 Fix #52586, cs0121-4.cs.
5445 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5446 and return a hashtable.
5447 (MemberCache.ClearDeclaredOnly): New.
5448 (MemberCache.MemberCache): Update to change. Make a deep copy of
5449 the method_hash of a base type too.
5450 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5451 type methods. Overwrite entries with the same MethodHandle so
5452 that the ReflectedType is correct. The process leaves in base
5453 virtual functions and their overrides as distinct entries.
5454 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5455 matters since it was boxed in a ArrayList before.
5456 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5458 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5459 case of a virtual function and its override (choose the overload
5461 (Invocation.OverloadResolve): Avoid 'override' members during
5462 'applicable_type' calculation.
5464 2005-02-09 Raja R Harinath <rharinath@novell.com>
5466 Combine two near-redundant caches.
5467 * typemanager.cs (method_params): Rename from method_internal_params.
5468 (TypeManager.GetParameterData): New. Replace
5469 Invocation.GetParameterData.
5470 (TypeManager.LookupParametersByBuilder): Remove.
5471 * expression.cs (Invocation.method_parameter_cache): Remove.
5472 (Invocation.GetParameterData): Remove.
5474 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5477 2005-02-08 Raja R Harinath <rharinath@novell.com>
5480 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5481 TypeManager.multicast_delegate_type is null, resolve it by looking
5482 up "System.MulticastDelegate".
5483 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5485 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5486 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5487 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5490 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5491 (LabeledStatement.AddReference): New. Set 'referenced'.
5492 (Goto.Resolve): Use it.
5494 2005-02-05 John Luke <john.luke@gmail.com>
5496 * driver.cs: remove duplicate -doc line in Usage ()
5498 2005-02-04 Raja R Harinath <rharinath@novell.com>
5500 * location.cs (Location.AddFile): Fix CS2002 error report.
5502 2005-02-02 Martin Baulig <martin@ximian.com>
5504 * delegate.cs (Delegate.DefineType): Report an internal error if
5505 TypeManager.multicast_delegate_type is null. See bug #72015 for
5508 2005-02-02 Raja R Harinath <rharinath@novell.com>
5510 Fix a crasher in a variant of #31984.
5511 * const.cs (Constant.CheckBase): New override that defers the
5512 new-or-override check in case the base type hasn't been populated
5514 (Constant.Define): Ensure the new-or-override check is performed.
5516 2005-02-01 Duncan Mak <duncan@ximian.com>
5518 * const.cs (LookupConstantValue): Check that `ce' is not null
5519 before calling GetValue ().
5521 2005-02-01 Raja R Harinath <rharinath@novell.com>
5523 Fix test-334.cs (#69519).
5524 * cs-parser.jay (using_alias_directive): Pass in an expression to
5525 NamespaceEntry.UsingAlias.
5526 (using_namespace_directive): Pass in an expression to
5527 NamespaceEntry.Using.
5528 (namespace_name): Don't flatten to a string.
5529 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5530 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5532 (NamespaceEntry.UsingEntry): Likewise.
5533 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5535 (NamespaceEntry.LookupForUsing): Remove.
5536 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5538 (NamespaceEntry.Lookup): Remove support for dotted names.
5540 2005-02-01 Raja R Harinath <rharinath@novell.com>
5542 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5544 (NamespaceEntry.ImplicitParent): Compute on demand.
5545 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5546 parallels the current.
5547 (NamespaceEntry.LookupForUsing): Use it.
5548 (NamespaceEntry.Lookup): If the current namespace-entry is
5549 implicit, don't search aliases and using tables.
5551 2005-02-01 Raja R Harinath <rharinath@novell.com>
5554 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5556 (TypeContainer.BaseCache): Compute on demand.
5557 (TypeContainer.FindMembers): Define constants and types if they're
5558 not already created.
5559 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5561 * const.cs (Constant.Define): Make idempotent.
5563 2005-01-29 Miguel de Icaza <miguel@novell.com>
5565 * pending.cs: Produce better code (no nops produced by using Ldarg
5568 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5569 i - 1' it should be arg + 1.
5573 2005-01-28 Raja R Harinath <rharinath@novell.com>
5575 * attribute.cs (Attribute.CheckAttributeType): Make private
5577 (Attribute.ResolveType): Make virtual.
5578 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5579 handling of RootContext.Tree.Types.
5581 2005-01-27 Raja R Harinath <rharinath@novell.com>
5583 Update attribute-handling to use the SimpleName/MemberAccess
5585 * cs-parser.jay (attribute): Pass in an expression to the
5586 constructors of Attribute and GlobalAttribute.
5587 * attribute.cs (Attribute): Take an expression for the name.
5588 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5589 passed in attribute name expression.
5590 (Attribute.CheckAttributeType): Use it.
5591 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5592 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5593 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5594 argument to prevent error messages if the lookup fails.
5596 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5598 * expression.cs (Indirection): Implemented IVariable interface
5599 to support indirection in AddressOf operator.
5600 (PointerArithmetic.Emit): Add optimalization for case where
5601 result can be precomputed.
5603 2005-01-26 Martin Baulig <martin@ximian.com>
5605 * class.cs (TypeContainer.AttributeTargets): Return the correct
5606 AttributeTargets depending on our `Kind' instead of throwing an
5607 exception; fixes #71632.
5609 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5612 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5615 2005-01-25 Raja R Harinath <rharinath@novell.com>
5618 * expression.cs (MemberAccess.DoResolve): Don't complain with
5619 cs0572 when the LHS of a member access has identical name and type
5622 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5625 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5627 Create custom PermissionSet only for PermissionSetAttribute.
5629 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5632 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5633 delegates in static class.
5635 2005-01-24 Martin Baulig <martin@ximian.com>
5637 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5638 merging an implicit block, just use its reachability.
5640 * statement.cs (Block.Resolve): Make the unreachable code check
5641 work wrt. implicit blocks; see test-337 from #63842.
5643 2005-01-21 Alp Toker <alp@atoker.com>
5645 * cs-parser.jay: destructor_declaration's container is PartialContainer
5646 not Class when partial types are used, so use Kind prop instead of
5649 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5651 * cs-parser.jay: Improve error reporting when an interface
5654 2005-01-20 Dick Porter <dick@ximian.com>
5656 * support.cs: SeekableStreamReader fix from Sandor Dobos
5657 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5658 chars are read. Fixes bug 70369.
5660 2005-01-20 Raja R Harinath <rharinath@novell.com>
5662 * cs-parser.jay (catch_clause): Simplify current_block handling
5665 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5667 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5668 code with ImplicitStandardConversion to handle the implicit
5669 conversion of method groups into valid delegate invocations.
5671 The problem is that in parameter handling we were using this code
5672 path. Fixes bug #64698
5674 2005-01-19 Raja R Harinath <rharinath@novell.com>
5676 * cs-parser.jay: Fix several infelicities.
5677 - Avoid assigning to the parser value stack. Code like
5678 '$3 = null' is unclean. Synthesize a value for the code block
5680 - Avoid using oob_stack for storing location information. Use ...
5681 (_mark_): ... this. New (empty) rule. Saves the current location
5683 (foreach_statement): Avoid using oob_stack for current_block
5684 handling. Use technique used in for_statement and
5685 using_statement. Synthesize a value for the code block to store
5686 additional intermediate information.
5688 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5690 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5691 of a different type is only allowed to private fields of a
5692 containing type, not on fields of a base class.
5694 See test-174.cs and error cs0122-9.cs
5696 2005-01-13 Raja R Harinath <rharinath@novell.com>
5698 Fix test-335.cs (bug #58126).
5699 * cs-parser.jay (argument): Split out non-expression parts of the
5700 rule into 'non_simple_argument'.
5701 (invocation_expression): Support parenthesized invocations with
5702 multiple arguments, and with single non-simple arguments.
5704 2005-01-13 Raja R Harinath <rharinath@novell.com>
5706 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5709 2005-01-12 Raja R Harinath <rharinath@novell.com>
5711 Fix cs0038-1.cs, cs1640-6.cs.
5712 * ecore.cs (Expression.Resolve): Remove special-case for
5713 SimpleName in error-handling.
5714 (Expression.almostMatchedMembers): Relax access permission to
5716 (Expression.MemberLookupFailed): Handle duplicates in
5717 almostMatchedMembers list.
5718 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5719 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5720 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5721 overload if the passed in MemberInfo is a MethodBase.
5723 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5726 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5727 for non-CAS & merge permission sets properly.
5729 2005-01-11 Raja R Harinath <rharinath@novell.com>
5731 Improve standard-compliance of simple name and member access
5732 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5733 * ecore.cs (FullNamedExpression): New abstract base class
5734 for Namespaces and TypeExpressions.
5735 (ResolveFlags.SimpleName): Remove.
5736 (SimpleName): Remove support for dotted names.
5737 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5738 DeclSpace.FindType and DeclSpace.LookupType.
5739 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5740 (Expression.ExprClassName): Make member function.
5741 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5742 a namespace. Remove creation of dotted "SimpleName"s.
5743 (MemberAccess.DoResolve): Likewise.
5744 * decl.cs (DeclSpace.Cache): Make private.
5745 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5746 (DeclSpace.FindType): Update.
5747 (DeclSpace.LookupType): Move here from RootContext. Return a
5748 FullNamedExpression.
5749 * namespace.cs (Namespace): Derive from FullNamedExpression
5750 so that it can be part of expression resolution.
5751 (Namespace.Lookup): Return an FullNamedExpression.
5752 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5754 * rootcontext.cs (NamespaceLookup): Remove.
5755 (LookupType): Move to DeclSpace.
5756 * attribute.cs (CheckAttributeType): Update.
5757 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5758 (FindDocumentedTypeNonArray): Likewise.
5760 2005-01-11 Raja R Harinath <rharinath@novell.com>
5762 Fix cs0509.cs, cs1632.cs.
5763 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5764 is the same as IsInterface.
5765 (TypeContainer.GetClassBases): Likewise.
5766 * statement.cs (LabeledStatement.ig): New field.
5767 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5769 (LabeledStatement.DoEmit): Check that the label was created with
5770 the same ILGenerator.
5772 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5775 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5776 accessors to its properties.
5778 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5779 from accessors to property.
5781 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5784 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5787 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5789 * attribute.cs: Check for null and empty strings.
5791 I have lost another battle to Paolo.
5793 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5796 * class.cs (PropertyMethod): Set Parent field in ctors.
5797 (SetMethod.InternalParameters): Add unsafe switch hack.
5798 Override MarkForDuplicationCheck where it is appropriate.
5800 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5801 It says whether container allows members with the same name.
5803 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5804 Removed is_method parameter.
5806 2005-01-06 Duncan Mak <duncan@ximian.com>
5808 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5809 because the previous change led to incorrect reporting of CS1032
5810 ("Cannot define/undefine preprocessor symbols after first token in
5811 file"). Instead of using `tokens_seen' as the only flag that
5812 triggers CS1040, introduce `comments_seen'. This new flag is used
5813 to signify having seen comments on the current line, so it is
5814 unset after a newline.
5816 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5818 * doc.cs : When searching for a type, find nested type too.
5819 This fixes bug #71040.
5821 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5824 - Warn missing member comment on those classes which also does not
5825 have doc comments. Fixed bug #71041.
5826 - Don't warn missing doc comment on default constructor.
5829 2005-01-06 Duncan Mak <duncan@ximian.com>
5831 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5832 comments, set `tokens_seen' to true. This allows us to detect
5833 misplaced preprocessor directives (i.e. not at the beginning of
5834 the a line, nor after whitespaces). In that case, report error
5835 CS1040. This fixes bug #56460.
5837 * cs-parser.jay (interface_member_declaration): Add checks for
5838 IsExplicitImpl, and report CS0541 error if an interface member is
5839 defined as an explicit interface declaration.
5841 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5844 * class.cs (PropertyMethod): Set Parent field in ctors.
5845 (SetMethod.InternalParameters): Add unsafe switch hack.
5847 * decl.cs (MemberCore.Parent): Cannot be readonly.
5849 2005-01-06 Raja R Harinath <rharinath@novell.com>
5851 * decl.cs (DeclSpace.ResolveType): Remove.
5852 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5853 Merge in code from ...
5854 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5855 * class.cs, enum.cs: Update to changes.
5857 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5859 * anonymous.cs: Ensure that we init the scope of our parent if it
5860 has not been initialized yet.
5862 2004-12-30 Duncan Mak <duncan@ximian.com>
5864 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5865 if field.FieldBuilder is null. Fixes #70758.
5867 * convert.cs: Fixed some typos and updated some of the comments.
5868 (ImplicitStandardConversionExists):
5869 (TryImplicitIntConversion): If `target_type' is an interface and
5870 the type of `ic' implements this interface, return true or a new
5871 BoxedCast instead of null. This fixes #70468.
5873 2004-12-29 Duncan Mak <duncan@ximian.com>
5875 * expression.cs (Argument.Emit): Check that Expr is
5876 IMemoryLocation before casting to it, and report CS1510 otherwise.
5880 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5882 * statement.cs (Block.ThisVariable): remove the recursion here, to
5883 make the --profile more sane.
5885 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5887 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5888 assembly, by JB Evain.
5890 2004-12-17 Raja R Harinath <rharinath@novell.com>
5892 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5893 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5894 "parent" refers to enclosing type/class. "base" refers to superclass.
5896 2004-12-17 Raja R Harinath <rharinath@novell.com>
5898 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5899 Ensure that we only have GlobalAttributes.
5900 * attribute.cs (Attribute.Emit): Make non-virtual.
5901 (GlobalAttribute.Emit): Remove.
5902 (Attribute.Resolve): Make virtual.
5903 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5904 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5905 the argument. Don't create one.
5906 (Attribute.GetObsoleteAttribute): Likewise.
5907 (Attribute.GetClsCompliantAttributeValue): Likewise.
5908 * class.cs, decl.cs: Update to changes.
5910 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5912 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5914 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5916 * statement.cs (Foreach.Resolve): Add error 186 report.
5918 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5920 * expression.cs (Conditional.DoResolve): Add warning 429.
5922 * statement.cs (If.Resolve): Add warning 665.
5924 2004-12-16 Raja R Harinath <rharinath@novell.com>
5926 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5927 except when in the parser, and in GlobalAttribute.
5928 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5929 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5930 RootContext.Tree.Types.NamespaceEntry once work is done.
5931 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5932 and resets RootContext.Tree.Types.NamespaceEntry.
5934 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5936 * cs-parser.jay: Don't create a block for every variable.
5938 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5940 * location.cs: Provide extra information.
5942 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5943 variables from the captured environment, it is the ldarg_0.
5945 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5947 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5950 * class.cs: Changed warning level for 169 to avoid developer
5951 displeasure from warning flooding. It will be changed back when they
5952 fix most of current BCL warnings.
5954 * RootContext.cs: Pushed default WarningLevel to 3.
5956 * statement.cs: Removed unused variable.
5958 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5960 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5961 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5962 Add error 502 report.
5963 (StaticClass.DefineType): Add error 441 report.
5964 (Class.AllowedModifiersProp): New virtual property as temporary
5965 extension to AllowedModifiers.
5966 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5967 to share implementation with StaticClass and don't call virtual
5970 * driver.cs (MainDriver): Add error 1558 test.
5972 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5973 report. Moved error 36 test here.
5975 * statement.cs (Throw.Resolve): Add error 724 report.
5977 * typemanager.cs: Add out_attribute_type core type.
5979 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5981 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5983 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5985 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5988 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5990 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5991 Add error 3023 report.
5992 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5994 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5997 2004-12-12 John Luke <john.luke@gmail.com>
5999 * driver.cs (AddArgs): take -- into account when
6000 adding arguments, fixes bug 65710
6002 2004-12-12 Martin Baulig <martin@ximian.com>
6004 * expression.cs (Unary.TryReduceNegative): Added support for
6005 SByteConstant and ByteConstant.
6006 (Unary.Reduce): Check error values from TryReduceNegative().
6008 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6010 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6011 and report exception as error 182.
6013 2004-12-10 Raja R Harinath <rharinath@novell.com>
6015 * driver.cs (Main): Fix message when there are warnings.
6017 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6019 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6021 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6023 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6024 Reduced number of warnings.
6026 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6028 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6030 * driver.cs: Removed message.
6032 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6034 2004-12-08 <vargaz@freemail.hu>
6036 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6038 2004-12-08 Martin Baulig <martin@ximian.com>
6040 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6041 instead of a CS3002 for properties and indexer.
6043 2004-12-08 Martin Baulig <martin@ximian.com>
6045 * decl.cs (MemberName.ToString): Make this work again.
6047 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6049 * attribute.cs (Resolve): Add error 591 detection.
6051 * class.cs (FieldMember.Define): Add error 1547 detection.
6052 (Indexer.Define): Add error 620 detection.
6053 (Operator.Define): Add error 590 detection.
6055 * ecore.cs: Missing argument for error 79.
6057 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6060 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6063 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6066 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6068 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6069 Some operator comments were suppressed.
6070 * doc.cs : Implicit/explicit operator name in doc comments are like
6071 "op_Explicit(type)~returnType", so added suffix handling.
6073 2004-12-07 Martin Baulig <martin@ximian.com>
6076 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6077 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6078 (DeclSpace.ec): New protected field; store the EmitContext here.
6079 (DeclSpace.EmitContext): New public property; moved here from
6081 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6084 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6085 (Enum.Emit): Don't create a new EmitContext.
6087 * delegate.cs (Delegate.DefineType): Always create the
6090 * iterators.cs (Iterators.DefineIterator): Create a new
6091 EmitContext and store it in `ec'.
6093 2004-08-24 Martin Baulig <martin@ximian.com>
6096 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6097 this for accessibility checks.
6098 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6099 IsNestedFamilyAccessible.
6100 (TypeManager.IsSubclassOf): New method, do what the name actually
6103 2004-12-06 Raja R Harinath <rharinath@novell.com>
6105 Fix crash on cs0657-17.cs.
6106 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6107 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6108 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6109 the case where the NamespaceEntry gets overwritten.
6111 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6113 Fixed #69195, #56821
6114 * ecore.cs (ResolveBoolean): Tiny refactoring.
6116 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6117 of right expression resolving when left is false constant and
6118 operator is LogicalAnd OR true constant and operator is LogicalOr.
6120 * statement.cs (ResolveUnreachable): Always reports warning.
6122 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6124 * class.cs: Distinguish between 1721 and 1722 (just a little help
6125 for the programmer).
6127 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6129 * delegate.cs: Only allow this on new versions of the language.
6131 2004-12-02 Duncan Mak <duncan@ximian.com>
6133 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6135 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6136 here as a static method. Take an additional bool out parameter
6137 `must_do_cs1540_check' for signaling to InstanceResolve.
6138 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6139 member field from PropertyExpr class and made it an argument of
6141 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6142 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6143 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6144 and `remove_accessor' as well as InstanceResolve: report CS0122
6149 2004-12-03 Raja R Harinath <rharinath@novell.com>
6151 Fix test-327.cs, test-328.cs, and put in early infrastructure
6152 for eventually fixing #52697.
6153 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6154 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6156 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6157 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6158 (VerifyUsing, error246): Update.
6159 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6160 'NamespaceEntry.LookupNamespaceOrType'.
6162 2004-12-03 Martin Baulig <martin@ximian.com>
6164 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6165 method as our child, call AnonymousMethod.Compatible() on it.
6167 2004-12-03 Raja R Harinath <rharinath@novell.com>
6169 Disable XML documentation support in 'basic' profile.
6170 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6171 Redirect XmlElement to System.Object.
6172 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6173 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6174 * mcs.exe.sources: Add doc-bootstrap.cs.
6175 * doc-bootstrap.cs: New file. Contains empty stub implementation
6178 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6180 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6181 comments are allowed.
6183 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6185 * delegate.cs: Add checks for subtypes in paramaters and return values
6186 in VerifyMethod () to add support for Covariance/Contravariance
6189 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6191 * report.cs: Remove extra closing parenthesis.
6193 * convert.cs (Error_CannotImplicitConversion): If the name of the
6194 types are the same, provide some extra information.
6196 * class.cs (FieldBase): Use an unused bit field from the field to
6197 encode the `has_offset' property from the FieldMember. This saves
6198 a couple of Ks on bootstrap compilation.
6200 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6201 method as our child, return the AnonymousMethod resolved
6204 * expression.cs (New.DoResolve): Allow return values from
6205 NewDelegate to also include AnonymousMethods.
6209 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6212 * attribute.cs (Resolve): Improved implementation of params
6213 attribute arguments.
6215 * support.cs (ParameterData): Add HasParams to be faster.
6217 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6219 all things are for /doc support:
6221 * doc.cs: new file that supports XML documentation generation.
6222 * mcs.exe.sources: added doc.cs.
6224 Handle /doc command line option.
6225 Report error 2006 instead of 5 for missing file name for /doc.
6226 Generate XML documentation when required, after type resolution.
6228 Added support for picking up documentation (/// and /** ... */),
6229 including a new XmlCommentState enumeration.
6231 Added lines to fill Documentation element for field, constant,
6232 property, indexer, method, constructor, destructor, operator, event
6233 and class, struct, interface, delegate, enum.
6234 Added lines to warn incorrect comment.
6236 Added Documentation field (passed only when /doc was specified).
6238 Added DocComment, DocCommentHeader, GenerateDocComment() and
6239 OnGenerateDocComment() and some supporting private members for
6240 /doc feature to MemberCore.
6242 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6244 Added overriden DocCommentHeader.
6246 Added overriden DocCommentHeader and GenerateDocComment().
6248 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6250 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6251 unwrapping the enumeration values, chain to
6252 DoConstantNumericPromotions again, so we can promote things to the
6253 fundamental types (takes care of enums that are bytes, sbytes).
6257 2004-12-01 Raja R Harinath <rharinath@novell.com>
6259 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6260 Fix long-standing bug in type-lookup. Use FindType instead of
6261 LookupType when ec.ResolvingTypeTree.
6262 (Attribute.ResolveType, Attribute.Resolve)
6263 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6265 (Attributes.Search): Remove internal version. Update.
6266 (Attributes.SearchMulti): Update.
6267 (Attributes.GetClsCompliantAttribute): Remove.
6268 (Attributes.GetIndexerNameAttribute): Remove.
6269 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6270 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6271 * class.cs (Indexer.Define): Likewise.
6273 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6276 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6277 MarshallByReference members access.
6279 * expression.cs: Use CheckMarshallByRefAccess;
6280 Better error CS0197 message.
6282 * report.cs: Print whole related error message.
6284 2004-11-30 Raja R Harinath <rharinath@novell.com>
6286 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6287 the current directory to help debugging.
6289 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6291 * class (GetClassBases): Better error 60 report.
6292 (EventProperty): Disabled warning 67 detection.
6294 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6297 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6299 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6302 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6305 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6307 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6309 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6311 * attribute.cs (Attribute.Resolve): Refine error reporting and
6312 report a cs0117 if the identifier does not exist, to distinguish
6313 from 0617 which is a miss-use of the actual identifier.
6315 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6316 between cs0070 and cs0079.
6318 * class.cs (MemberBase.DoDefine): When reporting a wrong
6319 accessibility level, we use MethodCore to compare instead of
6320 Method (this was a regression in some refactoring effort).
6322 So now we correctly report cs0056 again.
6324 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6325 testing the target_type (which was known to be object_type) and
6326 not the source type (which is anonymous_method).
6328 Fixed reporting of error cs1660.
6330 * expression.cs (UserCast.Source): Expose the underlying cast.
6332 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6333 allowed types to find a match to int32 first (most common).
6335 In addition, it ignores any ImplicitUserConversions that did an
6336 internal implicit conversion (as the switch statement allows only
6337 one integral conversion to exist).
6339 * class.cs (PartialContainer.Create): rename `name' to
6340 `member_name' for clarity. Then replace the string calls with a
6341 call to MemberName.GetPartialName, as now using
6342 MemberName.ToString is an error (this is due to the side effects
6343 it had, that were fixed in the past).
6345 This will restore the error reporting on a number of partial class
6346 errors that were missusing this (and getting an exception as a
6347 results, which is now just a plain textual warning, because
6348 yyparse debug output would crash otherwise).
6350 2004-11-26 Raja R Harinath <rharinath@novell.com>
6352 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6354 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6356 * rootcontext.cs (LookupType): Make sure to cache lookups that
6357 don't give us a negative result. This saves about 5% of corlib
6360 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6362 * report.cs (AbstractMessage.Print): messages are sent to stderr
6364 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6365 non-interface in the list of interfaces (at this point, either
6366 parent was properly set, or a base class is being listed in the
6367 interfaces section).
6369 This flags error 1722, and resolves the crash from bug 69259.
6371 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6373 * statement.cs (Using.EmitExpressionFinally): make this work right
6374 for valuetypes. Fixes 69926.
6376 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6378 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6379 converted to an enum" here, before we try to change the underlying
6380 type. This code exists, but it is a different code path than the
6381 one used while encoding constants.
6383 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6384 old bug: when converting from the null literal to a pointer,
6385 return an EmptyCast, not the NullLiteral.
6387 This fixes #69921, the recent null_type changes probably made this
6390 (ImplicitReferenceConversionExists): In addition, resynchronized
6391 the code here, so it matches the same code in
6392 ImplicitReferenceConversionExists for the `from any class-type S
6393 to any interface-type T'.
6396 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6398 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6400 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6402 * cs-parser.jay: Use verbosity accordingly.
6404 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6406 * expression.cs (Unary.ResolveOperator): Do not report warning;
6407 AddressOf reads from variable.
6409 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6411 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6415 * attribute.cs (Attributable): Removed CheckTargets.
6416 (Attributes.Emit): Explicit attribute targets are tested here.
6418 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6419 not enabled for interfaces.
6421 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6422 (GetAssemblyName): Ouch next bug there.
6424 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6426 * expression.cs: Error 275 added.
6428 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6430 Fix bug #69177 (Implemented decimal constant support)
6432 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6433 (BinaryFold): Add DecimalConstant.
6435 * const.cs (Define): Decimal constant
6437 (ChangeType): Add decimal type handling.
6438 (LookupConstantValue): Don't set value for decimal type but
6439 emit DecimalConstantAttribute. Needed for constant optimization.
6441 * constant.cs (ToDecimal): New method.
6442 (ConvertToDecimal): New method.
6443 (IntConstant): Implemented ConvertToDecimal.
6444 (DecimalConstant.Emit): Emit optimized version for decimals in
6447 * expression.cs (ResolveOperator): Changed order of constant
6448 reduction to work correctly with native types which have
6449 overloaded operators.
6450 (ResolveMemberAccess): Extract constant value from attribute
6453 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6455 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6456 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6457 (ChangeType): Decimal is special.
6458 (TypeToCoreType): Add decimal type.
6460 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6462 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6465 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6467 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6470 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6472 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6474 * pending.cs (PendingImplementation): Grab only interfaces.
6476 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6478 * statement.cs (ForeachHelperMethods): Add location member and
6479 error 202 detection.
6481 2004-11-19 Raja R Harinath <rharinath@novell.com>
6483 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
6484 automatically handled by executable.make.
6485 (PROGRAM): Make profile-specific.
6487 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6489 * expression.cs (DoResolveBase): Fixed wrong warning for out
6492 2004-11-18 Martin Baulig <martin@ximian.com>
6494 Merged latest changes into gmcs. Please keep this comment in
6495 here, it makes it easier for me to see what changed in MCS since
6496 the last time I merged.
6498 2004-11-17 Raja R Harinath <rharinath@novell.com>
6500 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6501 (TypeHandle.GetMemberCache): New.
6502 (TypeHandle.TypeHandle): Update.
6503 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6504 (TypeManager.LookupParentInterfacesCache):
6505 Rename from LookupInterfaceCache. Optimize slightly.
6506 (TypeManager.MemberLookup_FindMembers): Update.
6507 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6509 (AddCacheContents): Rename from AddHashtable.
6510 * class.cs (TypeContainer.parent_container): Remove.
6511 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6512 (TypeContainer.DoDefineMembers): Don't initialize it.
6513 Update to name changes.
6515 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6517 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6518 that factors the code to check access modifiers on override.
6520 (PropertyBase): Use the code here.
6522 Patch from Lluis S'anchez, fixes bug #69361.
6524 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6526 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6527 routine that is used to report the use of a captured variable
6528 whose address has been taken.
6530 There are two checks: one when variables are being captured and
6531 the other check is when the address of a variable is taken.
6533 (because an anonymous methods might be resolved before *or* after
6534 the address has been taken) and
6536 * expression.cs (Conditional.DoResolve): Remove the special
6537 casing that Martin added to trueExpr and falseExpr being both
6538 NullLiteral. We get the right behavior now just by introducing
6539 the null_type into the compiler.
6541 * convert.cs (ExplicitConversion): Change the code to use
6542 null_type instead of testing `expr is NullLiteral'.
6543 (ImplicitConversionStandard): use null_type too.
6544 (ImplicitReferenceConversionExists): use null_type too.
6545 (ImplicitReferenceConversion): use null_type too.
6547 * literal.cs: The type of `NullLiteral' is now null_type instead
6549 (Resolve): Set the type here.
6551 * typemanager.cs: Introduce null_type.
6553 2004-11-17 Martin Baulig <martin@ximian.com>
6555 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6556 direction, like FindMembers() does. Fixes #69546, testcase is in
6559 2004-11-16 Martin Baulig <martin@ximian.com>
6561 This is based on a patch from Marek Safar, see bug #69082.
6562 Fixes bugs #63705 and #67130.
6564 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6565 method; create a MemberCache for an interface type and cache the
6568 * decl.cs (IMemberContainer.ParentContainer): Removed.
6569 (IMemberContainer.ParentCache): New property.
6570 (MemberCache.SetupCacheForInterface): Removed.
6571 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6572 to create a cache for an interface's "parent".
6574 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6577 2004-11-16 Martin Baulig <martin@ximian.com>
6579 Merged back from gmcs; these changes already went into gmcs a
6580 couple of weeks ago.
6583 (TypeManager.AddUserType): Removed the `ifaces' argument.
6584 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6586 (TypeManager.AddUserInterface): Removed.
6587 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6589 (TypeManager.GetInterfaces): Likewise.
6590 (TypeManager.GetExplicitInterfaces): Likewise.
6592 * ecore.cs (TypeExpr.GetInterfaces): Removed.
6594 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6595 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6597 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6599 * statement.cs: Avoid adding bools to a hashtable.
6601 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6603 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6604 calling an unsafe method from a safe location.
6606 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6609 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6611 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6613 * namespace.cs (VerifyUsing): use GetPartialName instead of
6616 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6618 * statement.cs (Return.Resolve): Fix regression in typo: if
6619 `in_exc', we have to request a NeedReturnLabel, this was a typo
6620 introduced in the anonymous method check-in. Fixes #69131.
6622 * Indexers were using the ShortName when defining themselves,
6623 causing a regression in the compiler bootstrap when applying the
6624 patch from 2004-11-02 (first part), now they use their full name
6625 and the bug is gone.
6627 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6629 * driver.cs: Strip the path from the names of embedded resources. Fixes
6632 2004-11-04 Raja R Harinath <rharinath@novell.com>
6634 Fix error message regression: cs0104-2.cs.
6635 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6636 (AliasEntry.Resolve): Update.
6637 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6639 (RootContext.LookupType): Update.
6641 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6643 * cs-parser.jay: Add support for handling accessor modifiers
6644 * class: Add support port accessor modifiers and error checking,
6645 define PropertyMethod.Define as virtual (not abstract anymore)
6646 * ecore.cs: Add checking for proeprties access with access modifiers
6647 * iterators.cs: Modify Accessor constructor call based in the modified
6649 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6651 * expression.cs (StringConcat): Handle being called twice,
6652 as when we have a concat in a field init with more than two
6655 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6657 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6658 special case explicit implementations, we should always produce
6659 the .property or .event declaration.
6661 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6662 since it will not return correct data if people use this
6663 unresolved in the presence of using statements (see test-313).
6665 * class.cs (MethodData.Define): If we are an explicit interface
6666 implementation, set the method name to the full name of the
6667 interface plus the name of the method.
6669 Notice that using the method.MethodName.GetFullName() does not
6670 work, as it will only contain the name as declared on the source
6671 file (it can be a shorthand in the presence of using statements)
6672 and not the fully qualifed type name, for example:
6676 class D : ICloneable {
6677 object ICloneable.Clone () {
6681 Would produce a method called `ICloneable.Clone' instead of
6682 `System.ICloneable.Clone'.
6684 * namespace.cs (Alias.Resolve): Use GetPartialName.
6686 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6688 * cs-parser.jay: Add error 1055 report.
6690 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6692 * assign.cs (Assign.DoResolve): Only do the transform of
6693 assignment into a New if the types are compatible, if not, fall
6694 through and let the implicit code deal with the errors and with
6695 the necessary conversions.
6697 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6699 * cs-parser.jay: Add error 1031 report.
6701 * cs-tokenizer.cs: Add location for error 1038.
6703 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6705 * cs-parser.jay: Add error 1016 report.
6707 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6709 * cs-parser.jay: Add errors 1575,1611 report.
6711 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6713 * cs-parser.jay: Add error 1001 report.
6715 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6718 * attribute.cs (GetMarshal): Add method argument for
6719 caller identification.
6721 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6722 agument for GetMarshal and RuntimeMissingSupport.
6724 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6726 * attribute.cs (ExtractSecurityPermissionSet): Removed
6727 TypeManager.code_access_permission_type.
6729 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6731 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6733 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6734 for obsolete use of a variable here. Fixes regression on errors
6735 cs0619-25 and cs0619-26.
6737 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6739 Fix #62358, implemented security attribute encoding.
6741 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6742 Tests permitted SecurityAction for assembly or other types.
6743 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6744 data from SecurityPermissionAttribute to PermisionSet class.
6746 * class.cs (ApplyAttributeBuilder): Added special handling
6747 for System.Security.Permissions.SecurityAttribute based types.
6749 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6750 special handling for System.Security.Permissions.SecurityAttribute
6753 * enum.cs (ApplyAttributeBuilder): Added special handling
6754 for System.Security.Permissions.SecurityAttribute based types.
6756 * parameter.cs (ApplyAttributeBuilder): Added special handling
6757 for System.Security.Permissions.SecurityAttribute based types.
6759 * rootcontext.cs: Next 2 core types.
6761 * typemanager.cs (TypeManager.security_permission_attr_type):
6762 Built in type for the SecurityPermission Attribute.
6763 (code_access_permission_type): Build in type.
6765 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6767 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6768 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6769 all of this information into
6770 EmitContext.EmitCapturedVariableInstance.
6772 * codegen.cs (EmitCapturedVariableInstance): move here the
6773 funcionality of emitting an ldarg.0 in the presence of a
6774 remapping. This centralizes the instance emit code.
6776 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6777 then emit a load of this: it means that we have reached the
6778 topmost ScopeInfo: the one that contains the pointer to the
6779 instance of the class hosting the anonymous method.
6781 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6782 captures to the topmost CaptureContext.
6784 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6786 * expression.cs (LocalVariableReference): Move the knowledge about
6787 the iterators into codegen's EmitCapturedVariableInstance.
6789 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6791 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6792 all code paths return a value from an anonymous method (it is the
6793 same as the 161 error, but for anonymous methods).
6795 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6797 The introduction of anonymous methods in the compiler changed
6798 various ways of doing things in the compiler. The most
6799 significant one is the hard split between the resolution phase
6800 and the emission phases of the compiler.
6802 For instance, routines that referenced local variables no
6803 longer can safely create temporary variables during the
6804 resolution phase: they must do so from the emission phase,
6805 since the variable might have been "captured", hence access to
6806 it can not be done with the local-variable operations from the runtime.
6810 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6811 is a toplevel block.
6813 (ToplevelBlock): A new kind of Block, these are the blocks that
6814 are created by the parser for all toplevel method bodies. These
6815 include methods, accessors and anonymous methods.
6817 These contain some extra information not found in regular blocks:
6818 A pointer to an optional CaptureContext (for tracking captured
6819 local variables and parameters). A pointer to the parent
6822 (Return.Resolve): Catch missmatches when returning a value from an
6823 anonymous method (error 1662).
6824 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6827 (Break.Resolve): ditto.
6829 (SwitchLabel): instead of defining the labels during the
6830 resolution phase, we now turned the public ILLabel and ILLabelCode
6831 labels into methods called GetILLabelCode() and GetILLabel() that
6832 only define the label during the Emit phase.
6834 (GotoCase): Track the SwitchLabel instead of the computed label
6835 (its contained therein). Emit the code by using
6836 SwitchLabel.GetILLabelCode ().
6838 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6839 whether the Local has been captured or not.
6841 (LocalInfo.IsCaptured): New property, used to tell whether the
6842 local has been captured.
6844 * anonymous.cs: Vastly updated to contain the anonymous method
6847 The main classes here are: CaptureContext which tracks any
6848 captured information for a toplevel block and ScopeInfo used to
6849 track the activation frames for various local variables.
6851 Each toplevel block has an optional capture context associated
6852 with it. When a method contains an anonymous method both the
6853 toplevel method and the anonymous method will create a capture
6854 context. When variables or parameters are captured, they are
6855 recorded on the CaptureContext that owns them, for example:
6859 MyDelegate d = delegate {
6864 Here `a' will be recorded as captured on the toplevel
6865 CapturedContext, the inner captured context will not have anything
6866 (it will only have data if local variables or parameters from it
6867 are captured in a nested anonymous method.
6869 The ScopeInfo is used to track the activation frames for local
6870 variables, for example:
6872 for (int i = 0; i < 10; i++)
6873 for (int j = 0; j < 10; j++){
6874 MyDelegate d = delegate {
6879 At runtime this captures a single captured variable `i', but it
6880 captures 10 different versions of the variable `j'. The variable
6881 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6882 recorded on a child.
6884 The toplevel ScopeInfo will also track information like the `this'
6885 pointer if instance variables were referenced (this is necessary
6886 as the anonymous method lives inside a nested class in the host
6887 type of the method).
6889 (AnonymousMethod): Expanded to track the Toplevel, implement
6890 `AnonymousMethod.Compatible' to tell whether an anonymous method
6891 can be converted to a target delegate type.
6893 The routine now also produces the anonymous method content
6895 (AnonymousDelegate): A helper class that derives from
6896 DelegateCreation, this is used to generate the code necessary to
6897 produce the delegate for the anonymous method that was created.
6899 * assign.cs: API adjustments for new changes in
6900 Convert.ImplicitStandardConversionExists.
6902 * class.cs: Adjustments to cope with the fact that now toplevel
6903 blocks are of type `ToplevelBlock'.
6905 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6906 insteda of standard blocks.
6908 Flag errors if params arguments are passed to anonymous methods.
6910 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6911 `CurrentAnonymousMethod' which points to the current Anonymous
6912 Method. The variable points to the AnonymousMethod class that
6913 holds the code being compiled. It is set in the new EmitContext
6914 created for the anonymous method.
6916 (EmitContext.Phase): Introduce a variable and an enumeration to
6917 assist in enforcing some rules about when and where we are allowed
6918 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6919 only one that enfonces this right now).
6921 (EmitContext.HaveCaptureInfo): new helper method that returns
6922 whether we have a CapturedContext initialized.
6924 (EmitContext.CaptureVariable): New method used to register that a
6925 LocalInfo must be flagged for capturing.
6927 (EmitContext.CapturedParameter): New method used to register that a
6928 parameters must be flagged for capturing.
6930 (EmitContext.CapturedField): New method used to register that a
6931 field must be flagged for capturing.
6933 (EmitContext.HaveCapturedVariables,
6934 EmitContext.HaveCapturedFields): Return whether there are captured
6935 variables or fields.
6937 (EmitContext.EmitMethodHostInstance): This is used to emit the
6938 instance for the anonymous method. The instance might be null
6939 (static methods), this (for anonymous methods that capture nothing
6940 and happen to live side-by-side with the current method body) or a
6941 more complicated expression if the method has a CaptureContext.
6943 (EmitContext.EmitTopBlock): Routine that drives the emission of
6944 code: it will first resolve the top block, then emit any metadata
6945 and then emit the code. The split is done so that we can extract
6946 any anonymous methods and flag any captured variables/parameters.
6948 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6949 during this phase, the ILGenerator should not be used as labels
6950 and local variables declared here might not be accessible to any
6951 code that is part of an anonymous method.
6953 Exceptions to this include the temporary variables that are
6954 created by some statements internally for holding temporary
6957 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6960 (EmitContext.TemporaryReturn): This method is typically called
6961 from the Emit phase, and its the only place where we allow the
6962 ReturnLabel to be defined other than the EmitMeta. The reason is
6963 that otherwise we would have to duplicate a lot of logic in the
6964 Resolve phases of various methods that today is on the Emit
6967 (EmitContext.NeedReturnLabel): This no longer creates the label,
6968 as the ILGenerator is not valid during the resolve phase.
6970 (EmitContext.EmitThis): Extended the knowledge in this class to
6971 work in anonymous methods in addition to iterators.
6973 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6974 code is necessary on the stack to access the instance to a local
6975 variable (the variable will be accessed as a field).
6977 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6978 EmitContext.EmitAddressOfParameter): Routines to support
6979 parameters (not completed at this point).
6981 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6982 will also remove the parameters.
6984 * convert.cs (Convert): Define a `ConstantEC' which points to a
6985 null. This is just to prefity some code that uses
6986 ImplicitStandardConversion code and do not have an EmitContext
6989 The idea is to flag explicitly that at that point in time, it is
6990 known that the conversion will not trigger the delegate checking
6991 code in implicit conversions (which requires a valid
6994 Everywhere: pass new EmitContext parameter since
6995 ImplicitStandardConversionExists now requires it to check for
6996 anonymous method conversions.
6998 (Convert.ImplicitStandardConversionExists): If the type of an
6999 expression is the anonymous_method_type, and the type is a
7000 delegate, we invoke the AnonymousMethod.Compatible method to check
7001 whether an implicit conversion is possible.
7003 (Convert.ImplicitConversionStandard): Only do implicit method
7004 group conversions if the language level is not ISO_1.
7006 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7007 MethodInfo for the Invoke method. used by Delegate and
7010 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7011 method conversions if the target type is a delegate.
7013 Removed extra debugging nops.
7015 (LocalVariableReference): Turn the `local_info' into a public
7018 Add `prepared' field, the same hack used for FieldExprs to cope
7019 with composed assignments, as Local variables do not necessarily
7020 operate purely on the stack as they used to: they can be captured
7023 Add `temp' for a temporary result, like fields.
7025 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7027 It now copes with Local variables that are captured and emits the
7028 proper instance variable to load it from a field in the captured
7031 (ParameterReference.DoResolveBase): During the resolve phase,
7032 capture parameters if we are in an anonymous method.
7034 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7035 anonymous method, use the EmitContext helper routines to emit the
7036 parameter reference.
7038 * iterators.cs: Set RemapToProxy to true/false during the
7041 * parameters.cs (GetParameterByName): New helper method.
7043 * typemanager.cs (anonymous_method_type) a new type that
7044 represents an anonyous method. This is always an internal type,
7045 used as a fencepost to test against the anonymous-methodness of an
7048 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7050 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7052 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7054 2004-10-18 Martin Baulig <martin@ximian.com>
7056 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7057 `Type' directly, but call ResolveType() on it.
7058 (Catch.Resolve): Likewise.
7059 (Foreach.Resolve): Likewise.
7061 2004-10-18 Martin Baulig <martin@ximian.com>
7063 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7064 `Type' directly, but call ResolveType() on it.
7065 (Probe.DoResolve): Likewise.
7066 (ArrayCreation.LookupType): Likewise.
7067 (TypeOf.DoResolve): Likewise.
7068 (SizeOf.DoResolve): Likewise.
7070 2004-10-18 Martin Baulig <martin@ximian.com>
7072 * expression.cs (Invocation.BetterFunction): Put back
7073 TypeManager.TypeToCoreType().
7075 2004-10-18 Raja R Harinath <rharinath@novell.com>
7077 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7080 2004-10-18 Martin Baulig <martin@ximian.com>
7082 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
7083 `Type' directly, but call ResolveType() on it.
7085 2004-10-18 Martin Baulig <martin@ximian.com>
7087 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7088 `Type' directly, but call ResolveType() on it.
7089 (MemberBase.DoDefine): Likewise.
7091 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7092 `Type' directly, but call ResolveType() on it.
7093 (ComposedCast.DoResolveAsTypeStep): Likewise.
7095 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7096 `Type' directly, but call ResolveType() on it.
7098 2004-10-17 John Luke <john.luke@gmail.com>
7100 * class.cs (Operator.GetSignatureForError): use CSharpName
7102 * parameter.cs (Parameter.GetSignatureForError): Returns
7103 correct name even if was not defined.
7105 2004-10-13 Raja R Harinath <rharinath@novell.com>
7108 * class.cs (TypeContainer.EmitContext): New property.
7109 (DefineNestedTypes): Create an emitcontext for each part.
7110 (MethodCore.DoDefineParameters): Use container's emitcontext.
7111 Pass type array to InternalParameters.
7112 (MemberBase.DoDefine): Use container's emitcontext.
7113 (FieldMember.Define): Likewise.
7114 (Event.Define): Likewise.
7115 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7116 Pass type array to InternalParameters.
7117 (SetIndexerMethod.GetParameterInfo): Likewise.
7118 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7119 * delegate.cs (Define): Pass emitcontext to
7120 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7121 array to InternalParameters.
7122 * expression.cs (ParameterReference.DoResolveBase): Pass
7123 emitcontext to GetParameterInfo.
7124 (ComposedCast.DoResolveAsTypeStep): Remove check on
7125 ec.ResolvingTypeTree.
7126 * parameter.cs (Parameter.Resolve): Change argument to
7127 EmitContext. Use ResolveAsTypeTerminal.
7128 (Parameter.GetSignature): Change argument to EmitContext.
7129 (Parameters.ComputeSignature): Likewise.
7130 (Parameters.ComputeParameterTypes): Likewise.
7131 (Parameters.GetParameterInfo): Likewise.
7132 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7133 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7134 * support.cs (InternalParameters..ctor): Remove variant that takes
7136 * typemanager.cs (system_intptr_expr): New.
7137 (InitExpressionTypes): Initialize it.
7139 2004-10-12 Chris Toshok <toshok@ximian.com>
7141 * cs-parser.jay: fix location for try_statement and catch_clause.
7143 2004-10-11 Martin Baulig <martin@ximian.com>
7145 * report.cs: Don't make --fatal abort on warnings, we have
7146 -warnaserror for that.
7148 2004-10-07 Raja R Harinath <rharinath@novell.com>
7150 More DeclSpace.ResolveType avoidance.
7151 * decl.cs (MemberCore.InUnsafe): New property.
7152 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7153 with newly created EmitContext.
7154 (FieldMember.Define): Likewise.
7155 * delegate.cs (Delegate.Define): Likewise.
7156 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7157 only if normal name-lookup fails.
7158 (TypeExpr.DoResolve): Enable error-checking.
7159 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7160 (SizeOf.DoResolve): Likewise.
7161 (ComposedCast.DoResolveAsTypeStep): Likewise.
7162 (StackAlloc.DoResolve): Likewise.
7163 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7164 (Block.Unsafe): New property.
7165 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7166 (Unsafe): Set 'unsafe' flag of contained block.
7167 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7168 (Fixed.Resolve): Likewise.
7169 (Catch.Resolve): Likewise.
7170 (Using.ResolveLocalVariableDecls): Likewise.
7171 (Foreach.Resolve): Likewise.
7173 2004-10-05 John Luke <john.luke@gmail.com>
7175 * cs-parser.jay: add location to error CS0175
7177 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7179 * ecore.cs (Expression.Constantity): Add support for turning null
7182 * const.cs (Const.Define): Allow constants to be reference types
7183 as long as the value is Null.
7185 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7187 * namespace.cs (NamespaceEntry.Using): No matter which warning
7188 level is set, check if this namespace name has already been added.
7190 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7192 * expression.cs: reftype [!=]= null should always use br[true,false].
7195 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7198 * attribute.cs: Enum conversion moved to
7199 GetAttributeArgumentExpression to be applied to the all
7202 2004-10-01 Raja R Harinath <rharinath@novell.com>
7204 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7205 * class.c (TypeContainer.DefineType): Flag error if
7206 base types aren't accessible due to access permissions.
7207 * decl.cs (DeclSpace.ResolveType): Move logic to
7208 Expression.ResolveAsTypeTerminal.
7209 (DeclSpace.ResolveTypeExpr): Thin layer over
7210 Expression.ResolveAsTypeTerminal.
7211 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7212 Refactor code into NestedAccess. Use it.
7213 (DeclSpace.NestedAccess): New.
7214 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7215 argument to silence errors. Check access permissions.
7216 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7217 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7218 (Cast.DoResolve): Likewise.
7219 (New.DoResolve): Likewise.
7220 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7221 (TypeOf.DoResolve): Likewise.
7223 * expression.cs (Invocation.BetterConversion): Return the Type of
7224 the better conversion. Implement section 14.4.2.3 more faithfully.
7225 (Invocation.BetterFunction): Make boolean. Make correspondence to
7226 section 14.4.2.2 explicit.
7227 (Invocation.OverloadResolve): Update.
7228 (Invocation): Remove is_base field.
7229 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7230 (Invocation.Emit): Likewise.
7232 2004-09-27 Raja R Harinath <rharinath@novell.com>
7234 * README: Update to changes.
7236 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7238 * cs-parser.jay: Reverted 642 warning fix.
7240 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7243 * decl.cs (FindMemberWithSameName): Indexer can have more than
7246 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7248 * expression.cs (LocalVariableReference.DoResolveLValue):
7249 Do not report warning 219 for out values.
7250 (EmptyExpression.Null): New member to avoid extra allocations.
7252 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7254 * cs-parser.jay: Fix wrong warning 642 report.
7256 * cs-tokenizer.cs (CheckNextToken): New helper;
7257 Inspect next character if is same as expected.
7259 2004-09-23 Martin Baulig <martin@ximian.com>
7261 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7262 (Convert.ImplicitReferenceConversionExists): Likewise.
7264 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7266 * class.cs (Operator.Define): Add error 448 and 559 report.
7268 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7270 * class.cs (MemberBase.IsTypePermitted): New protected
7271 method for checking error CS0610.
7273 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7275 * class.cs (TypeContainer.HasExplicitLayout): New property
7276 Returns whether container has StructLayout attribute set Explicit.
7277 (FieldMember): New abstract class for consts and fields.
7278 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7279 (Field): Reuse FieldMember.
7281 * const.cs (Const): Reuse FieldMember.
7283 * rootcontext.cs: EmitConstants call moved to class.
7285 2004-09-22 Martin Baulig <martin@ximian.com>
7287 Thanks to Peter Sestoft for this bug report.
7289 * expression.cs (Conditional): If both the `trueExpr' and the
7290 `falseExpr' is a NullLiteral, return a NullLiteral.
7292 2004-09-22 Martin Baulig <martin@ximian.com>
7294 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7295 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7296 for the "get_Current" call.
7298 2004-09-22 Martin Baulig <martin@ximian.com>
7300 Marek and me just fixed one of our oldest bugs: #28562 :-)
7302 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7304 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7305 we're an EnumConstant, just return that.
7306 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7307 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7308 to get the value which'll actually be written into the attribute.
7309 However, we have to use GetValue() to access the attribute's value
7312 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7314 * constant.cs (Constant.IsNegative): New abstract property
7317 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7318 (StackAlloc.DoResolve): Reused IsNegative.
7320 2004-09-21 Martin Baulig <martin@ximian.com>
7322 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7323 if we're used in an iterator, we may be called from different
7326 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7327 we actually have an exception block.
7329 2004-09-20 John Luke <jluke@cfl.rr.com>
7331 * class.cs, cs-parser.jay: Improve the error report for 1520:
7332 report the actual line where the error happens, not where the
7335 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7336 Pass location information that was available elsewhere.
7338 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
7340 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7341 runtime to delay sign assemblies.
7343 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7345 * cs-parser.jay: Do not report the stack trace, this is barely
7348 2004-08-22 John Luke <john.luke@gmail.com>
7350 * driver.cs : check that a resource id is not already used
7351 before adding it, report CS1508 if it is, bug #63637
7353 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7355 * ecore.cs: Removed dead code.
7357 2004-09-18 Marek Safar <marek.safar@seznam.cz>
7359 * class.cs: Do not report warning CS0067 on the interfaces.
7361 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7363 * cs-parser.jay: Add error 504 report.
7365 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7367 * rootcontext.cs: WarningLevel is 4 by default now.
7369 * statement.cs (Fixed.Resolve): Do not null
7372 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7375 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7376 deep search when property is not virtual.
7377 (PropertyExpr.ResolveAccessors): Make one call for both
7380 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7383 * statement.cs: Error 152 report constains also location.
7385 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7388 * const.cs: Explicitly set constant as static.
7390 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7393 * cs-parser.jay: Add error 1017 report.
7395 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7397 Fixed bug #59980, #64224
7398 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7400 * typemanager.cs (IsSpecialMethod): Simplified
7402 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7404 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7405 condition with better params.
7407 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7410 * attribute.cs (Resolve): Property has to have both
7413 2004-09-14 Martin Baulig <martin@ximian.com>
7415 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7417 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7420 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7421 called and is obsolete then this member suppress message
7422 when call is inside next [Obsolete] method or type.
7424 * expression.cs: Use TestObsoleteMethodUsage member.
7426 2004-09-14 Martin Baulig <martin@ximian.com>
7428 * cs-parser.jay: Sync a bit with the GMCS version.
7430 2004-09-14 Martin Baulig <martin@ximian.com>
7432 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7433 (CSharpParser.yacc_verbose_flag): New public field.
7435 * genericparser.cs: Removed.
7437 2004-09-14 Raja R Harinath <rharinath@novell.com>
7439 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7441 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7443 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7445 2004-09-10 Martin Baulig <martin@ximian.com>
7447 Backported my MemberName changes from GMCS into MCS.
7449 - we are now using a special `MemberName' class instead of using
7450 strings; in GMCS, the `MemberName' also contains the type
7453 - changed the grammar rules a bit:
7454 * the old `member_name' is now a `namespace_or_type_name':
7455 The rule is that we use `namespace_or_type_name' everywhere
7456 where we expect either a "member name" (GetEnumerator) or a
7457 "member name" with an explicit interface name
7458 (IEnumerable.GetEnumerator).
7459 In GMCS, the explicit interface name may include type arguments
7460 (IEnumerable<T>.GetEnumerator).
7461 * we use `member_name' instead of just `IDENTIFIER' for
7463 The rule is that we use `member_name' wherever a member may
7464 have type parameters in GMCS.
7466 * decl.cs (MemberName): New public class.
7467 (MemberCore.MemberName): New public readonly field.
7468 (MemberCore.ctor): Take a `MemberName' argument, not a string.
7469 (DeclSpace): Likewise.
7471 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7472 * enum.cs (Enum.ctor): Likewise.
7474 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7476 (AliasEntry.ctor): Take a MemberName, not an Expression.
7477 (AliasEntry.UsingAlias): Likewise.
7479 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7480 (IMethodData.MemberName): Changed type from string to MemberName.
7481 (MemberBase.ExplicitInterfaceName): Likewise.
7482 (AbstractPropertyEventMethod.SetupName): Make this private.
7483 (AbstractPropertyEventMethod.ctor): Added `string prefix'
7484 argument; compute the member name here.
7485 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7486 on the `member.MemberName' and the `prefix'.
7488 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7490 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7491 thus, we get a `MemberName' instead of a `string'. These
7492 declarations may have type parameters in GMCS.
7493 (interface_method_declaration, delegate_declaration): Likewise.
7494 (class_declaration, interface_declaration): Likewise.
7495 (method_header): Use `namespace_or_type_name' instead of
7496 `member_name'. We may be an explicit interface implementation.
7497 (property_declaration, event_declaration): Likewise.
7498 (member_name): This is now just an `IDENTIFIER', not a
7499 `namespace_or_type_name'.
7500 (type_name, interface_type): Removed.
7501 (namespace_or_type_name): Return a MemberName, not an Expression.
7502 (primary_expression): Use `member_name' instead of `IDENTIFIER';
7503 call GetTypeExpression() on the MemberName to get an expression.
7504 (IndexerDeclaration.interface_type): Changed type from string to
7506 (MakeName): Operate on MemberName's instead of string's.
7508 2004-09-13 Raja R Harinath <rharinath@novell.com>
7511 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7512 (NamespaceEntry.Lookup): Add new argument to flag if we want the
7513 lookup to avoid symbols introduced by 'using'.
7514 * rootcontext.cs (NamespaceLookup): Update.
7516 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7518 * class.cs (TypeContainer.DoDefineMembers): Do not call
7519 DefineDefaultConstructor for static classes.
7521 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7523 * attribute.cs (Attribute.Resolve): Add error 653 report.
7525 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7527 (Method.ApplyAttributeBuilder): Add error 685 report.
7528 (Operator.Define): Add error 564 report.
7530 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7532 * expression.cs (Invocation.DoResolve): Add error
7535 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7538 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7540 * class.cs (ConstructorInitializer.Resolve):
7541 Wrong error number (515->516).
7543 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7545 * class.cs (Indexer.Define): Add error 631 report.
7547 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7549 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7551 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7553 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7555 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7557 * cs-parser.jay: Added error CS0241 report.
7559 2004-09-10 Raja R Harinath <rharinath@novell.com>
7561 * cs-parser.jay (fixed_statement): Introduce a scope for the
7562 declaration in the 'fixed' statement.
7564 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7566 * cs-parser.jay: Added CS0230 error report.
7568 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7570 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7572 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7574 * expression.cs (Argument.Resolve): Added error CS0192 and
7577 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7579 C# 2.0 #pragma warning feature
7581 * cs-tokenizer.cs (PreProcessPragma): New method;
7582 Handles #pragma directive.
7584 * report.cs (WarningRegions): New class; Support
7585 class for #pragma warning directive. It tests whether
7586 warning is enabled for a given line.
7588 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7590 * const.cs: Add more descriptive error report, tahnks to
7593 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7595 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7597 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7599 * expression.cs: Apply patch from Ben: Remove dead code from
7600 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7601 as that code just threw an exception anwyays.
7603 * const.cs: Remove the call to the turnintoconstant, for details
7606 * literal.cs: The type of the null-literal is the null type; So
7607 we use a placeholder type (literal.cs:System.Null, defined here)
7610 * expression.cs (Conditional.DoResolve): Remove some old code that
7611 is no longer needed, conversions have been fixed.
7613 (ArrayCreationExpression.DoResolve): Return false if we fail to
7614 resolve the inner expression.
7616 2004-09-07 Raja R Harinath <rharinath@novell.com>
7619 * cs-parser.jay (delegate_declaration): Record a delegate
7620 declaration as a type declaration.
7621 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7623 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7625 * parameter.cs: Do not crash if the type can not be resolved.
7627 * expression.cs: Report errors with unsafe pointers, fixes #64896
7629 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7631 * expression.cs: Pointer arith always needs to do a conv.i
7632 if the operand is a long. fix 65320
7634 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7636 Fixed cs0619-37.cs, cs0619-38.cs
7638 * enum.cs (GetObsoleteAttribute): Removed.
7640 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7641 on Enum member is double staged. The first is tested member
7644 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7646 Fixed #56986, #63631, #65231
7648 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7649 adds member to name container.
7650 (TypeContainer.AddToTypeContainer): New method, adds type to
7652 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7653 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7654 AddOperator): Simplified by reusing AddToMemberContainer.
7655 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7657 (Method.CheckForDuplications): Fixed implementation to test all
7659 (MemberBase): Detection whether member is explicit interface
7660 implementation is now in constructor.
7661 (MemberBase.UpdateMemberName): Handles IndexerName.
7662 (Accessor): Changed to keep also location information.
7663 (AbstractPropertyEventMethod): Is derived from MemberCore.
7664 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7665 will be emited or not.
7666 (PropertyBase.AreAccessorsDuplicateImplementation):
7667 Tests whether accessors are not in collision with some method.
7668 (Operator): Is derived from MethodCore to simplify common
7671 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7673 (DeclSpace.AddToContainer): Adds the member to defined_names
7674 table. It tests for duplications and enclosing name conflicts.
7676 * enum.cs (EnumMember): Clean up to reuse the base structures
7678 2004-09-03 Martin Baulig <martin@ximian.com>
7680 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7681 into TypeContainer, to make partial classes work again.
7683 2004-09-03 Martin Baulig <martin@ximian.com>
7685 * rootcontext.cs (RootContext.V2): Removed.
7687 2004-03-23 Martin Baulig <martin@ximian.com>
7689 * expression.cs (Invocation.OverloadResolve): Added `bool
7690 may_fail' argument and use it instead of the Location.IsNull() hack.
7692 2004-09-03 Martin Baulig <martin@ximian.com>
7694 Merged latest changes into gmcs. Please keep this comment in
7695 here, it makes it easier for me to see what changed in MCS since
7696 the last time I merged.
7698 2004-09-03 Raja R Harinath <rharinath@novell.com>
7701 * expression.cs (BetterConversion): Don't allow either conversion
7702 to be null. Remove redundant implicit conversion test when 'q ==
7703 null' -- when this function is invoked, we already know that the
7704 implicit conversion exists.
7705 (BetterFunction): Assume that 'best' is non-null. Remove
7706 redundant reimplementation of IsApplicable when 'best' is null.
7707 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7708 number of arguments.
7709 (IsAncestralType): Extract from OverloadResolve.
7710 (OverloadResolve): Make robust to the MethodGroupExpr being
7711 unsorted. Implement all the logic of Section 14.5.5.1, and
7712 support overloading of methods from multiple applicable types.
7713 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7715 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7716 (RealError, Warning): Append type of report to related symbol.
7718 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7720 * enum.cs: Fixed CLS-Compliance checks for enum members.
7721 Error tests cs3008-8.cs, cs3014-8.cs
7723 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7725 Fixed bug #62342, #63102
7726 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7727 like ImplementMethod.
7729 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7731 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7734 2004-09-02 Martin Baulig <martin@ximian.com>
7736 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7737 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7740 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7742 C# 2.0 Static classes implemented
7744 * class.cs (TypeContainer): instance_constructors,
7745 initialized_fields, initialized_static_fields,
7746 default_constructor, base_inteface_types are protected to be
7747 accessible from StaticClass.
7748 (TypeContainer.DefineDefaultConstructor): New virtual method
7749 for custom default constructor generating
7750 (StaticClass): New class to handle "Static classes" feature.
7752 * cs-parser.jay: Handle static keyword on class like instance
7755 * driver.cs: Added "/langversion" command line switch with two
7756 options (iso-1, default).
7758 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7760 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7762 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7764 * delegate.cs: Style.
7766 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7768 * delegate.cs: Add seperate instance expr field for miguel.
7770 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7772 * PointerArithmetic (Resolve): make sure we are not doing
7773 pointer arith on void*. Also, make sure we are resolved
7774 by not setting eclass until resolve.
7776 All callers: Make sure that PointerArithmetic gets resolved.
7778 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7780 * ArrayCreation (LookupType): If the type does not resolve
7781 to an array, give an error.
7783 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7785 * statement.cs (Try.Resolve): Fixed bug #64222
7787 2004-08-27 Martin Baulig <martin@ximian.com>
7790 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7793 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7795 * ecore.cs (Constantify): Get underlying type via
7796 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7797 Windows in special cases.
7799 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7801 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7802 for obtaining also private methods.
7803 (GetRemoveMethod): Used GetRemoveMethod (true)
7804 for obtaining also private methods.
7806 2004-08-24 Martin Baulig <martin@ximian.com>
7808 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7809 MethodAttributes.HideBySig for operators.
7811 2004-08-23 Martin Baulig <martin@ximian.com>
7813 Back to the old error reporting system :-)
7815 * report.cs (Message): Removed.
7816 (Report.MessageData, ErrorData, WarningData): Removed.
7817 (Report.Error, Warning): Back to the old system.
7819 2004-08-23 Martin Baulig <martin@ximian.com>
7821 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7823 * class.cs (TypeContainer.ParentContainer): New public virtual
7824 method; replaces the explicit interface implementation.
7825 (ClassPart.ParentContainer): Override.
7827 2004-08-23 Martin Baulig <martin@ximian.com>
7829 * statement.cs (Switch): Added support for constant switches; see
7830 #59428 or test-285.cs.
7832 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7835 * statement.cs (GetEnumeratorFilter): Removed useless
7836 logic because C# specs is strict. GetEnumerator must be
7839 2004-08-22 Martin Baulig <martin@ximian.com>
7841 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7842 a switch and may break, reset the barrier. Fixes #59867.
7844 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7846 CLS-Compliance speed up (~5% for corlib)
7848 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7849 New method. Tests container for CLS-Compliant names
7851 * class.cs (TypeContainer.VerifyClsName): New method.
7852 Checks whether container name is CLS Compliant.
7853 (Constructor): Implements IMethodData.
7855 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7856 low-case table for CLS Compliance test.
7857 (MemberCache.VerifyClsParameterConflict): New method.
7858 Checks method parameters for CS3006 error.
7860 * enum.cs (EnumMember): Is derived from MemberCore.
7861 (Enum.VerifyClsName): Optimized for better performance.
7863 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7865 * report.cs: Renamed Error_T to Error and changed all
7868 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7870 * class.cs (TypeContainer.IndexerArrayList): New inner class
7871 container for indexers.
7872 (TypeContainer.DefaultIndexerName): New constant for default
7873 indexer name. Replaced all "Item" with this constant.
7874 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7876 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7877 DefaultMemberAttribute constructor.
7879 2004-08-05 Martin Baulig <martin@ximian.com>
7881 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7884 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7886 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7887 multi platforms problem.
7889 * compiler.csproj: Included shared files.
7891 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7893 Fix bug 60333, 55971 in the more general way
7894 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7895 Added arg_type argument for constant conversion.
7896 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7898 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7901 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7902 OperatorArrayList, MethodCoreArrayList for typecontainer
7903 containers. Changed class member types to these new types.
7904 (MethodArrayList.DefineMembers): Added test for CS0659.
7906 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7908 * cfold.cs: Synchronize the folding with the code in expression.cs
7909 Binary.DoNumericPromotions for uint operands.
7911 * attribute.cs: Revert patch from Raja, it introduced a regression
7912 while building Blam-1.2.1 (hard to isolate a test case).
7914 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7918 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7920 (MethodCore.parent_method): New member. The method we're overriding
7921 if this is an override method.
7922 (MethodCore.CheckBase): Moved from Method class and made common.
7923 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7925 (MethodCore.CheckForDuplications): New abstract method. For custom
7926 member duplication search in a container
7927 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7928 method and its return type.
7929 (Event.conflict_symbol): New member. Symbol with same name in the
7933 (MemberCache.FindMemberWithSameName): New method. The method
7934 is looking for conflict with inherited symbols.
7936 2004-08-04 Martin Baulig <martin@ximian.com>
7938 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7940 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7942 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7944 * report.cs (Message): New enum for better error, warning reference in
7946 (MessageData): New inner abstract class. It generally handles printing of
7947 error and warning messages.
7948 Removed unused Error, Warning, Message methods.
7950 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7952 Fix for cs0592-8.cs test
7954 (Attributable.ValidAttributeTargets): Made public.
7955 (Attribute.ExplicitTarget): New member for explicit target value.
7956 (Attribute.CheckTargets): Now we translate explicit attribute
7957 target to Target here.
7959 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7961 * ecore.cs (MethodGroupExpr): new IsBase property.
7963 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7965 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7966 rather than an instance expr.
7968 (DelegateCreation.Emit): Use the method group rather than
7969 the instance expression. Also, if you have base.Foo as the
7970 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7972 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7974 (NewDelegate.DoResolve): Only check for the existance of Invoke
7975 if the method is going to be needed. Use MethodGroupExpr.
7977 (NewDelegate.Emit): Remove, DelegateCreation implements this.
7979 * expression.cs: For pointer arith., make sure to use
7980 the size of the type, not the size of the pointer to
7983 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7986 * class.cs (Class): Added error CS0502 test.
7988 2004-08-03 John Luke <jluke@cfl.rr.com>
7989 Raja R Harinath <rharinath@novell.com>
7992 * attribute.cs (Attribute.complained_before): New flag.
7993 (Attribute.ResolveType, Attribute.Resolve),
7994 (Attribute.DefinePInvokeMethod): Set it.
7995 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7997 2004-08-03 Martin Baulig <martin@ximian.com>
7999 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8000 use a user-defined operator; we still need to do numeric
8001 promotions in case one argument is a builtin type and the other
8002 one has an implicit conversion to that type. Fixes #62322.
8004 2004-08-02 Martin Baulig <martin@ximian.com>
8006 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8007 (LocalInfo.IsThis): New public property.
8008 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8010 2004-08-01 Martin Baulig <martin@ximian.com>
8012 * class.cs (TypeContainer.GetClassBases): Don't set the default
8013 here since we may get called from GetPartialBases().
8014 (TypeContainer.DefineType): If GetClassBases() didn't return a
8015 parent, use the default one.
8017 2004-07-30 Duncan Mak <duncan@ximian.com>
8019 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8021 2004-07-30 Martin Baulig <martin@ximian.com>
8023 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8025 * class.cs (SourceMethod): New public class, derive from the
8026 symbol writer's ISourceMethod.
8027 (Method): Use the new symbol writer API.
8029 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8030 as argument and use the new symbol writer.
8033 (SourceFile): Implement the symbol writer's ISourceFile.
8034 (Location.SymbolDocument): Removed.
8035 (Location.SourceFile): New public property.
8037 * symbolwriter.cs: Use the new symbol writer API.
8039 2004-07-30 Raja R Harinath <rharinath@novell.com>
8041 * Makefile (install-local): Remove. Functionality moved to
8044 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8046 * Makefile: Install mcs.exe.config file together with mcs.exe.
8047 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8048 correct runtime version.
8050 2004-07-25 Martin Baulig <martin@ximian.com>
8053 (TypeContainer.RegisterOrder): Removed, this was unused.
8054 (TypeContainer, interface_order): Removed.
8055 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8056 TypeContainer as argument since we can also be called with a
8057 `PartialContainer' for a partial class/struct/interface.
8058 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8059 of checking whether we're an `Interface' - we could be a
8061 (PartialContainer.Register): Override; call
8062 AddClass()/AddStruct()/AddInterface() on our parent.
8064 * cs-parser.jay (interface_member_declaration): Add things to the
8065 `current_container', not the `current_class'.
8067 * rootcontext.cs (RegisterOrder): The overloaded version which
8068 takes an `Interface' was unused, removed.
8070 * typemanager.cs (TypeManager.LookupInterface): Return a
8071 `TypeContainer', not an `Interface'.
8072 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8073 contain a `PartialContainer' for an interface, so check it's
8074 `Kind' to figure out what it is.
8076 2004-07-25 Martin Baulig <martin@ximian.com>
8078 * class.cs (Class.DefaultTypeAttributes): New public constant.
8079 (Struct.DefaultTypeAttributes): Likewise.
8080 (Interface.DefaultTypeAttributes): Likewise.
8081 (PartialContainer.TypeAttr): Override this and add the
8082 DefaultTypeAttributes.
8084 2004-07-25 Martin Baulig <martin@ximian.com>
8086 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8087 we can just use the `Parent' field instead.
8089 2004-07-25 Martin Baulig <martin@ximian.com>
8091 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8093 2004-07-25 Martin Baulig <martin@ximian.com>
8095 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8096 our parts before defining any methods.
8097 (TypeContainer.VerifyImplements): Make this virtual.
8098 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8099 on our PartialContainer.
8101 2004-07-25 Martin Baulig <martin@ximian.com>
8103 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8105 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8106 argument, we can just use the `Parent' field instead.
8109 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8110 (MemberBase.DoDefine): Likewise.
8112 2004-07-24 Martin Baulig <martin@ximian.com>
8114 * decl.cs (MemberCore.Parent): New public field.
8115 (DeclSpace.Parent): Moved to MemberCore.
8117 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8118 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8120 (FieldBase, Field, Operator): Likewise.
8121 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8122 (EventField, Event): Likewise.
8124 2004-07-23 Martin Baulig <martin@ximian.com>
8126 * class.cs (PartialContainer): New public class.
8127 (ClassPart): New public class.
8128 (TypeContainer): Added support for partial classes.
8129 (TypeContainer.GetClassBases): Splitted some of the functionality
8130 out into GetNormalBases() and GetPartialBases().
8132 * cs-tokenizer.cs (Token.PARTIAL): New token.
8133 (Tokenizer.consume_identifier): Added some hacks to recognize
8134 `partial', but only if it's immediately followed by `class',
8135 `struct' or `interface'.
8137 * cs-parser.jay: Added support for partial clases.
8139 2004-07-23 Martin Baulig <martin@ximian.com>
8141 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8142 a `DeclSpace' and also made it readonly.
8143 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8144 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8145 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8147 * cs-parser.jay: Pass the `current_class', not the
8148 `current_container' (at the moment, this is still the same thing)
8149 to a new Method, Property, Event, Indexer or Constructor.
8151 2004-07-23 Martin Baulig <martin@ximian.com>
8153 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8154 and removed the `current_interface' one.
8155 (struct_declaration, class_declaration, interface_declaration):
8156 Set `current_class' to the newly created class/struct/interface;
8157 set their `Bases' and call Register() before parsing their body.
8159 2004-07-23 Martin Baulig <martin@ximian.com>
8161 * class.cs (Kind): New public enum.
8162 (TypeContainer): Made this class abstract.
8163 (TypeContainer.Kind): New public readonly field.
8164 (TypeContainer.CheckDef): New public method; moved here from
8166 (TypeContainer.Register): New public abstract method.
8167 (TypeContainer.GetPendingImplementations): New public abstract
8169 (TypeContainer.GetClassBases): Removed the `is_class' and
8170 `is_iface' parameters.
8171 (TypeContainer.DefineNestedTypes): Formerly known as
8173 (ClassOrStruct): Made this class abstract.
8175 * tree.cs (RootTypes): New public type.
8177 2004-07-20 Martin Baulig <martin@ximian.com>
8179 * tree.cs (Tree.RecordNamespace): Removed.
8180 (Tree.Namespaces): Removed.
8182 * rootcontext.cs (RootContext.IsNamespace): Removed.
8184 * cs-parser.jay (namespace_declaration): Just create a new
8185 NamespaceEntry here.
8187 2004-07-20 Martin Baulig <martin@ximian.com>
8189 * statement.cs (ExceptionStatement): New abstract class. This is
8190 now used as a base class for everyone who's using `finally'.
8191 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8192 our local variables before using them.
8194 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8195 virtual method. This is used by Yield.Resolve() to "steal" an
8196 outer block's `finally' clauses.
8197 (FlowBranchingException): The .ctor now takes an ExceptionStatement
8200 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8201 version which takes an ExceptionStatement. This version must be
8202 used to create exception branchings.
8205 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8206 (Iterator.EmitMoveNext): Added exception support; protect the
8207 block with a `fault' clause, properly handle 'finally' clauses.
8208 (Iterator.EmitDispose): Run all the `finally' clauses here.
8210 2004-07-20 Martin Baulig <martin@ximian.com>
8212 * iterator.cs: This is the first of a set of changes in the
8213 iterator code. Match the spec more closely: if we're an
8214 IEnumerable, then GetEnumerator() must be called. The first time
8215 GetEnumerator() is called, it returns the current instance; all
8216 subsequent invocations (if any) must create a copy.
8218 2004-07-19 Miguel de Icaza <miguel@ximian.com>
8220 * expression.cs: Resolve the constant expression before returning
8223 2004-07-19 Martin Baulig <martin@ximian.com>
8225 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8226 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8227 the return type of the new EmitContext.
8229 2004-07-18 Martin Baulig <martin@ximian.com>
8231 * class.cs (Property.Define): Fix iterators.
8233 * iterators.cs (Iterator.Define): Moved the
8234 `container.AddInterator (this)' call here from the .ctor; only do
8235 it if we resolved successfully.
8237 2004-07-17 Miguel de Icaza <miguel@ximian.com>
8239 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8240 `true' for preprocessing directives that we parse. The return
8241 value indicates whether we should return to regular tokenizing or
8242 not, not whether it was parsed successfully.
8244 In the past if we were in: #if false ... #line #endif, we would
8245 resume parsing after `#line'. See bug 61604.
8247 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8248 building: IsEnumType should return true only for enums, not for
8249 enums or System.Enum itself. This fixes #61593.
8251 Likely what happened is that corlib was wrong: mcs depended on
8252 this bug in some places. The bug got fixed, we had to add the
8253 hack, which caused bug 61593.
8255 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8256 that was a workaround for the older conditions.
8258 2004-07-16 Ben Maurer <bmaurer@ximian.com>
8260 * assign.cs: IAssignMethod has a new interface, as documented
8261 inline. All assignment code now uses this new api.
8263 * ecore.cs, expression.cs: All classes which implement
8264 IAssignMethod now use the new interface.
8266 * expression.cs (Invocation): add a hack to EmitCall so that
8267 IndexerAccess can be the target of a compound assignment without
8268 evaluating its arguments twice.
8270 * statement.cs: Handle changes in Invocation api.
8272 2004-07-16 Martin Baulig <martin@ximian.com>
8274 * iterators.cs: Rewrote this. We're now using one single Proxy
8275 class for both the IEnumerable and the IEnumerator interface and
8276 `Iterator' derives from Class so we can use the high-level API.
8278 * class.cs (TypeContainer.AddIterator): New method.
8279 (TypeContainer.DoDefineType): New protected virtual method, which
8280 is called from DefineType().
8281 (TypeContainer.DoDefineMembers): Call DefineType() and
8282 DefineMembers() on all our iterators.
8283 (TypeContainer.Emit): Call Emit() on all our iterators.
8284 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8286 * codegen.cs (EmitContext.CurrentIterator): New public field.
8288 2004-07-15 Martin Baulig <martin@ximian.com>
8291 (TypeManager.not_supported_exception_type): New type.
8293 2004-07-14 Martin Baulig <martin@ximian.com>
8295 * iterators.cs: Use real error numbers.
8297 2004-07-14 Martin Baulig <martin@ximian.com>
8299 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8300 requires this to be a System.Collection.IEnumerable and not a
8301 class implementing that interface.
8302 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8304 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8306 * class.cs: Fixed previous fix, it broke some error tests.
8308 2004-07-12 Martin Baulig <martin@ximian.com>
8310 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8313 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8315 * assign.cs (LocalTemporary): Add new argument: is_address,If
8316 `is_address' is true, then the value that we store is the address
8317 to the real value, and not the value itself.
8319 * ecore.cs (PropertyExpr): use the new local temporary
8320 stuff to allow us to handle X.Y += z (where X is a struct)
8322 2004-07-08 Martin Baulig <martin@ximian.com>
8324 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8325 not always return, just like we're doing in Using.Resolve().
8327 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8329 * cs-parser.jay (fixed_statement): flag this as Pinned.
8331 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8333 * typemanager.cs (TypeManager): Removed MakePinned method, this
8334 mechanism is replaced with the .NET 2.x compatible mechanism of
8335 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8337 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8338 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8339 `IsFixed' property which has a different meaning.
8341 2004-07-02 Raja R Harinath <rharinath@novell.com>
8343 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8344 visible from inside a nested class, not just the names of the
8345 immediately enclosing class.
8348 2004-06-24 Raja R Harinath <rharinath@novell.com>
8350 * expression.cs (BetterConversion): Remove buggy special-case
8351 handling of "implicit constant expression conversions". At this
8352 point, we already know that the conversion is possible -- we're
8353 only checking to see which is better.
8355 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8357 * cs-parser.jay: Added error CS0210 test.
8359 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8361 * cs-parser.jay: Added error CS0134 test.
8363 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8366 * cs-parser.jay: Added error CS0145 test.
8368 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8370 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8372 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8374 * expression.cs (StackAlloc.Resolve): The argument may not
8375 be a constant; deal with this case.
8377 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8379 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8380 GetIndexerAttributeValue.
8381 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8383 * class.cs (Indexer.Define): Added error tests for CS0415,
8386 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8388 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8391 2004-06-23 Martin Baulig <martin@ximian.com>
8393 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8394 neither return nor throw, reset the barrier as well. Fixes #60457.
8396 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8398 * class.cs : EventAttributes is now set to None by default.
8399 This fixes bug #60459.
8401 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8404 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8405 Don't throw exception but return null (it's sufficient now).
8407 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8409 * typemanager.cs (GetArgumentTypes): Faster implementation.
8411 2004-06-18 Martin Baulig <martin@ximian.com>
8413 * attribute.cs (Attribute.Resolve): Check whether we're an
8414 EmptyCast which a Constant child. Fixes #60333.
8416 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8418 * statement.cs (EmitCollectionForeach): Account for the fact that
8419 not all valuetypes are in areas which we can take the address of.
8420 For these variables, we store to a temporary variable. Also, make
8421 sure that we dont emit a `callvirt' on a valuetype method.
8423 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8425 * expression.cs (StackAlloc.DoReSolve): Added test for
8426 negative parameter (CS0247).
8428 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8431 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8433 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8436 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8439 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8441 Fix bug #58254 & cs1555.cs, cs1556.cs
8442 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8444 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8446 * cs-parser.jay: Added error CS1669 test for indexers.
8448 2004-06-11 Martin Baulig <martin@ximian.com>
8450 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8451 call this twice: for params and varargs methods.
8453 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8456 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8458 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8460 * attribute.cs (Attribute.GetValidTargets): Made public.
8463 (AbstractPropertyEventMethod): New class for better code sharing.
8464 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8466 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8468 2004-06-11 Raja R Harinath <rharinath@novell.com>
8471 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8472 that the call to Resolve is part of a MemberAccess.
8473 (Expression.Resolve): Use it for SimpleName resolution.
8474 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8475 Add 'intermediate' boolean argument.
8476 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
8477 error message when the SimpleName can be resolved ambiguously
8478 between an expression and a type.
8479 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8481 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8482 call on the left-side.
8484 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8487 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8489 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8491 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8493 2004-06-11 Martin Baulig <martin@ximian.com>
8495 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8496 varargs methods if applicable.
8498 2004-06-11 Martin Baulig <martin@ximian.com>
8500 * expression.cs (Invocation.EmitCall): Don't use
8501 `method.CallingConvention == CallingConventions.VarArgs' since the
8502 method could also have `CallingConventions.HasThis'.
8504 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8506 * class.cs (Event.GetSignatureForError): Implemented.
8507 Fixed crash in error test cs3010.cs
8509 2004-06-10 Miguel de Icaza <miguel@ximian.com>
8511 * cs-tokenizer.cs: Change the way we track __arglist to be
8512 consistent with the other keywords.
8514 2004-06-09 Miguel de Icaza <miguel@ximian.com>
8516 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8519 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
8521 * codegen.cs: Check that all referenced assemblies have a strongname
8522 before strongnaming the compiled assembly. If not report error CS1577.
8523 Fix bug #56563. Patch by Jackson Harper.
8524 * typemanager.cs: Added a method to return all referenced assemblies.
8525 Fix bug #56563. Patch by Jackson Harper.
8527 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8530 (Method.ApplyAttributeBuilder): Moved and added conditional
8531 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8534 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8536 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8539 * class.cs: (EventField.attribute_targets): Changed default target.
8541 2004-06-08 Martin Baulig <martin@ximian.com>
8543 * expression.cs (Invocation.EmitCall): Enable varargs methods.
8545 2004-06-08 Martin Baulig <martin@ximian.com>
8547 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8549 2004-06-07 Martin Baulig <martin@ximian.com>
8551 Added support for varargs methods.
8553 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8556 * cs-parser.jay: Added support for `__arglist'.
8558 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8560 * expression.cs (Argument.AType): Added `ArgList'.
8561 (Invocation): Added support for varargs methods.
8562 (ArglistAccess): New public class.
8563 (Arglist): New public class.
8565 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8567 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
8568 a method's top-level block if the method has varargs.
8570 * support.cs (ReflectionParameters, InternalParameters): Added
8571 support for varargs methods.
8573 2004-06-07 Miguel de Icaza <miguel@ximian.com>
8575 * class.cs: Provide location in indexer error report.
8577 * driver.cs: Use standard names.
8579 * namespace.cs: Catch the use of using after a namespace has been
8580 declared also on using aliases.
8582 2004-06-03 Raja R Harinath <rharinath@novell.com>
8585 * typemanager.cs (closure_private_ok, closure_invocation_type)
8586 (closure_qualifier_type, closure_invocation_assembly)
8587 (FilterWithClosure): Move to ...
8588 (Closure): New internal nested class.
8589 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8590 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8591 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8592 (MemberLookup, MemberLookupFailed): Use it.
8593 * expression.cs (New.DoResolve): Treat the lookup for the
8594 constructor as being qualified by the 'new'ed type.
8595 (Indexers.GetIndexersForTypeOrInterface): Update.
8597 2004-06-03 Marek Safar <marek.safar@seznam.cz>
8600 (GetConditionalAttributeValue): New method. Returns
8601 condition of ConditionalAttribute.
8602 (SearchMulti): New method. Returns all attributes of type 't'.
8603 Use it when attribute is AllowMultiple = true.
8604 (IsConditionalMethodExcluded): New method.
8607 (Method.IsExcluded): Implemented. Returns true if method has conditional
8608 attribute and the conditions is not defined (method is excluded).
8609 (IMethodData): Extended interface for ConditionalAttribute support.
8610 (PropertyMethod.IsExcluded): Implemented.
8613 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8616 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8619 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
8621 * expression.cs (ArrayCreationExpression): Make this just an
8622 `expression'. It can't be a statement, so the code here was
8625 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8628 * typemanager.cs (GetFullNameSignature): New method for
8631 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8634 * class.cs (MemberBase.GetSignatureForError): New virtual method.
8635 Use this method when MethodBuilder is null.
8636 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8637 Added test for error CS0626 (MONO reports error for this situation).
8638 (IMethodData.GetSignatureForError): Extended interface.
8640 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8643 (AttributeTester.GetObsoleteAttribute): Returns instance of
8644 ObsoleteAttribute when type is obsolete.
8647 (TypeContainer.VerifyObsoleteAttribute): Override.
8648 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8649 (MethodCode.VerifyObsoleteAttribute): Override.
8650 (MemberBase.VerifyObsoleteAttribute): Override.
8653 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8654 and report proper error.
8657 Delegate.VerifyObsoleteAttribute): Override.
8660 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8661 and report proper error.
8662 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8665 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8669 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8670 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8671 Added test for ObsoleteAttribute.
8674 (Catch): Derived from Statement.
8676 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8678 Fixed bug #59071 & cs0160.cs
8680 * statement.cs (Try.Resolve): Check here whether order of catch
8681 clauses matches their dependencies.
8683 2004-05-31 Miguel de Icaza <miguel@ximian.com>
8685 * Reverted patch to namespace.cs (Use lookuptypedirect). This
8686 caused a regression: #59343. Referencing nested classes from an
8687 assembly stopped working.
8689 2004-05-31 Martin Baulig <martin@ximian.com>
8691 MCS is now frozen for beta 2.
8693 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8695 * convert.cs: add a trivial cache for overload operator resolution.
8697 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8699 * decl.cs: If possible, use lookuptypedirect here. We can only do
8700 this if there is no `.' after the namespace. Avoids using
8701 LookupType, which does lots of slow processing.
8702 (FindNestedType) New method, does what it says :-).
8703 * namespace.cs: use LookupTypeDirect.
8704 * rootcontext.cs: use membercache, if possible.
8705 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8707 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8710 According to the spec,
8712 In a member access of the form E.I, if E is a single identifier,
8713 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8714 field, property, localvariable, or parameter with the same type as
8715 the meaning of E as a type-name (§3.8), then both possible
8716 meanings of E are permitted.
8718 We did not check that E as a simple-name had the same type as E as
8721 This trivial check gives us 5-7% on bootstrap time.
8723 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8725 * expression.cs (Invocation.OverloadResolve): Avoid the
8726 use of hashtables and boxing here by allocating on demand.
8728 2004-05-30 Martin Baulig <martin@ximian.com>
8730 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8731 we're doing a silent lookup. Don't try to lookup nested types in
8732 TypeManager.object_type (thanks to Ben Maurer).
8734 2004-05-30 Martin Baulig <martin@ximian.com>
8736 Committing a patch from Ben Maurer.
8738 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8740 2004-05-29 Martin Baulig <martin@ximian.com>
8742 * class.cs (IMethodData.ShouldIgnore): New method.
8744 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8745 `Location' argument, we don't need it anywhere. Use
8746 `IMethodData.ShouldIgnore ()' instead of
8747 `MethodData.GetMethodFlags ()'.
8748 (TypeManager.AddMethod): Removed.
8749 (TypeManager.AddMethod2): Renamed to AddMethod.
8751 2004-05-29 Martin Baulig <martin@ximian.com>
8753 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8755 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8756 converting from a class type S to an interface type and we already
8757 have an object on the stack, don't box it again. Fixes #52578.
8759 2004-05-29 Martin Baulig <martin@ximian.com>
8761 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8762 Added support for `params' parameters. Fixes #59267.
8764 2004-05-29 Martin Baulig <martin@ximian.com>
8766 * literal.cs (NullPointer): Provide a private .ctor which sets
8767 `type' to TypeManager.object_type. Fixes #59048.
8769 2004-05-29 Martin Baulig <martin@ximian.com>
8771 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8772 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8774 * ecore.cs (EventExpr.instance_expr): Make the field private.
8776 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8778 Fixed bug #50080 & cs0214-2.cs
8779 * expression.cs (Cast.DoResolve): Check unsafe context here.
8781 * statement.cs (Resolve.DoResolve): Likewise.
8783 2004-05-26 Martin Baulig <martin@ximian.com>
8785 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8787 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8788 (RootContext.LookupType): Pass down the `silent' flag.
8790 2004-05-25 Martin Baulig <martin@ximian.com>
8793 (MethodGroupExpr.IdenticalTypeName): New public property.
8794 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8795 expression actually refers to a type.
8797 2004-05-25 Martin Baulig <martin@ximian.com>
8799 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8800 for #56176 and made it actually work.
8802 2004-05-25 Martin Baulig <martin@ximian.com>
8804 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8805 (FieldExpr, PropertyExpr): Override and implement
8806 CacheTemporaries. Fixes #52279.
8808 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8810 * location.cs: In the new compiler listing a file twice is a
8811 warning, not an error.
8813 2004-05-24 Martin Baulig <martin@ximian.com>
8815 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8816 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8818 2004-05-24 Martin Baulig <martin@ximian.com>
8820 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8821 walking the `using' list. Fixes #53921.
8823 2004-05-24 Martin Baulig <martin@ximian.com>
8825 * const.cs (Const.LookupConstantValue): Added support for
8826 EmptyCast's; fixes #55251.
8828 2004-05-24 Martin Baulig <martin@ximian.com>
8830 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8831 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8832 which does the CS0135 check. The reason is that we first need to
8833 check whether the variable actually exists.
8835 2004-05-24 Martin Baulig <martin@ximian.com>
8837 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8838 than RootContext.LookupType() to find the explicit interface
8841 2004-05-24 Raja R Harinath <rharinath@novell.com>
8843 * Makefile: Simplify. Use executable.make.
8844 * mcs.exe.sources: New file. List of sources of mcs.exe.
8846 2004-05-24 Anders Carlsson <andersca@gnome.org>
8850 Use the invariant culture when doing String.Compare for CLS case
8853 2004-05-23 Martin Baulig <martin@ximian.com>
8855 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8856 don't have any dots. Fixes #52622, added cs0246-8.cs.
8858 * namespace.cs (NamespaceEntry.Lookup): Likewise.
8860 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8862 * class.cs (MemberBase.Define): Reuse MemberType member for
8863 resolved type. Other methods can use it too.
8865 2004-05-23 Martin Baulig <martin@ximian.com>
8867 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8868 the variable also exists in the current block (otherwise, we need
8869 to report a CS0103). Fixes #58670.
8871 2004-05-23 Martin Baulig <martin@ximian.com>
8873 * flowanalysis.cs (Reachability.Reachable): Compute this
8874 on-the-fly rather than storing it as a field.
8876 2004-05-23 Martin Baulig <martin@ximian.com>
8878 * flowanalysis.cs (Reachability.And): Manually compute the
8879 resulting `barrier' from the reachability.
8881 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8884 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8885 instance of ObsoleteAttribute when symbol is obsolete.
8888 (IMethodData): Extended interface for ObsoleteAttribute support.
8890 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8892 * attribute.cs: Fix bug #55970
8894 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8898 (GetObsoleteAttribute): New method. Creates the instance of
8900 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8901 ObsoleteAttribute when member is obsolete.
8902 (AttributeTester.Report_ObsoleteMessage): Common method for
8903 Obsolete error/warning reporting.
8906 (TypeContainer.base_classs_type): New member for storing parent type.
8909 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8910 for this MemberCore.
8912 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8914 * attribute.cs, const.cs: Fix bug #58590
8916 2004-05-21 Martin Baulig <martin@ximian.com>
8918 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8919 out parameters if the end of the method is unreachable. Fixes
8922 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8924 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8925 Hari was right, why extra method.
8927 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8929 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8931 2004-05-20 Martin Baulig <martin@ximian.com>
8933 Merged this back from gmcs to keep the differences to a minumum.
8935 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8936 instead of a Declspace.
8937 (Attribute.ResolveType): Likewise.
8938 (Attributes.Search): Likewise.
8939 (Attributes.Contains): Likewise.
8940 (Attributes.GetClsCompliantAttribute): Likewise.
8942 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8944 (MethodData.ApplyAttributes): Take an EmitContext instead of a
8947 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8949 Fix bug #58688 (MCS does not report error when the same attribute
8952 * attribute.cs (Attribute.Emit): Distinction between null and default.
8954 2004-05-19 Raja R Harinath <rharinath@novell.com>
8956 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8957 of a top-level attribute without an attribute target.
8958 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8960 (Attribute.Conditional_GetConditionName),
8961 (Attribute.Obsolete_GetObsoleteMessage): Update.
8962 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8963 part of ScanForIndexerName.
8964 (Attribute.CanIgnoreInvalidAttribute): New function.
8965 (Attribute.ScanForIndexerName): Move to ...
8966 (Attributes.ScanForIndexerName): ... here.
8967 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8968 (Attributes.Search): New internal variant that can choose not to
8969 complain if types aren't resolved. The original signature now
8971 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8972 complaints suppressed.
8973 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8974 only if it not useful.
8975 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8976 top-level for attributes that are shared between the assembly
8977 and a top-level class.
8978 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8979 * class.cs: Update to reflect changes.
8980 (DefineIndexers): Fuse loops.
8981 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
8982 a couple more variants of attribute names.
8984 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8986 Fix bug #52585 (Implemented explicit attribute declaration)
8989 (Attributable.ValidAttributeTargets): New abstract method. It gets
8990 list of valid attribute targets for explicit target declaration.
8991 (Attribute.Target): It holds target itself.
8992 (AttributeSection): Removed.
8993 (Attribute.CheckTargets): New method. It checks whether attribute
8994 target is valid for the current element.
8997 (EventProperty): New class. For events that are declared like
8998 property (with add and remove accessors).
8999 (EventField): New class. For events that are declared like field.
9002 * cs-parser.jay: Implemented explicit attribute target declaration.
9004 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9005 Override ValidAttributeTargets.
9008 (ReturnParameter): Class for applying custom attributes on
9010 (ParameterAtribute): New class. Class for applying custom
9011 attributes on the parameter type.
9013 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9015 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9018 (Method): Allow UNSAFE here.
9020 * modifiers.cs: Support unsafe reporting.
9022 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9024 * decl.cs: Fix bug #58478.
9026 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9028 * statement.cs: When checking for unreachable code on an EmptyStatement,
9029 set the location. Fixes bug #58488.
9031 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9033 * driver.cs: Add -pkg handling.
9035 From Gonzalo: UseShelLExecute=false
9037 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9040 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9042 (Attribute.IsClsCompliaceRequired): Moved to base for better
9044 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9045 when attribute is AttributeUsageAttribute.
9046 (Attribute.GetValidTargets): Simplified.
9047 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9048 attribute for this type.
9049 (Attribute.ApplyAttributes): Method renamed to Emit and make
9051 (GlobalAttributeSection): New class for special handling of global
9052 attributes (assembly, module).
9053 (AttributeSection.Emit): New method.
9055 * class.cs: Implemented Attributable abstract methods.
9056 (MethodCore.LabelParameters): Moved to Parameter class.
9057 (Accessor): Is back simple class.
9058 (PropertyMethod): Implemented Attributable abstract class.
9059 (DelegateMethod): Implemented Attributable abstract class.
9060 (Event): New constructor for disctintion between normal Event
9061 and Event with accessors.
9063 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9065 * codegen.cs, const.cs, decl.cs, delegate.cs:
9066 (CommonAssemblyModulClass): Implemented Attributable abstract class
9069 * enum.cs: Implement IAttributeSupport interface.
9070 (EnumMember): New class for emum members. Implemented Attributable
9074 (ParameterBase): Is abstract.
9075 (ReturnParameter): New class for easier [return:] attribute handling.
9077 * typemanager.cs: Removed builder_to_attr.
9079 2004-05-11 Raja R Harinath <rharinath@novell.com>
9082 * attribute.cs (Attribute.GetPositionalValue): New function.
9083 * class.cs (TypeContainer.VerifyMembers): New function.
9084 (TypeContainer.Emit): Use it.
9085 (ClassOrStruct): New base class for Class and Struct.
9086 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9087 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9089 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9090 then each non-static field should have a FieldOffset attribute.
9091 Otherwise, none of the fields should have a FieldOffset attribute.
9092 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9093 and FieldOffset attributes.
9094 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9095 (TypeManager.field_offset_attribute_type): New core types.
9096 (TypeManager.InitCoreTypes): Initialize them.
9098 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9100 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9101 Return correct type.
9104 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9106 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9107 be implicitly converted to ulong.
9109 * expression.cs: The logic for allowing operator &, | and ^ worked
9110 was wrong, it worked before because we did not report an error in
9111 an else branch. Fixes 57895.
9113 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9114 allow volatile fields to be reference types.
9116 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9118 * driver.cs: Add support for /debug-
9120 2004-05-07 Raja R Harinath <rharinath@novell.com>
9122 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9123 Add a 'complain' parameter to silence errors.
9124 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9125 silently overlooked type-resolutions.
9126 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9128 (Attributes.Search): New function.
9129 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9130 (Attributes.GetAttributeFullName): Remove hack.
9131 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9132 Update to reflect changes.
9133 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9134 Use Attributes.Search instead of nested loops.
9136 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9139 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9140 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9141 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9143 * report.cs: (Report.Warning): Renamed to Warning_T because of
9144 parameter collision.
9146 2004-05-05 Raja R Harinath <rharinath@novell.com>
9148 * expression.cs (MemberAccess.ResolveMemberAccess):
9149 Exit with non-zero status after Report.Error.
9150 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9152 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9154 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9156 * support.cs: Don't hang when the file is empty.
9158 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9160 * support.cs: In SeekableStreamReader, compute the preamble size of the
9161 underlying stream. Position changes should take into account that initial
9164 2004-05-03 Todd Berman <tberman@sevenl.net>
9166 * driver.cs: remove unused GetSysVersion function.
9168 2004-05-03 Todd Berman <tberman@sevenl.net>
9170 * driver.cs: Remove the hack from saturday, as well as the hack
9171 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9172 link_paths to get that bit proper.
9174 2004-05-01 Todd Berman <tberman@sevenl.net>
9176 * driver.cs: Try a LoadFrom before a Load, this checks the current
9177 path. This is currently a bug in mono that is be fixed, however, this
9178 provides a workaround for now. This will be removed when the bug
9181 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9183 * CryptoConvert.cs: Updated to latest version. Fix issue with
9184 incomplete key pairs (#57941).
9186 2004-05-01 Todd Berman <tberman@sevenl.net>
9188 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9191 2004-04-30 Jackson Harper <jackson@ximian.com>
9193 * codegen.cs: Open keys readonly.
9195 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9197 * typemanager.cs: don't report cyclic struct layout when a struct
9198 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9199 which has 2 Pango.Rectangle fields.
9201 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9203 * expression.cs: Handle IntPtr comparisons with IL code
9204 rather than a method call.
9206 2004-04-29 Martin Baulig <martin@ximian.com>
9208 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9209 the list of PropertyInfo's in class hierarchy and find the
9210 accessor. Fixes #56013.
9212 2004-04-29 Martin Baulig <martin@ximian.com>
9214 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9216 2004-04-29 Martin Baulig <martin@ximian.com>
9218 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9220 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9222 2004-04-29 Martin Baulig <martin@ximian.com>
9224 * class.cs (ConstructorInitializer.Resolve): Check whether the
9225 parent .ctor is accessible. Fixes #52146.
9227 2004-04-29 Martin Baulig <martin@ximian.com>
9229 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9231 * statement.cs (Using.EmitLocalVariableDecls): Use
9232 TypeManager.idisposable_type, not typeof (IDisposable).
9233 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9235 2004-04-29 Martin Baulig <martin@ximian.com>
9237 * class.cs (Event.Define): Don't emit the field and don't set
9238 RTSpecialName and SpecialName for events on interfaces. Fixes
9241 2004-04-29 Raja R Harinath <rharinath@novell.com>
9243 Refactor Attribute.ApplyAttributes.
9244 * attribute.cs (Attributable): New base class for objects that can
9245 have Attributes applied on them.
9246 (Attribute): Make AttributeUsage fields public.
9247 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9248 (Attribute.IsInternalCall): New property.
9249 (Attribute.UsageAttr): Convert to a public read-only property.
9250 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9251 (Attribute.ResolveType, Attribute.Resolve)
9252 (Attribute.ScanForIndexerName): Update to reflect changes.
9253 (Attribute.CheckAttributeTarget): Re-format.
9254 (Attribute.ApplyAttributes): Refactor, to various
9255 Attributable.ApplyAttributeBuilder methods.
9256 * decl.cs (MemberCore): Make Attributable.
9257 * class.cs (Accessor): Make Attributable.
9258 (MethodData.ApplyAttributes): Use proper attribute types, not
9260 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9261 (TypeContainer.ApplyAttributeBuilder)
9262 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9263 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9264 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9265 (Operator.ApplyAttributeBuilder): New factored-out methods.
9266 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9267 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9268 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9269 * parameter.cs (ParameterBase): New Attributable base class
9270 that can also represent Return types.
9271 (Parameter): Update to the changes.
9273 2004-04-29 Jackson Harper <jackson@ximian.com>
9275 * driver.cs: Prefer the corlib system version when looking for
9276 assemblies in the GAC. This is still a hack, but its a better hack
9279 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9281 * decl.cs, enum.cs: Improved error 3005 reporting.
9283 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9284 (related_symbols): New private member for list of symbols
9285 related to reported error/warning.
9287 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9289 2004-04-29 Martin Baulig <martin@ximian.com>
9291 * ecore.cs (Expression.Constantify): If we're an enum and
9292 TypeManager.TypeToCoreType() doesn't give us another type, use
9293 t.UnderlyingSystemType. Fixes #56178.
9295 2004-04-29 Martin Baulig <martin@ximian.com>
9297 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9298 interfaces and for each interface, only add members directly
9299 declared in that interface. Fixes #53255.
9301 2004-04-28 Martin Baulig <martin@ximian.com>
9303 * expression.cs (ConditionalLogicalOperator): Use a temporary
9304 variable for `left' to avoid that we evaluate it more than once;
9307 2004-04-28 Martin Baulig <martin@ximian.com>
9309 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9312 2004-04-28 Martin Baulig <martin@ximian.com>
9314 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9317 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9318 whether the type is not void (CS1547).
9320 2004-04-28 Martin Baulig <martin@ximian.com>
9322 * expression.cs (Unary.DoResolveLValue): Override this and report
9323 CS0131 for anything but Operator.Indirection.
9325 2004-04-28 Martin Baulig <martin@ximian.com>
9327 Committing a patch from Ben Maurer; see bug #50820.
9329 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9332 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9335 2004-04-28 Martin Baulig <martin@ximian.com>
9337 Committing a patch from Ben Maurer; see bug #50820.
9339 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9342 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9345 2004-04-28 Martin Baulig <martin@ximian.com>
9347 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9348 (Block.AddLabel): Call DoLookupLabel() to only search in the
9351 2004-04-28 Martin Baulig <martin@ximian.com>
9353 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9354 comparing StringConstants and NullLiterals in Equality and Inequality.
9356 2004-04-28 Jackson Harper <jackson@ximian.com>
9358 * driver.cs: Attempt to load referenced assemblies from the
9359 GAC. This is the quick and dirty version of this method that
9360 doesnt take into account versions and just takes the first
9361 canidate found. Will be good enough for now as we will not have more
9362 then one version installed into the GAC until I update this method.
9364 2004-04-28 Martin Baulig <martin@ximian.com>
9366 * typemanager.cs (TypeManager.CheckStructCycles): New public
9367 static method to check for cycles in the struct layout.
9369 * rootcontext.cs (RootContext.PopulateTypes): Call
9370 TypeManager.CheckStructCycles() for each TypeContainer.
9371 [Note: We only need to visit each type once.]
9373 2004-04-28 Martin Baulig <martin@ximian.com>
9375 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9377 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9378 success and added `out object value'. Use a `bool resolved' field
9379 to check whether we've already been called rather than
9380 `ConstantValue != null' since this breaks for NullLiterals.
9382 2004-04-28 Raja R Harinath <rharinath@novell.com>
9384 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9385 setting of this flag, since the 'set' method may be non-public.
9387 2004-04-28 Raja R Harinath <rharinath@novell.com>
9389 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9390 check on current_vector.Block.
9392 2004-04-27 Martin Baulig <martin@ximian.com>
9394 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9395 a field initializer. Fixes #56459.
9397 2004-04-27 Martin Baulig <martin@ximian.com>
9399 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9400 we're not attempting to use an indexer. Fixes #52154.
9402 2004-04-27 Martin Baulig <martin@ximian.com>
9404 * statement.cs (Return): Don't create a return label if we don't
9405 need it; reverts my change from January 20th. Thanks to Ben
9408 2004-04-27 Martin Baulig <martin@ximian.com>
9410 According to the spec, `goto' can only leave a nested scope, but
9413 * statement.cs (Block.LookupLabel): Only lookup in the current
9414 block, don't recurse into parent or child blocks.
9415 (Block.AddLabel): Check in parent and child blocks, report
9416 CS0140/CS0158 if we find a duplicate.
9417 (Block): Removed this indexer for label lookups.
9418 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9419 this already does the error reporting for us.
9422 (FlowBranching.UsageVector.Block): New public variable; may be null.
9423 (FlowBranching.CreateSibling): Added `Block' argument.
9424 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9425 label for the target of a `goto' and check whether we're not
9426 leaving a `finally'.
9428 2004-04-27 Martin Baulig <martin@ximian.com>
9430 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9431 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9434 2004-04-27 Martin Baulig <martin@ximian.com>
9436 * statement.cs (Block.AddLabel): Also check for implicit blocks
9437 and added a CS0158 check.
9439 2004-04-27 Martin Baulig <martin@ximian.com>
9441 * flowanalysis.cs (FlowBranchingLoop): New class.
9442 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9443 UsageVector's instead of an ArrayList.
9444 (FlowBranching.Label): Likewise.
9445 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9446 (FlowBranching.AddBreakVector): New method.
9448 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9450 * attribute.cs: Small regression fix: only convert the type if we
9451 the type is different, fixes System.Drawing build.
9453 2004-04-27 Martin Baulig <martin@ximian.com>
9455 * attribute.cs (Attribute.Resolve): If we have a constant value
9456 for a named field or property, implicity convert it to the correct
9459 2004-04-27 Raja R Harinath <rharinath@novell.com>
9461 * statement.cs (Block.Block): Implicit blocks share
9462 'child_variable_names' fields with parent blocks.
9463 (Block.AddChildVariableNames): Remove.
9464 (Block.AddVariable): Mark variable as "used by a child block" in
9465 every surrounding block.
9466 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9467 been used in a child block, complain about violation of "Invariant
9468 meaning in blocks" rule.
9469 * cs-parser.jay (declare_local_variables): Don't use
9470 AddChildVariableNames.
9471 (foreach_statement): Don't create an implicit block: 'foreach'
9474 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9476 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9477 converting from 0L to ulong. Fixes 57522.
9479 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9481 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9482 derived class hides via 'new' keyword field from base class (test-242.cs).
9483 TODO: Handle this in the more general way.
9485 * class.cs (CheckBase): Ditto.
9487 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9489 * decl.cs (caching_flags): New member for storing cached values
9491 (MemberCore.Flags): New enum where bit flags for caching_flags
9493 (MemberCore.cls_compliance): Moved to caching_flags.
9494 (DeclSpace.Created): Moved to caching_flags.
9496 * class.cs: Use caching_flags instead of DeclSpace.Created
9498 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9500 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9501 if we are only a derived class, not a nested class.
9503 * typemanager.cs: Same as above, but do this at the MemberLookup
9504 level (used by field and methods, properties are handled in
9505 PropertyExpr). Allow for the qualified access if we are a nested
9508 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9510 * class.cs: Refactoring.
9511 (IMethodData): New inteface; Holds links to parent members
9512 to avoid member duplication (reduced memory allocation).
9513 (Method): Implemented IMethodData interface.
9514 (PropertyBase): New inner classes for get/set methods.
9515 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9516 (Event): New inner classes for add/remove methods.
9517 (Event.DelegateMethod): Implemented IMethodData interface.
9519 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9520 EmitContext (related to class.cs refactoring).
9522 2004-04-21 Raja R Harinath <rharinath@novell.com>
9524 * delegate.cs (Delegate.VerifyApplicability): If the number of
9525 arguments are the same as the number of parameters, first try to
9526 verify applicability ignoring any 'params' modifier on the last
9530 2004-04-16 Raja R Harinath <rharinath@novell.com>
9532 * class.cs (TypeContainer.AddIndexer): Use
9533 'ExplicitInterfaceName' to determine if interface name was
9534 explicitly specified. 'InterfaceType' is not initialized at this time.
9535 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9536 Indexers array is already in the required order. Initialize
9537 'IndexerName' only if there are normal indexers.
9538 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9539 (TypeContainer.Emit): Emit DefaultMember attribute only if
9540 IndexerName is initialized.
9543 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9545 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9548 2004-04-15 Raja R Harinath <rharinath@novell.com>
9550 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9554 * attribute.cs (Attribute.Resolve): Check for duplicate named
9558 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9560 * iterators.cs (MarkYield): track whether we are in an exception,
9561 and generate code accordingly. Use a temporary value to store the
9562 result for our state.
9564 I had ignored a bit the interaction of try/catch with iterators
9565 since their behavior was not entirely obvious, but now it is
9566 possible to verify that our behavior is the same as MS .NET 2.0
9570 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9572 * iterators.cs: Avoid creating temporaries if there is no work to
9575 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9576 Enumerations, use TypeManager.EnumToUnderlying and call
9579 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9582 (This.Emit): Use EmitContext.EmitThis to emit our
9585 (This.EmitAssign): Ditto.
9587 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9588 codepaths, we will move all the functionality into
9591 (FieldExpr.EmitAssign): Ditto.
9593 This fixes several hidden bugs that I uncovered while doing a code
9594 review of this today.
9596 * codegen.cs (EmitThis): reworked so the semantics are more clear
9597 and also support value types "this" instances.
9599 * iterators.cs: Changed so that for iterators in value types, we
9600 do not pass the value type as a parameter.
9602 Initialization of the enumerator helpers is now done in the caller
9603 instead of passing the parameters to the constructors and having
9604 the constructor set the fields.
9606 The fields have now `assembly' visibility instead of private.
9608 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9610 * expression.cs (Argument.Resolve): Check if fields passed as ref
9611 or out are contained in a MarshalByRefObject.
9613 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9614 another compiler type.
9616 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9618 * class.cs (Indexer.Define): use the new name checking method.
9619 Also, return false on an error.
9620 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9621 (is_identifier_[start/part]_character): make static.
9623 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9625 * expression.cs (Binary.ResolveOperator): Do no append strings
9626 twice: since we can be invoked more than once (array evaluation)
9627 on the same concatenation, take care of this here. Based on a fix
9628 from Ben (bug #56454)
9630 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9632 * codegen.cs: Fix another case where CS1548 must be reported (when
9633 delay-sign isn't specified and no private is available #56564). Fix
9634 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9635 error when MCS is used on the MS runtime and we need to delay-sign
9636 (which seems unsupported by AssemblyBuilder - see #56621).
9638 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9640 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9641 (TypeManager.ComputeNamespaces): Faster implementation for
9644 * compiler.csproj: Updated AssemblyName to mcs.
9646 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9648 * rootcontext.cs: Add new types to the boot resolution.
9650 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9651 MulticastDelegate is not allowed.
9653 * typemanager.cs: Add new types to lookup: System.TypedReference
9656 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9657 check for TypedReference or ArgIterator, they are not allowed.
9659 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9660 makes us properly catch 1510 in some conditions (see bug 56016 for
9663 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9665 * CryptoConvert.cs: update from corlib version
9668 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9670 * class.cs (Indexer.Define): Check indexername declaration
9672 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9674 * attribute.cs (IsClsCompliant): Fixed problem with handling
9675 all three states (compliant, not-compliant, undetected).
9677 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9679 * attribute.cs (Attribute): Location is now public.
9680 (Resolve): Store resolved arguments (pos_values) in attribute class.
9681 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9682 (GetClsCompliantAttributeValue): New method that gets
9683 CLSCompliantAttribute value.
9684 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9685 if exists else null.
9686 (AttributeTester): New class for CLS-Compliant verification routines.
9688 * class.cs (Emit): Add CLS-Compliant verification.
9689 (Method.GetSignatureForError): Implemented.
9690 (Constructor.GetSignatureForError): Implemented
9691 (Constructor.HasCompliantArgs): Returns if constructor has
9692 CLS-Compliant arguments.
9693 (Constructor.Emit): Override.
9694 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9695 is needed to test only parameters.
9696 (FieldBase.GetSignatureForError): Implemented.
9697 (TypeContainer): New member for storing base interfaces.
9698 (TypeContainer.FindMembers): Search in base interfaces too.
9700 * codegen.cs (GetClsComplianceAttribute): New method that gets
9701 assembly or module CLSCompliantAttribute value.
9702 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9704 (ModuleClass.Emit): Add error 3012 test.
9706 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9708 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9709 state for all decl types.
9710 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9711 if CLS-Compliant tests are required.
9712 (IsClsCompliaceRequired): New method. Analyze whether code
9713 must be CLS-Compliant.
9714 (IsExposedFromAssembly): New method. Returns true when MemberCore
9715 is exposed from assembly.
9716 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9717 value or gets cached value.
9718 (HasClsCompliantAttribute): New method. Returns true if MemberCore
9719 is explicitly marked with CLSCompliantAttribute.
9720 (IsIdentifierClsCompliant): New abstract method. This method is
9721 used to testing error 3005.
9722 (IsIdentifierAndParamClsCompliant): New method. Common helper method
9723 for identifier and parameters CLS-Compliant testing.
9724 (VerifyClsCompliance): New method. The main virtual method for
9725 CLS-Compliant verifications.
9726 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9727 null. I don't know why is null (too many public members !).
9728 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9729 and get value of first CLSCompliantAttribute that found.
9731 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9732 (VerifyClsCompliance): Override and add extra tests.
9734 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9735 clscheck- disable CLS-Compliant verification event if assembly is has
9736 CLSCompliantAttribute(true).
9738 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9739 ApllyAttribute is now called in emit section as in the other cases.
9740 Possible future Emit integration.
9741 (IsIdentifierClsCompliant): New override.
9742 (VerifyClsCompliance): New override.
9743 (GetEnumeratorName): Returns full enum name.
9745 * parameter.cs (GetSignatureForError): Implemented.
9747 * report.cs (WarningData): New struct for Warning message information.
9748 (LocationOfPreviousError): New method.
9749 (Warning): New method. Reports warning based on the warning table.
9750 (Error_T): New method. Reports error based on the error table.
9752 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9753 verifications are done here.
9755 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9757 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9758 CLSCompliantAttribute.
9759 (all_imported_types): New member holds all imported types from other
9761 (LoadAllImportedTypes): New method fills static table with exported types
9762 from all referenced assemblies.
9763 (Modules): New property returns all assembly modules.
9765 2004-03-30 Miguel de Icaza <miguel@ximian.com>
9767 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9768 throwing a parser error.
9770 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9771 which removes the hardcoded get_/set_ prefixes for properties, as
9772 IL allows for the properties to be named something else.
9776 * expression.cs: Do not override operand before we know if it is
9779 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9781 * typemanager.cs: support for pinned variables.
9783 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9785 * decl.cs, typemanager.cs: Avoid using an arraylist
9786 as a buffer if there is only one result set.
9788 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9790 * expression.cs: Make sure you cant call a static method
9791 with an instance expression, bug #56174.
9793 2004-03-29 Miguel de Icaza <miguel@ximian.com>
9795 * class.cs (IsDuplicateImplementation): Improve error reporting to
9796 flag 663 (method only differs in parameter modifier).
9798 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9799 in preprocessor directives.
9801 * location.cs (LookupFile): Allow for the empty path.
9803 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
9804 better approach for some of that patch, but its failing with the
9805 CharSet enumeration. For now try/catch will do.
9807 * typemanager.cs: Do not crash if a struct does not have fields.
9810 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9812 * expression.cs: cs0213, cant fix a fixed expression.
9815 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9817 * cs-parser.jay: detect invalid embeded statements gracefully.
9820 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9822 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9825 the invocation type may not be a subclass of the tye of the item/
9826 The type of the item must be a subclass of the invocation item.
9831 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
9833 * attribute.cs: Added methods to get a string and a bool from an
9834 attribute. Required to information from AssemblyKeyFileAttribute,
9835 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9836 * codegen.cs: Modified AssemblyName creation to include support for
9837 strongnames. Catch additional exceptions to report them as CS1548.
9838 * compiler.csproj: Updated include CryptoConvert.cs.
9839 * compiler.csproj.user: Removed file - user specific configuration.
9840 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
9841 Mono.Security assembly. The original class is maintained and tested in
9842 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9843 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9844 like CSC 8.0 (C# v2) supports.
9845 * Makefile: Added CryptoConvert.cs to mcs sources.
9846 * rootcontext.cs: Added new options for strongnames.
9848 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
9850 * driver.cs: For --expect-error, report error code `2'
9851 if the program compiled with no errors, error code `1' if
9852 it compiled with an error other than the one expected.
9854 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
9856 * compiler.csproj: Updated for Visual Studio .NET 2003.
9857 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9858 * compiler.sln: Updated for Visual Studio .NET 2003.
9860 2004-03-24 Ravi Pratap M <ravi@ximian.com>
9862 * expression.cs: Fix bug #47234. We basically need to apply the
9863 rule that we prefer the conversion of null to a reference type
9864 when faced with a conversion to 'object' (csc behaviour).
9866 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9868 * statement.cs: Shorter form for foreach, eliminates
9869 a local variable. r=Martin.
9871 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9873 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9874 checks if we can use brtrue/brfalse to test for 0.
9875 * expression.cs: use the above in the test for using brtrue/brfalse.
9878 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9880 * expression.cs: Rewrite string concat stuff. Benefits:
9882 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9883 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9884 rather than a concat chain.
9886 * typemanager.cs: Add lookups for more concat overloads.
9888 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9890 * expression.cs: Emit shorter il code for array init.
9907 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
9909 * statement.cs: Before, two switch blocks would be merged if the
9910 total size of the blocks (end_item - begin_item + 1) was less than
9911 two times the combined sizes of the blocks.
9913 Now, it will only merge if after the merge at least half of the
9918 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
9920 * class.cs : csc build fix for GetMethods(). See bug #52503.
9922 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
9924 * expression.cs: Make sure fp comparisons work with NaN.
9925 This fixes bug #54303. Mig approved this patch a long
9926 time ago, but we were not able to test b/c the runtime
9929 2004-03-19 Miguel de Icaza <miguel@ximian.com>
9931 * ecore.cs (TypExpr.GetHashCode): implement this overload.
9933 2004-03-19 Martin Baulig <martin@ximian.com>
9935 * class.cs (MemberCore.IsDuplicateImplementation): Report the
9936 error here and not in our caller.
9938 2004-03-19 Martin Baulig <martin@ximian.com>
9940 * interface.cs: Completely killed this file.
9941 (Interface): We're now a TypeContainer and live in class.cs.
9943 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9944 argument; we're now also called for interfaces.
9945 (TypeContainer.DefineMembers): Allow this method being called
9947 (TypeContainer.GetMethods): New public method; formerly known as
9948 Interface.GetMethod(). This is used by PendingImplementation.
9949 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9950 it's now private and non-static.
9951 (Interface): Moved this here; it's now implemented similar to
9953 (Method, Property, Event, Indexer): Added `bool is_interface'
9954 argument to their .ctor's.
9955 (MemberBase.IsInterface): New public field.
9957 * cs-parser.jay: Create normal Method, Property, Event, Indexer
9958 instances instead of InterfaceMethod, InterfaceProperty, etc.
9959 (opt_interface_base): Removed; we now use `opt_class_base' instead.
9960 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9962 2004-03-19 Martin Baulig <martin@ximian.com>
9964 * class.cs (MethodCore.IsDuplicateImplementation): New private
9965 method which does the CS0111 checking.
9966 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9967 Use IsDuplicateImplementation().
9969 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9971 * decl.cs (FindMemberToOverride): New method to find the correct
9972 method or property to override in the base class.
9974 - Make Method/Property use the above method to find the
9975 version in the base class.
9976 - Remove the InheritableMemberSignatureCompare as it is now
9979 This patch makes large code bases much faster to compile, as it is
9980 O(n) rather than O(n^2) to do this validation.
9982 Also, it fixes bug 52458 which is that nested classes are not
9983 taken into account when finding the base class member.
9985 Reviewed/Approved by Martin.
9987 2004-03-17 Marek Safar <marek.safar@seznam.cz>
9989 * interface.cs: In all interface classes removed redundant
9990 member initialization.
9992 2004-03-16 Martin Baulig <martin@ximian.com>
9994 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9996 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9998 * decl.cs (DefineTypeAndParents): New helper method to define a
9999 type's containers before the type itself is defined; This is a
10000 bug exposed by the recent changes to Windows.Forms when an
10001 implemented interface was defined inside a class that had not been
10004 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10006 (Check): Loop correctly to report errors modifiers
10007 (UNSAFE was not in the loop, since it was the same as TOP).
10009 * interface.cs: Every interface member now takes a ModFlags,
10010 instead of a "is_new" bool, which we set on the base MemberCore.
10012 Every place where we called "UnsafeOk" in the interface, now we
10013 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10014 the unsafe settings from the member declaration instead of the
10015 container interface.
10017 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10019 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10020 `set_indexer_name' to the pending bits (one per type).
10022 We fixed a bug today that was picking the wrong method to
10023 override, since for properties the existing InterfaceMethod code
10024 basically ignored the method name. Now we make sure that the
10025 method name is one of the valid indexer names.
10027 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10029 * support.cs (SeekableStreamReader): Keep track of stream byte
10030 positions and don't mix them with character offsets to the buffer.
10032 Patch from Gustavo Giráldez
10034 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10036 * interface.cs (InterfaceSetGetBase): Removed double member
10037 initialization, base class does it as well.
10039 2004-03-13 Martin Baulig <martin@ximian.com>
10041 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10042 when compiling corlib.
10044 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10046 * convert.cs (ExplicitConversion): We were reporting an error on
10047 certain conversions (object_type source to a value type, when the
10048 expression was `null') before we had a chance to pass it through
10049 the user defined conversions.
10051 * driver.cs: Replace / and \ in resource specifications to dots.
10054 * class.cs: Add check for duplicate operators. Fixes 52477
10056 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10058 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10059 that are in the middle of the statements, not only at the end.
10062 * class.cs (TypeContainer.AddField): No longer set the
10063 `HaveStaticConstructor' flag, now we call it
10064 `UserDefineStaticConstructor' to diferentiate the slightly
10065 semantic difference.
10067 The situation is that we were not adding BeforeFieldInit (from
10068 Modifiers.TypeAttr) to classes that could have it.
10069 BeforeFieldInit should be set to classes that have no static
10074 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10076 And most importantly Zoltan's comment:
10078 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10080 "I think beforefieldinit means 'it's ok to initialize the type sometime
10081 before its static fields are used', i.e. initialization does not need
10082 to be triggered by the first access to the type. Setting this flag
10083 helps the JIT to compile better code, since it can run the static
10084 constructor at JIT time, and does not need to generate code to call it
10085 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10086 this flag for lots of classes like String.
10088 csc sets this flag if the type does not have an explicit static
10089 constructor. The reasoning seems to be that if there are only static
10090 initalizers for a type, and no static constructor, then the programmer
10091 does not care when this initialization happens, so beforefieldinit
10094 This bug prevents the AOT compiler from being usable, since it
10095 generates so many calls to mono_runtime_class_init that the AOT code
10096 is much slower than the JITted code. The JITted code is faster,
10097 because it does not generate these calls if the vtable is type is
10098 already initialized, which is true in the majority of cases. But the
10099 AOT compiler can't do this."
10101 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10103 * class.cs (MethodData.Emit): Refactor the code so symbolic
10104 information is generated for destructors; For some reasons we
10105 were taking a code path that did not generate symbolic information
10108 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10110 * class.cs: Create a Constructor.CheckBase method that
10111 takes care of all validation type code. The method
10112 contains some code that was moved from Define.
10114 It also includes new code that checks for duplicate ctors.
10115 This fixes bug #55148.
10117 2004-03-09 Joshua Tauberer <tauberer@for.net>
10119 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10120 a { ... }-style array creation invokes EmitStaticInitializers
10121 which is not good for reference-type arrays. String, decimal
10122 and now null constants (NullCast) are not counted toward
10123 static initializers.
10125 2004-03-05 Martin Baulig <martin@ximian.com>
10127 * location.cs (SourceFile.HasLineDirective): New public field;
10128 specifies whether the file contains or is referenced by a "#line"
10130 (Location.DefineSymbolDocuments): Ignore source files which
10131 either contain or are referenced by a "#line" directive.
10133 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10135 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10136 direct access to our parent, so check the method inline there.
10138 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10140 * expression.cs (Invocation.EmitCall): Miguel's last commit
10141 caused a regression. If you had:
10146 In Foo the implict this would be null.
10148 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10150 * expression.cs (Invocation.EmitCall): If the method is not
10151 virtual, do not emit a CallVirt to it, use Call.
10153 * typemanager.cs (GetFullNameSignature): Improve the method to
10154 cope with ".ctor" and replace it with the type name.
10156 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10157 as an argument the ConstructorBuilder where it is being defined,
10158 to catch the recursive constructor invocations.
10160 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10162 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10163 routines to check if a type is an enumerable/enumerator allow
10164 classes that implement the IEnumerable or IEnumerator interfaces.
10166 * class.cs (Property, Operator): Implement IIteratorContainer, and
10167 implement SetYields.
10169 (Property.Define): Do the block swapping for get_methods in the
10170 context of iterators. We need to check if Properties also
10171 include indexers or not.
10173 (Operator): Assign the Block before invoking the
10174 OperatorMethod.Define, so we can trigger the Iterator code
10177 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10178 Property and Operator classes are not created when we parse the
10179 declarator but until we have the block completed, so we use a
10180 singleton SimpleIteratorContainer.Simple to flag whether the
10181 SetYields has been invoked.
10183 We propagate this setting then to the Property or the Operator to
10184 allow the `yield' to function.
10186 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10188 * codegen.cs: Implemented attribute support for modules.
10189 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10190 Assembly/Module functionality.
10192 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10193 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10194 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10196 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10198 * interface.cs (FindMembers): The operation is performed on all base
10199 interfaces and not only on the first. It is required for future CLS Compliance patch.
10201 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10203 * statement.cs, codegen.cs:
10204 This patch deals with patterns such as:
10206 public class List : IEnumerable {
10208 public MyEnumerator GetEnumerator () {
10209 return new MyEnumerator(this);
10212 IEnumerator IEnumerable.GetEnumerator () {
10216 public struct MyEnumerator : IEnumerator {
10221 Before, there were a few things we did wrong:
10222 1) we would emit callvirt on a struct, which is illegal
10223 2) we emited ldarg when we needed to emit ldarga
10224 3) we would mistakenly call the interface methods on an enumerator
10225 type that derived from IEnumerator and was in another assembly. For example:
10227 public class MyEnumerator : IEnumerator
10229 Would have the interface methods called, even if there were public impls of the
10230 method. In a struct, this lead to invalid IL code.
10232 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10234 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10237 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10239 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10241 * cs-parser.jay: Fix small regression: we were not testing V2
10242 compiler features correctly.
10244 * interface.cs: If the emit context is null, then create one
10246 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10248 * decl.cs (GetSignatureForError): New virtual method to get full name
10249 for error messages.
10251 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10252 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10254 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10255 Duplicated members and code in these classes has been removed.
10256 Better encapsulation in these classes.
10258 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10260 * assign.cs (Assign.DoResolve): When dealing with compound
10261 assignments, there is a new rule in ECMA C# 2.4 (might have been
10262 there before, but it is documented here) that states that in:
10266 If b is of type int, and the `op' is a shift-operator, then the
10267 above is evaluated as:
10271 * expression.cs (Binary.ResolveOperator): Instead of testing for
10272 int/uint/long/ulong, try to implicitly convert to any of those
10273 types and use that in pointer arithmetic.
10275 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10276 method to print information for from the type, not from the
10277 null-method we were given.
10279 2004-02-01 Duncan Mak <duncan@ximian.com>
10281 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10282 parsing for cmd, fixes bug #53694.
10284 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10286 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10287 in the member name duplication tests. Property and operator name duplication
10288 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10290 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10292 * interface.cs (PopulateMethod): Fixed crash when interface method
10293 returns not existing type (error test cs0246-3.cs).
10295 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10297 * cs-parser.jay (interface_accessors): Re-write actions to also
10298 store attributes attached to get and set methods. Fix spelling
10301 (inteface_property_declaration): Modify accordingly.
10303 (InterfaceAccessorInfo): New helper class to store information to pass
10304 around between rules that use interface_accessors.
10306 * interface.cs (Emit): Apply attributes on the get and set
10307 accessors of properties and indexers too.
10309 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10310 right MethodBuilder when applying attributes to the get and set accessors.
10312 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10314 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10316 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10318 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10320 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10322 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10323 changes that treat `yield' specially when present before `break'
10324 or `return' tokens.
10326 * cs-tokenizer.cs: yield is no longer a keyword.
10328 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10330 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10331 setting for default constructors.
10332 For default constructors are almost every time set wrong Modifier. The
10333 generated IL code has been alright. But inside mcs this values was
10334 wrong and this was reason why several of my CLS Compliance tests
10337 2004-01-22 Martin Baulig <martin@ximian.com>
10339 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10340 not a QualifiedIdentifier. This is what `type_name_expression'
10341 was previously doing.
10342 (type_name_expression): Removed; the code is now in
10343 `namespace_or_type_name'.
10344 (qualified_identifier): Removed, use `namespace_or_type_name'
10346 (QualifiedIdentifier): Removed this class.
10348 2004-01-22 Martin Baulig <martin@ximian.com>
10350 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10351 not a string as alias name.
10353 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10355 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10356 #52730 bug, and instead compute correctly the need to use a
10357 temporary variable when requesting an address based on the
10358 static/instace modified of the field and the constructor.
10360 2004-01-21 Martin Baulig <martin@ximian.com>
10362 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10363 class and namespace before looking up aliases. Fixes #52517.
10365 2004-01-21 Martin Baulig <martin@ximian.com>
10367 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10368 assinged in a 'try'; fixes exception4.cs.
10370 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10371 * class.cs : Implemented parameter-less constructor for TypeContainer
10373 * decl.cs: Attributes are now stored here. New property OptAttributes
10375 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10377 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10379 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10381 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10382 (CSharpSignature): New method for indexer and property signature.
10384 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10386 * pending.cs (IsVirtualFilter): Faster implementation.
10388 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10390 * typemanager.cs: Avoid inclusion of same assembly more than once.
10392 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10394 * cs-parser.jay: Fixed problem where the last assembly attribute
10395 has been applied also to following declaration (class, struct, etc.)
10397 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10399 * class.cs: Added error CS0538, CS0539 reporting.
10400 Fixed crash on Microsoft runtime when field type is void.
10402 * cs-parser.jay: Added error CS0537 reporting.
10404 * pending.cs: Added error CS0535 reporting.
10405 Improved error report for errors CS0536, CS0534.
10407 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10409 Merge a few bits from the Anonymous Method MCS tree.
10411 * statement.cs (ToplevelBlock): New class for toplevel methods,
10412 will hold anonymous methods, lifted variables.
10414 * cs-parser.jay: Create toplevel blocks for delegates and for
10415 regular blocks of code.
10417 2004-01-20 Martin Baulig <martin@ximian.com>
10419 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10420 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10421 and `NeedExplicitReturn'; added `IsLastStatement'.
10422 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10423 have a `ReturnLabel' or we're not unreachable.
10425 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10426 child's reachability; don't just override ours with it. Fixes
10427 #58058 (lluis's example).
10428 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10429 InFinally(), InLoop(), InSwitch() and
10430 BreakCrossesTryCatchBoundary() methods.
10432 * statement.cs (Return): Do all error checking in Resolve().
10433 Unless we are the last statement in a top-level block, always
10434 create a return label and jump to it.
10435 (Break, Continue): Do all error checking in Resolve(); also make
10436 sure we aren't leaving a `finally'.
10437 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10438 statement in a top-level block.
10439 (Block.Flags): Added `IsDestructor'.
10440 (Block.IsDestructor): New public property.
10442 2004-01-20 Martin Baulig <martin@ximian.com>
10444 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10446 2004-01-20 Martin Baulig <martin@ximian.com>
10448 * statement.cs (Statement.ResolveUnreachable): New public method.
10449 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10450 (Block.Resolve): Resolve unreachable statements.
10452 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10454 * expression.cs: We need to fix the case where we do
10455 not have a temp variable here.
10457 * assign.cs: Only expression compound assignments need
10458 temporary variables.
10460 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10462 * flowanalysis.cs: Reduce memory allocation in a few ways:
10463 - A block with no variables should not allocate a bit
10465 - A method with no out parameters does not need any tracking
10466 for assignment of the parameters, so we need not allocate
10469 public readonly Type[] VariableTypes;
10470 public readonly string[] VariableNames;
10471 Are redundant. The data is already stored in the variable
10472 map, so we need not allocate another array for it.
10473 - We need to add alot of checks for if (params | locals) == null
10474 due to the first two changes.
10476 2004-01-18 Miguel de Icaza <miguel@ximian.com>
10478 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10479 implement IMemoryLocation, we store a copy on a local variable and
10480 take the address of it. Patch from Benjamin Jemlich
10482 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10483 to use a special "type_name_expression" rule which reduces the
10484 number of "QualifiedIdentifier" classes created, and instead
10485 directly creates MemberAccess expressions.
10487 2004-01-17 Miguel de Icaza <miguel@ximian.com>
10489 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10490 that fixes #52853. Null literal assignment to ValueType
10492 * class.cs (MethodData.Emit): Instead of checking the name of the
10493 method to determine if its a destructor, create a new derived
10494 class from Method called Destructor, and test for that.
10496 * cs-parser.jay: Create a Destructor object instead of a Method.
10498 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10502 2004-01-16 Miguel de Icaza <miguel@ximian.com>
10504 * expression.cs (Binary.ResolveOperator): Perform an implicit
10505 conversion from MethodGroups to their delegate types on the
10506 Addition operation.
10508 * delegate.cs: Introduce a new class DelegateCreation that is the
10509 base class for `NewDelegate' and `ImplicitDelegateCreation',
10510 factor some code in here.
10512 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10513 conversion from MethodGroups to compatible delegate types.
10515 * ecore.cs (Expression.Resolve): Do not flag error 654
10516 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10517 we allow conversions from MethodGroups to delegate types now.
10519 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10520 assignments in v2 either.
10522 2004-01-10 Miguel de Icaza <miguel@ximian.com>
10524 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10525 static read-only fields in ctors.
10527 Applied patch from Benjamin Jemlich
10529 * expression.cs (UnaryMutator): Avoid leaking local variables.
10531 2004-01-09 Miguel de Icaza <miguel@ximian.com>
10533 * cs-tokenizer.cs (IsCastToken): Allow the various native types
10534 here to return true, as they can be used like this:
10536 (XXX) int.MEMBER ()
10538 Fixed 49836 and all the other dups
10540 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
10542 * driver.cs: Implement /win32res and /win32icon.
10544 2004-01-08 Miguel de Icaza <miguel@ximian.com>
10546 * cs-parser.jay: Add a rule to improve error handling for the
10547 common mistake of placing modifiers after the type.
10549 2004-01-07 Miguel de Icaza <miguel@ximian.com>
10551 * cs-parser.jay (interface_event_declaration): Catch
10552 initialization of events on interfaces, and report cs0068
10554 * cs-parser.jay (interface_event_declaration): Catch
10555 initialization of events.
10557 * ecore.cs: Better report missing constructors.
10559 * expression.cs (Binary.ResolveOperator): My previous bug fix had
10560 the error reporting done in the wrong place. Fix.
10562 * expression.cs (Binary.ResolveOperator): Catch the
10563 operator + (E x, E y) error earlier, and later allow for implicit
10564 conversions in operator +/- (E e, U x) from U to the underlying
10567 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10568 52596, if the container class is abstract, the default constructor
10569 is protected otherwise its public (before, we were always public).
10571 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10574 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10575 Jemlich that fixes bug #52597, MCS was generating invalid code for
10576 idisposable structs. Thanks to Ben for following up with this
10579 2004-01-06 Miguel de Icaza <miguel@ximian.com>
10581 * driver.cs: Allow assemblies without code to be generated, fixes
10584 2004-01-07 Nick Drochak <ndrochak@gol.com>
10586 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10588 2004-01-05 Miguel de Icaza <miguel@ximian.com>
10590 * cs-parser.jay: Add rules to improve error reporting if fields or
10591 methods are declared at the namespace level (error 116)
10593 * Add rules to catch event add/remove
10595 2004-01-04 David Sheldon <dave-mono@earth.li>
10597 * expression.cs: Added matching ")" to error message for
10600 2004-01-03 Todd Berman <tberman@gentoo.org>
10602 * ecore.cs, attribute.cs:
10603 Applying fix from #52429.
10605 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10607 * ecore.cs, expression.cs, statement.cs:
10608 Total rewrite of how we handle branching. We
10609 now handle complex boolean expressions with fewer
10610 jumps. As well if (x == 0) no longer emits a ceq.
10612 if (x is Foo) is much faster now, because we generate
10615 Overall, we get a pretty big improvement on our benchmark
10616 tests. The code we generate is smaller and more readable.
10618 I did a full two-stage bootstrap. The patch was reviewed
10619 by Martin and Miguel.
10621 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10623 * cs-parser.jay: Make primary_expression not take a QI.
10624 we dont need this because the member_access rule covers
10625 us here. So we replace the rule with just IDENTIFIER.
10627 This has two good effects. First, we remove a s/r conflict.
10628 Second, we allocate many fewer QualifiedIdentifier objects.
10630 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10632 * attribute.cs: Handle MarshalAs attributes as pseudo, and
10633 set the correct information via SRE. This prevents
10634 hanging on the MS runtime. Fixes #29374.
10636 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10638 * convert.cs: correctly handle conversions to value types
10639 from Enum and ValueType as unboxing conversions.
10641 Fixes bug #52569. Patch by Benjamin Jemlich.
10643 2004-01-02 Ravi Pratap <ravi@ximian.com>
10645 * expression.cs (BetterConversion): Prefer int -> uint
10646 over int -> ulong (csc's behaviour). This fixed bug #52046.
10648 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10650 * decl.cs (MemberCache.FindMembers): now returns a
10653 * typemanager.cs: In general, go with with ^^.
10654 (CopyNewMethods): take an IList.
10655 (RealMemberLookup): Only allocate an arraylist
10656 if we copy from two sets of methods.
10658 This change basically does two things:
10659 1) Fewer array lists allocated due to CopyNewMethods.
10660 2) the explicit cast in MemberList costed ALOT.
10662 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10664 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10665 a hashtable to avoid needless string allocations when an identifier is
10666 used more than once (the common case).
10668 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10670 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10671 is broken, it will not return anything. So, we
10672 have to use the information we have in mcs to
10675 * typemanager.cs: Add a cache for GetInterfaces,
10676 since this will now be used more often (due to ^^)
10678 (GetExplicitInterfaces) New method that gets the
10679 declared, not effective, interfaces on a type
10680 builder (eg, if you have interface IFoo, interface
10681 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10684 This patch makes MCS able to bootstrap itself on
10687 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10689 * expression.cs: Remove the Nop's that Miguel put
10692 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10694 * report.cs, codegen.cs: Give the real stack trace to
10695 the error when an exception is thrown.
10697 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10699 * decl.cs: only allocate hashtables for ifaces if
10702 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10704 * expression.cs: fix the error from cs0121-2.cs
10705 (a parent interface has two child interfaces that
10706 have a function with the same name and 0 params
10707 and the function is called through the parent).
10709 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10711 * class.cs, rootcontext.cs, typmanager.cs: do not
10714 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10716 * codegen.cs: remove stack for the ec flow branching.
10717 It is already a linked list, so no need.
10719 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10721 * Makefile: Allow custom profiler here.
10723 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10725 * typemanager.cs (LookupType):
10726 - Use a static char [], because split takes
10727 a param array for args, so it was allocating
10729 - Do not store true in a hashtable, it boxes.
10731 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10733 * flowanalysis.cs: bytify common enums.
10735 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10737 * modifiers.cs: Add a new set of flags for the
10738 flags allowed on explicit interface impls.
10739 * cs-parser.jay: catch the use of modifiers in
10740 interfaces correctly.
10741 * class.cs: catch private void IFoo.Blah ().
10743 All related to bug #50572.
10745 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10747 * decl.cs: Rewrite the consistant accessability checking.
10748 Accessability is not linear, it must be implemented in
10749 a tableish way. Fixes #49704.
10751 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10753 * expression.cs: Handle negation in a checked context.
10754 We must use subtraction from zero. Fixes #38674.
10756 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10758 * class.cs: Ignore static void main in DLLs.
10759 * rootcontext.cs: Handle the target type here,
10760 since we are have to access it from class.cs
10761 * driver.cs: account for the above.
10763 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10765 * report.cs: Give line numbers and files if available.
10767 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10769 * driver.cs: Implement /addmodule.
10771 * typemanager.cs: Change 'modules' field so it now contains Modules not
10774 2003-12-20 Martin Baulig <martin@ximian.com>
10776 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10777 (FieldBase.IsAssigned): Removed this field.
10778 (FieldBase.SetAssigned): New public method.
10779 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10781 2003-12-20 Martin Baulig <martin@ximian.com>
10783 * expression.cs (LocalVariableReference.DoResolve): Don't set
10784 `vi.Used' if we're called from DoResolveLValue().
10786 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10787 returns the usage vector it just merged into the current one -
10788 pass this one to UsageWarning().
10789 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10790 of the `EmitContext', don't call this recursively on our children.
10792 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
10794 * driver.cs: Implement /target:module.
10796 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10798 * support.cs (CharArrayHashtable): New helper class.
10800 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
10801 char arrays, not strings, so we can avoid creating a string in
10802 consume_identifier if the identifier is a keyword.
10804 2003-12-16 Martin Baulig <martin@ximian.com>
10806 * statement.cs (LocalInfo.Assigned): Removed this property.
10807 (LocalInfo.Flags): Removed `Assigned'.
10808 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10809 and uses flow analysis.
10810 (Block.UsageWarning): Made this method private.
10811 (Block.Resolve): Call UsageWarning() if appropriate.
10813 * expression.cs (LocalVariableReference.DoResolve): Always set
10814 LocalInfo.Used here.
10816 2003-12-13 Martin Baulig <martin@ximian.com>
10818 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10819 any value here; we're now using flow analysis to figure out
10820 whether a statement/block returns a value.
10822 2003-12-13 Martin Baulig <martin@ximian.com>
10824 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10826 (FlowBranching.MergeFinally): Don't call
10827 `branching.CheckOutParameters()' here, this is called in
10829 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10830 when adding the `finally' vector.
10832 2003-12-13 Martin Baulig <martin@ximian.com>
10835 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10836 actually work and also fix #48962.
10838 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10840 * decl.cs: Do not check System.Object for nested types,
10841 since we know it does not have any. Big bang for buck:
10844 Run 1: 8.35 seconds
10845 Run 2: 8.32 seconds
10846 corlib: 17.99 seconds
10848 Run 1: 8.17 seconds
10849 Run 2: 8.17 seconds
10850 corlib: 17.39 seconds
10852 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10854 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10855 time we are returning 0 members, so we save alot here.
10857 2003-12-11 Martin Baulig <martin@ximian.com>
10859 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10860 `MergeChild()', also just take the `FlowBranching' as argument;
10861 call Merge() on it and return the result.
10862 (FlowBranching.Merge): We don't need to do anything if we just
10865 2003-12-11 Martin Baulig <martin@ximian.com>
10867 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10868 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10869 Maurer for this idea.
10871 2003-12-11 Martin Baulig <martin@ximian.com>
10873 * flowanalysis.cs (MergeResult): This class is now gone; we now
10874 use the `UsageVector' for this. The reason for this is that if a
10875 branching just has one sibling, we don't need to "merge" them at
10876 all - that's the next step to do.
10877 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10880 2003-12-11 Martin Baulig <martin@ximian.com>
10882 Reworked flow analyis and made it more precise and bug-free. The
10883 most important change is that we're now using a special `Reachability'
10884 class instead of having "magic" meanings of `FlowReturns'. I'll
10885 do some more cleanups and optimizations and also add some more
10886 documentation this week.
10888 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10889 largely reworked this class.
10890 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10891 the new `Reachability' class instead of having "magic" values here.
10892 (FlowBranching): We're now using an instance of `Reachability'
10893 instead of having separate `Returns', `Breaks' etc. fields.
10895 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10896 based on flow analysis; ignore the return value of block.Emit ().
10898 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10900 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10901 if they are private.
10903 2003-12-09 Martin Baulig <martin@ximian.com>
10905 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10906 call them directly on the UsageVector.
10908 2003-12-09 Martin Baulig <martin@ximian.com>
10910 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10911 Changed return type from `FlowReturns' to `Reachability'.
10913 2003-12-09 Martin Baulig <martin@ximian.com>
10915 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10916 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10917 `Reachable' fields with a single `Reachability' one.
10919 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10921 * class.cs (FindMembers): Remove foreach's.
10926 Run 1: 8.74 seconds
10927 Run 2: 8.71 seconds
10930 Run 1: 8.64 seconds
10931 Run 2: 8.58 seconds
10934 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10939 This patch does a few things:
10940 1. EmptyStatement is now a singleton, so it is never reallocated.
10941 2. All blah is EmptyStatement constructs have been changed to
10942 blah == EmptyStatement.Value, which is much faster and valid
10943 now that EmptyStatement is a singleton.
10944 3. When resolving a block, rather than allocating a new array for
10945 the non-empty statements, empty statements are replaced with
10946 EmptyStatement.Value
10947 4. Some recursive functions have been made non-recursive.
10948 Mainly the performance impact is from (3), however (1) and (2) are needed for
10949 this to work. (4) does not make a big difference in normal situations, however
10950 it makes the profile look saner.
10955 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10956 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10957 Total memory allocated: 56397 KB
10960 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10961 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10962 Total memory allocated: 55666 KB
10964 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10966 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10967 than the hashtable in a hashtable version
10969 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10970 we always end up concating a string. This results in a huge perf
10971 loss, because many strings have to be tracked by the GC. In this
10972 patch, we first use a hashtable that works with two keys, so that
10973 the strings do not need to be concat'ed.
10977 Run 1: 8.74 seconds
10978 Run 2: 8.71 seconds
10981 Run 1: 8.65 seconds
10982 Run 2: 8.56 seconds
10984 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10986 * Makefile: Add a new target `do-time' that does a quick and simple
10987 profile, leaving easy to parse output.
10989 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10991 * codegen.cs (Init): Create the dynamic assembly with
10992 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10994 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10996 * support.cs: Make the PtrHashtable use only one
10997 instance of its comparer.
10999 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11001 * typemanager.cs: Fix lookup of GetNamespaces.
11003 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11005 * expression.cs: Removed redundant line.
11007 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11008 ArrayLists, use for loops with bounds.
11010 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11013 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11014 arraylists, use for loop with bounds.
11016 The above three changes give us a 0.071 second performance
11017 improvement out of 3.294 seconds down to 3.223. On my machine
11018 the above changes reduced the memory usage by 1,387 KB during
11019 compiler bootstrap.
11021 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11022 QualifiedIdentifiers. Before we created a new string through
11023 concatenation, and mostly later on, the result would be
11024 manipulated by DecomposeQI through string manipulation.
11026 This reduced the compiler memory usage for bootstrapping from
11027 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11028 compile times in 0.05 seconds.
11030 2003-11-28 Dick Porter <dick@ximian.com>
11032 * support.cs: Do string compares with the Invariant culture.
11040 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11041 the comparison is done with the Invariant culture.
11043 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11045 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11046 GetEnumerator method.
11048 (ProbeCollectionType): Iterate starting at the most specific type
11049 upwards looking for a GetEnumerator
11051 * expression.cs: Shift count can be up to 31 for int/uint and 63
11054 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11056 * statement.cs (Block.LookupLabel): Also look for the label on the
11057 children blocks. Use a hash table to keep track of visited
11060 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11061 we actually did transform the other operand, otherwise fall back
11062 to the common codepath that casts to long.
11064 * cs-tokenizer.cs: Use the same code pattern as the int case.
11065 Maybe I should do the parsing myself, and avoid depending on the
11066 Parse routines to get this done.
11068 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11070 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11071 which fixes bug 51347. This time test it.
11073 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11074 attributes for example can not tell the difference between these.
11075 The difference was only a syntax feature of the language.
11077 * attribute.cs: Apply attributes to delegates.
11079 * delegate.cs: Call the apply attributes method.
11081 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11083 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11084 comparing 0 vs Byte.MinValue, not the value
11086 (ImplicitConversionRequired): When reporting a conversion error,
11087 use error 31 to print out the constant error instead of the
11090 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11091 which fixes bug 51347.
11093 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11095 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11096 which fixes the -warnaserror command line option.
11098 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11100 * cfold.cs (DoNumericPromotions): During constant folding of
11101 additions on UIntConstant, special case intconstants with
11102 IntConstants like we do on the expression binary operator.
11104 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11106 * convert.cs (ImplicitReferenceConversion): We were missing a case
11107 (System.Enum are not value types or class types, so we need to
11108 classify them separatedly).
11110 * driver.cs: We do not support error 2007.
11112 2003-11-12 Jackson Harper <jackson@ximian.com>
11114 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11115 system directory. Also use the full file name so users can
11116 libraries names mscorlib-o-tron.dll in a non system dir.
11118 2003-11-10 Martin Baulig <martin@ximian.com>
11120 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11121 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11122 calling `ResolveType()' on them, directly assign their `Type'.
11124 2003-11-08 Martin Baulig <martin@ximian.com>
11126 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11127 return value and the `out parent' parameter.
11128 (TypeContainer.DefineType): Moved the CS0644 check into
11129 GetClassBases(). Don't pass the interface types to the
11130 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11131 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11133 * ecore.cs (TypeExpr.IsAttribute): New property.
11134 (TypeExpr.GetInterfaces): New method.
11136 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11137 TypeExpr instead of a Type.
11138 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11139 (Interface.DefineType): Don't pass the interface types to the
11140 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11141 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11143 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11144 instead of a `Type[]'.
11145 (TypeManager.RegisterBuilder): Likewise.
11146 (TypeManager.AddUserInterface): Likewise.
11147 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11148 `Type[]' and also return a `TypeExpr[]'.
11149 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11151 2003-11-08 Martin Baulig <martin@ximian.com>
11153 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11156 2003-11-08 Martin Baulig <martin@ximian.com>
11158 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11159 TypeManager.ResolveExpressionTypes().
11161 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11162 instead of an Expression.
11163 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11164 (TypeExpression): New public class; formerly known as `TypeExpr'.
11166 * expression.cs (ComposedCast): Derive from TypeExpr.
11168 * typemanager.cs (TypeManager.system_*_expr): These are now
11169 TypExpr's instead of Expression's.
11170 (TypeManager.ResolveExpressionTypes): New public static function;
11171 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11174 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11176 * expression.cs (New.DoResolve): Do not dereference value that
11177 might be a null return.
11179 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11180 sure that the constant value has the right type. Fixes an
11181 unreported bug, similar to 50425.
11183 * const.cs (Const.LookupConstantValue): Call
11184 ImplicitStandardConversionExists before doing a conversion to
11185 avoid havng the TypeManager.ChangeType do conversions.
11187 Reduced the number of casts used
11189 (Const.ChangeType): New routine to enable reuse of the constant
11190 type changing code from statement.
11192 * typemanager.cs (ChangeType): Move common initialization to
11193 static global variables.
11197 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11198 every value type to go through, even if it was void. Fix that.
11200 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11201 character of the define, and the is_identifier_part_character for
11202 the rest of the string.
11204 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11206 * expression.cs (UnaryMutator.EmitCode): When I updated
11207 LocalVariableReference.DoResolve, I overdid it, and dropped an
11208 optimization done on local variable references.
11210 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11212 * ecore.cs: Convert the return from Ldlen into an int.
11214 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11216 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11217 the accessibility, this is a special case for toplevel non-public
11218 classes (internal for instance).
11220 2003-10-20 Nick Drochak <ndrochak@gol.com>
11222 * ecore.cs: Fix typo and build. Needed another right paren.
11224 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11226 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11227 `internal' case regular and protected, but not allowing protected
11228 to be evaluated later. Bug 49840
11230 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11232 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11233 to kb.Nlast, and not the kb.nFirst to isolate the switch
11236 Extract the underlying type, so enumerations of long/ulong are
11237 treated like long/ulong.
11239 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11241 * expression.cs (New): Overload the meaning of RequestedType to
11242 track the possible creation of the NewDelegate type, since
11243 DoResolve is invoked more than once for new constructors on field
11246 See bugs: #48800 and #37014
11248 * cs-parser.jay (declare_local_constants): Take an arraylist
11249 instead of a single constant.
11251 (local_constant_declaration): It should take a
11252 constant_declarators, not a constant_declarator. Fixes 49487
11254 * convert.cs: Fix error report.
11256 2003-10-13 Jackson Harper <jackson@ximian.com>
11258 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11261 2003-10-09 Martin Baulig <martin@ximian.com>
11263 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11265 (MethodCore.DoDefineParameters): Removed the TypeContainer
11266 argument; use the DeclSpace which was passed to the .ctor instead.
11267 (MethodCore.CheckParameter): Take a DeclSpace instead of a
11268 TypeContainer; we only need a DeclSpace here.
11270 2003-10-09 Martin Baulig <martin@ximian.com>
11272 * class.cs (MethodData): Added additional `DeclSpace ds' argument
11274 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11275 EmitContext's .ctor.
11277 2003-10-09 Martin Baulig <martin@ximian.com>
11279 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11280 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11281 AsAccessible(), moved them as well.
11283 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11285 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11287 * cs-parser.jay : Renamed yyName to yyNames related to jay.
11289 2003-10-07 Miguel de Icaza <miguel@ximian.com>
11291 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11292 generation for >=, as spotted by Paolo, bug 48679.
11293 Patch from David Waite.
11295 * cs-tokenizer.cs: Add handling for #pragma.
11297 * cs-parser.jay: Allow for both yield and yield return in the
11298 syntax. The anti-cobolization of C# fight will go on!
11300 * class.cs (TypeBuilder.DefineType): Catch error condition here
11301 (Parent.DefineType erroring out and returning null).
11303 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11304 coping with enumerations variables, we were mistakenly processing
11305 them as a regular value type instead of built-in types. Fixes the
11308 * typemanager.cs (IsBuiltinOrEnum): New method.
11310 2003-09-30 Miguel de Icaza <miguel@ximian.com>
11312 * cs-parser.jay: Upgrade: yield now needs the return clause.
11314 2003-09-19 Martin Baulig <martin@ximian.com>
11316 * decl.cs (MemberCache.SetupCacheForInterface): Take a
11317 `MemberCache parent' argument. Normally, an interface doesn't
11318 have a parent type except System.Object, but we use this in gmcs
11319 for generic type parameters.
11321 2003-09-18 Martin Baulig <martin@ximian.com>
11323 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11324 on `type.IsInterface'; don't check whether the type has a parent
11325 to determine whether it's an interface.
11327 2003-09-15 Martin Baulig <martin@ximian.com>
11329 * class.cs (TypeContainer.DefineType): Added an error flag to
11330 avoid reporting duplicate CS0146's ("class definition is
11333 * driver.cs (Driver.MainDriver): Abort if
11334 RootContext.ResolveTree() reported any errors.
11336 2003-09-07 Martin Baulig <martin@ximian.com>
11338 * report.cs (Error, Warning): Added overloaded versions which take
11339 a `params object[] args' and call String.Format().
11341 2003-09-07 Martin Baulig <martin@ximian.com>
11343 * decl.cs (DeclSpace..ctor): Don't call
11344 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11345 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
11346 (DeclSpace.RecordDecl): New method.
11348 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11350 2003-09-02 Ravi Pratap <ravi@ximian.com>
11352 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11353 value attributes to be applied to ParameterBuilders.
11355 * class.cs (MethodCore.LabelParameters): Make static and more
11356 generic so that it can be used from other places - like interface
11357 methods, for instance.
11359 * interface.cs (Interface.Emit): Call LabelParameters before
11360 emitting attributes on the InterfaceMethod.
11362 2003-08-26 Martin Baulig <martin@ximian.com>
11364 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11365 resolving aliases; fixes #47927.
11367 2003-08-26 Martin Baulig <martin@ximian.com>
11369 * statement.cs (Using.DoResolve): This is internally emitting a
11370 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11371 do not always return. Fixes #47681.
11373 2003-08-26 Martin Baulig <martin@ximian.com>
11375 * decl.cs (MemberCore): Moved WarningNotHiding(),
11376 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11378 (AdditionResult): Make this nested in DeclSpace.
11379 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11380 argument; call NamespaceEntry.Define() unless we're nested in a
11383 * namespace.cs (Namespace.DefineName): New public function. This
11384 is called from DeclSpace's .ctor to add
11385 (Namespace.Lookup): Include DeclSpaces in the lookup.
11387 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11389 * const.cs (Const): Derive from MemberBase, not MemberCore.
11391 2003-08-25 Martin Baulig <martin@ximian.com>
11393 * convert.cs (Convert.ExplicitReferenceConversion): When
11394 converting from an interface type to a class, unbox if the target
11395 type is a struct type. Fixes #47822.
11397 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11399 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11402 2003-08-22 Martin Baulig <martin@ximian.com>
11404 * class.cs (TypeManager.DefineType): When defining a nested type,
11405 call DefineType() on our parent; fixes #47801.
11407 2003-08-22 Martin Baulig <martin@ximian.com>
11409 * class.cs (MethodData.Define): While checking if a method is an
11410 interface implementation, improve the test a bit more to fix #47654.
11412 2003-08-22 Martin Baulig <martin@ximian.com>
11414 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11415 correctly; fixes #47722.
11417 2003-08-22 Martin Baulig <martin@ximian.com>
11419 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11420 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11422 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11424 2003-08-22 Martin Baulig <martin@ximian.com>
11426 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11427 can only be assigned in static constructors. Fixes #47161.
11429 2003-08-22 Martin Baulig <martin@ximian.com>
11431 Rewrote and improved the flow analysis code.
11433 * flowbranching.cs (FlowBranching): Make this class abstract.
11434 (FlowBranching.CreateBranching): New static function to create a
11435 new flow branching.
11436 (FlowBranchingBlock, FlowBranchingException): New classes.
11437 (FlowBranching.UsageVector.Type): New public readonly field.
11438 (FlowBranching.UsageVector.Breaks): Removed the setter.
11439 (FlowBranching.UsageVector.Returns): Removed the setter.
11440 (FlowBranching.UsageVector): Added Break(), Return(),
11441 NeverReachable() and Throw() methods to modify the reachability.
11442 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11443 done by FlowBranching.Merge().
11444 (FlowBranching.UsageVector.MergeChild): New method; merges the
11445 merge result into the current vector.
11446 (FlowBranching.Merge): New abstract method to merge a branching.
11448 2003-08-12 Martin Baulig <martin@ximian.com>
11450 * expression.cs (Indirection.CacheTemporaries): Create the
11451 LocalTemporary with the pointer type, not its element type.
11453 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11455 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11456 token was a keyword or not.
11458 Add `error' options where an IDENTIFIER was expected; Provide
11459 CheckToken and CheckIdentifierToken convenience error reporting
11462 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11464 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11465 NameSpaceEntry NameSpaceEntry.
11467 (LookupInterfaceOrClass): Avoid creating a full qualified name
11468 from namespace and name: avoid doing lookups when we know the
11469 namespace is non-existant. Use new Tree.LookupByNamespace which
11470 looks up DeclSpaces based on their namespace, name pair.
11472 * driver.cs: Provide a new `parser verbose' to display the
11473 exception thrown during parsing. This is turned off by default
11474 now, so the output of a failure from mcs is more graceful.
11476 * namespace.cs: Track all the namespaces defined in a hashtable
11479 (IsNamespace): New method
11481 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11483 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11484 we know that we need to concatenate (full typename can never be
11489 * statement.cs: Use a bitfield; Do not initialize to null things
11490 which are done by the constructor by default.
11492 * cs-parser.jay: bug fix, parameter was 4, not 3.
11494 * expression.cs: Just use the property;
11496 * statement.cs: No need for GetVariableInfo method.
11498 2003-08-08 Martin Baulig <martin@ximian.com>
11500 * flowanalysis.cs (FlowReturns): This is now nested in the
11501 `FlowBranching' class.
11502 (MyBitVector): Moved this here from statement.cs.
11503 (FlowBranching.SiblingType): New enum type.
11504 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11506 2003-08-07 Martin Baulig <martin@ximian.com>
11508 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11509 `FlowBranching' class and called `BranchingType'.
11511 2003-08-07 Martin Baulig <martin@ximian.com>
11513 * flowanalysis.cs: Moved all the control flow analysis code into
11516 2003-08-07 Martin Baulig <martin@ximian.com>
11518 * assign.cs (Assign.DoResolve): `target' must either be an
11519 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11522 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11524 * expression.cs (BinaryMethod): This kind of expression is created by the
11525 Binary class if it determines that the operator has to be handled
11528 (BinaryDelegate): This kind of expression is created if we are
11529 dealing with a + or - operator on delegates.
11531 (Binary): remove method, argumetns, and DelegateOperator: when
11532 dealing with methods,
11534 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11536 * statement.cs (Block): use bitfields for the three extra booleans
11537 we had in use. Remove unused topblock parameter.
11539 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11541 * assign.cs: Drop extra unneeded tests.
11543 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11545 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11547 * statement.cs (Foreach): Use VariableStorage instead of
11550 * codegen.cs (VariableStorage): New class used by clients that
11551 require a variable stored: locals or fields for variables that
11552 need to live across yield.
11554 Maybe provide a convenience api for EmitThis+EmitLoad?
11556 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11559 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11561 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11562 RemapParameterLValue): New methods that are used to turn a
11563 precomputed FieldInfo into an expression like this:
11567 The idea is to use this instead of making LocalVariableReference
11568 have more than one meaning.
11570 * cs-parser.jay: Add error production to BASE.
11572 * ecore.cs: Deal with TypeManager.GetField returning null, which
11573 is now a valid return value.
11575 (FieldExprNoAddress): New expression for Fields whose address can
11578 * expression.cs (LocalVariableReference): During the resolve
11579 phases, create new expressions if we are in a remapping context.
11580 Remove code that dealt with remapping here.
11582 (ParameterReference): same.
11584 (ProxyInstance): New expression, like the `This' expression, but
11585 it is born fully resolved. We know what we are doing, so remove
11586 the errors that are targeted to user-provided uses of `this'.
11588 * statement.cs (Foreach): our variable is now stored as an
11589 Expression; During resolution, follow the protocol, dont just
11590 assume it will return this.
11592 2003-08-06 Martin Baulig <martin@ximian.com>
11594 * support.cs (SeekableStreamReader.cs): New public class.
11596 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11597 SeekableStreamReader instead of the normal StreamReader.
11599 2003-08-04 Martin Baulig <martin@ximian.com>
11601 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11602 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11603 deambiguate casts and delegate invocations.
11604 (parenthesized_expression): Use the new tokens to ensure this is
11605 not a cast of method invocation.
11607 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11608 when reading a `)' and Deambiguate_CloseParens () was previously
11611 * expression.cs (ParenthesizedExpression): New class. This is
11612 just used for the CS0075 test.
11613 (Binary.DoResolve): Check for CS0075.
11615 2003-07-29 Ravi Pratap <ravi@ximian.com>
11617 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11618 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11619 reference comparison.
11621 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11622 examine the ReturnType for equality - this is necessary in the
11623 cases of implicit and explicit operators whose signature also
11624 includes the return type.
11626 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11628 * namespace.cs: Cache the result of the namespace computation,
11629 instead of computing it every time.
11631 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11633 * decl.cs: Use a global arraylist that we reuse over invocations
11634 to avoid excesive memory consumption. Reduces memory usage on an
11635 mcs compile by one meg (45 average).
11637 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11638 private, work around that.
11640 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11642 * literal.cs (IntLiteral): Define Zero and One static literals.
11644 * cs-parser.jay (integer_literal): use static literals to reduce
11645 memory usage for the most used literals (0, 1 and -1). 211kb
11646 reduced in memory usage.
11648 Replace all calls to `new ArrayList' with `new
11649 ArrayList(4)' which is a good average number for most allocations,
11650 and also requires only 16 bytes of memory for its buffer by
11653 This reduced MCS memory usage in seven megabytes for the RSS after
11656 2003-07-28 Ravi Pratap <ravi@ximian.com>
11658 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11659 handle params methods the correct way by forming only one
11660 applicable set with params and normal methods in them. Earlier we
11661 were looking at params methods only if we found no normal methods
11662 which was not the correct thing to do.
11664 (Invocation.BetterFunction): Take separate arguments indicating
11665 when candidate and the best method are params methods in their
11668 This fixes bugs #43367 and #46199.
11670 * attribute.cs: Documentation updates.
11672 (CheckAttribute): Rename to CheckAttributeTarget.
11673 (GetValidPlaces): Rename to GetValidTargets.
11675 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11676 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11680 2003-07-28 Martin Baulig <martin@ximian.com>
11682 * class.cs (TypeContainer.DefineMembers): Use the base type's full
11683 name when looking up the base class of a nested class. Fixes #46977.
11685 2003-07-26 Martin Baulig <martin@ximian.com>
11687 * expression.cs (Indexers.Indexer): New nested struct; contains
11688 getter, setter and the indexer's type.
11689 (Indexers.Properties): This is now an ArrayList of
11690 Indexers.Indexer's.
11691 (IndexerAccess.DoResolveLValue): Correctly set the type if the
11692 indexer doesn't have any getters.
11694 * assign.cs (Assign.DoResolve): Also do the implicit conversions
11695 for embedded property and indexer assignments.
11697 2003-07-26 Martin Baulig <martin@ximian.com>
11699 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11700 preprocessor directive is not the first non-whitespace character
11703 2003-07-26 Martin Baulig <martin@ximian.com>
11705 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11706 namespace parsing, follow the spec more closely.
11708 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11709 NamespaceEntry.Lookup().
11711 2003-07-25 Martin Baulig <martin@ximian.com>
11713 * MethodCore.cs (OverridesSomething): New public field; it's set
11714 from TypeContainer.DefineMembers if this method overrides
11715 something (which doesn't need to be a method). Fix #39462.
11717 2003-07-25 Ravi Pratap <ravi@ximian.com>
11719 * typemanager.cs (GetMembers): Ensure that the list of members is
11720 reversed. This keeps things in sync.
11722 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11723 find an AttributeUsage attribute.
11725 * expression.cs (Invocation.OverloadResolve): Perform the check
11726 which disallows Invoke to be directly called on a Delegate.
11728 (Error_InvokeOnDelegate): Report error cs1533.
11730 2003-07-25 Martin Baulig <martin@ximian.com>
11732 * expression.cs (Indexers.GetIndexersForType): Only look in the
11733 interface hierarchy if the requested type is already an
11734 interface. Fixes #46788 while keeping #46502 fixed.
11736 2003-07-25 Martin Baulig <martin@ximian.com>
11738 * class.cs (TypeContainer.DefineMembers): Check whether all
11739 readonly fields have been assigned and report warning CS0649 if
11742 * statement.cs (LocalInfo.IsFixed): Always return true if this is
11745 2003-07-24 Ravi Pratap <ravi@ximian.com>
11747 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11748 returned from GetMethods to make things consistent with the
11749 assumptions MCS makes about ordering of methods.
11751 This should comprehensively fix bug #45127 and it does :-)
11753 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11754 ordering is actually reverse.
11756 * Clean up some debug messages I left lying around.
11758 * interface.cs (Populate*): Get rid of code which emits attributes
11759 since the stage in which we emit attributes is the 'Emit' stage,
11760 not the define stage.
11762 (Emit): Move attribute emission for interface members here.
11764 2003-07-22 Ravi Pratap <ravi@ximian.com>
11766 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11767 closely: we eliminate methods in base types when we have an
11768 applicable method in a top-level type.
11770 Please see section 14.5.5.1 for an exact description of what goes
11773 This fixes bug #45127 and a host of other related to corlib compilation.
11775 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11776 array is the method corresponding to the top-level type (this is
11777 because of the changes made to icall.c) so we change this
11780 (MethodGroupExpr.Name): This too.
11782 * typemanager.cs (GetElementType): New method which does the right
11783 thing when compiling corlib.
11785 * everywhere: Make use of the above in the relevant places.
11787 2003-07-22 Martin Baulig <martin@ximian.com>
11789 * cs-parser.jay (invocation_expression): Moved
11790 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11791 `cast_expression', but create a InvocationOrCast which later
11792 resolves to either an Invocation or a Cast.
11794 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11795 method; call this before EmitStatement() to make sure that this
11796 expression can be used as a statement.
11798 * expression.cs (InvocationOrCast): New class; resolves to either
11799 an Invocation or a Cast.
11801 * statement.cs (StatementExpression): Call ResolveStatement() on
11802 the ExpressionStatement before emitting it.
11804 2003-07-21 Martin Baulig <martin@ximian.com>
11806 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11807 `ref' and `out' attributes match; fixes #46220.
11808 (MemberAccess.ResolveMemberAccess): You can't reference a type
11809 through an expression; fixes #33180.
11810 (Indexers.GetIndexersForType): Don't return the indexers from
11811 interfaces the class implements; fixes #46502.
11813 2003-07-21 Martin Baulig <martin@ximian.com>
11815 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11816 CS0661 checks; fixes bug #30442.
11818 2003-07-21 Martin Baulig <martin@ximian.com>
11820 * decl.cs (AdditionResult): Added `Error'.
11822 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11824 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11825 makes cs0031.cs actually work.
11827 2003-07-20 Martin Baulig <martin@ximian.com>
11829 * namespace.cs: Fixed that bug which caused a crash when compiling
11830 the debugger's GUI.
11832 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11834 * typemanager.cs (LookupTypeReflection): Never expose types which
11835 are NotPublic, NestedPrivate, NestedAssembly, or
11836 NestedFamANDAssem. We used to return these, and later do a check
11837 that would report a meaningful error, but the problem is that we
11838 would not get the real match, if there was a name override.
11840 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11842 * namespace.cs (Namespace, Name): Do not compute the namespace
11843 name dynamically, compute it in the constructor. This reduced
11844 memory usage by 1697 KB.
11846 * driver.cs: Use --pause to pause at the end.
11848 2003-07-17 Peter Williams <peter@newton.cx>
11850 * Makefile: Change the name of the test target so that it doesn't
11851 conflict with the recursive test target.
11853 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11855 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11856 AddressOf): Do not use EmitThis, that was wrong, use the actual
11859 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11861 * class.cs (MethodData.Define): While checking if a method is an
11862 interface implementation, improve the test: If we are not public
11863 (use new test here: use the computed MethodAttributes directly,
11864 instead of the parsed modifier flags) check if the `implementing'
11865 method comes from an interface or not.
11867 * pending.cs (VerifyPendingMethods): Slightly better error
11870 * makefile: add test target that does the mcs bootstrap.
11872 2003-07-16 Ravi Pratap <ravi@ximian.com>
11874 * interface.cs (Define): Do nothing here since there are no
11875 members to populate etc. Move the attribute emission out of here
11876 since this was just totally the wrong place to put it. Attribute
11877 application happens during the 'Emit' phase, not in the 'Define'
11880 (Emit): Add this method and move the attribute emission here
11882 * rootcontext.cs (EmitCode): Call the Emit method on interface
11885 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11887 * expression.cs (OverloadResolve): Report error only if Location
11888 is not 'Null' which means that there was a probe going on.
11890 2003-07-14 Martin Baulig <martin@ximian.com>
11892 * expression.cs (ConditionalLogicalOperator): New public class to
11893 implement user defined conditional logical operators.
11894 This is section 14.11.2 in the spec and bug #40505.
11896 2003-07-14 Martin Baulig <martin@ximian.com>
11898 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11900 2003-07-14 Martin Baulig <martin@ximian.com>
11902 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11904 * ecore.cs (IVariable.VerifyFixed): New interface method.
11906 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11907 operator, check whether the variable is actually fixed. Fixes bug
11908 #36055. Set a variable definitely assigned when taking its
11909 address as required by the spec.
11911 * statement.cs (LocalInfo.IsFixed): New field.
11912 (LocalInfo.MakePinned): Set `IsFixed' to true.
11914 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11916 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11917 for .ctors, ensure that we only ask for members declared in the
11918 attribute type (BindingFlags.DeclaredOnly).
11922 * expression.cs (Error_WrongNumArguments): Report error 1501
11923 correctly the way CSC does.
11925 2003-07-13 Martin Baulig <martin@ximian.com>
11927 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11928 lookup on the fully qualified name, to make things like "X.X" work
11929 where "X.X" is a fully qualified type name, but we also have a
11930 namespace "X" in the using list. Fixes #41975.
11932 2003-07-13 Martin Baulig <martin@ximian.com>
11934 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11935 function. If we're a CompoundAssign, we need to create an embedded
11936 CompoundAssign, not an embedded Assign.
11937 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11940 2003-07-13 Martin Baulig <martin@ximian.com>
11942 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11943 work to fix bug #46088.
11945 2003-07-13 Ravi Pratap <ravi@ximian.com>
11947 * class.cs (Operator.Emit): Do not emit attributes here - it is
11948 taken care of by the Method class that we delegate too. This takes
11949 care of bug #45876.
11951 2003-07-10 Martin Baulig <martin@ximian.com>
11953 * expression.cs (TypeOfVoid): New class.
11954 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11956 2003-07-10 Martin Baulig <martin@ximian.com>
11958 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11961 2003-07-10 Martin Baulig <martin@ximian.com>
11963 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11964 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11966 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11968 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11970 2003-07-10 Martin Baulig <martin@ximian.com>
11972 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11973 of decimal. Fixes #42850.
11975 NOTE: I also fixed the created byte blob, but this doesn't work on
11976 the MS runtime and csc never produces any byte blobs for decimal
11979 2003-07-10 Martin Baulig <martin@ximian.com>
11981 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11982 structs; fixes #32068.
11983 (Block.AddChildVariableNames): Fixed #44302.
11985 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11987 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11989 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11991 * attribute.cs: And this test is onger needed.
11993 2003-07-08 Martin Baulig <martin@ximian.com>
11995 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11996 inaccessible types. Fixes #36313.
11998 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12000 * namespace.cs (NamespaceEntry): Create implicit entries for all
12001 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12002 implicit entries for N1.N2 and N1.
12004 2003-07-08 Martin Baulig <martin@ximian.com>
12006 Rewrote the handling of namespaces to fix a lot of the issues
12007 wrt. `using' aliases etc.
12009 * namespace.cs (Namespace): Splitted this class into a
12010 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12012 * typemanager.cs (TypeManager.IsNamespace): Removed.
12013 (TypeManager.ComputeNamespaces): Only compute namespaces from
12014 loaded assemblies here, not the namespaces from the assembly we're
12015 currently compiling.
12017 2003-07-08 Martin Baulig <martin@ximian.com>
12019 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12021 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12023 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12026 I thought about the memory savings here, but LookupTypeReflection
12027 is used under already very constrained scenarios. Compiling
12028 corlib or mcs only exposes one hit, so it would not really reduce
12029 any memory consumption.
12031 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12033 * typemanager.cs: fixes bug #45889 by only adding public types from
12034 other assemblies to the list of known types.
12036 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12038 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12039 on the type we resolved.
12041 2003-07-05 Martin Baulig <martin@ximian.com>
12043 * pending.cs (PendingImplementation.ParentImplements): Don't
12044 create the proxy if the parent is abstract.
12046 * class.cs (TypeContainer.DefineIndexers): Process explicit
12047 interface implementations first. Fixes #37714.
12049 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12051 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12052 defined recursively; but since we modify the input parameters
12053 (left is set to `this' temporarily), we reset this value if the
12054 left_is_explicit is false, which gives the original semantics to
12057 * literal.cs (NullPointer): new class used to represent a null
12058 literal in a pointer context.
12060 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12061 type is a pointer, use a NullPointer object instead of a
12062 NullLiteral. Closes 43687
12064 (ExplicitConversion): Convert pointer values using
12065 the conv opcode to the proper type.
12067 * ecore.cs (New): change ValueTypeVariable property into a method,
12068 that returns whether the valuetype is suitable for being used.
12070 * expression.cs (Binary.DoNumericPromotions): Only return if we
12071 the int constant was a valid uint, and we can return both left and
12072 right as uints. If not, we continue processing, to trigger the
12073 type conversion. This fixes 39018.
12075 * statement.cs (Block.EmitMeta): During constant resolution, set
12076 the CurrentBlock property on the emitcontext, so that we resolve
12077 constants propertly.
12079 2003-07-02 Martin Baulig <martin@ximian.com>
12081 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12082 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12084 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12085 than emitting it here.
12087 * statement.cs: Fixed some more flow analysis bugs.
12089 2003-07-02 Martin Baulig <martin@ximian.com>
12091 * class.cs (MethodData.Define): When implementing interface
12092 methods, set Final unless we're Virtual.
12094 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12095 check work for interface methods.
12097 2003-07-01 Martin Baulig <martin@ximian.com>
12099 * ecore.cs (EmitContext.This): Replaced this property with a
12100 GetThis() method which takes a Location argument. This ensures
12101 that we get the correct error location for a CS0188.
12103 2003-07-01 Miguel de Icaza <miguel@ximian.com>
12105 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12106 ImplicitStandardConversion.
12108 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12110 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
12112 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12115 2003-06-30 Miguel de Icaza <miguel@ximian.com>
12117 * class.cs (Constructor.Define): Turn off initlocals for unsafe
12120 (MethodData.Define): Turn off initlocals for unsafe methods.
12122 2003-06-29 Miguel de Icaza <miguel@ximian.com>
12124 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12125 complete; Fixes #37521.
12127 * delegate.cs: Use Modifiers.TypeAttr to compute the
12128 TypeAttributes, instead of rolling our own. This makes the flags
12129 correct for the delegates.
12131 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12133 * class.cs (Constructor.Define): Set the private flag for static
12134 constructors as well.
12136 * cs-parser.jay (statement_expression): Set the return value to
12137 null, to avoid a crash when we catch an error.
12139 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12141 * cs-parser.jay: Applied patch from Jackson that adds support for
12142 extern and unsafe modifiers to destructor declarations.
12144 * expression.cs: Report error 21 if the user is trying to index a
12147 * driver.cs: Add an error message, suggested by the bug report.
12149 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12150 if we do not have a ": this ()" constructor initializer. Fixes 45149
12152 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12154 * namespace.cs: Add some information to reduce FAQs.
12156 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12158 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12159 underlying enumeration types. Fixes #43915.
12161 * expression.cs: Treat ushort/short as legal values to be used in
12162 bitwise operations.
12164 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12166 * delegate.cs: transfer custom attributes for paramenters from
12167 the delegate declaration to Invoke and BeginInvoke.
12169 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12171 * attribute.cs: handle custom marshalers and emit marshal info
12174 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12176 * makefile.gnu: Added anonymous.cs to the compiler sources.
12178 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12180 * iterators.cs: Change the name of the proxy class to include two
12183 * cs-parser.jay: Update grammar to include anonymous methods.
12185 * anonymous.cs: new file.
12187 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12189 * class.cs (Field.Define): Add missing test for pointers and
12192 2003-05-27 Ravi Pratap <ravi@ximian.com>
12194 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12195 we use the stobj opcode.
12197 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12198 since it wasn't the correct fix.
12200 It still is puzzling that we are required to use stobj for IntPtr
12201 which seems to be a ValueType.
12203 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12205 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12206 during regular simple name resolution. Now, the trick is that
12207 instead of returning for processing the simplename, we do a
12208 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12209 contextual lookup type). If a match is found, return that, if
12210 not, return for further composition.
12212 This fixes long-standing 30485.
12214 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12215 using the address to initialize an object, do an Stobj instead of
12216 using the regular Stelem.
12218 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12219 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12220 Because if we are a BaseIndexerAccess that value will be true.
12223 * statement.cs (GotoCase.Resolve): Return after reporting an
12224 error, do not attempt to continue.
12226 * expression.cs (PointerArithmetic.Emit): If our operand is a
12227 long, convert our constants to match the operand before
12228 multiplying. Convert to I type before adding. Fixes 43670.
12230 2003-05-14 Ravi Pratap <ravi@ximian.com>
12232 * enum.cs (ImplicitConversionExists) : Rename to
12233 ImplicitEnumConversionExists to remove ambiguity.
12235 * ecore.cs (NullCast): New type of cast expression class which
12236 basically is very similar to EmptyCast with the difference being
12237 it still is a constant since it is used only to cast a null to
12239 (eg. (string) null)
12241 * convert.cs (ImplicitReferenceConversion): When casting a null
12242 literal, we return a NullCast.
12244 * literal.cs (NullLiteralTyped): Remove - I don't see why this
12245 should be around anymore.
12247 The renaming (reported was slightly wrong). Corrections:
12249 ConvertImplicitStandard -> ImplicitConversionStandard
12250 ConvertExplicitStandard -> ExplicitConversionStandard
12252 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12253 before passing them in !
12255 * convert.cs (ImplicitConversionStandard): When comparing for
12256 equal expr and target types, ensure that expr is not a
12259 In general, we must not be checking (expr_type ==
12260 target_type) in the top level conversion methods
12261 (ImplicitConversion, ExplicitConversion etc). This checking is
12262 done in the methods that they delegate to.
12264 2003-05-20 Miguel de Icaza <miguel@ximian.com>
12266 * convert.cs: Move Error_CannotConvertType,
12267 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12268 ImplicitNumericConversion, ImplicitConversionExists,
12269 ImplicitUserConversionExists, StandardConversionExists,
12270 FindMostEncompassedType, FindMostSpecificSource,
12271 FindMostSpecificTarget, ImplicitUserConversion,
12272 ExplicitUserConversion, GetConversionOperators,
12273 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12274 TryImplicitIntConversion, Error_CannotConvertImplicit,
12275 ConvertImplicitRequired, ConvertNumericExplicit,
12276 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12277 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12280 Perform the following renames:
12282 StandardConversionExists -> ImplicitStandardConversionExists
12283 ConvertImplicit -> ImplicitConversion
12284 ConvertImplicitStandard -> ImplicitStandardConversion
12285 TryImplicitIntConversion -> ImplicitIntConversion
12286 ConvertImplicitRequired -> ImplicitConversionRequired
12287 ConvertNumericExplicit -> ExplicitNumericConversion
12288 ConvertReferenceExplicit -> ExplicitReferenceConversion
12289 ConvertExplicit -> ExplicitConversion
12290 ConvertExplicitStandard -> ExplicitStandardConversion
12292 2003-05-19 Martin Baulig <martin@ximian.com>
12294 * statement.cs (TypeInfo.StructInfo): Made this type protected.
12295 (TypeInfo): Added support for structs having structs as fields.
12297 * ecore.cs (FieldExpr): Implement IVariable.
12298 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12299 VariableInfo for the field.
12301 2003-05-18 Martin Baulig <martin@ximian.com>
12303 * expression.cs (This.DoResolve): Report a CS0027 if we're
12304 emitting a field initializer.
12306 2003-05-18 Martin Baulig <martin@ximian.com>
12308 * expression.cs (This.ResolveBase): New public function.
12309 (This.DoResolve): Check for CS0188.
12311 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12314 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12315 `instance_expression' to null if we don't have any non-static
12318 2003-05-18 Martin Baulig <martin@ximian.com>
12320 Reworked the way how local variables and parameters are handled by
12321 the flow analysis code.
12323 * statement.cs (TypeInfo, VariableMap): New public classes.
12324 (VariableInfo): New public class. This is now responsible for
12325 checking whether a variable has been assigned. It is used for
12326 parameters and local variables.
12327 (Block.EmitMeta): Take the InternalParameters as argument; compute
12328 the layout of the flow vectors here.
12329 (Block.LocalMap, Block.ParameterMap): New public properties.
12330 (FlowBranching): The .ctor doesn't get the InternalParameters
12331 anymore since Block.EmitMeta() now computes the layout of the flow
12333 (MyStructInfo): This class is now known as `StructInfo' and nested
12334 in `TypeInfo'; we don't access this directly anymore.
12336 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12337 property and removed IsAssigned(), IsFieldAssigned(),
12338 SetAssigned() and SetFieldAssigned(); we now call them on the
12339 VariableInfo so we don't need to duplicate this code everywhere.
12341 * expression.cs (ParameterReference): Added `Block block' argument
12343 (LocalVariableReference, ParameterReference, This): The new
12344 VariableInfo class is now responsible for all the definite
12347 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12348 IsParameterAssigned, SetParameterAssigned): Removed.
12350 2003-05-18 Martin Baulig <martin@ximian.com>
12352 * typemanager.cs (InitCoreTypes): Try calling
12353 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12354 the 3-args-version. Corlib now also needs our `void_type'.
12355 (GetMethod): Added overloaded version which takes an optional
12356 `bool report_errors' to allow lookups of optional methods.
12358 2003-05-12 Martin Baulig <martin@ximian.com>
12360 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12361 only used for locals and not for parameters.
12363 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12365 * support.cs (InternalParameters.ParameterType): Return the
12366 ExternalType of the parameter.
12368 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12371 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12373 * class.cs (MethodData.Define): Do not set the `newslot' on
12374 interface members, if they are also flagged as "override".
12376 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12377 better code for ++i and i++. This only works for static fields
12378 and local variables.
12380 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12381 want to pull the DeclSpace out of the builder_to_declspace instead
12382 of the TypeBuilder (like in TypeContainer.FindMembers).
12384 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12385 instead of LookupTypeContainer. Fixes the crash on .NET for
12386 looking up interface members.
12388 * const.cs: Create our own emit context during the Definition
12389 stage, so that constants are evaluated in the proper context, when
12390 a recursive definition happens.
12392 2003-05-11 Martin Baulig <martin@ximian.com>
12394 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12395 new block for a switch section.
12396 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12397 the adding/lookup in the switch block. Fixes #39828.
12399 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12401 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12402 functionality: I needed to convert the data after I had performed
12403 the add/sub operation into the operands type size.
12405 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12406 pass the type for the box operation, otherwise the resulting
12407 object would have been of type object.
12409 (BoxedCast): Add constructor to specify the type to box as.
12411 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12413 * iterators.cs: I was reusing the `count' variable inadvertently,
12414 take steps to not allow this to happen.
12416 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12418 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12419 by creating an array at the point where the params starts and
12420 putting all those arguments there, then adjusting the size of the
12423 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12425 * expression.cs (New.AddressOf): Implement interface
12426 IMemoryLocation. This is used when the `new' operator is used in
12427 the context of an invocation to a method on a value type.
12429 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12432 * namespace.cs: Also check the using aliases here.
12434 * driver.cs: Move the test for using validity after the types have
12435 been entered, so we do a single pass that also includes the using
12438 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12439 in the regular case. CreateSiblingForFinally is doing extra
12442 * attribute.cs (GetAttributeArgumentExpression): Store the result
12443 on an out value, and use the return value to indicate failure
12444 instead of using null (which is a valid return for Constant.GetValue).
12446 * statement.cs: Perform the analysis flow for the increment
12447 portion after the statement, because this will be the real flow of
12448 execution. Fixes #42385
12450 * codegen.cs (EmitContext.EmitArgument,
12451 EmitContext.EmitStoreArgument): New helper functions when the
12452 RemapToProxy flag is set.
12454 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12457 Add support for remapping parameters.
12459 * iterators.cs: Propagate parameter values; Store parameter
12460 values in the proxy classes.
12462 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12464 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12465 need a proxy reference; I do not know what I was thinking
12467 * cs-parser.jay (constructor_initializer): catch another error,
12468 and display nice message.
12470 (field_declaration): catch void field declaration
12471 to flag a better error.
12473 * class.cs (MemberBase.CheckBase): Report an error instead of a
12474 warning if a new protected member is declared in a struct.
12475 (Field.Define): catch the error of readonly/volatile.
12477 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12479 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12480 volatile variable is taken
12482 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12484 * statement.cs (Fixed.Resolve): Report an error if we are not in
12487 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12489 * typemanager.cs: reuse the code that handles type clashes for
12490 delegates and enumerations.
12492 * class.cs (Report28): Always report.
12494 * expression.cs (EncodeAsAttribute): Allow nulls here.
12496 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12498 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12499 the functionality for testing whether an expression is valid for
12500 an attribute here. Also handle the case of arrays of elements
12503 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12504 encoding a linear array into an array of objects that are suitable
12505 to be passed to an CustomAttributeBuilder.
12507 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12509 * ecore.cs: (FieldExpr): Handle field remapping here.
12511 * iteratators.cs: Pass the instance variable (if the method is an
12512 instance method) to the constructors, so we can access the field
12513 variables on the class.
12515 TODO: Test this with structs. I think the THIS variable on
12516 structs might have to be a pointer, and not a refenrece
12518 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12520 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12521 local variables to fields in a proxy class.
12523 * iterators.cs (PopulateProxy): Rename our internal fields to
12525 Create a <THIS> field if we are an instance method, so we can
12526 reference our parent container variables.
12527 (MapVariable): Called back from the EmitContext code to enter a
12528 new variable to field mapping into the proxy class (we just create
12532 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12533 for using the remapped locals to fields.
12535 I placed the code here, because that gives the same semantics to
12536 local variables, and only changes the Emit code.
12538 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12539 statements inside iterators.
12540 (VariableInfo): Add a FieldBuilder for the cases when we are
12541 remapping local variables to fields in a proxy class
12543 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12544 current_block != null.
12546 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12547 not cope with strings, as it has been moved to the
12548 TableSwitchEmit. Fixed bug in switch generation.
12550 * expression.cs (New.DoResolve): Provide more context for the user
12551 when reporting an error.
12553 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12556 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12557 check the permissions for it. Note than in a type-resolution
12558 context the check was already present in DeclSpace.ResolveType,
12559 but was missing from the MemberAccess.
12561 (ArrayCreation.CheckIndices): warn if the user has
12562 more nested levels of expressions, but there are no more
12563 dimensions specified. Avoids crash on bug 41906.
12565 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12567 * statement.cs (Block): replace Implicit bool, for a generic
12569 New flag: `Unchecked'. This is used during the EmitMeta phase
12570 (which is out-of-line with the regular Resolve/Emit process for a
12571 statement, as this is done ahead of time, but still gets a chance
12572 to call constant resolve).
12574 (Block.Flags): new enum for adding a new flag.
12576 (Block.EmitMeta): track the state of unchecked.
12578 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12579 to enable constant resolution to work there as well.
12581 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12583 * typemanager.cs (ienumerable_type): Also look up
12584 System.Collections.IEnumerable.
12586 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12588 TODO: Test more than one conditional per method.
12590 * class.cs (Indexer.Define): Report the location where the user is
12591 referencing the unsupported feature.
12593 (MethodData): Overload the use of `conditionals' to
12594 minimize the creation of needless ArrayLists. This saves roughly
12595 212kb on my machine.
12597 (Method): Implement the new IIteratorContainer interface.
12598 (Method.SetYields): Implement the method by setting the ModFlags
12599 to contain METHOD_YIELDS.
12601 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12602 which just got set to null.
12604 * iterators.cs: New file.
12606 (Yield, YieldBreak): New statements.
12608 * statement.cs (Return.Resolve): Flag an error if we are used in
12609 an iterator method.
12611 * codegen.cs (InIterator): New flag set if the code is being
12612 compiled in an iterator method.
12614 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12615 internal modifier, and we just use it to avoid adding extra
12616 fields, as this is seldom used.
12618 * cs-parser.jay: Add yield_statement (yield and yield break).
12620 * driver.cs: New flag -v2 to turn on version 2 features.
12622 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12623 hashtable when v2 is enabled.
12625 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12627 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12628 there is already a namespace defined with this name.
12630 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12631 people upgraded their corlibs.
12633 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12634 always use fully qualified types, no need to use the compiler
12637 (TypeManager.IsNamespace): Use binarysearch.
12639 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12640 AddDelegate): I did not quite use the new IsValid API properly: I
12641 have to pass the short-name and the fullname. I was passing only
12642 the basename instead of the fullname sometimes.
12644 (TypeContainer.DefineType): call NamespaceClash.
12646 * interface.cs (Interface.DefineType): use NamespaceClash before
12649 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12652 * enum.cs: (Enum.DefineType): use NamespaceClash before
12655 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12656 speed increase. First, use the negative_hits cache when we get a
12657 negative. Second, add the type with its full original name
12658 instead of the new . and + encoded name (reflection uses + to
12659 separate type from a nested type). Use LookupTypeReflection
12660 directly which bypasses the type->name hashtable (that we already
12661 know does not contain the type.
12663 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12664 location/container type.
12666 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12668 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12670 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12672 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12673 method is being referenced in the method group from a static
12674 context, and report error 120 if so.
12676 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12679 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12680 is created, we create the A namespace).
12682 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12685 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12687 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12688 invocation to ModuleBuilder.GetType with the same values will
12689 return a new type instance, so we need to cache its return
12692 * expression.cs (Binary.ResolveOperator): Only allow the compare
12693 operators on enums if they are of the same type.
12695 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12696 types of ValueType on their own case. Before we were giving them
12697 the same treatment as objects.
12699 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12700 fullname. Short name is used to compare against container name.
12701 Fullname is used to check against defined namespace names.
12703 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12704 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12706 (Method.CheckBase): Call parent.
12707 (MemberBase.CheckBase): Check for protected members on sealed
12709 (PropertyBase.CheckBase): Call parent.
12710 (Field.Define): Call parent.
12712 * report.cs: Negative error codes are now mapped to 8000 - code,
12713 so that the display is render more nicely.
12715 * typemanager.cs: Do not use try/catch, instead report a regular
12718 (GetPointerType, GetReferenceType): These methods provide
12719 mechanisms to obtain the T* and T& from a T. We had the code
12720 previously scattered around the code base, and it also used
12721 TypeManager.LookupType that would go through plenty of caches.
12722 This one goes directly to the type source.
12724 In some places we did the Type.GetType followed by
12725 ModuleBuilder.GetType, but not in others, so this unifies the
12726 processing as well.
12728 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12729 statements now that we have namespace information.
12731 * typemanager.cs (IsNamespace): New method, returns whether the
12732 string presented is a namespace or not.
12734 (ComputeNamespaces): New public entry point, computes the list of
12735 available namespaces, using the GetNamespaces API call in Mono, or
12736 the slower version in MS.NET.
12738 Now before we start the semantic analysis phase, we have a
12739 complete list of namespaces including everything that the user has
12742 Deleted old code to cache namespaces in .nsc files.
12744 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12746 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12747 class/struct location definition Location for the implicit
12748 constructor location.
12750 (Operator.Define): Use the location of the operator for the
12751 implicit Method definition.
12753 (Constructor.Emit): use the constructor location for the implicit
12754 base initializer constructor.
12756 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12757 and the Expression class now contains two new methods:
12759 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12760 isolate type lookup from the rest of the resolution process.
12762 Since we use Expressions to hold type definitions due to the way
12763 we parse the input we have historically overloaded Resolve to
12764 perform the Type lookups if a special flag is passed. Now this is
12765 eliminated and two methods take their place.
12767 The differences in the two methods between xStep and xTerminal is
12768 that xStep is involved in our current lookup system that uses
12769 SimpleNames to compose a name, while xTerminal is used just to
12770 catch the case where the simplename lookup failed.
12772 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12774 * expression.cs (ResolveMemberAccess): Remove redundant code.
12775 TypeExpr expressions are always born fully resolved.
12777 * interface.cs (PopulateMethod): Do not lookup the types twice.
12778 We were doing it once during SemanticAnalysis and once during
12781 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12782 in local variable type definitions, were being returned as a
12783 SimpleName (we decomposed everything into a string), that is
12784 because primary_expression was being used instead of a type in the
12785 grammar (reduce/reduce conflicts).
12787 The part that was wrong is that we converted the expression into a
12788 string (an oversimplification in one hand, compounded with primary
12789 expressions doing string concatenation).
12795 Would return "A.B.C[]" as a SimpleName. This stopped things like
12796 using clauses from working on this particular context. And a type
12797 was being matched directly against "A.B.C[]".
12799 We now use the correct approach, and allow for ComposedCast to be
12800 part of the unary expression. So the "A.B.C []" become a composed
12801 cast of "A.B.C" (as a nested group of MemberAccess with a
12802 SimpleName at the end) plus the rank composition "[]".
12806 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12808 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12809 for the access level checking.
12811 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12812 `TypeContainer container', because I kept getting confused when I
12813 was debugging this code.
12815 * expression.cs (Indexers): Instead of tracking getters/setters,
12816 we now track them in parallel. We create one arraylist less, but
12817 most importantly it is possible now for the LValue code to find a
12818 matching get for a set.
12820 (IndexerAccess.DoResolveLValue): Update the code.
12821 GetIndexersForType has been modified already to extract all the
12822 indexers from a type. The code assumed it did not.
12824 Also make the code set the correct return type for the indexer.
12825 This was fixed a long time ago for properties, but was missing for
12826 indexers. It used to be void_type.
12828 (Binary.Emit): Test first for doubles instead of
12829 floats, as they are more common.
12831 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12832 when dealing with floats and the <=, >= operators. This fixes bug
12835 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12836 to load the array value by emitting a load on the foreach variable
12837 type. This was incorrect.
12839 We now emit the code to load an element using the the array
12840 variable type, and then we emit the conversion operator.
12844 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12846 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12848 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12850 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12851 test for protection before we test for signatures.
12853 (MethodSignature.ToString): implement.
12855 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12856 to the case where we reduced into a LongConstant.
12858 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12859 depend on whether the information is acurrate, because the
12860 Microsoft runtime will always claim that the array type is public,
12861 regardless of the real state.
12863 If the type is a pointer, another problem happens: the type is
12864 reported as non-public in Microsoft.
12866 In both cases we have to call CheckAccessLevel recursively with
12867 the underlying type as the argument to be tested.
12869 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12871 * assign.cs (Assign.Emit): If we are dealing with a compound
12872 assignment expression, we should use the code path that stores the
12873 intermediate result in a temporary value. This fixes #40903.
12875 *expression.cs (Indirection.ToString): Provide ToString method for
12878 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12880 * class.cs: Null out fields holding references to Block objects so
12881 they can be garbage collected.
12883 * expression.cs (OverloadResolve): Remove unused local.
12885 2003-04-07 Martin Baulig <martin@ximian.com>
12887 * codegen.cs (EmitContext.CurrentFile): New public field.
12888 (EmitContext.Mark): Use the CurrentFile to check whether the
12889 location is in the correct file.
12890 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12892 2003-04-07 Martin Baulig <martin@ximian.com>
12894 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12896 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12897 location. [FIXME: The location argument which gets passed to this
12898 method is sometimes wrong!]
12900 2003-04-07 Nick Drochak <ndrochak@gol.com>
12902 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12904 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12906 * expression.cs (Indirection.EmitAssign): We were using the
12907 temporary, but returning immediately instead of continuing the
12910 2003-04-06 Martin Baulig <martin@ximian.com>
12912 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12913 if it's a nested child, but also deriving from the outer class.
12916 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12917 nested child, but also deriving from the outer class. See
12919 (FilterWithClosure): We may access private members of the outer
12920 class if we're a nested child and deriving from the outer class.
12921 (RealMemberLookup): Only set `closure_private_ok' if the
12922 `original_bf' contained BindingFlags.NonPublic.
12924 2003-04-05 Martin Baulig <martin@ximian.com>
12926 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12928 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12930 * class.cs (Event.Define): Do not allow abstract events to have
12933 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12935 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12936 block in event declarations.
12938 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12939 value type, get its address.
12941 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12942 leaving a class on the stack instead of a boolean value (int
12943 0/1). Change the code so we compare against null, and then the
12944 result against zero.
12946 * class.cs (TypeContainer.GetClassBases): We were checking for the
12947 parent class being sealed too late.
12949 * expression.cs (Binary.Emit): For <= and >= when dealing with
12950 floating point values, use cgt.un and clt.un instead of cgt and
12953 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12955 * statement.cs: Apply the same optimization as MS: skip the
12956 GetEnumerator returning an IEnumerator, and use the one returning a
12957 CharEnumerator instead. This allows us to avoid the try-finally block
12960 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12962 * cs-parser.jay: Attributes cannot be applied to
12963 namespaces. Fixes #40473
12965 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12968 (Add*): check if the name is valid using the full name for constants,
12969 fields, properties and events.
12971 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12973 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12974 char constants to be part of the enumeration.
12976 * expression.cs (Conditional.DoResolve): Add support for operator
12977 true. Implements the missing functionality from 14.12
12979 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12980 operator true/false as required by the spec.
12982 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12983 implicit conversion to boolean.
12985 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12986 also one where the type implements `operator true'.
12988 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12989 get an expression that will invoke operator true based on an
12992 (GetConversionOperators): Removed the hack that called op_True
12995 (Expression.ResolveBoolean): Move this from Statement.
12997 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12999 * ecore.cs (FieldExpr): do not allow initialization of initonly
13000 fields on derived classes
13002 2003-03-13 Martin Baulig <martin@ximian.com>
13004 * statement.cs (Block.Emit): Call ig.BeginScope() and
13005 ig.EndScope() when compiling with debugging info; call
13006 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13008 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13010 * expression.cs (Indexers): Do not construct immediately, allow
13011 for new members to be appended as we go. Fixes 38143
13013 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13015 * expression.cs: save/restore context when resolving an unchecked
13018 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13020 * cfold.cs: Catch division by zero in modulus operator during
13023 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13025 * interface.cs (Interface.DefineMembers): Avoid defining members
13028 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13030 * driver.cs: handle the +/- options for -noconfig
13032 * statement.cs (Unckeched.Resolve): Also track the state of
13033 unchecked in the Resolve phase.
13035 2003-02-27 Martin Baulig <martin@ximian.com>
13037 * ecore.cs (Expression.MemberLookup): Don't create a
13038 MethodGroupExpr for something which is not a method. Fixes #38291.
13040 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13042 * class.cs (MemberBase.CheckParameters): Also check that the type
13043 is unmanaged if it is a pointer.
13045 * expression.cs (SizeOf.Resolve): Add location information.
13047 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13048 a managed type is declared.
13050 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13051 parameter modifiers as well. Fixes bug 38606
13053 * class.cs: Very sad. Am backing out the speed up changes
13054 introduced by the ArrayList -> Array in the TypeContainer, as they
13055 were not actually that much faster, and introduced a bug (no error
13056 reports on duplicated methods).
13058 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13059 source first, this will guarantee that we have a valid expression
13060 before calling in lower levels functions that will require a
13061 resolved object. Then use this original_source in the
13062 target.ResolveLValue instead of the original source that was
13065 Another change. Use target.Resolve instead of LValueResolve.
13066 Although we are resolving for LValues, we will let the Assign code
13067 take care of that (it will be called again from Resolve). This
13068 basically allows code like this:
13070 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13071 class Y { void A (X x) { x [0] += o; }
13073 The problem was that the indexer was trying to resolve for
13074 set_Item (idx, object o) and never finding one. The real set_Item
13075 was set_Item (idx, X). By delaying the process we get the right
13080 2003-02-23 Martin Baulig <martin@ximian.com>
13082 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13083 while calling DoEmit ().
13085 * codegen.cs (EmitContext.Mark): Don't mark locations in other
13086 source files; if you use the #line directive inside a method, the
13087 compiler stops emitting line numbers for the debugger until it
13088 reaches the end of the method or another #line directive which
13089 restores the original file.
13091 2003-02-23 Martin Baulig <martin@ximian.com>
13093 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13095 2003-02-23 Martin Baulig <martin@ximian.com>
13097 * statement.cs (Block.AddChildVariableNames): We need to call this
13098 recursively, not just for our immediate children.
13100 2003-02-23 Martin Baulig <martin@ximian.com>
13102 * class.cs (Event.Define): Always make the field private, like csc does.
13104 * typemanager.cs (TypeManager.RealMemberLookup): Make events
13105 actually work, fixes bug #37521.
13107 2003-02-23 Miguel de Icaza <miguel@ximian.com>
13109 * delegate.cs: When creating the various temporary "Parameters"
13110 classes, make sure that we call the ComputeAndDefineParameterTypes
13111 on those new parameters (just like we do with the formal ones), to
13112 allow them to be resolved in the context of the DeclSpace.
13114 This fixes the bug that Dick observed in Bugzilla #38530.
13116 2003-02-22 Miguel de Icaza <miguel@ximian.com>
13118 * expression.cs (ResolveMemberAccess): When resolving a constant,
13119 do not attempt to pull a constant if the value was not able to
13120 generate a valid constant.
13122 * const.cs (LookupConstantValue): Do not report more errors than required.
13124 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13126 * expression.cs: fixes bug #38328.
13128 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13130 * class.cs: Changed all the various members that can be part of a
13131 class from being an ArrayList to be an Array of the right type.
13132 During the DefineType type_list, interface_list, delegate_list and
13133 enum_list are turned into types, interfaces, delegates and enums
13136 And during the member population, indexer_list, event_list,
13137 constant_list, field_list, instance_constructor_list, method_list,
13138 operator_list and property_list are turned into their real arrays.
13140 Although we could probably perform this operation earlier, for
13141 good error reporting we need to keep the lists and remove the
13142 lists for longer than required.
13144 This optimization was triggered by Paolo profiling the compiler
13145 speed on the output of `gen-sample-program.pl' perl script.
13147 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13148 not crash in methods like MemberLookupFailed that use this field.
13150 This problem arises when the compiler fails to resolve a type
13151 during interface type definition for example.
13153 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13155 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13156 inherit from System.Object, so we have to stop at null, not only
13157 when reaching System.Object.
13159 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13161 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13162 DeclaredOnly because the parent indexer might have had a different
13163 name, but did not loop until the top of the hierarchy was reached.
13165 The problem this one fixes is 35492: when a class implemented an
13166 indexer from an interface, we were getting the interface method
13167 (which was abstract) and we were flagging an error (can not invoke
13170 This also keeps bug 33089 functioning, and test-148 functioning.
13172 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13173 out if a method is special is to see if it is declared in a
13174 property or event, or whether it is one of the predefined operator
13175 names. This should fix correctly #36804.
13177 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13179 The goal here is to remove the dependency on EmptyCast.Peel ().
13180 Killing it completely.
13182 The problem is that currently in a number of places where
13183 constants are expected, we have to "probe" for an EmptyCast, and
13184 Peel, which is not the correct thing to do, as this will be
13185 repetitive and will likely lead to errors.
13187 The idea is to remove any EmptyCasts that are used in casts that
13188 can be reduced to constants, so we only have to cope with
13191 This bug hunt was triggered by Bug 37363 and the desire to remove
13192 the duplicate pattern where we were "peeling" emptycasts to check
13193 whether they were constants. Now constants will always be
13196 * ecore.cs: Use an enumconstant here instead of wrapping with
13199 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13200 throwing me off. By handling this we can get rid of a few hacks.
13202 * statement.cs (Switch): Removed Peel() code.
13204 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13206 * class.cs: Location information for error 508
13208 * expression.cs (New.DoResolve): Add a guard against double
13209 resolution of an expression.
13211 The New DoResolve might be called twice when initializing field
13212 expressions (see EmitFieldInitializers, the call to
13213 GetInitializerExpression will perform a resolve on the expression,
13214 and later the assign will trigger another resolution
13216 This leads to bugs (#37014)
13218 * delegate.cs: The signature for EndInvoke should contain any ref
13219 or out parameters as well. We were not doing this in the past.
13221 * class.cs (Field.Define): Do not overwrite the type definition
13222 inside the `volatile' group. Turns out that volatile enumerations
13223 were changing the type here to perform a validity test, which
13226 2003-02-12 Miguel de Icaza <miguel@ximian.com>
13228 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13229 and structs, we do not want to load the instance variable
13231 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13232 enum_type has to be handled like an object reference (implicit
13233 conversions exists from this to object), but the regular IsClass
13234 and IsValueType tests will never return true for this one.
13236 Also we use TypeManager.IsValueType instead of type.IsValueType,
13237 just for consistency with the rest of the code (this is only
13238 needed if we ever use the construct exposed by test-180.cs inside
13239 corlib, which we dont today).
13241 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
13243 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13246 2003-02-09 Martin Baulig <martin@ximian.com>
13248 * namespace.cs (Namespace..ctor): Added SourceFile argument.
13249 (Namespace.DefineNamespaces): New static public method; this is
13250 called when we're compiling with debugging to add all namespaces
13251 to the symbol file.
13253 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13254 pass it to the Namespace's .ctor.
13256 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13257 and MethodBase arguments; pass the namespace ID to the symwriter;
13258 pass the MethodBase instead of the token to the symwriter.
13259 (SymbolWriter.DefineNamespace): New method to add a namespace to
13262 2003-02-09 Martin Baulig <martin@ximian.com>
13264 * symbolwriter.cs: New file. This is a wrapper around
13265 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
13266 methods here in near future.
13268 2003-02-09 Martin Baulig <martin@ximian.com>
13270 * codegen.cs (EmitContext.Mark): Just pass the arguments to
13271 ILGenerator.MarkSequencePoint() which are actually used by the
13274 2003-02-09 Martin Baulig <martin@ximian.com>
13276 * location.cs (SourceFile): New public sealed class. This
13277 contains the name and an index which is used in the location's token.
13278 (Location): Reserve an appropriate number of bits in the token for
13279 the source file instead of walking over that list, this gives us a
13280 really huge performance improvement when compiling with debugging.
13282 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13283 `SourceFile' argument instead of a string.
13284 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13285 but don't parse/tokenize here, we need to generate the list of all
13286 source files before we do that.
13287 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13290 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13291 instead of a string.
13293 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13296 2003-02-09 Martin Baulig <martin@ximian.com>
13298 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13299 filename on `#line default'.
13301 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13303 * statement.cs: don't clear the pinned var when the fixed statement
13304 returns from the method (fixes bug#37752).
13306 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13308 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13311 2003-02-07 Martin Baulig <martin@ximian.com>
13313 * driver.cs: Removed the `--debug-args' command line argument.
13315 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13316 automatically by the AsssemblyBuilder.
13317 (CodeGen.InitializeSymbolWriter): We don't need to call any
13318 initialization function on the symbol writer anymore. This method
13319 doesn't take any arguments.
13321 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13323 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13324 from referenced assemblies as well.
13326 2003-02-02 Martin Baulig <martin@ximian.com>
13328 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13330 2003-02-02 Martin Baulig <martin@ximian.com>
13332 * class.cs (Constructor.Emit): Open the symbol writer before
13333 emitting the constructor initializer.
13334 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13335 single-stepping through constructor initializers.
13337 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13339 * class.cs: Handle error 549: do not allow virtual methods in
13342 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13344 * decl.cs: Check access levels when resolving types
13346 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13348 * statement.cs: Add parameters and locals set in catch blocks that might
13349 return to set vector
13351 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13353 * class.cs (Operator): Set the SpecialName flags for operators.
13355 * expression.cs (Invocation.DoResolve): Only block calls to
13356 accessors and operators on SpecialName methods.
13358 (Cast.TryReduce): Handle conversions from char constants.
13361 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13363 * statement.cs: small memory and time optimization in FlowBranching.
13365 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13367 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13368 problem that the last fix but in the other sid (Set).
13370 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13371 access when there is no indexer in the hierarchy.
13373 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13375 * class.cs: Combine some if statements.
13377 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13379 * driver.cs: fixed bug #37187.
13381 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13383 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13384 any indexer, it's needed to build a list with all the indexers in the
13385 hierarchy (AllGetters), else we have problems. Fixes #35653.
13387 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13389 * class.cs (MethodData.Define): It is wrong for an interface
13390 implementation to be static in both cases: explicit and implicit.
13391 We were only handling this in one case.
13393 Improve the if situation there to not have negations.
13395 * class.cs (Field.Define): Turns out that we do not need to check
13396 the unsafe bit on field definition, only on usage. Remove the test.
13398 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13400 * driver.cs: use assembly.Location instead of Codebase (the latest
13401 patch made mcs fail when using MS assemblies).
13403 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13405 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13406 get the path to *corlib.dll.
13408 2003-01-21 Nick Drochak <ndrochak@gol.com>
13412 * typemanager.cs: Remove compiler warnings
13414 2003-01-20 Duncan Mak <duncan@ximian.com>
13416 * AssemblyInfo.cs: Bump the version number to 0.19.
13418 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13420 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13422 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13424 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13426 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13428 * cs-parser.jay: Small fix: we were not comparing the constructor
13429 name correctly. Thanks to Zoltan for the initial pointer.
13431 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13433 * cs-tokenizer.cs: Set file name when specified with #line
13435 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13437 * cs-parser.jay: Only perform the constructor checks here if we
13438 are named like the class; This will help provider a better
13439 error. The constructor path is taken when a type definition is
13440 not found, but most likely the user forgot to add the type, so
13441 report that rather than the constructor error.
13443 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13445 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13448 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13450 * cs-parser.jay: Add cleanup call.
13452 2003-01-13 Duncan Mak <duncan@ximian.com>
13454 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13455 consistent with other methods.
13457 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13459 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13461 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13463 * attribute.cs: only set GuidAttr to true when we have a
13466 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13470 * typemanager.cs: fixes to allow mcs compile corlib with the new
13471 Type.IsSubclassOf fix.
13473 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13475 * expression.cs (LocalVariableReference.DoResolve): Classify a
13476 constant as a value, not as a variable. Also, set the type for
13479 * cs-parser.jay (fixed_statement): take a type instead of a
13480 pointer_type, so we can produce a better error message later.
13482 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13485 (For.DoEmit): Make inifinite loops have a
13486 non-conditional branch back.
13488 (Fixed.DoEmit): First populate the pinned variables, then emit the
13489 statement, then clear the variables. Before I was emitting the
13490 code once for each fixed piece.
13493 2003-01-08 Martin Baulig <martin@ximian.com>
13495 * statement.cs (FlowBranching.MergeChild): A break in a
13496 SWITCH_SECTION does not leave a loop. Fixes #36155.
13498 2003-01-08 Martin Baulig <martin@ximian.com>
13500 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13501 lives in the same number space than `param_map'. Fixes #36154.
13503 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13505 * cs-parser.jay (constructor_declaration): Set the
13506 Constructor.ModFlags before probing for it. This makes the
13507 compiler report 514, 515 and 132 (the code was there, but got
13510 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13511 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13512 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13514 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13516 * enum.cs: create the enum static fields using the enum type.
13518 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13520 * class.cs: don't try to create the ParamBuilder for the return
13521 type if it's not needed (and handle it breaking for the ms runtime
13524 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13526 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13528 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13530 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13531 the command. This showed up while compiling the JANET source
13532 code, which used \r as its only newline separator.
13534 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13536 * class.cs (Method.Define): If we are an operator (because it
13537 reuses our code), then set the SpecialName and HideBySig. #36128
13539 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13541 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13542 exception, report error 120 `object reference required'.
13544 * driver.cs: Add --pause option, used during to measure the size
13545 of the process as it goes with --timestamp.
13547 * expression.cs (Invocation.DoResolve): Do not allow methods with
13548 SpecialName to be invoked.
13550 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13552 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13553 number before adding it.
13555 2002-12-21 Ravi Pratap <ravi@ximian.com>
13557 * ecore.cs (StandardImplicitConversion): When in an unsafe
13558 context, we allow conversion between void * to any other pointer
13559 type. This fixes bug #35973.
13561 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13563 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13564 is not thrown when extensionless outputs are used
13566 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13568 * rootcontext.cs: fixed compilation of corlib.
13570 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13572 * attribute.cs (Attributes.Contains): Add new method.
13574 * class.cs (MethodCore.LabelParameters): if the parameter is an
13575 `out' parameter, check that no attribute `[In]' has been passed.
13577 * enum.cs: Handle the `value__' name in an enumeration.
13579 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13581 * decl.cs: Added special case to allow overrides on "protected
13584 2002-12-18 Ravi Pratap <ravi@ximian.com>
13586 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13587 since it makes much more sense.
13589 (Attributes.ctor): Don't require a Location parameter.
13591 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13593 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13594 since we already have that information per attribute.
13596 * everywhere : make appropriate changes.
13598 * class.cs (LabelParameters): Write the code which actually
13599 applies attributes to the return type. We can't do this on the MS
13600 .NET runtime so we flag a warning in the case an exception is
13603 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13605 * const.cs: Handle implicit null conversions here too.
13607 2002-12-17 Ravi Pratap <ravi@ximian.com>
13609 * class.cs (MethodCore.LabelParameters): Remove the extra
13610 Type [] parameter since it is completely unnecessary. Instead
13611 pass in the method's attributes so that we can extract
13612 the "return" attribute.
13614 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13616 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13617 of ignoring it and letting the compile continue.
13619 * typemanager.cs (ChangeType): use an extra argument to return an
13620 error condition instead of throwing an exception.
13622 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13624 * expression.cs (Unary.TryReduce): mimic the code for the regular
13625 code path. Perform an implicit cast in the cases where we can
13626 implicitly convert to one of the integral types, and then reduce
13627 based on that constant. This fixes bug #35483.
13629 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13631 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13633 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13635 * namespace.cs: fixed bug #35489.
13637 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13639 * class.cs: Remove some dead code.
13641 * cs-parser.jay: Estimate the number of methods needed
13642 (RootContext.MethodCount);
13644 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13645 numbers instead of StringBuilders.
13647 * support.cs (PtrHashtable): Add constructor with initial size;
13648 We can now reduce reallocations of the method table.
13650 2002-12-10 Ravi Pratap <ravi@ximian.com>
13652 * attribute.cs (ApplyAttributes): Keep track of the emitted
13653 attributes on a per-target basis. This fixes bug #35413.
13655 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13657 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13658 default to the Windows 1252 encoding.
13660 (UnixParseOption): Support version, thanks to Alp for the missing
13663 * AssemblyInfo.cs: Add nice assembly information.
13665 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13668 * cs-parser.jay: Allow a trailing comma before the close bracked
13669 in the attribute_section production.
13671 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13672 address of the instance was being taken, I will take this out,
13673 because we take the address of the object immediately here.
13675 2002-12-09 Ravi Pratap <ravi@ximian.com>
13677 * typemanager.cs (AreMultipleAllowed): Take care of the most
13678 obvious case where attribute type is not in the current assembly -
13681 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13683 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13684 definitions, instead of doing that afterwards.
13686 Also we use a nice little hack, depending on the constructor, we
13687 know if we are a "composed" name or a simple name. Hence, we
13688 avoid the IndexOf test, and we avoid
13690 * codegen.cs: Add code to assist in a bug reporter to track down
13691 the source of a compiler crash.
13693 2002-12-07 Ravi Pratap <ravi@ximian.com>
13695 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13696 types have been emitted for a given element and flag an error
13697 if something which does not have AllowMultiple set is used more
13700 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13701 attribute types and their corresponding AllowMultiple properties
13703 (AreMultipleAllowed): Check the property for a given type.
13705 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13706 property in the case we have a TypeContainer.
13708 (Attributes.AddAttribute): Detect duplicates and just skip on
13709 adding them. This trivial fix catches a pretty gross error in our
13710 attribute emission - global attributes were being emitted twice!
13712 Bugzilla bug #33187 is now fixed.
13714 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13716 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13717 instead of pp_and).
13719 * expression.cs (Binary.ResolveOperator): I can only use the
13720 Concat (string, string, string) and Concat (string, string,
13721 string, string) if the child is actually a concatenation of
13724 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13726 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13727 context where we need a 2-character lookahead.
13729 * pending.cs (PendingImplementation): Rework so we can keep track
13730 of interface types all the time, and flag those which were
13731 implemented by parents as optional.
13733 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13735 * expression.cs (Binary.ResolveOperator): Use
13736 String.Concat(string,string,string) or
13737 String.Concat(string,string,string,string) when possible.
13739 * typemanager: More helper methods.
13742 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13744 * pending.cs: remove the bogus return from GetMissingInterfaces()
13745 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13747 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13749 * namespace.cs: avoid duplicated 'using xxx' being added to
13750 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13751 when we get more than one 'using' statement for the same namespace.
13752 Report a CS0105 warning for it.
13754 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13756 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13757 of calling getChar/putback, uses internal knowledge of it.
13759 (xtoken): Reorder tokenizer so most common patterns are checked
13760 first. This reduces the compilation time in another 5% (from 8.11s
13761 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13763 The parsing time is 22% of the compilation in mcs, and from that
13764 64% is spent on the tokenization process.
13766 I tried using a binary search for keywords, but this is slower
13767 than the hashtable. Another option would be to do a couple of
13770 * Not use a StringBuilder, instead use an array of chars,
13771 with a set value. Notice that this way we could catch
13772 the 645 error without having to do it *afterwards*.
13774 * We could write a hand-parser to avoid the hashtable
13775 compares altogether.
13777 The identifier consumption process takes 37% of the tokenization
13778 time. Another 15% is spent on is_number. 56% of the time spent
13779 on is_number is spent on Int64.Parse:
13781 * We could probably choose based on the string length to
13782 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13785 Another 3% is spend on wrapping `xtoken' in the `token' function.
13787 Handle 0xa0 as whitespace (#34752)
13789 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13791 * typemanager.cs (IsCLRType): New routine to tell whether a type
13792 is one of the builtin types.
13794 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13795 typecode in more places instead of doing pointer comparissions.
13796 We could leverage some knowledge about the way the typecodes are
13799 New code to cache namespaces in assemblies, it is currently not
13800 invoked, to be used soon.
13802 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13804 * expression.cs (Binary.ResolveOperator): specially handle
13805 strings, and do not perform user-defined operator overloading for
13808 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13810 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13811 internalcall as it is a pretty simple operation; Avoid whenever
13812 possible to call Char.IsLetter.
13814 (consume_identifier): Cut by half the number of
13815 hashtable calls by merging the is_keyword and GetKeyword behavior.
13817 Do not short-circuit, because if we do, we
13818 report errors (ie, #if false && true would produce an invalid
13822 2002-11-24 Martin Baulig <martin@ximian.com>
13824 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13825 check constant ranges and report a CS0221. Fixes #33186.
13827 2002-11-24 Martin Baulig <martin@ximian.com>
13829 * cs-parser.jay: Make this work for uninitialized variable
13830 declarations in the `for' initializer. Fixes #32416.
13832 2002-11-24 Martin Baulig <martin@ximian.com>
13834 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13835 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13837 2002-11-24 Martin Baulig <martin@ximian.com>
13839 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13840 argument; if true, we also check for user-defined conversions.
13841 This is only needed if both arguments are of a user-defined type.
13842 Fixes #30443, added test-175.cs.
13843 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13845 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13847 2002-11-24 Martin Baulig <martin@ximian.com>
13849 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13850 function to get the store opcode.
13851 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13852 only emit the Ldelema if the store opcode is Stobj. You must run
13853 both test-34 and test-167 to test this. Fixes #34529.
13855 2002-11-23 Martin Baulig <martin@ximian.com>
13857 * ecore.cs (Expression.MemberLookup): Added additional
13858 `qualifier_type' argument which is used when we're being called
13859 from MemberAccess.DoResolve() and null if we're called from a
13861 (Expression.MemberLookupFailed): New method to report errors; this
13862 does the CS1540 check and reports the correct error message.
13864 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13865 argument for the CS1540 check and redone the way how we're dealing
13866 with private members. See the comment in the source code for details.
13867 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13868 `closure_start_type' to `closure_qualifier_type' and check whether
13869 it's not null. It was not this filter being broken, it was just
13870 being called with the wrong arguments.
13872 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13873 and pass it the correct `qualifier_type'; this also does the error
13876 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13878 * expression.cs (Invocation.EmitParams): If the we are dealing
13879 with a non-built-in value type, load its address as well.
13881 (ArrayCreation): Use a a pretty constant instead
13882 of the hardcoded value 2. Use 6 instead of 2 for the number of
13883 static initializers.
13885 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13886 because they are not really value types, just glorified integers.
13888 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13890 * ecore.cs: Remove redundant code for enumerations, make them use
13891 the same code path as everything else, fixes the casting issue
13892 with enumerations in Windows.Forms.
13894 * attribute.cs: Do only cast to string if it is a string, the
13895 validation happens later.
13897 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13898 people upgrade their corlibs.
13900 * ecore.cs: Oops, enumerations were not following the entire code path
13902 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13904 * typemanager.cs (FilterWithClosure): Commented out the test for
13905 1540 in typemanager.cs, as it has problems when accessing
13906 protected methods from a parent class (see test-174.cs).
13908 * attribute.cs (Attribute.ValidateGuid): new method.
13909 (Attribute.Resolve): Use above.
13911 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13913 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13915 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13916 handling for enumerations, as we only needed the TypeContainer
13917 functionality to begin with (this is required for the fix below to
13918 work for enums that reference constants in a container class for
13921 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13923 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13924 a valid TypeBuilder to perform lookups on.o
13926 * class.cs (InheritableMemberSignatureCompare): Use true in the
13927 call to GetGetMethod and GetSetMethod, because we are comparing
13928 the signature, and we need to get the methods *even* if they are
13931 (PropertyBase.CheckBase): ditto.
13933 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13934 GotoCase.Resolve): Use Peel on EmpytCasts.
13936 * ecore.cs (EmptyCast): drop child, add Peel method.
13938 2002-11-17 Martin Baulig <martin@ximian.com>
13940 * ecore.cs (EmptyCast.Child): New public property.
13942 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13943 label resolved to an EmptyCast. Fixes #34162.
13944 (GotoCase.Resolve): Likewise.
13945 (Block.EmitMeta): Likewise.
13947 2002-11-17 Martin Baulig <martin@ximian.com>
13949 * expression.cs (Invocation.BetterConversion): Prefer int over
13950 uint; short over ushort; long over ulong for integer literals.
13951 Use ImplicitConversionExists instead of StandardConversionExists
13952 since we also need to check for user-defined implicit conversions.
13953 Fixes #34165. Added test-173.cs.
13955 2002-11-16 Martin Baulig <martin@ximian.com>
13957 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13958 with the `true' and `false' literals. Fixes #33151.
13960 2002-11-16 Martin Baulig <martin@ximian.com>
13962 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13963 October 22nd; don't do the cs1540 check for static members.
13965 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13966 now using our own filter here and doing the cs1540 check again.
13968 2002-11-16 Martin Baulig <martin@ximian.com>
13970 * support.cs (InternalParameters): Don't crash if we don't have
13971 any fixed parameters. Fixes #33532.
13973 2002-11-16 Martin Baulig <martin@ximian.com>
13975 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13976 when looking up static methods to make this work on Windows.
13979 2002-11-16 Martin Baulig <martin@ximian.com>
13981 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13982 a setter rather than using PropertyInfo.CanWrite.
13984 2002-11-15 Nick Drochak <ndrochak@gol.com>
13986 * class.cs: Allow acces to block member by subclasses. Fixes build
13989 2002-11-14 Martin Baulig <martin@ximian.com>
13991 * class.cs (Constructor.Emit): Added the extern/block check.
13994 2002-11-14 Martin Baulig <martin@ximian.com>
13996 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13997 iteration while looking for indexers, this is needed because the
13998 indexer may have a different name in our base classes. Fixed the
13999 error reporting (no indexers at all, not get accessor, no
14000 overloaded match). Fixes bug #33089.
14001 (IndexerAccess.DoResolveLValue): Likewise.
14003 2002-11-14 Martin Baulig <martin@ximian.com>
14005 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14006 indexers. Fixes the first part of bug #33089.
14007 (MethodSignature.InheritableMemberSignatureCompare): Added support
14010 2002-11-13 Ravi Pratap <ravi@ximian.com>
14012 * attribute.cs (Attribute.Resolve): Catch the
14013 NullReferenceException and report it since it isn't supposed to
14016 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14018 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14019 LogicalOr and LogicalAnd that can benefit from recursively
14020 handling EmitBranchable. The code now should be nice for Paolo.
14022 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14024 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14025 the Type lookups, as we perform quite a number of lookups on
14026 non-Types. This can be removed once we can deterministically tell
14027 whether we have a type or a namespace in advance.
14029 But this might require special hacks from our corlib.
14033 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14034 and double which avoids a conversion from an integer to a double.
14036 * expression.cs: tiny optimization, avoid calling IsConstant,
14037 because it effectively performs the lookup twice.
14039 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14041 But a bogus return here to keep the semantics of the old code
14042 until the Mono runtime is fixed.
14044 * pending.cs (GetMissingInterfaces): New method used to remove all
14045 the interfaces that are already implemented by our parent
14046 classes from the list of pending methods.
14048 * interface.cs: Add checks for calls after ResolveTypeExpr.
14050 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14052 * class.cs (Class.Emit): Report warning 67: event not used if the
14053 warning level is beyond 3.
14055 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14056 being a NullLiteral.
14058 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14061 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14062 path that might fail if a type can not be resolved.
14064 * expression.cs (Binary.Emit): Emit unsigned versions of the
14067 * driver.cs: use error 5.
14069 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14071 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14073 2002-11-01 Miguel de Icaza <miguel@ximian.com>
14075 * cs-parser.jay (switch_section): A beautiful patch from Martin
14076 Baulig that fixed 33094.
14078 2002-10-31 Miguel de Icaza <miguel@ximian.com>
14080 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14081 Check whether the base is abstract and report an error if so.
14083 * expression.cs (IndexerAccess.DoResolveLValue,
14084 IndexerAccess.DoResolve): ditto.
14086 (Invocation.DoResolve): ditto.
14088 (Invocation.FullMethodDesc): Improve the report string.
14090 * statement.cs (Block): Eliminate IsVariableDefined as it is
14091 basically just a wrapper for GetVariableInfo.
14093 * ecore.cs (SimpleName): Use new
14095 * support.cs (ReflectionParamter.ParameterType): We unwrap the
14096 type, as we return the actual parameter ref/unref state on a
14099 2002-10-30 Miguel de Icaza <miguel@ximian.com>
14101 * support.cs: Return proper flags REF/OUT fixing the previous
14104 * expression.cs: Reverted last patch, that was wrong. Is_ref is
14105 not used to mean `ref' but `ref or out' in ParameterReference
14107 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14108 full type signature instead of calling TypeManger.CSharpName
14111 * support.cs (InternalParameters.ParameterDesc): Do not compare
14112 directly to the modflags, because REF/OUT will actually be bitsets
14115 * delegate.cs (VerifyMethod): Check also the modifiers.
14117 * cs-tokenizer.cs: Fix bug where floating point values with an
14118 exponent where a sign was missing was ignored.
14120 * driver.cs: Allow multiple assemblies to be specified in a single
14123 2002-10-28 Miguel de Icaza <miguel@ximian.com>
14125 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
14126 because identifiers after a parenthesis would end up in this kind
14127 of production, and we needed to desamiguate it for having casts
14130 (UserDefinedType *) xxx
14132 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14134 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14135 we should set on the Bindingflags.NonPublic, but not turn on
14136 private_ok. private_ok controls whether a Private member is
14137 returned (this is chekced on the filter routine), while the
14138 BindingFlags.NonPublic just controls whether private/protected
14139 will be allowed. This fixes the problem part of the problem of
14140 private properties being allowed to be used in derived classes.
14142 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14143 so we can call the children DoResolveLValue method (this will
14144 properly signal errors on lvalue assignments to base properties)
14146 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14147 getter are null, and we have a property info, we know that this
14148 happened because the lookup failed, so we report an error 122 for
14149 protection level violation.
14151 We also silently return if setter and getter are null in the
14152 resolve functions, this condition only happens if we have flagged
14153 the error before. This is the other half of the problem.
14155 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14156 not have accessibility information, that is why we were returning
14157 true in the filter function in typemanager.cs.
14159 To properly report 122 (property is inaccessible because of its
14160 protection level) correctly, we report this error in ResolveAccess
14161 by failing if both the setter and the getter are lacking (ie, the
14164 DoResolve and DoLResolve have been modified to check for both
14165 setter/getter being null and returning silently, the reason being
14166 that I did not want to put the knowledge about this error in upper
14169 int old = Report.Errors;
14170 x = new PropertyExpr (...);
14171 if (old != Report.Errors)
14176 So the property expr is returned, but it is invalid, so the error
14177 will be flagged during the resolve process.
14179 * class.cs: Remove InheritablePropertySignatureCompare from the
14180 class, as we no longer depend on the property signature to compute
14181 whether it is possible to implement a method or not.
14183 The reason is that calling PropertyInfo.GetGetMethod will return
14184 null (in .NET, in Mono it works, and we should change this), in
14185 cases where the Get Method does not exist in that particular
14190 class X { public virtual int A { get { return 1; } } }
14192 class Z : Y { public override int A { get { return 2; } } }
14194 Would fail in Z because the parent (Y) would not have the property
14195 defined. So we avoid this completely now (because the alternative
14196 fix was ugly and slow), and we now depend exclusively on the
14199 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14200 reference method, instead of using the property.
14202 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14203 routines are gone now.
14205 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14206 names, they were incorrectly named.
14208 * cs-tokenizer.cs: Return are more gentle token on failure.
14210 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14211 had an out-of-sync index variable, which caused it to remove from
14212 the list of pending methods the wrong method sometimes.
14214 2002-10-22 Miguel de Icaza <miguel@ximian.com>
14216 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14217 CanWrite, because those refer to this particular instance of the
14218 property, and do not take into account the fact that we can
14219 override single members of a property.
14221 Constructor requires an EmitContext. The resolution process does
14222 not happen here, but we need to compute the accessors before,
14223 because the resolution does not always happen for properties.
14225 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14226 subclass, before we did not update this flag, but we did update
14229 (GetAccessors): Drop this routine, as it did not work in the
14230 presence of partially overwritten set/get methods.
14232 Notice that this broke the cs1540 detection, but that will require
14235 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14239 * driver.cs: issue a warning instead of an error if we don't support
14240 debugging for the platform. Also ignore a couple of errors that may
14241 arise when trying to write the symbols. Undo my previous patch.
14243 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14245 * driver.cs: ignore /debug switch except for Unix platforms.
14247 2002-10-23 Nick Drochak <ndrochak@gol.com>
14249 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14251 2002-10-21 Miguel de Icaza <miguel@ximian.com>
14253 * driver.cs: Do not make mcs-debug conditional, so we do not break
14254 builds that use it.
14256 * statement.cs (UsageVector.MergeChildren): I would like Martin to
14257 review this patch. But basically after all the children variables
14258 have been merged, the value of "Breaks" was not being set to
14259 new_breaks for Switch blocks. I think that it should be set after
14260 it has executed. Currently I set this to the value of new_breaks,
14261 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14262 conservative, but I do not understand this code very well.
14264 I did not break anything in the build, so that is good ;-)
14266 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14268 2002-10-20 Mark Crichton <crichton@gimp.org>
14270 * cfold.cs: Fixed compile blocker. Really fixed it this time.
14272 2002-10-20 Nick Drochak <ndrochak@gol.com>
14274 * cfold.cs: Fixed compile blocker.
14276 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14278 * driver.cs: I was chekcing the key, not the file.
14280 2002-10-19 Ravi Pratap <ravi@ximian.com>
14282 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14283 message that we were generating - we just need to silently return
14286 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14288 * class.cs (Event.Define): Change my previous commit, as this
14289 breaks the debugger. This is a temporary hack, as it seems like
14290 the compiler is generating events incorrectly to begin with.
14292 * expression.cs (Binary.ResolveOperator): Added support for
14293 "U operator - (E x, E y)"
14295 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14298 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14299 init-only variables, but this path did not take into account that
14300 there might be also instance readonly variables. Correct this
14303 This fixes bug 32253
14305 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14308 * driver.cs: Change the extension for modules to `netmodule'
14310 * cs-parser.jay: Improved slightly the location tracking for
14311 the debugger symbols.
14313 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14314 modifiers that were specified instead of the hardcoded value
14315 (FamAndAssem). This was basically ignoring the static modifier,
14316 and others. Fixes 32429.
14318 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14319 fixed a bug in the process (32476)
14321 * expression.cs (ArrayAccess.EmitAssign): Patch from
14322 hwang_rob@yahoo.ca that fixes bug 31834.3
14324 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14326 * driver.cs: Make the module extension .netmodule.
14328 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14330 * driver.cs: Report an error if the resource file is not found
14331 instead of crashing.
14333 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14334 false, like Emit does.
14336 2002-10-16 Nick Drochak <ndrochak@gol.com>
14338 * typemanager.cs: Remove unused private member. Also reported mcs
14339 bug to report this as a warning like csc.
14341 2002-10-15 Martin Baulig <martin@gnome.org>
14343 * statement.cs (Statement.Emit): Made this a virtual method; emits
14344 the line number info and calls DoEmit().
14345 (Statement.DoEmit): New protected abstract method, formerly knows
14346 as Statement.Emit().
14348 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14350 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14352 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14353 have fixed a remaining problem: not every AddXXXX was adding a
14354 fully qualified name.
14356 Now everyone registers a fully qualified name in the DeclSpace as
14357 being defined instead of the partial name.
14359 Downsides: we are slower than we need to be due to the excess
14360 copies and the names being registered this way.
14362 The reason for this is that we currently depend (on the corlib
14363 bootstrap for instance) that types are fully qualified, because
14364 we dump all the types in the namespace, and we should really have
14365 types inserted into the proper namespace, so we can only store the
14366 basenames in the defined_names array.
14368 2002-10-10 Martin Baulig <martin@gnome.org>
14370 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14371 from bug #31834, see the bug report for a testcase which is
14374 2002-10-10 Martin Baulig <martin@gnome.org>
14376 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14377 flow analysis code for this.
14379 * statement.cs (Do, While, For): Tell the flow analysis code about
14381 (FlowBranching.UsageVector): Added support for infinite loops.
14382 (Block.Resolve): Moved the dead code elimination here and use flow
14385 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14387 * class.cs (Field.Define): Catch cycles on struct type
14390 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14391 fields if the fields are static. We only need to check instance
14394 * expression.cs (As.DoResolve): Test for reference type.
14396 * statement.cs (Using.ResolveExpression): Use
14397 ConvertImplicitRequired, not ConvertImplicit which reports an
14399 (Using.ResolveLocalVariableDecls): ditto.
14401 * expression.cs (Binary.ResolveOperator): Report errors in a few
14402 places where we had to.
14404 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14406 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14408 * expression.cs: Use StoreFromPtr instead of extracting the type
14409 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14411 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14412 an enumeration value to a System.Enum, but System.Enum is not a
14413 value type, but an class type, so we need to box.
14415 (Expression.ConvertExplicit): One codepath could return
14416 errors but not flag them. Fix this. Fixes #31853
14418 * parameter.cs (Resolve): Do not allow void as a parameter type.
14420 2002-10-06 Martin Baulig <martin@gnome.org>
14422 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14423 if it's a class type and not a struct. Fixes #31815.
14425 2002-10-06 Martin Baulig <martin@gnome.org>
14427 * statement.cs: Reworked the flow analysis code a bit to make it
14428 usable for dead code elimination.
14430 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14432 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14434 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14436 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14437 to fix the test 165, will investigate deeper.
14439 2002-10-04 Martin Baulig <martin@gnome.org>
14441 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14442 finally blocks actually work.
14443 (Try.Resolve): We don't need to create a sibling for `finally' if
14444 there is no finally block.
14446 2002-10-04 Martin Baulig <martin@gnome.org>
14448 * class.cs (Constructor.Define): The default accessibility for a
14449 non-default constructor is private, not public.
14451 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14453 * class.cs (Constructor): Make AllowedModifiers public, add
14456 * cs-parser.jay: Perform the modifiers test here, as the
14457 constructor for the Constructor class usually receives a zero
14458 because of the way we create it (first we create, later we
14459 customize, and we were never checking the modifiers).
14461 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14462 is a version of LookupTypeReflection that includes the type-name
14463 cache. This can be used as a fast path for functions that know
14464 the fully qualified name and are only calling into *.GetType() to
14465 obtain a composed type.
14467 This is also used by TypeManager.LookupType during its type
14470 (LookupType): We now also track the real type name, as sometimes
14471 we can get a quey for the real type name from things like
14472 ComposedCast. This fixes bug 31422.
14474 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14475 complete type fullname, it does not have to go through the type
14476 resolution system to obtain the composed version of the type (for
14477 obtaining arrays or pointers).
14479 (Conditional.Emit): Use the EmitBoolExpression to
14480 generate nicer code, as requested by Paolo.
14482 (ArrayCreation.CheckIndices): Use the patch from
14483 hwang_rob@yahoo.ca to validate the array initializers.
14485 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14487 * class.cs (ConstructorInitializer.Emit): simplify code by using
14488 Invocation.EmitCall, and at the same time, fix the bugs in calling
14489 parent constructors that took variable arguments.
14491 * ecore.cs (Expression.ConvertNumericExplicit,
14492 Expression.ImplicitNumericConversion): Remove the code that
14493 manually wrapped decimal (InternalTypeConstructor call is now gone
14496 * expression.cs (Cast.TryReduce): Also handle decimal types when
14497 trying to perform a constant fold on the type.
14499 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14501 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14502 that only turned off an error report, and did nothing else.
14504 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14506 * driver.cs: Handle and ignore /fullpaths
14508 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14510 * expression.cs (Binary.ResolveOperator): Catch the case where
14511 DoNumericPromotions returns true,
14513 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14515 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14517 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14520 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14522 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14523 conversion exists, but it is also required that the conversion be
14524 performed. This manifested in "(Type64Enum) 2".
14526 * class.cs (TypeManager.AddMethod): The fix is not to change
14527 AddEnum, because that one was using a fully qualified name (every
14528 DeclSpace derivative does), but to change the AddMethod routine
14529 that was using an un-namespaced name. This now correctly reports
14530 the duplicated name.
14532 Revert patch until I can properly fix it. The issue
14533 is that we have a shared Type space across all namespaces
14534 currently, which is wrong.
14536 Options include making the Namespace a DeclSpace, and merge
14537 current_namespace/current_container in the parser.
14539 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14541 * cs-parser.jay: Improve error reporting when we get a different
14542 kind of expression in local_variable_type and
14543 local_variable_pointer_type.
14545 Propagate this to avoid missleading errors being reported.
14547 * ecore.cs (ImplicitReferenceConversion): treat
14548 TypeManager.value_type as a target just like object_type. As
14553 Is valid, and needs to result in the int 1 being boxed before it
14554 is assigned to the value type v.
14556 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14557 to validate the enumeration name.
14559 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14560 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14561 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14563 * ecore.cs (TryImplicitIntConversion): When doing an
14564 implicit-enumeration-conversion, check if the type is 64-bits and
14565 perform a conversion before passing to EnumConstant.
14567 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14569 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14570 report ambiguous type references. Unlike the MS version, we
14571 report what the ambiguity is. Innovation at work ;-)
14573 (DeclSpace.FindType): Require a location argument to
14574 display when we display an ambiguous error.
14576 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14578 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14580 * expression.cs (EmitDynamicInitializers): Apply patch from
14581 hwang_rob@yahoo.ca that fixes the order in which we emit our
14584 2002-09-21 Martin Baulig <martin@gnome.org>
14586 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14587 delegate takes no arguments.
14589 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14591 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14594 * expression.cs: Extract the underlying type.
14596 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14598 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14600 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14602 * class.cs (TypeContainer.DefineType): We can not use the nice
14603 PackingSize with the size set to 1 DefineType method, because it
14604 will not allow us to define the interfaces that the struct
14607 This completes the fixing of bug 27287
14609 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14610 means also structs. This fixes part of the problem.
14611 (Expresion.ImplicitReferenceConversionExists): ditto.
14613 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14614 error if there were no errors reported during the type lookup
14615 process, to avoid duplicates or redundant errors. Without this
14616 you would get an ambiguous errors plus a type not found. We have
14617 beaten the user enough with the first error.
14619 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14622 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14623 during the resolution process, stop the lookup, this avoids
14624 repeated error reports (same error twice).
14626 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14628 * typemanager.cs (LookupType): Redo the type lookup code to match
14629 the needs of System.Reflection.
14631 The issue is that System.Reflection requires references to nested
14632 types to begin with a "+" sign instead of a dot. So toplevel
14633 types look like: "NameSpace.TopLevelClass", and nested ones look
14634 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14637 2002-09-19 Martin Baulig <martin@gnome.org>
14639 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14640 says that a method always returns or always throws an exception,
14641 don't report the CS0161.
14643 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14644 set `Returns = new_returns'.
14646 2002-09-19 Martin Baulig <martin@gnome.org>
14648 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14649 to an enum constant, check for a CS0176.
14651 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14653 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14654 for operators that must be in pairs and report errors.
14656 * ecore.cs (SimpleName.DoResolveType): During the initial type
14657 resolution process, when we define types recursively, we must
14658 check first for types in our current scope before we perform
14659 lookups in the enclosing scopes.
14661 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14663 (Invocation.VerifyArgumentsCompat): Call
14664 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14665 I thought we were supposed to always call this, but there are a
14666 few places in the code where we dont do it.
14668 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14670 * driver.cs: Add support in -linkres and -resource to specify the
14671 name of the identifier.
14673 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14675 * ecore.cs (StandardConversionExists): Sync with the conversion
14676 code: allow anything-* to void* conversions.
14678 (FindMostSpecificSource): Use an Expression argument
14679 instead of a Type, because we might be handed over a Literal which
14680 gets a few more implicit conversions that plain types do not. So
14681 this information was being lost.
14683 Also, we drop the temporary type-holder expression when not
14686 2002-09-17 Martin Baulig <martin@gnome.org>
14688 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14689 this is an explicit interface implementation.
14691 2002-09-17 Martin Baulig <martin@gnome.org>
14693 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14694 different `IndexerName' attributes.
14696 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14697 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14698 virtual CommonResolve().
14700 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14702 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14703 and convert that to the UnderlyingType.
14705 * statement.cs (Foreach.Resolve): Indexers are just like variables
14706 or PropertyAccesses.
14708 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14709 inside quoted strings, we were not doing this before.
14711 2002-09-16 Martin Baulig <martin@gnome.org>
14713 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14714 resolve it. This is needed for the definite assignment check of the
14715 instance expression, fixes bug #29846.
14716 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14718 2002-09-16 Nick Drochak <ndrochak@gol.com>
14720 * parameter.cs: Fix compile error. Cannot reference static member
14721 from an instance object. Is this an mcs bug?
14723 2002-09-14 Martin Baulig <martin@gnome.org>
14725 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14726 multiple times. Fixes bug #30295, added test-166.cs.
14728 2002-09-14 Martin Baulig <martin@gnome.org>
14730 * statement.cs (Block.Emit): Don't emit unreachable code.
14731 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14732 `break' statements.
14733 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14735 2002-09-14 Martin Baulig <martin@gnome.org>
14737 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14740 2002-09-14 Martin Baulig <martin@gnome.org>
14742 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14743 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14744 be false on the ms runtime.
14746 2002-09-13 Martin Baulig <martin@gnome.org>
14748 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14749 the CS0038 error message.
14751 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14753 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14754 constant inside, return it.
14756 2002-09-12 Martin Baulig <martin@gnome.org>
14758 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14759 implicit conversion can be done between enum types.
14761 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14762 check whether an implicit conversion to the current enum's UnderlyingType
14763 exists and report an error if not.
14765 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14766 without debugging support.
14768 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14769 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14771 2002-09-12 Martin Baulig <martin@gnome.org>
14773 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14775 * ecore.cs (IMemberExpr.DeclaringType): New property.
14776 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14777 nonstatic member of an outer type (CS0038).
14779 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14781 * driver.cs: Activate the using-error detector at warning level
14782 4 (at least for MS-compatible APIs).
14784 * namespace.cs (VerifyUsing): Small buglett fix.
14786 * pending.cs (PendingImplementation): pass the container pointer.
14788 * interface.cs (GetMethods): Allow for recursive definition. Long
14789 term, I would like to move every type to support recursive
14790 definitions, not the current ordering mechanism that we have right
14793 The situation is this: Attributes are handled before interfaces,
14794 so we can apply attributes to interfaces. But some attributes
14795 implement interfaces, we will now handle the simple cases
14796 (recursive definitions will just get an error).
14798 * parameter.cs: Only invalidate types at the end if we fail to
14801 2002-09-09 Martin Baulig <martin@gnome.org>
14803 * ecore.cs (PropertyExpr.Emit): Also check for
14804 TypeManager.system_int_array_get_length so this'll also work when
14805 compiling corlib. Fixes #30003.
14807 2002-09-09 Martin Baulig <martin@gnome.org>
14809 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14810 and throw an exception if we can't get the type's size. Fixed #30040,
14813 2002-09-09 Martin Baulig <martin@gnome.org>
14815 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14817 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14818 context. Fixes bug #30027.
14820 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14821 virtual functions. Fixes bug #30043, added test-164.cs.
14823 2002-09-08 Ravi Pratap <ravi@ximian.com>
14825 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14827 2002-09-08 Nick Drochak <ndrochak@gol.com>
14829 * driver.cs: Use an object to get the windows codepage since it's not a
14832 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14834 * statement.cs (For.Emit): for infinite loops (test == null)
14835 return whether there is a break inside, not always "true".
14837 * namespace.cs (UsingEntry): New struct to hold the name of the
14838 using definition, the location where it is defined, and whether it
14839 has been used in a successful type lookup.
14841 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14846 2002-09-06 Ravi Pratap <ravi@ximian.com>
14848 * attribute.cs : Fix incorrect code which relied on catching
14849 a NullReferenceException to detect a null being passed in
14850 where an object was expected.
14852 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14854 * statement.cs (Try): flag the catch variable as assigned
14856 * expression.cs (Cast): Simplified by using ResolveType instead of
14857 manually resolving.
14859 * statement.cs (Catch): Fix bug by using ResolveType.
14861 2002-09-06 Ravi Pratap <ravi@ximian.com>
14863 * expression.cs (BetterConversion): Special case for when we have
14864 a NullLiteral as the argument and we have to choose between string
14865 and object types - we choose string the way csc does.
14867 * attribute.cs (Attribute.Resolve): Catch the
14868 NullReferenceException and report error #182 since the Mono
14869 runtime no more has the bug and having this exception raised means
14870 we tried to select a constructor which takes an object and is
14873 2002-09-05 Ravi Pratap <ravi@ximian.com>
14875 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14876 message (1502, 1503) when we can't locate a method after overload
14877 resolution. This is much more informative and closes the bug
14880 * interface.cs (PopulateMethod): Return if there are no argument
14881 types. Fixes a NullReferenceException bug.
14883 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14884 expressions too. Previously we were checking only in one place for
14885 positional arguments leaving out named arguments.
14887 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14888 type to the enum type is not allowed. Remove code corresponding to
14891 (ConvertNumericExplicit): Allow explicit conversions from
14892 the underlying type to enum type. This precisely follows the spec
14893 and closes a bug filed by Gonzalo.
14895 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14898 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14900 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14902 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14903 it was important that we stored the right value after the
14904 reduction in `converted'.
14906 2002-09-04 Martin Baulig <martin@gnome.org>
14908 * location.cs (Location.SymbolDocument): Use full pathnames for the
14911 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14913 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14914 of the expression resolve mechanism, because that will catch the
14915 SimpleName error failures.
14917 (Conditional): If we can not resolve the
14918 expression, return, do not crash.
14920 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14923 (location): display token name instead of its number.
14925 2002-08-28 Martin Baulig <martin@gnome.org>
14927 * expression.cs (Binary.ResolveOperator): Don't silently return
14928 but return an error if an operator cannot be applied between two
14931 2002-08-28 Martin Baulig <martin@gnome.org>
14933 * class.cs (Constructor.Define): Set the permission attributes
14934 correctly instead of making all constructors public.
14936 2002-08-28 Martin Baulig <martin@gnome.org>
14938 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14939 for private members before reporting a CS0103; if we find anything,
14942 2002-08-28 Martin Baulig <martin@gnome.org>
14944 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14945 to check whether `closure_start_type == closure_invocation_type',
14946 we also need to check whether `m.DeclaringType == closure_invocation_type'
14947 before bypassing the permission checks. We might be accessing
14948 protected/private members from the base class.
14949 (TypeManager.RealMemberLookup): Only set private_ok if private
14950 members were requested via BindingFlags.NonPublic.
14952 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14954 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14955 MethodGroupExpr.IsExplicitImpl if appropriate.
14956 (Invocation.DoResolve): Don't report the CS0120 for explicit
14957 interface implementations.
14959 2002-08-27 Martin Baulig <martin@gnome.org>
14961 * expression.cs (Invocation.DoResolve): If this is a static
14962 method and we don't have an InstanceExpression, we must report
14965 2002-08-25 Martin Baulig <martin@gnome.org>
14967 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14968 `==' between a valuetype and an object.
14970 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14972 * ecore.cs (TypeExpr): Provide a ToString method.
14974 2002-08-24 Martin Baulig <martin@gnome.org>
14976 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14977 now called proggie.dbg and it's a binary file.
14979 2002-08-23 Martin Baulig <martin@gnome.org>
14981 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14983 2002-08-23 Martin Baulig <martin@gnome.org>
14985 * struct.cs (MyStructInfo.ctor): Make this work with empty
14986 structs; it's not allowed to use foreach() on null.
14988 2002-08-23 Martin Baulig <martin@gnome.org>
14990 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14991 writer the full pathname of the generated assembly.
14993 2002-08-23 Martin Baulig <martin@gnome.org>
14995 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14996 A `finally' block never returns or breaks; improved handling of
14999 2002-08-23 Martin Baulig <martin@gnome.org>
15001 * statement.cs (Throw.Resolve): Allow `throw null'.
15003 2002-08-23 Martin Baulig <martin@gnome.org>
15005 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15006 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15007 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15008 MemberLookup would return a wrong event if this is an explicit
15009 interface implementation and the class has an event with the same
15012 2002-08-23 Martin Baulig <martin@gnome.org>
15014 * statement.cs (Block.AddChildVariableNames): New public method.
15015 (Block.AddChildVariableName): Likewise.
15016 (Block.IsVariableNameUsedInChildBlock): Likewise.
15017 (Block.AddVariable): Check whether a variable name has already
15018 been used in a child block.
15020 * cs-parser.jay (declare_local_variables): Mark all variable names
15021 from the current block as being used in a child block in the
15024 2002-08-23 Martin Baulig <martin@gnome.org>
15026 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15027 find the symbol writer.
15029 * driver.cs: csc also allows the arguments to /define being
15030 separated by commas, not only by semicolons.
15032 2002-08-23 Martin Baulig <martin@gnome.org>
15034 * interface.cs (Interface.GetMembers): Added static check for events.
15036 2002-08-15 Martin Baulig <martin@gnome.org>
15038 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15039 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15041 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15042 why the MethodData.EmitDestructor() change was necessary.
15044 2002-08-20 Martin Baulig <martin@gnome.org>
15046 * class.cs (TypeContainer.FindMembers): Added static check for events.
15048 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15050 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15051 use Type.GetEvents(), not Type.FindMembers().
15053 2002-08-20 Martin Baulig <martin@gnome.org>
15055 * decl.cs (MemberCache): Added a special method cache which will
15056 be used for method-only searched. This ensures that a method
15057 search will return a MethodInfo with the correct ReflectedType for
15060 2002-08-20 Martin Baulig <martin@gnome.org>
15062 * decl.cs (DeclSpace.FindMembers): Made this public.
15064 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15066 * delegate.cs: fixed build on windows.
15067 [FIXME: Filed as bug #29150: MCS must report these errors.]
15069 2002-08-19 Ravi Pratap <ravi@ximian.com>
15071 * ecore.cs (StandardConversionExists): Return a false
15072 if we are trying to convert the void type to anything else
15073 since that is not allowed.
15075 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15076 we flag error 70 in the event an event is trying to be accessed
15077 directly from outside the declaring type.
15079 2002-08-20 Martin Baulig <martin@gnome.org>
15081 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15082 MemberCache from typemanager.cs to decl.cs.
15084 2002-08-19 Martin Baulig <martin@gnome.org>
15086 * class.cs (TypeContainer): Implement IMemberContainer.
15087 (TypeContainer.DefineMembers): Create the MemberCache.
15088 (TypeContainer.FindMembers): Do better BindingFlags checking; only
15089 return public members if BindingFlags.Public was given, check
15090 whether members are static.
15092 2002-08-16 Martin Baulig <martin@gnome.org>
15094 * decl.cs (DeclSpace.Define): Splitted this in Define and
15095 DefineMembers. DefineMembers is called first and initializes the
15098 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
15099 DefineMembers() on all our DeclSpaces.
15101 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15102 but call DefineMembers() on all nested interfaces. We call their
15103 Define() in our new Define() function.
15105 * interface.cs (Interface): Implement IMemberContainer.
15106 (Interface.Define): Moved all code except the attribute stuf to
15108 (Interface.DefineMembers): Initialize the member cache.
15110 * typemanager.cs (IMemberFinder): Removed this interface, we don't
15111 need this anymore since we can use MemberCache.FindMembers directly.
15113 2002-08-19 Martin Baulig <martin@gnome.org>
15115 * typemanager.cs (MemberCache): When creating the cache for an
15116 interface type, add all inherited members.
15117 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15118 to `out bool used_cache' and documented it.
15119 (TypeManager.MemberLookup): If we already used the cache in the first
15120 iteration, we don't need to do the interfaces check.
15122 2002-08-19 Martin Baulig <martin@gnome.org>
15124 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
15125 here from IMemberFinder and don't implement this interface anymore.
15126 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15128 * typemanager.cs (IMemberFinder): This interface is now only used by
15129 classes which actually support the member cache.
15130 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15131 since we only put DeclSpaces into this Hashtable.
15132 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15133 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15135 2002-08-16 Martin Baulig <martin@gnome.org>
15137 * typemanager.cs (ICachingMemberFinder): Removed.
15138 (IMemberFinder.MemberCache): New property.
15139 (TypeManager.FindMembers): Merged this with RealFindMembers().
15140 This function will never be called from TypeManager.MemberLookup()
15141 so we can't use the cache here, just the IMemberFinder.
15142 (TypeManager.MemberLookup_FindMembers): Check whether the
15143 IMemberFinder has a MemberCache and call the cache's FindMembers
15145 (MemberCache): Rewrote larger parts of this yet another time and
15146 cleaned it up a bit.
15148 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15150 * driver.cs (LoadArgs): Support quoting.
15152 (Usage): Show the CSC-like command line arguments.
15154 Improved a few error messages.
15156 2002-08-15 Martin Baulig <martin@gnome.org>
15158 * typemanager.cs (IMemberContainer.Type): New property.
15159 (IMemberContainer.IsInterface): New property.
15161 The following changes are conditional to BROKEN_RUNTIME, which is
15162 defined at the top of the file.
15164 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15165 class'es members, but add all members from TypeHandle.ObjectType
15166 if we're an interface.
15167 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15168 is the current type.
15169 (MemberCache.CacheEntry.Container): Removed this field.
15170 (TypeHandle.GetMembers): Include inherited members.
15172 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15174 * typemanager.cs: fixed compilation and added a comment on a field that
15177 2002-08-15 Martin Baulig <martin@gnome.org>
15179 * class.cs (ConstructorInitializer.Resolve): In the
15180 Expression.MemberLookup call, use the queried_type as
15183 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15184 declared' attribute, it's always true.
15185 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15186 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15187 temporary wrapper for FindMembers which tells MemberLookup whether
15188 members from the base classes are included in the return value.
15189 This will go away soon.
15190 (TypeManager.MemberLookup): Use this temporary hack here; once the
15191 new MemberCache is completed, we don't need to do the DeclaredOnly
15192 looping here anymore since the MemberCache will take care of this.
15193 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15194 (MemberCache): When creating the MemberCache for a class, get
15195 members from the current class and all its base classes.
15196 (MemberCache.CacheEntry.Container): New field. This is a
15197 temporary hack until the Mono runtime is fixed to distinguish
15198 between ReflectedType and DeclaringType. It allows us to use MCS
15199 with both the MS runtime and the unfixed Mono runtime without
15200 problems and without accecting performance.
15201 (MemberCache.SearchMembers): The DeclaredOnly looping from
15202 TypeManager.MemberLookup is now done here.
15204 2002-08-14 Martin Baulig <martin@gnome.org>
15206 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15207 Type.GetFields on dynamic types but get the fields from the
15208 corresponding TypeContainer.
15209 (MyStructInfo.GetStructInfo): Added check for enum types.
15211 * typemanager.cs (MemberList.IsSynchronized): Implemented.
15212 (MemberList.SyncRoot): Implemented.
15213 (TypeManager.FilterWithClosure): No need to check permissions if
15214 closure_start_type == closure_invocation_type, don't crash if
15215 closure_invocation_type is null.
15217 2002-08-13 Martin Baulig <martin@gnome.org>
15219 Rewrote TypeContainer.FindMembers to use a member cache. This
15220 gives us a speed increase of about 35% for the self-hosting MCS
15221 build and of about 15-20% for the class libs (both on GNU/Linux).
15223 * report.cs (Timer): New class to get enhanced profiling. This
15224 whole class is "TIMER" conditional since it remarkably slows down
15227 * class.cs (MemberList): New class. This is an IList wrapper
15228 which we're now using instead of passing MemberInfo[]'s around to
15229 avoid copying this array unnecessarily.
15230 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15231 (ICachingMemberFinder, IMemberContainer): New interface.
15232 (TypeManager.FilterWithClosure): If `criteria' is null, the name
15233 has already been checked, otherwise use it for the name comparision.
15234 (TypeManager.FindMembers): Renamed to RealMemberFinder and
15235 provided wrapper which tries to use ICachingMemberFinder.FindMembers
15236 if possible. Returns a MemberList, not a MemberInfo [].
15237 (TypeHandle): New class, implements IMemberContainer. We create
15238 one instance of this class per type, it contains a MemberCache
15239 which is used to do the member lookups.
15240 (MemberCache): New class. Each instance of this class contains
15241 all members of a type and a name-based hash table.
15242 (MemberCache.FindMembers): This is our new member lookup
15243 function. First, it looks up all members of the requested name in
15244 the hash table. Then, it walks this list and sorts out all
15245 applicable members and returns them.
15247 2002-08-13 Martin Baulig <martin@gnome.org>
15249 In addition to a nice code cleanup, this gives us a performance
15250 increase of about 1.4% on GNU/Linux - not much, but it's already
15251 half a second for the self-hosting MCS compilation.
15253 * typemanager.cs (IMemberFinder): New interface. It is used by
15254 TypeManager.FindMembers to call FindMembers on a TypeContainer,
15255 Enum, Delegate or Interface.
15256 (TypeManager.finder_to_member_finder): New PtrHashtable.
15257 (TypeManager.finder_to_container): Removed.
15258 (TypeManager.finder_to_delegate): Removed.
15259 (TypeManager.finder_to_interface): Removed.
15260 (TypeManager.finder_to_enum): Removed.
15262 * interface.cs (Interface): Implement IMemberFinder.
15264 * delegate.cs (Delegate): Implement IMemberFinder.
15266 * enum.cs (Enum): Implement IMemberFinder.
15268 * class.cs (TypeContainer): Implement IMemberFinder.
15270 2002-08-12 Martin Baulig <martin@gnome.org>
15272 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15274 2002-08-12 Martin Baulig <martin@gnome.org>
15276 * ecore.cs (ITypeExpression): New interface for expressions which
15278 (TypeExpression): Renamed to TypeLookupExpression.
15279 (Expression.DoResolve): If we're doing a types-only lookup, the
15280 expression must implement the ITypeExpression interface and we
15281 call DoResolveType() on it.
15282 (SimpleName): Implement the new ITypeExpression interface.
15283 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15284 hack, the situation that we're only looking up types can't happen
15285 anymore when this method is called. Moved the type lookup code to
15286 DoResolveType() and call it.
15287 (SimpleName.DoResolveType): This ITypeExpression interface method
15288 is now doing the types-only lookup.
15289 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15290 (ResolveFlags): Added MaskExprClass.
15292 * expression.cs (MemberAccess): Implement the ITypeExpression
15294 (MemberAccess.DoResolve): Added support for a types-only lookup
15295 when we're called via ITypeExpression.DoResolveType().
15296 (ComposedCast): Implement the ITypeExpression interface.
15298 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15299 Expression.Resolve() with ResolveFlags.Type instead.
15301 2002-08-12 Martin Baulig <martin@gnome.org>
15303 * interface.cs (Interface.Define): Apply attributes.
15305 * attribute.cs (Attribute.ApplyAttributes): Added support for
15306 interface attributes.
15308 2002-08-11 Martin Baulig <martin@gnome.org>
15310 * statement.cs (Block.Emit): Only check the "this" variable if we
15311 do not always throw an exception.
15313 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15314 whether the property has a set accessor.
15316 2002-08-11 Martin Baulig <martin@gnome.org>
15318 Added control flow analysis support for structs.
15320 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15321 with control flow analysis turned off.
15322 (IVariable): New interface.
15323 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15324 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15325 (FieldExpr.DoResolve): Resolve the instance expression with flow
15326 analysis turned off and do the definite assignment check after the
15327 resolving when we know what the expression will resolve to.
15329 * expression.cs (LocalVariableReference, ParameterReference):
15330 Implement the new IVariable interface, only call the flow analysis
15331 code if ec.DoFlowAnalysis is true.
15332 (This): Added constructor which takes a Block argument. Implement
15333 the new IVariable interface.
15334 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15335 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15336 This does the definite assignment checks for struct members.
15338 * class.cs (Constructor.Emit): If this is a non-static `struct'
15339 constructor which doesn't have any initializer, call
15340 Block.AddThisVariable() to tell the flow analysis code that all
15341 struct elements must be initialized before control returns from
15344 * statement.cs (MyStructInfo): New public class.
15345 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15346 argument to this indexer. If non-zero, check an individual struct
15347 member, not the whole struct.
15348 (FlowBranching.CheckOutParameters): Check struct members.
15349 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15350 overloaded versions of these methods which take an additional
15351 `int field_idx' argument to check struct members.
15352 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15353 overloaded versions of these methods which take an additional
15354 `string field_name' argument to check struct member.s
15355 (VariableInfo): Implement the IVariable interface.
15356 (VariableInfo.StructInfo): New public property. Returns the
15357 MyStructInfo instance of the variable if it's a struct or null.
15358 (Block.AddThisVariable): New public method. This is called from
15359 Constructor.Emit() for non-static `struct' constructor which do
15360 not have any initializer. It creates a special variable for the
15361 "this" instance variable which will be checked by the flow
15362 analysis code to ensure that all of the struct's fields are
15363 initialized before control returns from the constructor.
15364 (UsageVector): Added support for struct members. If a
15365 variable/parameter is a struct with N members, we reserve a slot
15366 in the usage vector for each member. A struct is considered fully
15367 initialized if either the struct itself (slot 0) or all its
15368 members are initialized.
15370 2002-08-08 Martin Baulig <martin@gnome.org>
15372 * driver.cs (Driver.MainDriver): Only report an error CS5001
15373 if there were no compilation errors.
15375 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15376 `UnsafeContext' property to determine whether the parent is in
15377 unsafe context rather than checking the parent's ModFlags:
15378 classes nested in an unsafe class are unsafe as well.
15380 2002-08-08 Martin Baulig <martin@gnome.org>
15382 * statement.cs (UsageVector.MergeChildren): Distinguish between
15383 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15384 we return. Added test17() and test18() to test-154.cs.
15386 2002-08-08 Martin Baulig <martin@gnome.org>
15388 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15389 Family access, make sure the invoking type isn't a subclass of the
15390 queried type (that'd be a CS1540).
15392 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15393 this method which takes an additional `Type invocation_type'.
15395 * expression.cs (BaseAccess.DoResolve): Use the base type as
15396 invocation and query type.
15397 (MemberAccess.DoResolve): If the lookup failed and we're about to
15398 report a CS0122, try a lookup with the ec.ContainerType - if this
15399 succeeds, we must report a CS1540.
15401 2002-08-08 Martin Baulig <martin@gnome.org>
15403 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15404 (MethodGroupExpr): Implement the IMemberExpr interface.
15406 * expression (MemberAccess.ResolveMemberAccess): No need to have
15407 any special code for MethodGroupExprs anymore, they're now
15410 2002-08-08 Martin Baulig <martin@gnome.org>
15412 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15413 Family, FamANDAssem and FamORAssem permissions.
15414 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15416 2002-08-08 Martin Baulig <martin@gnome.org>
15418 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15419 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15422 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15424 * driver.cs: implemented /resource option to embed managed resources.
15426 2002-08-07 Martin Baulig <martin@gnome.org>
15428 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15429 (FieldBase.HasFieldInitializer): New public property.
15430 (FieldBase.GetInitializerExpression): New public method. Resolves and
15431 returns the field initializer and makes sure it is only resolved once.
15432 (TypeContainer.EmitFieldInitializers): Call
15433 FieldBase.GetInitializerExpression to get the initializer, this ensures
15434 that it isn't resolved multiple times.
15436 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15437 the resolving process (SimpleName/MemberLookup) that we're currently
15438 emitting a field initializer (which must not access any instance members,
15439 this is an error CS0236).
15441 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15442 argument, if the `IsFieldInitializer' flag is set, we must report and
15443 error CS0236 and not an error CS0120.
15445 2002-08-07 Martin Baulig <martin@gnome.org>
15447 * ecore.cs (IMemberExpr): New public interface.
15448 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15449 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15450 if the expression is an IMemberExpr.
15452 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15453 to be null, implicitly default to `this' if we're non-static in
15454 this case. Simplified the code a lot by using the new IMemberExpr
15455 interface. Also fixed bug #28176 here.
15457 2002-08-06 Martin Baulig <martin@gnome.org>
15459 * cs-parser.jay (SimpleLookup): Removed. We need to create
15460 ParameterReferences during semantic analysis so that we can do a
15461 type-only search when resolving Cast, TypeOf and SizeOf.
15462 (block): Pass the `current_local_parameters' to the Block's
15465 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15466 argument to the constructor.
15467 (ConstructorInitializer.Resolve): Create a temporary implicit
15468 block with the parameters.
15470 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15471 references here if we aren't doing a type-only search.
15473 * statement.cs (Block): Added constructor which takes a
15474 `Parameters parameters' argument.
15475 (Block.Parameters): New public property.
15477 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15478 to `Parameters' and made it public readonly.
15480 2002-08-06 Martin Baulig <martin@gnome.org>
15482 * ecore.cs (Expression.Warning): Made this public as well.
15484 * report.cs (Report.Debug): Print the contents of collections.
15486 2002-08-06 Martin Baulig <martin@gnome.org>
15488 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15489 used to tell Resolve() which kinds of expressions it may return.
15490 (Expression.Resolve): Added overloaded version of this method which
15491 takes a `ResolveFlags flags' argument. This can be used to tell
15492 Resolve() which kinds of expressions it may return. Reports a
15494 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15495 ResolveFlags.SimpleName.
15496 (Expression.Error118): Added overloaded version of this method which
15497 takes a `ResolveFlags flags' argument. It uses the flags to determine
15498 which kinds of expressions are allowed.
15500 * expression.cs (Argument.ResolveMethodGroup): New public method.
15501 Resolves an argument, but allows a MethodGroup to be returned.
15502 This is used when invoking a delegate.
15504 * TODO: Updated a bit.
15506 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15508 Fixed compilation with csc.
15510 * ecore.cs: Expression.Error made public. Is this correct? Should
15511 Warning be made public too?
15513 * expression.cs: use ea.Location instead of ea.loc.
15514 [FIXME: Filed as bug #28607: MCS must report these errors.]
15516 2002-08-06 Martin Baulig <martin@gnome.org>
15518 * ecore.cs (Expression.loc): Moved the location here instead of
15519 duplicating it in all derived classes.
15520 (Expression.Location): New public property.
15521 (Expression.Error, Expression.Warning): Made them non-static and
15522 removed the location argument.
15523 (Expression.Warning): Added overloaded version which takes an
15524 `int level' argument.
15525 (Expression.Error118): Make this non-static and removed the
15526 expression and location arguments.
15527 (TypeExpr): Added location argument to the constructor.
15529 * expression.cs (StaticCallExpr): Added location argument to
15531 (Indirection, PointerArithmetic): Likewise.
15532 (CheckedExpr, UnCheckedExpr): Likewise.
15533 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15534 (StringPtr): Likewise.
15537 2002-08-05 Martin Baulig <martin@gnome.org>
15539 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15541 * assign.cs (Assign.DoResolve): Check whether the source
15542 expression is a value or variable.
15544 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15545 while resolving the corresponding blocks.
15547 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15548 an error, don't silently return null.
15550 * statement.cs (Block.AddVariable): Do the error reporting here
15551 and distinguish between CS0128 and CS0136.
15552 (Block.DoResolve): Report all unused labels (warning CS0164).
15553 (LabeledStatement): Pass the location to the constructor.
15554 (LabeledStatement.HasBeenReferenced): New property.
15555 (LabeledStatement.Resolve): Set it to true here.
15557 * statement.cs (Return.Emit): Return success even after reporting
15558 a type mismatch error (CS0126 or CS0127), this is what csc does and
15559 it avoids confusing the users with any consecutive errors.
15561 2002-08-05 Martin Baulig <martin@gnome.org>
15563 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15565 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15567 * expression.cs (MemberAccess.DoResolve): Silently return if an
15568 error has already been reported.
15570 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15571 error has already been reported.
15573 2002-08-05 Martin Baulig <martin@gnome.org>
15575 * statement.cs (UsageVector): Only initialize the `parameters'
15576 vector if we actually have any "out" parameters.
15578 2002-08-05 Martin Baulig <martin@gnome.org>
15580 * expression.cs (Binary.ResolveOperator): When combining delegates,
15581 they must have the same type.
15583 2002-08-05 Martin Baulig <martin@gnome.org>
15585 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15586 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15587 work with the ms runtime and we also don't need it: if we're a
15588 PropertyBuilder and not in the `indexer_arguments' hash, then we
15589 are a property and not an indexer.
15591 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15592 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15593 since the latter one doesn't work with the ms runtime.
15595 2002-08-03 Martin Baulig <martin@gnome.org>
15597 Fixed bugs #27998 and #22735.
15599 * class.cs (Method.IsOperator): New public field.
15600 (Method.CheckBase): Report CS0111 if there's already a method
15601 with the same parameters in the current class. Report CS0508 when
15602 attempting to change the return type of an inherited method.
15603 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15604 and it's not marked abstract or extern.
15605 (PropertyBase): New abstract base class for Property and Indexer.
15606 (PropertyBase.CheckBase): Moved here from Property and made it work
15608 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15609 the same so we can reuse it there.
15610 (Property, Indexer): Derive from PropertyBase.
15611 (MethodSignature.inheritable_property_signature_filter): New delegate
15612 to find properties and indexers.
15614 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15615 argument and improved error reporting.
15617 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15618 EmptyReadOnlyParameters and made it a property.
15620 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15621 version of this method which takes a `PropertyInfo indexer'.
15622 (TypeManager.RegisterIndexer): New method.
15624 * class.cs: Added myself as author of this file :-)
15626 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15628 * class.cs: fixed compilation on windoze.
15630 2002-08-03 Martin Baulig <martin@gnome.org>
15632 * interface.cs (Interface.GetInterfaceBases): Check whether all
15633 base interfaces are at least as accessible than the current one.
15635 * class.cs (TypeContainer.GetClassBases): Check whether base types
15636 are at least as accessible than the current type.
15637 (TypeContainer.AsAccessible): Implemented and made non-static.
15638 (MemberBase.CheckParameters): Report errors if the accessibility
15641 * delegate.cs (Delegate.Delegate): The default visibility is
15642 internal for top-level types and private for nested types.
15643 (Delegate.Define): Report errors if the accessibility checks fail.
15645 * enum.cs (Enum.Enum): The default visibility is internal for
15646 top-level types and private for nested types.
15647 (Enum.DefineType): Compute the correct visibility.
15649 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15650 function which takes a `bool is_toplevel' instead of a TypeContainer.
15652 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15655 2002-08-02 Martin Baulig <martin@gnome.org>
15657 * expression.cs (LocalVariableReferenc): Added constructor which
15658 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15659 (LocalVariableReference.IsReadOnly): New property.
15660 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15661 variable is readonly, use our own readonly flag to do this; you can
15662 use the new constructor to get a writable reference to a read-only
15665 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15666 reference to the local variable.
15668 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15670 * rootcontext.cs (ResolveCore): Also include System.Exception
15672 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15673 we reach an EmptyStatement.
15675 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15678 * expression.cs (Binary.ResolveOperator): Check error result in
15681 use brtrue/brfalse directly and avoid compares to null.
15683 2002-08-02 Martin Baulig <martin@gnome.org>
15685 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15686 Fixes bug #28407, added test-155.cs.
15688 2002-08-01 Martin Baulig <martin@gnome.org>
15690 * class.cs (Event.EmitDefaultMethod): Make this work with static
15691 events. Fixes #28311, added verify-3.cs.
15693 2002-08-01 Martin Baulig <martin@gnome.org>
15695 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15696 `is_disposable' fields.
15697 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15698 `hm.is_disposable' if we're using the collection pattern.
15699 (Foreach.EmitCollectionForeach): Use the correct type for the
15700 enumerator's local variable, only emit the try/finally block if
15701 necessary (fixes #27713).
15703 2002-08-01 Martin Baulig <martin@gnome.org>
15705 * ecore.cs (Expression.report118): Renamed to Error118 and made
15708 * statement.cs (Throw.Resolve): Check whether the expression is of
15709 the correct type (CS0118) and whether the type derives from
15710 System.Exception (CS0155).
15711 (Catch.Resolve): New method. Do the type lookup here and check
15712 whether it derives from System.Exception (CS0155).
15713 (Catch.CatchType, Catch.IsGeneral): New public properties.
15715 * typemanager.cs (TypeManager.exception_type): Added.
15717 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15719 * driver.cs: Updated About function.
15721 2002-07-31 Martin Baulig <martin@gnome.org>
15723 Implemented Control Flow Analysis.
15725 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15726 (EmitContext.CurrentBranching): Added.
15727 (EmitContext.StartFlowBranching): Added.
15728 (EmitContext.EndFlowBranching): Added.
15729 (EmitContext.KillFlowBranching): Added.
15730 (EmitContext.IsVariableAssigned): Added.
15731 (EmitContext.SetVariableAssigned): Added.
15732 (EmitContext.IsParameterAssigned): Added.
15733 (EmitContext.SetParameterAssigned): Added.
15734 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15735 Added control flow analysis stuff here.
15737 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15738 resolve the expression as lvalue.
15739 (LocalVariableReference.DoResolve): Check whether the variable has
15740 already been assigned.
15741 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15742 the parameter as assigned here.
15743 (ParameterReference.DoResolve): Check whether the parameter has already
15745 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15746 expression as lvalue.
15748 * statement.cs (FlowBranching): New class for the flow analysis code.
15749 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15750 (LabeledStatement.IsDefined): New public property.
15751 (LabeledStatement.AddUsageVector): New public method to tell flow
15752 analyis that the label may be reached via a forward jump.
15753 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15755 (VariableInfo.Number): New public field. This is used by flow analysis
15756 to number all locals of a block.
15757 (Block.CountVariables): New public property. This is the number of
15758 local variables in this block (including the locals from all parent
15760 (Block.EmitMeta): Number all the variables.
15762 * statement.cs: Added flow analysis support to all classes.
15764 2002-07-31 Martin Baulig <martin@gnome.org>
15766 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15767 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15768 then use this argument.
15770 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15772 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15773 use this to specify /define options.
15775 2002-07-29 Martin Baulig <martin@gnome.org>
15777 * statement.cs (Fixed): Moved all code that does variable lookups
15778 and resolvings from Emit to Resolve.
15780 * statement.cs (For): Moved all code that does variable lookups
15781 and resolvings from Emit to Resolve.
15783 * statement.cs (Using): Moved all code that does variable lookups
15784 and resolvings from Emit to Resolve.
15786 2002-07-29 Martin Baulig <martin@gnome.org>
15788 * attribute.cs (Attribute.Resolve): Explicitly catch a
15789 System.NullReferenceException when creating the
15790 CustromAttributeBuilder and report a different warning message.
15792 2002-07-29 Martin Baulig <martin@gnome.org>
15794 * support.cs (ParameterData.ParameterName): Added method to
15795 get the name of a parameter.
15797 * typemanager.cs (TypeManager.IsValueType): New public method.
15799 2002-07-29 Martin Baulig <martin@gnome.org>
15801 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15802 is a flag which specifies that it's either ref or out.
15803 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15804 the out parameter to `out Parameter.Modifier mod', also set the
15805 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15807 * support.cs (InternalParameters.ParameterModifier): Distinguish
15808 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15809 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15811 * expression.cs (Argument.GetParameterModifier): Distinguish
15812 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15813 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15815 2002-07-29 Martin Baulig <martin@gnome.org>
15817 * expression.cs (ParameterReference.ParameterReference): Added
15818 `Location loc' argument to the constructor.
15820 * cs-parser.jay: Pass location to ParameterReference.
15822 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15824 * statement.cs (Try): Initialize the location.
15826 * cs-parser.jay: pass location to Try.
15828 * expression.cs (Unary.Reduce): Change the prototype to return
15829 whether a constant fold could be performed or not. The result is
15830 returned in an out parameters. In the case of Indirection and
15831 AddressOf, we want to perform the full tests.
15833 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15835 * statement.cs (Statement.Emit): Flag dead code.
15837 2002-07-27 Andrew Birkett <andy@nobugs.org>
15839 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15841 2002-07-27 Martin Baulig <martin@gnome.org>
15843 * class.cs (MethodData.Define): Put back call to
15844 TypeManager.AddMethod(), accidentally commented this out.
15846 * report.cs (Debug): New public method to print debugging information,
15847 this is `[Conditional ("DEBUG")]'.
15849 2002-07-26 Martin Baulig <martin@gnome.org>
15851 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15852 (switch_statement): Push the current_block to the switch_stack and
15853 pop it again when we're done with the switch.
15854 (switch_section): The new block is a child of the current_block.
15855 Fixes bug #24007, added test-152.cs.
15857 2002-07-27 Martin Baulig <martin@gnome.org>
15859 * expression.cs (Invocation.EmitArguments): When calling a varargs
15860 function with only its fixed arguments, we need to pass an empty
15863 2002-07-27 Martin Baulig <martin@gnome.org>
15865 Mono 0.13 has been released.
15867 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15869 * driver.cs: Rename --resource to --linkres, because that is what
15870 we do currently, we dont support --resource yet.
15872 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15874 2002-07-25 Martin Baulig <martin@gnome.org>
15876 * class.cs (MethodData): New public class. This is a `method builder'
15877 class for a method or one accessor of a Property/Indexer/Event.
15878 (MethodData.GetMethodFlags): Moved here from MemberBase.
15879 (MethodData.ApplyAttributes): Likewise.
15880 (MethodData.ApplyObsoleteAttribute): Likewise.
15881 (MethodData.ApplyConditionalAttribute): Likewise.
15882 (MethodData.ApplyDllImportAttribute): Likewise.
15883 (MethodData.CheckAbstractAndExternal): Likewise.
15884 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15885 (MethodData.Emit): Formerly known as Method.Emit().
15886 (MemberBase): Moved everything which was specific to a single
15887 accessor/method to MethodData.
15888 (Method): Create a new MethodData and call Define() and Emit() on it.
15889 (Property, Indexer, Event): Create a new MethodData objects for each
15890 accessor and call Define() and Emit() on them.
15892 2002-07-25 Martin Baulig <martin@gnome.org>
15894 Made MethodCore derive from MemberBase to reuse the code from there.
15895 MemberBase now also checks for attributes.
15897 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15898 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15900 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15901 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15902 (MemberBase.ApplyAttributes): New virtual method; applies the
15903 attributes to a method or accessor.
15904 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15905 (MemberBase.ApplyConditionalAttribute): Likewise.
15906 (MemberBase.ApplyDllImportAttribute): Likewise.
15907 (MemberBase.CheckAbstractAndExternal): Likewise.
15908 (MethodCore.ParameterTypes): This is now a property instead of a
15909 method, it's initialized from DoDefineParameters().
15910 (MethodCore.ParameterInfo): Removed the set accessor.
15911 (MethodCore.DoDefineParameters): New protected virtual method to
15912 initialize ParameterTypes and ParameterInfo.
15913 (Method.GetReturnType): We can now simply return the MemberType.
15914 (Method.GetMethodFlags): Override the MemberBase version and add
15915 the conditional flags.
15916 (Method.CheckBase): Moved some code from Define() here, call
15917 DoDefineParameters() here.
15918 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15919 here to avoid some larger code duplication.
15920 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15921 ensure that abstract and external accessors don't declare a body.
15923 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15924 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15925 lookup in the attribute's parent classes, so we need to abort as soon
15926 as we found the first match.
15927 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15928 the attribute has no arguments.
15930 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15933 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15935 * cs-parser.jay: reverted previous patch.
15937 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15939 * cs-parser.jay: fixed bug #22119.
15941 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15943 * attribute.cs: fixed compilation. The error was:
15944 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15945 be assigned to before control leaves the current method."
15946 [FIXME: Filed as bug #28186: MCS must report this error.]
15948 2002-07-25 Martin Baulig <martin@gnome.org>
15950 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15951 method to pull the condition name ouf of a Conditional attribute.
15952 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15953 the obsolete message and error flag out of an Obsolete attribute.
15955 * class.cs (Method.GetMethodFlags): New public method to get the
15956 TypeManager.MethodFlags for this method.
15957 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15959 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15960 if we're overriding a virtual function, set the new private variable
15961 `parent_method'; call the new TypeManager.AddMethod().
15963 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15964 the MethodBuilder and the Method in a PtrHashtable.
15965 (TypeManager.builder_to_method): Added for this purpose.
15966 (TypeManager.MethodFlags): Added IsObsoleteError.
15967 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15968 Obsolete and Conditional arguments in MethodBuilders. If we discover
15969 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15970 the message from the attribute.
15972 2002-07-24 Martin Baulig <martin@gnome.org>
15974 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15975 preprocessor directives, ensure that the argument to #define/#undef is
15976 exactly one identifier and that it's actually an identifier.
15978 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15981 2002-07-24 Martin Baulig <martin@gnome.org>
15983 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15984 initialize it to TypeManager.object_type in the constructor.
15985 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15986 of the `hm.get_current' method if we're using the collection pattern.
15987 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15988 for the explicit conversion to make it work when we're using the collection
15989 pattern and the `Current' property has a different return type than `object'.
15992 2002-07-24 Martin Baulig <martin@gnome.org>
15994 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15995 does not match, but don't report any errors. This method is called in
15996 order for all methods in a MethodGroupExpr until a matching method is
15997 found, so we don't want to bail out if the first method doesn't match.
15998 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15999 matches, report the 123. Fixes #28070.
16001 2002-07-24 Martin Baulig <martin@gnome.org>
16003 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16004 TypeManager.TypeToCoreType() to the top of the method so the
16005 following equality checks will work. Fixes #28107.
16007 2002-07-24 Martin Baulig <martin@gnome.org>
16009 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16010 operand is of type uint, and the other operand is of type sbyte,
16011 short or int, the operands are converted to type long." -
16012 Actually do what this comment already told us. Fixes bug #28106,
16015 2002-07-24 Martin Baulig <martin@gnome.org>
16017 * class.cs (MethodBase): New abstract class. This is now a base
16018 class for Property, Indexer and Event to avoid some code duplication
16019 in their Define() and DefineMethods() methods.
16020 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16021 generic methods for Define() and DefineMethods().
16022 (FieldBase): Derive from MemberBase, not MemberCore.
16023 (Property): Derive from MemberBase, not MemberCore.
16024 (Property.DefineMethod): Moved all the code from this method to the
16025 new MethodBase.DefineAccessor(), just call it with appropriate
16027 (Property.Define): Call the new Property.DoDefine(), this does some
16028 sanity checks and we don't need to duplicate the code everywhere.
16029 (Event): Derive from MemberBase, not MemberCore.
16030 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16031 accessors, this will also make them work with interface events.
16032 (Indexer): Derive from MemberBase, not MemberCore.
16033 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16034 (Indexer.Define): Use the new MethodBase functions.
16036 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16037 argument to the constructor.
16038 (Interface.FindMembers): Added support for interface events.
16039 (Interface.PopluateEvent): Implemented.
16041 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16043 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16045 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16046 but this is required to check for a method name being the same as
16047 the containing class.
16051 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16053 * interface.cs: initialize variable.
16055 2002-07-23 Martin Baulig <martin@gnome.org>
16057 Implemented the IndexerName attribute in interfaces.
16059 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16060 name if this is an explicit interface implementation.
16061 (Indexer.InterfaceIndexerName): New public variable. If we're
16062 implementing an interface indexer, this is the IndexerName in that
16063 interface. Otherwise, it's the IndexerName.
16064 (Indexer.DefineMethod): If we're implementing interface indexer,
16065 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16066 and Pending.ImplementIndexer methods.
16067 (Indexer.Define): Also define the PropertyBuilder if we're
16068 implementing an interface indexer and this is neither an explicit
16069 interface implementation nor do the IndexerName match the one in
16072 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16073 If a method is defined here, then we always need to create a proxy
16074 for it. This is used when implementing interface indexers.
16075 (Pending.IsInterfaceIndexer): New public method.
16076 (Pending.ImplementIndexer): New public method.
16077 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16078 This is used when implementing interface indexers to define a proxy
16080 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16081 define a proxy if necessary.
16083 * interface.cs (Interface.IndexerName): New public variable.
16084 (Interface.PopulateIndexer): Set the IndexerName.
16085 (Interface.DefineIndexers): New private method. Populate all the
16086 indexers and make sure their IndexerNames match.
16088 * typemanager.cs (IndexerPropertyName): Added support for interface
16091 2002-07-22 Martin Baulig <martin@gnome.org>
16093 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16094 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16095 ret if HasReturnLabel.
16096 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16099 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16100 and set the ec.LoopBeginTryCatchLevel.
16101 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16102 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16103 the current ec.TryCatchLevel, the branch goes out of an exception
16104 block. In this case, we need to use Leave and not Br.
16106 2002-07-22 Martin Baulig <martin@gnome.org>
16108 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16109 block unless the block does not always return or it is contained in
16110 another try { ... } catch { ... } block. Fixes bug #26506.
16111 Added verify-1.cs to the test suite.
16113 2002-07-22 Martin Baulig <martin@gnome.org>
16115 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16116 then we do not always return. Fixes bug #24985.
16118 2002-07-22 Martin Baulig <martin@gnome.org>
16120 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16121 lookup on a per-class level; ie. walk up the class hierarchy until we
16122 found at least one applicable method, then choose the best among them.
16123 Fixes bug #24463 and test-29.cs.
16125 2002-07-22 Martin Baulig <martin@gnome.org>
16127 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16128 return types of the methods. The return type is not part of the
16129 signature and we must not check it to make the `new' modifier work.
16130 Fixes bug #27999, also added test-147.cs.
16131 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16133 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16134 on the method's return type.
16136 2002-07-21 Martin Baulig <martin@gnome.org>
16138 * assign.cs: Make this work if the rightmost source is a constant and
16139 we need to do an implicit type conversion. Also adding a few more tests
16140 to test-38.cs which should have caught this.
16142 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16143 target in the makefile for this. The makefile.gnu is primarily intended
16144 for end-users who don't want to debug the compiler.
16146 2002-07-21 Martin Baulig <martin@gnome.org>
16148 * assign.cs: Improved the Assign class so it can now handle embedded
16149 assignments (X = Y = Z = something). As a side-effect this'll now also
16150 consume less local variables. test-38.cs now passes with MCS, added
16151 a few new test cases to that test.
16153 2002-07-20 Martin Baulig <martin@gnome.org>
16155 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16156 instructions. Fixes bug #27977, also added test-146.cs.
16158 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16160 * cs-tokenizer.cs: fixed getHex ().
16162 2002-07-19 Martin Baulig <martin@gnome.org>
16164 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16165 not Type.GetType() to lookup the array type. This is needed when
16166 we're constructing an array of a user-defined type.
16167 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16168 single-dimensional arrays, but also for single-dimensial arrays of
16171 2002-07-19 Martin Baulig <martin@gnome.org>
16173 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16174 this function is called, it's not allowed to share LocalBuilders
16175 among ILGenerators.
16177 2002-07-19 Martin Baulig <martin@gnome.org>
16179 * expression.cs (Argument.Resolve): Report an error 118 when trying
16180 to pass a type as argument.
16182 2002-07-18 Martin Baulig <martin@gnome.org>
16184 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16185 Conv_R_Un for the signed `long' type.
16187 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16189 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16190 `expr' for the temporary result, as that will fail if we do
16191 multiple resolves on the same expression.
16193 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16195 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16196 ec.TypeContainer for looking up aliases.
16198 * class.cs (TypeContainer): Remove LookupAlias from here.
16200 * decl.cs (DeclSpace); Move here.
16202 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16204 * class.cs (FindMembers): Only call filter if the constructor
16205 bulider is not null.
16207 Also handle delegates in `NestedTypes' now. Now we will perform
16208 type lookups using the standard resolution process. This also
16211 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16212 This uses Expressions (the limited kind that can be parsed by the
16213 tree) instead of strings.
16215 * expression.cs (ComposedCast.ToString): Implement, used to flag
16216 errors since now we have to render expressions.
16218 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
16221 * ecore.cs (SimpleName.ToString): ditto.
16223 * cs-parser.jay: Instead of using strings to assemble types, use
16224 Expressions to assemble the type (using SimpleName, ComposedCast,
16225 MemberAccess). This should fix the type lookups in declarations,
16226 because we were using a different code path for this.
16228 * statement.cs (Block.Resolve): Continue processing statements
16229 even when there is an error.
16231 2002-07-17 Miguel de Icaza <miguel@ximian.com>
16233 * class.cs (Event.Define): Also remove the `remove' method from
16234 the list of pending items.
16236 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16237 generate more compact code.
16239 2002-07-17 Martin Baulig <martin@gnome.org>
16241 * const.cs (Const.LookupConstantValue): Add support for constant
16242 `unchecked' and `checked' expressions.
16243 Also adding test case test-140.cs for this.
16245 2002-07-17 Martin Baulig <martin@gnome.org>
16247 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16248 check whether mi.ReturnType implements the IEnumerator interface; the
16249 `==' and the IsAssignableFrom() will fail in this situation.
16251 2002-07-16 Ravi Pratap <ravi@ximian.com>
16253 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
16256 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16258 * expression.cs: fixed bug #27811.
16260 2002-07-14 Miguel de Icaza <miguel@ximian.com>
16262 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16263 Molaro: when we are a ref, the value already contains a pointer
16264 value, do not take the address of it.
16266 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16267 * removed mb-parser.jay and mb-tokenizer.cs
16269 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16271 * expression.cs: check against the building corlib void type.
16273 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16275 * ecore.cs: fix for valuetype static readonly fields: when
16276 initializing them, we need their address, not the address of a copy.
16278 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16280 * typemanager.cs: register also enum_type in corlib.
16282 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16284 * class.cs: allow calling this (but not base) initializers in structs.
16286 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16288 * ecore.cs: make sure we compare against the building base types
16291 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16293 * typemanager.cs: fix TypeToCoreType() to handle void and object
16294 (corlib gets no more typerefs after this change).
16296 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16298 * expression.cs (ArrayCreation.EmitArrayArguments): use
16299 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16301 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16302 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16303 array indexes, the runtime actually forbids them.
16305 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16306 for array arguments here.
16308 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16309 instead of the default for ValueTypes.
16311 (New.DoEmit): Use IsValueType instead of
16312 IsSubclassOf (value_type)
16313 (New.DoResolve): ditto.
16314 (Invocation.EmitCall): ditto.
16316 * assign.cs (Assign): ditto.
16318 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16319 Statements *are* currently doing part of their resolution during
16322 Expressions do always resolve during resolve, but statements are
16323 only required to propagate resolution to their children.
16325 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16327 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16329 (LoadAssembly): Do not add the dll if it is already specified
16331 (MainDriver): Add the System directory to the link path at the end,
16332 after all the other -L arguments.
16334 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16335 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16336 ldelem.u1) and using the opposite for sbytes.
16338 This fixes Digger, and we can finally run it.
16340 * driver.cs (UnixParseOption): Move the option parsing here.
16341 (CSCParseOption): Implement CSC-like parsing of options.
16343 We now support both modes of operation, the old Unix way, and the
16344 new CSC-like way. This should help those who wanted to make cross
16345 platform makefiles.
16347 The only thing broken is that /r:, /reference: and /lib: are not
16348 implemented, because I want to make those have the same semantics
16349 as the CSC compiler has, and kill once and for all the confussion
16350 around this. Will be doing this tomorrow.
16352 * statement.cs (Unsafe.Resolve): The state is checked during
16353 resolve, not emit, so we have to set the flags for IsUnsfe here.
16355 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16357 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16358 not catch the Error_ObjectRefRequired in SimpleName (as it is
16359 possible to have a class/instance variable name that later gets
16360 deambiguated), we have to check this here.
16362 2002-07-10 Ravi Pratap <ravi@ximian.com>
16364 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16365 make static and put into Expression.
16367 (Event.Define): Register the private field of the event with the
16368 TypeManager so that GetFieldFromEvent can get at it.
16370 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16371 keep track of the private field associated with an event which
16374 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16377 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16379 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16381 * expression.cs (Binary.EmitBranchable): this routine emits the
16382 Binary expression in a branchable context. This basically means:
16383 we need to branch somewhere, not just get the value on the stack.
16385 This works together with Statement.EmitBoolExpression.
16387 * statement.cs (Statement.EmitBoolExpression): Use
16390 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16392 * statement.cs (For): Reduce the number of jumps in loops.
16394 (For): Implement loop inversion for the For statement.
16396 (Break): We can be breaking out of a Try/Catch controlled section
16397 (foreach might have an implicit try/catch clause), so we need to
16398 use Leave instead of Br.
16400 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16401 now). If the instace expression supports IMemoryLocation, we use
16402 the AddressOf method from the IMemoryLocation to extract the
16403 address instead of emitting the instance.
16405 This showed up with `This', as we were emitting the instance
16406 always (Emit) instead of the Address of This. Particularly
16407 interesting when This is a value type, as we dont want the Emit
16408 effect (which was to load the object).
16410 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16412 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16414 * statement.cs (Checked): Set the CheckedState during the resolve
16415 process too, as the ConvCast operations track the checked state on
16416 the resolve process, and not emit.
16418 * cs-parser.jay (namespace_member_declaration): Flag that we have
16419 found a declaration when we do. This is used to flag error 1529
16421 * driver.cs: Report ok when we display the help only.
16423 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16425 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16427 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16429 * cs-tokenizer.cs (define): We also have to track locally the
16430 defines. AllDefines is just used for the Conditional Attribute,
16431 but we also need the local defines for the current source code.
16433 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16435 * statement.cs (While, For, Do): These loops can exit through a
16436 Break statement, use this information to tell whether the
16437 statement is the last piece of code.
16439 (Break): Flag that we break.
16441 * codegen.cs (EmitContexts): New `Breaks' state variable.
16443 2002-07-03 Martin Baulig <martin@gnome.org>
16445 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16446 modifiers in method declarations in structs. Otherwise, you won't
16447 be able to override things like Object.Equals().
16449 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16451 * class.cs (Method, Property, Indexer): Do not allow the public
16452 modifier to be used in explicit interface implementations.
16454 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16455 override modifiers in method declarations in structs
16457 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16459 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16460 integer or real overflow, report an error
16462 2002-07-02 Martin Baulig <martin@gnome.org>
16464 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16465 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16466 to tell the runtime about our newly created System.Object and
16467 System.ValueType types.
16469 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16471 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16472 struct instead of Ldarg/Starg.
16474 2002-07-02 Martin Baulig <martin@gnome.org>
16476 * expression.cs (Indirection.Indirection): Call
16477 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16479 2002-07-02 Martin Baulig <martin@gnome.org>
16481 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16482 ValueType, call TypeManager.TypeToCoreType() on it.
16483 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16484 the OpCodes.Newarr argument.
16486 2002-07-02 Martin Baulig <martin@gnome.org>
16488 * expression.cs (Invocation.EmitCall): When compiling corlib,
16489 replace all calls to the system's System.Array type to calls to
16490 the newly created one.
16492 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16493 System.Array methods.
16494 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16495 from the system's System.Array type which must be replaced.
16497 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16499 * typemanager.cs: load unverifiable_code_ctor so we can build
16500 corlib using the correct type. Avoid using GetTypeCode() with
16502 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16503 TypeManager.object_type to allow building corlib.
16505 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16507 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16509 2002-07-01 Martin Baulig <martin@gnome.org>
16511 * class.cs: Make the last change actually work, we need to check
16512 whether `ifaces != null' to avoid a crash.
16514 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16516 * class.cs: when we build structs without fields that implement
16517 interfaces, we need to add the interfaces separately, since there is
16518 no API to both set the size and add the interfaces at type creation
16521 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16523 * expression.cs: the dimension arguments to the array constructors
16524 need to be converted if they are a long.
16526 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16528 * class.cs: don't emit ldarg.0 if there is no parent constructor
16529 (fixes showstopper for corlib).
16531 2002-06-29 Martin Baulig <martin@gnome.org>
16533 MCS now compiles corlib on GNU/Linux :-)
16535 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16536 ie. check for MethodImplOptions.InternalCall.
16538 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16539 and TypeManager.attribute_type are null, so we must explicitly check
16540 whether parent is not null to find out whether it's an attribute type.
16541 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16542 and SetBuilder, not only if the property is neither abstract nor external.
16543 This is necessary to set the MethodImplOptions on the accessor methods.
16544 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16545 SetBuilder, see Property.Emit().
16547 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16548 populate "System.Object", "System.ValueType" and "System.Attribute" since
16549 they've already been populated from BootCorlib_PopulateCoreTypes().
16551 2002-06-29 Martin Baulig <martin@gnome.org>
16553 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16554 is the NullLiteral, we also need to make sure that target_type is not
16557 2002-06-29 Martin Baulig <martin@gnome.org>
16559 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16560 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16561 before calling BootstrapCorlib_ResolveDelegate ().
16563 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16565 * statement.cs: fixed build-breaker. All tests passed ok.
16567 2002-06-27 Martin Baulig <martin@gnome.org>
16569 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16570 for System.Decimal when compiling corlib.
16572 2002-06-27 Martin Baulig <martin@gnome.org>
16574 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16575 switch blocks which contain nothing but a default clause.
16577 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16579 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16581 2002-06-27 Martin Baulig <martin@gnome.org>
16583 * ecore.cs (PropertyExpr.PropertyExpr): Call
16584 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16586 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16587 is already a TypeBuilder.
16589 2002-06-27 Martin Baulig <martin@gnome.org>
16591 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16592 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16593 the "from an array-type to System.Array" case. This makes it work
16594 when compiling corlib.
16596 2002-06-27 Martin Baulig <martin@gnome.org>
16598 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16599 non-static PropertyExpr, set its InstanceExpression. This makes
16600 the `ICollection.Count' property work in System/Array.cs.
16602 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16604 * driver.cs: Made error handling more consistent. Errors now
16605 tracked by Report class, so many methods which used to return int
16606 now return void. Main() now prints success/failure and
16607 errors/warnings message.
16609 Renamed '--probe' compiler argument to '--expect-error'. Removed
16610 the magic number return values (123 and 124). Now, if the
16611 expected error occurs, the compiler exits with success (exit value
16612 0). If the compilation completes without seeing that particular
16613 error, the compiler exits with failure (exit value 1). The
16614 makefile in mcs/errors has been changed to handle the new behaviour.
16616 * report.cs: Made 'expected error' number a property and renamed
16617 it from 'Probe' to 'ExpectedError'.
16619 * genericparser.cs: Removed error handling support, since it is
16620 now all done by Report class.
16622 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16623 class, so parse() no longer returns an int.
16625 * namespace.cs: Use Report.Error instead of GenericParser.error
16627 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16629 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16630 TypeContainer.AddOperator): At the front of the list put the
16631 explicit implementations, so they get resolved/defined first.
16633 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16635 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16636 interface type is implemented by this TypeContainer. Used during
16637 explicit interface implementation.
16639 (Property.Define, Indexer.Define, Method.Define): Validate that
16640 the given interface in the explicit implementation is one of the
16641 base classes for the containing type.
16643 Also if we are explicitly implementing an interface, but there is
16644 no match in the pending implementation table, report an error.
16646 (Property.Define): Only define the property if we are
16647 not explicitly implementing a property from an interface. Use the
16648 correct name also for those properties (the same CSC uses,
16649 although that is really not needed).
16651 (Property.Emit): Do not emit attributes for explicitly implemented
16652 properties, as there is no TypeBuilder.
16654 (Indexer.Emit): ditto.
16656 Hiding then means that we do not really *implement* a pending
16657 implementation, which makes code fail.
16659 2002-06-22 Martin Baulig <martin@gnome.org>
16661 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16662 the return value of Object.GetType(). [FIXME: we need to do this whenever
16663 we get a type back from the reflection library].
16665 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16667 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16669 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16671 * attribute.cs: Return null if we can not look up the type.
16673 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16674 the interface types found.
16676 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16677 interface types found.
16679 * typemanager.cs (GetInterfaces): Make this routine returns alll
16680 the interfaces and work around the lame differences between
16681 System.Type and System.Reflection.Emit.TypeBuilder in the results
16682 result for GetInterfaces.
16684 (ExpandInterfaces): Given an array of interface types, expand and
16685 eliminate repeated ocurrences of an interface. This expands in
16686 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16689 2002-06-21 Martin Baulig <martin@gnome.org>
16691 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16694 2002-06-21 Martin Baulig <martin@gnome.org>
16696 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16697 and called with one of the core types, return the corresponding typebuilder for
16700 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16703 2002-06-21 Martin Baulig <martin@gnome.org>
16705 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16706 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16707 (Expression.ConvertReferenceExplicit): Likewise.
16709 * expression.cs (ElementAccess.DoResolve): Likewise.
16710 (ElementAccess.DoResolveLValue): Likewise.
16712 2002-06-10 Martin Baulig <martin@gnome.org>
16714 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16715 add the "value" parameter to the parameter list.
16717 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16720 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16722 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16723 the argument to an int, uint, long or ulong, per the spec. Also
16724 catch negative constants in array creation.
16726 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16728 * class.cs: do not allow the same interface to appear twice in
16729 the definition list.
16731 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16733 * ecore.cs: don't use ldlen with System.Array.
16735 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16737 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16739 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16741 * modifiers.cs: produce correct field attributes for protected
16742 internal. Easy fix so miguel can work on ther harder stuff:-)
16744 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16746 * pending.cs: New file. Move the code from class.cs here.
16747 Support clearning the pending flag for all methods (when not doing
16748 explicit interface implementation).
16750 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16752 * rootcontext.cs: added a couple more types needed to bootstrap.
16754 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16756 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16757 constructor in the type, instead of any constructor in the type
16758 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16759 a bug in the Mono runtime when applying the params attribute).
16761 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16762 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16764 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16766 * expression.cs (Unary.ResolveOperator): Use TypeManager
16767 to resolve the type.
16769 2002-06-13 Ravi Pratap <ravi@ximian.com>
16771 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16774 * enum.cs (AddEnumMember): Add support to store the attributes associated
16775 with each member too.
16777 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16778 field builders too - this takes care of the enum member case.
16780 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16782 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16783 address-of operator on both value types and pointers.
16785 2002-06-10 Martin Baulig <martin@gnome.org>
16787 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16788 PropertyBuilder to the `property_builders' list.
16790 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16791 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16792 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16793 find any indexers which are inherited from an interface.
16795 2002-06-09 Martin Baulig <martin@gnome.org>
16797 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16798 the same type as the constant if necessary. There's also a test-130.cs
16801 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16803 * typemanager.cs (TypeManager.ChangeType): Previously known as
16804 Enum.ChangeEnumType().
16806 2002-06-09 Martin Baulig <martin@gnome.org>
16808 * expression.cs (Cast.TryReduce): Added support for consts.
16810 2002-06-08 Ravi Pratap <ravi@ximian.com>
16812 * class.cs (Accessor): Hold attributes information so we can pass
16815 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16816 Modify to pass in attributes attached to the methods.
16818 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16820 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16821 to handle the Accessor kind :-)
16823 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16825 2002-06-08 Martin Baulig <martin@gnome.org>
16827 * expression.cs (Unary.TryReduceNegative): Added support for
16830 2002-06-08 Martin Baulig <martin@gnome.org>
16832 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16833 name can't be found in the `defined_names' - the caller will do a
16834 MemberLookup in this case and thus find methods in System.Enum
16835 such as Enum.IsDefined().
16837 2002-06-08 Martin Baulig <martin@gnome.org>
16839 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16840 Convert.ChangeType() which works with TypeBuilder created types.
16841 (Enum.LookupEnumValue, Enum.Define): Use it here.
16843 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16844 `TypeBuilder.BaseType != null' check.
16845 (TypeContainer.FindMembers): Only lookup parent members if we
16846 actually have a parent.
16847 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16848 (ConstructorInitializer.Resolve): Likewise.
16850 * interface.cs (Interface.FindMembers): Added
16851 `TypeBuilder.BaseType != null' check.
16853 * rootcontext.cs (RootContext.ResolveCore): Added
16854 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16855 classes_second_stage.
16857 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16858 debug_type and trace_type when compiling with --nostdlib.
16860 2002-06-07 Martin Baulig <martin@gnome.org>
16862 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16863 (AddField): Set it to true when adding a non-static field.
16864 (DefineType): Use `have_nonstatic_fields' to find out whether we
16865 have non-static fields, not `Fields != null'.
16867 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16869 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16870 dereferencing a null on the static-field code path)
16872 2002-05-30 Martin Baulig <martin@gnome.org>
16874 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16875 to take command line arguments. Use reflection to call the new
16876 custom `Initialize' function on the symbol writer and pass it the
16877 command line arguments.
16879 * driver.cs (--debug-args): New command line argument to pass command
16880 line arguments to the symbol writer.
16882 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16884 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16885 the target type for indexers and properties. Thanks to Joe for
16888 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16890 * typemanager.cs (MethodFlags): returns the method flags
16891 (Obsolete/ShouldIgnore) that control warning emission and whether
16892 the invocation should be made, or ignored.
16894 * expression.cs (Invocation.Emit): Remove previous hack, we should
16895 not do this on matching a base type, we should do this based on an attribute
16897 Only emit calls to System.Diagnostics.Debug and
16898 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16899 on the command line.
16901 * rootcontext.cs: Global settings for tracing and debugging.
16903 * cs-tokenizer.cs (define): New utility function to track
16904 defines. Set the global settings for TRACE and DEBUG if found.
16906 2002-05-25 Ravi Pratap <ravi@ximian.com>
16908 * interface.cs (Populate*): Pass in the TypeContainer as well as
16909 the DeclSpace as parameters so that we can create EmitContexts and
16910 then use that to apply attributes etc.
16912 (PopulateMethod, PopulateEvent, PopulateProperty)
16913 (PopulateIndexer): Apply attributes everywhere.
16915 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16918 (ApplyAttributes): Update accordingly.
16920 We now apply interface attributes for all members too.
16922 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16924 * class.cs (Indexer.Define); Correctly check if we are explicit
16925 implementation (instead of checking the Name for a ".", we
16926 directly look up if the InterfaceType was specified).
16928 Delay the creation of the PropertyBuilder.
16930 Only create the PropertyBuilder if we are not an explicit
16931 interface implementation. This means that explicit interface
16932 implementation members do not participate in regular function
16933 lookups, and hence fixes another major ambiguity problem in
16934 overload resolution (that was the visible effect).
16936 (DefineMethod): Return whether we are doing an interface
16939 * typemanager.cs: Temporary hack until we get attributes in
16940 interfaces (Ravi is working on that) and we get IndexerName
16941 support in interfaces.
16943 * interface.cs: Register the indexers as properties.
16945 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16946 warning, I have verified that this is a bug in the .NET runtime
16947 (JavaScript suffers of the same problem).
16949 * typemanager.cs (MemberLookup): When looking up members for
16950 interfaces, the parent of an interface is the implicit
16951 System.Object (so we succeed in searches of Object methods in an
16952 interface method invocation. Example: IEnumerable x; x.ToString
16955 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16957 * class.cs (Event): Events should also register if they do
16958 implement the methods that an interface requires.
16960 * typemanager.cs (MemberLookup); use the new GetInterfaces
16963 (GetInterfaces): The code used to lookup interfaces for a type is
16964 used in more than one place, factor it here.
16966 * driver.cs: Track the errors at the bottom of the file, we kept
16969 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16970 instance if the method we are calling is static!
16972 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16974 * attribute.cs (ApplyAttributes): Make this function filter out
16975 the IndexerName attribute (as that attribute in reality is never
16976 applied) and return the string constant for the IndexerName
16979 * class.cs (TypeContainer.Emit): Validate that all the indexers
16980 have the same IndexerName attribute, and if so, set the
16981 DefaultName attribute on the class.
16983 * typemanager.cs: The return value might contain other stuff (not
16984 only methods). For instance, consider a method with an "Item"
16985 property and an Item method.
16987 * class.cs: If there is a problem with the parameter types,
16990 2002-05-24 Ravi Pratap <ravi@ximian.com>
16992 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16993 looks at user defined conversion after making a call to
16994 StandardConversionExists - we need this for overload resolution.
16996 * expression.cs : Update accordingly the various method calls.
16998 This fixes 2 bugs filed against implicit user defined conversions
17000 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17002 * statement.cs: Track the result of the assignment.
17004 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17006 * expression.cs (MemberAccess): Improved error reporting for
17007 inaccessible members.
17009 2002-05-22 Martin Baulig <martin@gnome.org>
17011 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17012 itself with debugging support.
17014 2002-05-22 Martin Baulig <martin@gnome.org>
17016 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17017 Removed, this isn't needed anymore.
17019 2002-05-20 Martin Baulig <martin@gnome.org>
17021 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17022 be underlying type for an enum.
17024 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17026 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17027 that splits out the loading of just the core types.
17029 * rootcontext.cs (ResolveCore): Split the struct resolution in
17030 two, so we can load the enumeration underlying types before any
17033 * expression.cs (Is): Bandaid until we fix properly Switch (see
17034 bug #24985 for details).
17036 * typemanager.cs (ImplementsInterface): The hashtable will contain
17037 a null if there are no interfaces implemented.
17039 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17041 * cs-parser.jay (indexer_declarator): It is fine to have array
17044 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17046 * typemanager.cs: (RegisterBuilder): New function used to register
17047 TypeBuilders that implement interfaces. Since
17048 TypeBuilder.GetInterfaces (as usual) does not work with lame
17050 (AddUserType): register interfaces.
17052 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17053 dealing with TypeBuilder. Also, arrays are showing up as
17054 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17055 methods can not be invoked on them!
17057 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17058 (ImplicitReferenceConversionExists): Split out from
17059 StandardConversionExists.
17061 * expression.cs (As): We were only implementing one of the three
17062 cases for the as operator. We now implement them all.
17063 (Is): Implement the various other cases for Is as well.
17065 * typemanager.cs (CACHE): New define used to control if we want or
17066 not the FindMembers cache. Seems to have a negative impact on
17067 performance currently
17069 (MemberLookup): Nested types have full acess to
17070 enclosing type members
17072 Remove code that coped with instance/static returns for events, we
17073 now catch this in RealFindMembers.
17075 (RealFindMembers): only perform static lookup if the instance
17076 lookup did not return a type or an event.
17078 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17080 * assign.cs (CompoundAssign): We pass more semantic information
17081 now to Compound Assignments than we did before: now we have all
17082 the information at hand, and now we resolve the target *before* we
17083 do the expression expansion, which allows the "CacheValue" method
17084 to have the effect we intended (before, a [x] += 1 would generate
17085 two differen ArrayAccess expressions from the ElementAccess,
17086 during the resolution process).
17088 (CompoundAssign.DoResolve): Resolve target and original_source here.
17090 2002-05-16 Miguel de Icaza <miguel@ximian.com>
17092 * expression.cs (ArrayAccess): dropped debugging information.
17094 * typemanager.cs: Small bug fix: I was always returning i_members,
17095 instead of one of i_members or s_members (depending on which had
17098 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
17099 method is invoked before any code generation takes place, and it
17100 is a mechanism to inform that the expression will be invoked more
17101 than once, and that the method should use temporary values to
17102 avoid having side effects
17104 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17106 * ecore.cs (Expression.CacheTemporaries): Provide empty default
17109 * expression.cs (Indirection, ArrayAccess): Add support for
17110 CacheTemporaries in these two bad boys.
17112 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17113 ldobj or ldind_ref.
17114 (StoreFromPtr): Handle stobj as well.
17116 * expression.cs (UnaryMutator): Share more code.
17118 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17119 down: I was not tracking the Filter function as well, which
17120 was affecting the results of the cache.
17122 2002-05-15 Miguel de Icaza <miguel@ximian.com>
17124 * attribute.cs: Remove the hack to handle the CharSet property on
17127 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17129 * attribute.cs (DoResolve): More uglyness, we now only try to
17130 resolve the attribute partially, to extract the CharSet
17131 information (only if we are a StructLayout attribute). Otherwise
17133 (GetExtraTypeInfo): Add some code to conditionally kill in the
17134 future this. I am more and more convinced that the .NET
17135 framework has special code to handle the attribute setting on
17138 * expression.cs (IsParamsMethodApplicable): Revert my previous
17139 foreach change here, it was wrong.
17141 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17143 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17144 (pp_expr): do not abort on unknown input, just return.
17145 (eval): abort if there are pending chars.
17147 * attribute.cs (Attribute.Resolve): Positional parameters are
17148 optional. Deal with that case.
17150 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17151 the Ansi/Unicode/Auto information for the type.
17153 (TypeContainer.DefineType): instantiate the EmitContext here, as
17154 we will be using it during the type definition (to resolve
17155 attributes) and during the emit phase.
17157 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17158 to pull type information out of the attributes
17160 (Attribute.Resolve): track the constructor builder, and allow for
17161 multiple invocations (structs and classes will use this).
17163 * ecore.cs (MemberLookupFinal): new version with all the
17164 parameters customizable.
17166 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17167 constructors. Return if the result value is null (as the error
17168 would have been flagged already by MemberLookupFinal)
17170 Do not allow instances of abstract classes or interfaces to be
17173 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17174 We have to compare the assembly property here when dealing with
17175 FamANDAssem and Assembly access modifiers, because we might be
17176 creating an assembly from *modules* (that means that we are not
17177 getting TypeBuilders for types defined in other modules that are
17178 part of this assembly).
17180 (Method.Emit): If the method is marked abstract and has a body,
17183 (TypeContainer.DefineMembers): If both the defined member and the
17184 parent name match are methods, then do not emit any warnings: let
17185 the Method.Define routine take care of flagging warnings. But if
17186 there is a mismatch (method overrides something else, or method is
17187 overriwritten by something, then emit warning).
17189 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17190 set to null, this means `do not check for the return type on the
17193 (Method.Define): set the return type for the method signature to
17194 null, so that we get methods with the same name and parameters and
17195 different return types. This is used to flag warning 114 (you are
17196 hiding a method, and you probably want to use the new/override
17199 * typemanager.cs (MemberLookup): Implemented proper access
17200 control, closing a long standing set of bug reports. The problem
17201 was that the Framework only has two bits: Public and NonPublic,
17202 and NonPublic includes private and protected methods, but we need
17203 to enforce the FamANDAssem, FamOrAssem and Family.
17205 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17207 * statement.cs (GotoCase): Return true: Ammounts to giving up
17208 knowledge on whether we return or not, and letting the other case
17209 be responsible for it.
17211 2002-05-10 Miguel de Icaza <miguel@ximian.com>
17213 * driver.cs: Do not load directories for each file processed, only
17214 do it if there is a pattern.
17216 * ecore.cs: Report readonly assigns here as well, as we might have
17217 been resolved only by MemberAccess.
17219 (SimpleName.SimpleNameResolve): Also be useful for LValue
17220 resolution. We need this to propagate assign to local readonly variables
17222 * typemanager.cs: Use a ptrhashtable for the criteria, because we
17223 do not want to reuse potential criteria memory.
17225 * class.cs (MyEventBuilder): Set reflected_type;
17227 * ecore.cs (Constantify): Added support for constifying bools.
17229 (RootContext.LookupType): Added a cache for values looked up in
17230 the declaration space.
17232 * typemanager.cs (FindMembers): Now is a front-end to
17233 RealFindMembers, and provides a two-level hashtable-based cache to
17236 15% performance improvement: from 22.5 to 19.2 seconds.
17238 * expression.cs (IsParamsMethodApplicable): use foreach.
17239 (Invocation.DoResolve): ditto.
17240 (New.DoResolve): ditto.
17241 (ArrayCreation.DoResolve): ditto.
17243 * ecore.cs (FindMostEncompassingType): use foreach.
17245 * delegate.cs (NewDelegate.DoResolve): Use foreach
17247 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17248 (RemoveMethods): use foreach.
17250 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17251 nested foreach statements instead of for, and also break out of
17252 the inner loop once a match is found.
17254 (Invocation.OverloadResolve): Use foreach, simplify the code.
17256 2002-05-08 Miguel de Icaza <miguel@ximian.com>
17258 * cfold.cs (BinaryFold): During an enumeration evaluation context,
17259 we actually unwrap the expression to allow for extra information
17262 * expression.cs: Use Shr_Un on unsigned operations.
17264 2002-05-08 Ravi Pratap <ravi@ximian.com>
17266 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
17267 applicable operators was not being considered correctly. This closes
17268 the bug Miguel reported.
17270 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17272 * attribute.cs: check that the type derives from System.Attribute
17273 and report the correct error in that case (moved the duplicate code to
17274 its own method, too).
17276 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17278 * attribute.cs: lookup attribute type name as the spec says: first the
17279 bare attribute name and then name + "Attribute" (nant compiles with
17280 mcs after this fix).
17282 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17284 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17285 Because of the way we parse things, we should try to see if a
17286 UIntConstant can fit in an integer.
17288 2002-05-07 Ravi Pratap <ravi@ximian.com>
17290 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17291 when we are in an explicit context.
17293 (ConvertReferenceExplicit): When converting from Iface type S to Class
17294 T make sure the rules are implemented as an OR.
17296 * parameter.cs (ParameterType): Make it a property for now although the
17297 purpose really isn't anything immediate.
17299 * expression.cs (Is*Applicable): Do better checking on the parameter type
17300 of a ref/out parameter. The ones from the system assemblies are already
17301 marked with the correct type so we don't need to do any correction.
17303 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17304 the object type is standard too so include that.
17306 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17308 * ecore.cs (StandardConversionExists): Augment with missing code:
17309 deal with IntConstant, LongConstants and Enumerations.
17311 * assign.cs: Report the error, instead of failing silently
17313 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17314 typecontainer that they are declared, because the
17315 typecontainer/namespace will have the list of using clauses that
17316 need to be applied.
17318 Assembly Attributes were escaping the normal registration
17321 (EmitCode): Apply attributes within an EmitContext that represents
17322 the container they were declared on.
17324 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17326 2002-05-06 Ravi Pratap <ravi@ximian.com>
17328 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17329 Revamp completely - make much cleaner as we now operate only
17332 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17333 to implement the logic detailed in the spec more correctly.
17335 (UserDefinedConversion): Update accordingly.
17337 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17339 * statement.cs: Return flow analysis information up.
17341 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17344 (token): Do not consume an extra character before calling
17347 2002-05-06 Piers Haken <piersh@friskit.com>
17349 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17351 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17353 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17354 EmitContext during the instance constructor initializer
17355 resolution, to stop access to instance variables.
17357 This is mandated by the spec, last paragraph of the `constructor
17358 initializers' section.
17360 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17362 * cs-parser.jay, class.cs (Accessor): new class used to represent
17363 an accessor (get or set). In the past we used `null' to represent
17364 a missing accessor. But this is ambiguous because there was no
17365 way to tell in abstract indexers/properties if one of them was
17368 Now there is a way of addressing that.
17370 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17371 instead of FindMembers.
17373 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17374 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17376 * attribute.cs: Treat indexers and properties as the same in terms
17377 of applying attributes
17379 * ecore.cs (FindMostEncompassedType): Use statically initialized
17380 EmptyExpressions()s like we do elsewhere to avoid creating useless
17381 objects (and we take this out of the tight loop).
17383 (GetConversionOperators): Move the code to extract the actual
17384 operators to a separate routine to clean things up.
17386 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17388 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17389 events are always registered FieldBuilders.
17391 * class.cs (FieldBase): New class shared by Fields
17393 * delegate.cs: If we are a toplevel delegate, use our full name.
17394 If we are a nested delegate, then only use our tail name.
17396 2002-05-02 Ravi Pratap <ravi@ximian.com>
17398 * expression.cs (IsApplicable): Ensure that we add the "&" to
17399 ref/out types before comparing it with the type of the argument.
17401 (IsParamsMethodApplicable): Ditto.
17403 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17406 * delegate.cs : Handle the case when we have more than one applicable
17407 method. Flag an error only when we finish checking all.
17409 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17411 * expression.cs: Add support for boolean static initializers.
17413 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17415 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17417 * parameter.cs (ComputeParameterTypes,
17418 ComputeAndDefineParameterTypes): Better error handling: now we
17419 clear the `types' cache if we fail during any of the type lookups.
17420 We also return the status code correctly to our caller
17422 * delegate.cs: If we fail to define a delegate, abort the extra
17425 * expression.cs (Binary.ResolveOperator): for
17426 operator==(object,object) and operator !=(object, object) we also
17427 have to verify that there is an implicit conversion from one to
17430 (ArrayAccess.DoResolve): Array Access can operate on
17433 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17435 * assign.cs (CompoundAssign): A new class used as a "flag" that
17436 the assignment actually is happening as part of a compound
17437 assignment operator.
17439 During compound assignment, a few new rules exist to enable things
17446 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17447 to the type of x) if y is implicitly convertible to the type of x,
17448 and the operator is a builtin operator and the return type of the
17449 operator is explicitly convertible to the type of x.
17451 * rootcontext.cs: Reset warning level to 2. 4 catches various
17452 "interesting" features in mcs, we must clean this up at some
17453 point, but currently am trying to kill other bugs ;-)
17455 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17456 in container classes as well.
17458 * expression.cs (Binary.ResolveOperator): Handle string case
17459 before anything else (as operator overloading does emit an error
17460 before doing anything else).
17462 This code could go away when we move to a table driven model, but
17463 i could not come up with a good plan last night.
17465 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17467 * typemanager.cs (CSharpName): reimplementation using regex.
17468 * class.cs: added null check for fields in Emit
17469 * rootcontext.cs: set warninglevel to 4
17471 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17473 * typemanager.cs (CSharpName): reimplemented with Lupus
17476 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17478 * statement.cs (If): correclty implement Resolve, because we were
17479 not catching sem errors in there. The same process is needed
17481 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17484 (Statement.Warning_DeadCodeFound): Factorize code.
17485 (While): Report dead code here too.
17487 (Statement): Added Resolve virtual method to allow
17488 for resolution split from the emit code.
17490 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17492 * statement.cs (EmitBoolExpression): No longer try to resolve the
17494 (MakeBoolean): New utility function that resolve, implicitly
17495 converts to boolean and tags the expression.
17498 (If, Do): Implement dead code elimination.
17499 (While): Implement loop inversion
17501 (Do, While, For, If): Resolve the expression prior to calling our
17504 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17507 - added method Report28 (warning: program has more than one entry point)
17508 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17509 - modified method Method.Define, the part at the end of the method
17511 * rootcontext.cs: added static public Location EntryPointLocation;
17513 * ../errors/cs0028.cs : Add test case for the above warning.
17516 - modified method CSharpName to allow arrays of primitive type to
17517 be printed nicely (e.g. instead of System.Int32[][] it now prints
17519 - added method CSharpSignature: returns the signature of a method
17520 in string format to be used in reporting errors, warnings, etc.
17522 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17525 2002-04-26 Ravi Pratap <ravi@ximian.com>
17527 * delegate.cs (Define): Fix extremely silly bug where I was
17528 setting the type of the 'object' parameter of the BeginInvoke
17529 method to System.IAsyncResult instead of System.Object ;-)
17531 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17533 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17536 (Constructor.Emit): return if we fail to initialize the
17537 constructor. Another door closed!
17539 * expression.cs (New.DoResolve): Improve error message (from -6 to
17540 1501). Use DeclaredOnly lookup to find the exact constructor.
17542 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17543 loop. This is useful.
17545 * cs-parser.jay: Adjust the default parameters so that destructors
17546 have the proper signature.
17548 2002-04-26 Martin Baulig <martin@gnome.org>
17550 * driver.cs (LoadAssembly): If `assembly' contains any characters
17551 which are only valid in path names and not in assembly names
17552 (currently slash, backslash and point), use Assembly.LoadFrom ()
17553 instead of Assembly.Load () on the `assembly' (before iteration
17554 over the link_paths).
17556 2002-04-26 Martin Baulig <martin@gnome.org>
17558 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17560 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17562 * class.cs (Property): use the new typemanager.MemberLookup
17564 (TypeContainer.MemberLookup): Implement using the
17565 TypeManager.MemberLookup now.
17567 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17568 and return MemberInfos, so that these can be used without an
17569 EmitContext (what we had before).
17571 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17573 * expression.cs: Fix the case where the argument to params if the
17574 type of the params. I omitted handling this before. Fixed
17576 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17578 * driver.cs: Call BootCorlib_PopulateCoreType
17580 * class.cs (Property.CheckBase): Check for properties only, not
17583 * interface.cs: Temporary hack: try/catch around the
17584 CustomAttributeBuilder, because I am getting an exception that I
17587 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17588 types whose definitions are required to be there (attributes are
17589 defined before standard types).
17591 Compute definitions as we boot the various types, as they are used
17592 immediately (value_type class will need object_type, but if we do
17593 not initialize object_type, we will pass a null, which will let
17594 the runtime pick the System.Object from the existing corlib, which
17595 is not what we want).
17597 2002-04-22 Patrik Torstensson <totte@labs2.com>
17599 * cs-tokenizer.cs: fixed a number of trim() issues.
17601 2002-04-22 Ravi Pratap <ravi@ximian.com>
17603 * expression.cs (Argument.Type): Ensure that we return the correct
17604 type when we have out or ref parameters [in which case we
17607 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17609 * class.cs (Property, Indexer): Allow extern modifier in there.
17611 * typemanager.cs (InitBaseTypes): Initializes object_type and
17612 value_type, since those will be used early on during the bootstrap
17613 process to compile corlib.
17615 (InitCoreTypes): Move code from here to InitBaseTypes.
17617 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17619 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17620 single-dimension arrays as using the ldlen opcode.
17622 Daniel Lewis discovered this optimization.
17624 * typemanager.cs: Add signature for System.Array::get_Length
17626 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17628 * statement.cs: report the error when the foreach does not apply to an
17629 array nor a collection.
17631 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17633 * expression.cs: Add implicit conversions to the operator ~.
17635 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17637 * typemanager.cs: Locate the decimal constructor.
17639 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17641 * attribute.cs: use the new property of TypeOf.
17642 * expression.cs: added 'get' property around typearg.
17644 These changes fix a build breaker reported by NickD. Is this the
17645 correct way to fix? If not, please, revert my changes and make it
17648 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17650 * attribute.cs: Add support for typeof in attribute invocations.
17651 I am not sure that this is right though.
17653 2002-04-14 Duncan Mak <duncan@ximian.com>
17655 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17656 Binary.Operator.Division case.
17658 2002-04-13 Ravi Pratap <ravi@ximian.com>
17660 * class.cs (DefineType): Ensure that we do a proper check on
17661 attribute types and also register it with the TypeManager.
17663 (TypeContainer.Targets): The default for attribute types is
17664 AttributeTargets.All.
17666 * attribute.cs (ApplyAttributes): Registering the attribute type
17667 is done elsewhere, not when we discover we have a Usage attribute.
17669 2002-04-12 Ravi Pratap <ravi@ximian.com>
17671 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17672 and get rid of is_delegate parameter.
17674 * everywhere : update.
17676 2002-04-12 Ravi Pratap <ravi@ximian.com>
17678 * cs-parser.jay (compilation_unit): Revamp completely to use
17679 some new ideas that I got from Rhys' grammar to solve the problems
17680 with assembly level attributes.
17682 (outer_declaration): New grammar production.
17684 (attribute_sections): Add.
17686 (opt_attributes): Base on attribute_sections
17688 (namespace_declaration): Allow opt_attributes to tackle the case
17689 when we have assembly level attributes - we are clever in this
17692 * attribute.cs (ApplyAttributes): Do not worry about assembly
17693 attributes in the non-global context.
17695 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17696 instead of SetGlobalAttributes.
17698 * class.cs, rootcontext.cs : Ensure we define and generate
17699 attribute types before anything else.
17701 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17702 and flag the new error -20 for the case when the attribute type
17703 does not have valid targets specified. csc does not catch this.
17705 * ../errors/errors.txt : update for error # -20
17707 2002-04-11 Ravi Pratap <ravi@ximian.com>
17709 * support.cs (InternalParameters.ParameterModifier): Do some null
17710 checking and return sane values.
17712 * class.cs (Method.Define): If we are a PInvoke method, ensure
17713 that we are static and extern. Report error # 601
17715 * ../errors/cs0601.cs : Add test case for the above error.
17717 2002-04-07 Ravi Pratap <ravi@ximian.com>
17719 * rootcontext.cs (attribute_types): We need to keep type of
17720 all attribute types separately and emit code for them first.
17722 (RegisterAttribute) : Implement.
17724 * class.cs (DefineType): Check if the current Type is a custom
17725 attribute type and register it accordingly.
17727 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17728 adding the first attribute twice and rename to
17730 (SetGlobalAttributes): this.
17732 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17735 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17736 if we are processing global arguments. Hmm, I am unsure of this.
17738 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17740 * expression.cs: added static array of strings to avoid calling
17741 Enum.ToString () for Operator in Binary. Significant recover of
17744 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17746 * class.cs (FindMembers): Allow the Builders of the various
17747 members to be null. If they are skip them. This only happens
17748 during the PInvoke declaration.
17750 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17752 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17753 failure, so we do not keep going afterwards.
17755 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17756 wanted to pass `false' as the `is_delegate' argument. If this is
17757 the case, why not use delegate_type == null to mean `is_delegate =
17758 false' and anything else as is_delegate = true.
17760 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17762 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17763 code for the section, not the beginning of the tests.
17765 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17767 * cfold.cs: Handle operator + (Enum x, Underlying x)
17769 * expression.cs (Binary): same. Warn about errors where we have
17770 Enum/Enum in operator + as well.
17772 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17775 - added support for switch(bool)
17776 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17777 - add TableSwitchEmit() to handle table-based switch statements
17779 2002-04-05 Ravi Pratap <ravi@ximian.com>
17781 * expression.cs (Invocation.OverloadResolve): Factor out code which
17782 does parameter compatibility checking with arguments so that we can
17783 re-use the code even from Delegate.VerifyApplicability
17785 (VerifyArgumentsCompat): Move above code here.
17787 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17788 and instead make a call to the above method.
17790 2002-03-31 Ravi Pratap <ravi@ximian.com>
17792 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17793 We use it to keep track of classes which are attribute types.
17795 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17797 * delegate.cs (Delegate.Define): Correctly define the types in the
17798 presence of fixed and array parameters.
17800 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17803 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17804 include NonPublic after the first iteration.
17806 * class.cs (Indexer.CheckBase): Only check if both parents are
17809 * cs-parser.jay (accessor_body): If empty, set to null.
17811 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17812 same code path here to resolve constants names that we did have in
17813 MemberAccess.DoResolve. There is too much code duplicated here.
17815 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17817 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17819 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17822 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17823 tokens, numbers and strings.
17825 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17828 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17829 asyncronous parameters and the regular parameters.
17831 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17832 specify the target directory.
17834 * expression.cs: (This.DoResolve): Simplify
17835 (As.Emit): Optimize, do not generate IsInst if the expression is
17836 always of the given type.
17838 (Is.DoResolve): Bug fix, we were reporting both always/never for
17841 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17842 creating too many unnecessary arrays.
17844 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17846 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17847 fields instead of rolling our own initializer. Takes care of all
17848 implicit conversions, and drops unnecessary static checks/argument.
17850 2002-03-31 Dick Porter <dick@ximian.com>
17852 * driver.cs: use the GetDirectories() return values properly, and
17853 use "/" as path separator.
17855 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17857 * expression.cs (Unary): Optimize - - expr into expr.
17858 (Binary): Optimize a + (-b) into a -b.
17860 * codegen.cs (CodeGen): Made all methods static.
17862 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17866 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17867 TypeBuilder property.
17869 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17872 * tree.cs: Removed the various RecordXXXX, and replaced with a
17873 single RecordDecl. Removed all the accessor methods, and just
17874 left a single access point Type
17876 * enum.cs: Rename DefineEnum to DefineType.
17878 * decl.cs: New abstract method `DefineType' used to unify the
17879 Defines for Enumerations, Interfaces, TypeContainers and
17882 (FindType): Moved LookupInterfaceOrClass here. Moved the
17883 LookupBaseClasses method that used to live in class.cs and
17884 interface.cs here, and renamed to FindType.
17886 * delegate.cs: Implement DefineType. Take advantage of the
17887 refactored pattern for locating the parent builder without taking
17888 the parent_builder argument (which we know does not work if we are
17889 nested, and triggering a toplevel definition).
17891 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17893 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17894 accessibility of a member has changed during override and report
17897 * class.cs (Method.Define, Property.Define): Only complain on
17898 overrides if the method is private, any other accessibility is
17899 fine (and since we just checked the permission is the same, we are
17902 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17903 and elif are processed always. The other pre-processing
17904 directives are only processed if we are "taking" the path
17906 2002-03-29 Martin Baulig <martin@gnome.org>
17908 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17909 current location is not Null.
17911 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17912 a separate method so we can profile it.
17914 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17915 `span.Seconds' are just seconds, but no minutes or hours.
17916 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17918 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17920 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17921 Remove the gratuitous set of Final:
17923 // If an interface implementation, then we can set Final.
17924 if (((flags & MethodAttributes.Abstract) == 0) &&
17925 implementing.DeclaringType.IsInterface)
17926 flags |= MethodAttributes.Final;
17928 I do not know what I was smoking when I used that.
17931 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17932 step into fixing the name resolution issues for delegates and
17933 unifying the toplevel name resolution.
17935 2002-03-28 Martin Baulig <martin@gnome.org>
17937 * class.cs (Method.Emit): If we have a symbol writer, call its
17938 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17939 tell it about the current method.
17941 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17942 writer that we're going to emit the first byte of IL code for a new
17943 statement (a new source line).
17944 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17945 EmitContext.Mark() before emitting any code.
17947 * location.cs (SymbolDocument): Return null when we're Null.
17949 * statement.cs (Statement): Moved the `Location loc' variable here.
17950 (Statement.EmitBoolExpression): If we have a symbol writer, call
17951 ec.Mark() before emitting any code to tell it that we're at the
17952 beginning of a new statement.
17953 (StatementExpression): Added `Location' argument to the constructor.
17954 (Block): Added public readonly variable `StartLocation' and public
17955 variable `EndLocation'. The latter is to be set using SetEndLocation().
17956 (Block): Added constructor which takes a start and end location.
17957 (Block.SetEndLocation): New method. This sets the end location.
17958 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17959 local variables we create.
17960 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17961 each statement and do also mark the begin and end of the block.
17963 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17964 tell it the current lexer.Location, use Location.Null for the end of the
17966 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17967 current block, set its end location using SetEndLocation().
17968 (statement_expression): StatementExpression constructor now takes the
17969 lexer.Location as additional argument.
17970 (for_statement, declare_local_variables): Likewise.
17971 (declare_local_variables): When creating a new implicit block, use the
17972 new Block constructor and pass it the lexer.Location.
17974 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17976 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17977 members also on the parent interfaces recursively.
17979 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17981 * report.cs: Use new formats, since Gonzalo finished the missing
17984 * expression.cs (Binary.ResolveOperator): added missing operator|
17985 operator& and operator^ for bool/bool.
17987 * cs-parser.jay: CheckDef now takes a Location argument that is
17988 used to report errors more precisly (instead of reporting the end
17989 of a definition, we try to track something which is a lot closer
17990 to the source of the problem).
17992 * cs-tokenizer.cs: Track global token use, so we can properly flag
17993 the use of #define/#undef after the first token has been seen.
17995 Also, rename the reportXXXX to Error_DescriptiveName
17997 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17998 TypeContainer, so that Enum and Interface can use this too.
18000 * class.cs (TypeContainer.LookupInterfaceOrClass,
18001 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18002 `builder' argument. Typically this was used to pass the parent
18003 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18006 The problem is that a nested class could trigger the definition of
18007 a toplevel class, and the builder would be obviously wrong in that
18010 So we drop this argument, and we compute dynamically the
18011 TypeBuilder/ModuleBuilder (the correct information was available
18012 to us anyways from DeclSpace.Parent)
18014 * interface.cs (Interface.DefineInterface): Drop builder
18015 parameter cleanup like class.cs
18017 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18020 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18023 (Try.Emit): Propagate the returns value from the statement.
18025 (Return.Emit): Even if we are leavning
18027 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18029 * modifiers.cs: Fix the computation of MethodAttributes flags.
18031 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18033 * driver.cs: allow compilation of files that start with '/'.
18034 Add a default case when checking the argument of --target.
18036 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18038 * interface.cs: Implement the same search algorithm for types in
18039 the interface code.
18041 * delegate.cs: Do not allow multiple definition.
18043 * Recovered ChangeLog that got accidentally amputated
18045 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18047 * rootcontext.cs: Load manually enum to allow core classes to
18048 contain enumerations.
18050 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18051 Update to new static methods in TypeManager.
18053 * typemanager.cs (GetMethod, GetConstructor): Use our
18054 implementation of FindMembers to find the members, since during
18055 corlib compilation, the types are TypeBuilders and GetMethod and
18056 GetConstructor do not work.
18058 Make all methods in TypeManager static.
18060 (InitCodeHelpers): Split the functionality from
18061 the InitCodeTypes function.
18063 * driver.cs: Call InitCodeHelpers after we have populated the
18066 * cs-parser.jay (delegate_declaration): we did not used to compute
18067 the delegate name correctly for void delegates.
18069 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18071 * rootcontext.cs (RootContext): Init the interface_resolve_order
18072 and type_container_resolve_order always.
18074 (ResolveCore, BootstrapCorlib_ResolveClass,
18075 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18076 compiler when compiling with --nostdlib
18078 * class.cs (TypeContainer.DefineType): Check that our parent is
18079 not null. This test is most important when we are bootstraping
18082 * codegen.cs: Split out the symbol writing code.
18084 2002-03-25 Martin Baulig <martin@gnome.org>
18086 * driver.cs (-g): Made -g an alias for --debug.
18088 2002-03-24 Martin Baulig <martin@gnome.org>
18090 * codegen.cs (SymbolWriter): New public variable. Returns the
18091 current symbol writer.
18092 (CodeGen): Added `bool want_debugging_support' argument to the
18093 constructor. If true, tell the ModuleBuild that we want debugging
18094 support and ask it for the ISymbolWriter.
18095 (Save): If we have a symbol writer, call it's Close() method after
18096 saving the assembly.
18098 * driver.c (--debug): New command line argument to create a
18099 debugger information file.
18101 * location.cs (SymbolDocument): New public property. Returns an
18102 ISymbolDocumentWriter object for the current source file or null
18103 if we don't have a symbol writer.
18105 2002-03-21 Miguel de Icaza <miguel@ximian.com>
18107 * driver.cs (LoadAssembly): Correctly return when all the paths
18108 have been tried and not before.
18110 * statement.cs (Switch.Emit): return the actual coverage for this
18111 statement (returns/not-returns)
18113 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18114 switch of the statement if we are the last switch section. That
18115 kills two problems: try/catch problems (we used to emit an empty
18116 nop at the end) and switch statements where all branches would
18119 2002-03-19 Miguel de Icaza <miguel@ximian.com>
18121 * driver.cs: Add default assemblies (the equivalent to the
18122 Microsoft CSC.RSP file)
18124 * cs-tokenizer.cs: When updating `cols and setting it to zero,
18125 also update tokens_seen and set it to false.
18127 * driver.cs: Implement --recurse for Mike.
18129 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18130 correctly splitting out the paths.
18132 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18134 * interface.cs (Interface.PopulateProperty): Instead of using
18135 `parent' as the declaration space for the set parameters, use
18138 * support.cs (InternalParameters): InternalParameters constructor
18139 takes a DeclSpace instead of a TypeContainer.
18141 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18142 types are being initialized, load the address of it before calling
18145 (New): Provide a mechanism to disable the generation of local
18146 value type temporaries when the caller will be providing us with
18147 an address to store it.
18149 (ArrayCreation.EmitDynamicInitializers): Use it.
18151 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18153 * expression.cs (Invocation.EmitArguments): Only probe for array
18154 property if there is more than one argument. Sorry about that.
18156 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18157 empty param arrays.
18159 * class.cs (Method.LabelParameters): Fix incorrect code path that
18160 prevented the `ParamArrayAttribute' from being applied to the
18163 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18165 * support.cs (ReflectionParameters): Correctly compute whether the
18166 last argument is a params array. Fixes the problem with
18169 * typemanager.cs: Make the assemblies array always be non-null
18170 (empty, but non-null)
18172 * tree.cs (RecordDecl): New function that abstracts the recording
18173 of names. This reports error 101, and provides a pointer to the
18174 previous declaration. Fixes a crash in the compiler.
18176 * cs-parser.jay (constructor_declaration): Update to new grammar,
18177 and provide a constructor_body that can be empty.
18179 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18181 * driver.cs: Add support for --resources.
18183 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18184 Make all types for the various array helper methods be integer.
18186 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18187 CheckState to ConvCast.
18189 (ConvCast): Now it takes a `checked' state argument, to avoid
18190 depending on the emit context for the conversion, and just using
18191 the resolve time setting.
18193 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18194 instead of Invocation.EmitArguments. We do not emit the original
18195 arguments, instead we emit those which have been converted to
18196 unsigned int expressions.
18198 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18200 * codegen.cs: ditto.
18202 * expression.cs (LocalVariableReference): Drop the use of the
18203 Store function that depended on the variable index.
18205 * statement.cs (VariableInfo): Drop the `Idx' property from this
18206 class, as this is not taking into account the indexes for
18207 temporaries tat we generate during the execution, getting the
18210 * class.cs: First emit class initializers, then call the parent
18213 * expression.cs (Binary): Fix opcode emision.
18214 (UnaryMutator.EmitCode): Support checked code generation
18216 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18217 matches for events for both the Static and Instance scans,
18218 pointing to the same element. Fix that.
18220 2002-03-14 Miguel de Icaza <miguel@ximian.com>
18222 * rootcontext.cs (ResolveTree): Always set the
18223 interface_resolve_order, because nested interfaces will be calling
18226 * class.cs (GetInterfaceOrClass): Track the same resolution
18227 process used by TypeManager.LookupType. This fixes the nested
18228 type lookups in class declarations (separate path from
18231 (TypeContainer.DefineType): Also define nested interfaces.
18232 (TypeContainer.RegisterOrder): New public function used to
18233 register the order in which child interfaces need to be closed.
18235 Nested interfaces need to be closed after their parents have been
18238 * interface.cs (InterfaceAttr): Put all the logic for computing
18239 the interface attribute here.
18241 (DefineInterface): Register our interface order with the
18242 RootContext or with the TypeContainer depending on the case.
18244 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18246 * cs-parser.jay: rework foreach statement to work with the new
18247 changes to the policy on SimpleNames.
18249 * report.cs: support Stacktrace on warnings as well.
18251 * makefile: drop --unsafe and /unsafe from the compile.
18253 2002-03-13 Ravi Pratap <ravi@ximian.com>
18255 * ecore.cs (StandardConversionExists): Modify to take an Expression
18256 as the first parameter. Ensure we do null -> reference type conversion
18259 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18260 temporary Expression objects.
18262 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18264 * interface.cs: workaround bug in method overloading resolution
18265 (there is already a bugzilla bug for it).
18267 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18269 We could also solve this problem by having a separate path for
18270 performing type lookups, instead of DoResolve, we could have a
18271 ResolveType entry point, and only participating pieces of the
18272 production (simplename, deref, array) would implement this.
18274 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18275 signal SimpleName to only resolve type names and not attempt to
18276 resolve anything else.
18278 * expression.cs (Cast): Set the flag.
18280 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18282 * class.cs: Only report 108 if there is no `new' modifier.
18284 * cs-parser.jay: rework foreach statement to work with the new
18285 changes to the policy on SimpleNames.
18287 * report.cs: support Stacktrace on warnings as well.
18289 * makefile: drop --unsafe and /unsafe from the compile.
18291 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18293 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18294 lookups here, instead of doing that at parse time. This means
18295 that our grammar will not introduce `LocalVariableReferences' as
18296 expressions at this point. That solves the problem of code like
18300 static void Main ()
18304 This is only half the fix. The full fix requires parameters to
18305 also be handled in this way.
18307 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18308 makes the use more obvious of the DeclSpace. The
18309 ec.TypeContainer.TypeBuilder is now only used to pull the
18310 TypeBuilder for it.
18312 My theory is that I can get rid of the TypeBuilder completely from
18313 the EmitContext, and have typecasts where it is used (from
18314 DeclSpace to where it matters).
18316 The only pending problem is that the code that implements Aliases
18317 is on TypeContainer, and probably should go in DeclSpace.
18319 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18320 lookups here, instead of doing that at parse time. This means
18321 that our grammar will not introduce `LocalVariableReferences' as
18322 expressions at this point. That solves the problem of code like
18326 static void Main ()
18330 This is only half the fix. The full fix requires parameters to
18331 also be handled in this way.
18333 * class.cs (Property.DefineMethod): When implementing an interface
18334 method, set newslot, when implementing an abstract method, do not
18335 set the flag (before we tried never setting it, or always setting
18336 it, which is the difference).
18337 (Indexer.DefineMethod): same.
18338 (Method.DefineMethod): same.
18340 * ecore.cs: Only set the status used flag if we get back a Field.
18342 * attribute.cs: Temporary hack, so Paolo can keep working.
18344 2002-03-08 Ravi Pratap <ravi@ximian.com>
18346 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18347 the unmanaged type in the case we have a MarshalAs attribute.
18349 (Resolve): Handle the case when we are parsing the special MarshalAs
18350 attribute [we need to store the unmanaged type to use later]
18352 * typemanager.cs (marshal_as_attr_type): Built in type for the
18353 MarshalAs Attribute.
18355 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18356 on parameters and accordingly set the marshalling info.
18358 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18360 * class.cs: Optimizing slightly by removing redundant code after
18361 we switched to the `NoTypes' return value.
18362 (Property.DefineMethod): use NoTypes here too.
18364 This fixes the bug I introduced in my last batch of changes.
18366 2002-03-05 Ravi Pratap <ravi@ximian.com>
18368 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18370 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18371 Enums since those are types too.
18373 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18375 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18376 thanks to a call during the lookup process.
18378 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18380 * statement.cs (Foreach): Lots of work to accomodate a particular
18381 kind of foreach statement that I had not kept in mind. It is
18382 possible to have foreachs on classes that provide a GetEnumerator
18383 method that return objects that implement the "pattern" for using
18384 a foreach, there is no need to support GetEnumerator
18387 This is needed to compile nant.
18389 * decl.cs: Only report 114 if the member is not `Finalize' and if
18390 the warning level is at least 2.
18392 * class.cs: Moved the compare function from Method to
18395 (MethodSignature.InheritableMemberSignatureCompare): Add new
18396 filter function that is used to extract inheritable methods from a
18399 (Method.Define): Use the new `inheritable_method_signature_filter'
18402 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18405 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18407 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18409 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18411 * expression.cs: Pass location information to
18412 ConvertImplicitStandard.
18414 * class.cs: Added debugging code to track return values from
18417 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18419 * expression.cs (Is.DoResolve): If either side of the `is' is an
18420 interface, do not flag the warning.
18422 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18425 * report.cs: Allow for --fatal to be used with --probe.
18427 * typemanager.cs (NoTypes): Move the definition for the empty Type
18430 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18432 (TypeContainer.DefineProxy): New function used to proxy to parent
18433 implementations when implementing interfaces.
18434 (TypeContainer.ParentImplements): used to lookup if our parent
18435 implements a public function that is required by an interface.
18436 (TypeContainer.VerifyPendingMethods): Hook this up.
18438 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18439 `modules' and `assemblies' arraylists into arrays. We only grow
18440 these are the very early start up of the program, so this improves
18441 the speedof LookupType (nicely measured).
18443 * expression.cs (MakeByteBlob): Replaced unsafe code with
18444 BitConverter, as suggested by Paolo.
18446 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18447 folding of string concatenation, but if either side is a string,
18448 and the other is not, then return null, and let the runtime use
18449 the concatenation on the string plus the object (using
18450 `Object.ToString').
18452 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18454 Constant Folding has been implemented now.
18456 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18457 the error instead on types that are not supported in one's
18460 * constant.cs (Constant and all children): New set of functions to
18461 perform implict and explicit conversions.
18463 * ecore.cs (EnumConstant): Implement the new functions to perform
18464 conversion by proxying to the child expression.
18466 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18467 own separate setting that can not be turned off from the command
18468 line using --unchecked or --checked and is only controlled using
18469 the checked/unchecked statements and expressions. This setting is
18470 used by the constant folder to flag errors.
18472 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18473 ConstantCheckState as well.
18475 During Resolve, they also have to flag the state, because the
18476 constant folder runs completely in the Resolve phase.
18478 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18481 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18483 * cfold.cs: New file, this file contains the constant folder.
18485 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18486 argument to track whether we are using the resulting address to
18487 load or store a value and provide better error messages.
18489 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18490 new AddressOf arguments.
18492 * statement.cs (Foreach.EmitCollectionForeach): Update
18494 * expression.cs (Argument.Emit): Call AddressOf with proper
18495 arguments to track usage.
18497 (New.DoEmit): Call AddressOf with new arguments.
18499 (Unary.Emit): Adjust AddressOf call.
18501 2002-03-01 Ravi Pratap <ravi@ximian.com>
18503 * cs-parser.jay (member_access): Change the case for pre-defined types
18504 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18507 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18510 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18511 essentially like methods and apply attributes like MethodImplOptions to them too.
18513 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18516 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18517 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18520 * Update code everywhere accordingly.
18522 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18524 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18526 2002-02-28 Ravi Pratap <ravi@ximian.com>
18528 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18529 try performing lookups against those instead of jumping straight into using
18530 the 'using' clauses.
18532 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18534 (LookupType): Perform lookups in implicit parents too.
18536 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18537 sequence as RootContext.LookupType.
18539 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18540 the various cases of namespace lookups into this method.
18542 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18544 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18545 in positional arguments)
18547 * class.cs (Operator): Update the AllowedModifiers to contain
18550 * cs-parser.jay: Update operator declaration to allow for the
18551 operator body to be empty.
18553 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18556 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18558 * class.cs (Method.Emit): Label parameters.
18560 * driver.cs: Return 1 or 0 as the program exit code.
18562 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18564 * expression.cs: Special case the `null' object when trying to
18565 auto-compute the type, as anything can be explicitly converted to
18568 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18569 spotting this Paolo.
18571 (Expression.ImplicitNumericConversion): Perform comparissions of
18572 the type using the underlying type in the case of an enumeration
18573 rather than using the enumeration type for the compare.
18575 Cope with the underlying == type case, which is not possible to
18578 (Expression.ConvertNumericExplicit): Perform comparissions of
18579 the type using the underlying type in the case of an enumeration
18580 rather than using the enumeration type for the compare.
18582 * driver.cs: If the user does not supply an extension, assume .exe
18584 * cs-parser.jay (if_statement): Rewrote so that we can track the
18585 location for the if statement.
18587 * expression.cs (Binary.ConstantFold): Only concat strings when
18588 the operation is "+", not everything ;-)
18590 * statement.cs (Statement.EmitBoolExpression): Take a location
18592 (If, While, Do): Track location.
18594 * expression.cs (Binary.ResolveOperator): In the object + string
18595 case, I was missing a call to ConvertImplicit
18597 2002-02-25 Ravi Pratap <ravi@ximian.com>
18599 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18600 Location arguments. Ensure we use RootContext.LookupType to do our work
18601 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18603 * interface.cs (PopulateMethod): Handle the type of the parameter being
18606 * expression.cs (Invocation.BetterFunction): Handle the case when we
18607 have a params method with no fixed arguments and a call is made with no
18610 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18612 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18613 the verbatim-string-literal
18615 * support.cs (InternalParameters.ParameterModifier): handle null
18617 (InternalParameters.ParameterType): ditto.
18619 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18620 duplicating the name of the variable parameter.
18621 (GetParameterByName): Fix bug where we were not looking up array
18622 paramters if they were the only present (thanks Paolo!).
18623 (GetParameterInfo): We only have an empty set of types if both
18624 fixed and array are set to null.
18625 (GetParameterInfo-idx): Handle FixedParameter == null
18627 * cs-parser.jay: Handle the case where there is no catch
18628 statements (missing null test).
18630 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18632 * driver.cs (MainDriver): Be conservative on our command line
18635 Catch DirectoryNotFoundException when calling GetFiles.
18637 (SplitPathAndPattern): Used to split the input specification into
18638 a path and a pattern that we can feed to Directory.GetFiles.
18640 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18642 * statement.cs (Fixed): Implement the last case of the Fixed
18643 statement (string handling).
18645 * expression.cs (StringPtr): New class used to return a char * to
18646 a string; Used by the Fixed statement.
18648 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18650 * expression.cs (Binary.ResolveOperator): Remove redundant
18651 MemberLookup pn parent type.
18652 Optimize union call, we do not need a union if the types are the same.
18653 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18656 Specialize the use of MemberLookup everywhere, instead of using
18657 the default settings.
18659 (StackAlloc): Implement stackalloc keyword.
18661 * cs-parser.jay: Add rule to parse stackalloc.
18663 * driver.cs: Handle /h, /help, /?
18665 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18666 before we supported unsafe code.
18668 * makefile: add --unsafe to the self compilation of mcs.
18670 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18672 * expression.cs (PointerArithmetic): New class that is used to
18673 perform pointer arithmetic.
18674 (Binary.Resolve): Handle pointer arithmetic
18675 Handle pointer comparission.
18676 (ArrayPtr): Utility expression class that is used to take the
18677 address of an array.
18679 (ElementAccess): Implement array access for pointers
18681 * statement.cs (Fixed): Implement fixed statement for arrays, we
18682 are missing one more case before we are done.
18684 * expression.cs (Indirection): Implement EmitAssign and set the
18685 ExprClass to Variable. This allows pointer dereferences to be
18686 treated as variables, and to have values assigned to them.
18688 * ecore.cs (Expression.StoreFromPtr): New utility function to
18689 store values dereferencing.
18691 2002-02-20 Ravi Pratap <ravi@ximian.com>
18693 * expression.cs (Binary.ResolveOperator): Ensure that we are
18694 not trying to operate on a void type - this fixes the reported
18697 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18698 the parent implementation is sealed.
18700 * ../errors/cs0239.cs : Add.
18702 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18704 * typemanager.cs (unverifiable_code_type): Corresponds to
18705 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18706 which have unsafe code in them.
18708 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18711 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18713 * cs-tokenizer.cs: Add support for @"litreal strings"
18715 Make tokenizer accept pre-processor directives
18716 on any column (remove the old C-like limitation).
18718 * rootcontext.cs (EmitCode): Emit any global attributes.
18719 (AddGlobalAttributes): Used to keep track of assembly attributes.
18721 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18723 * cs-parser.jay: Add support for global attributes.
18725 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18727 * expression.cs (Indirection): New helper class. Unary will
18728 create Indirection classes to be able to implement the
18729 IMemoryLocation interface on it.
18731 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18733 * cs-parser.jay (fixed_statement): reference the right statement.
18735 * statement.cs (Fixed.Emit): Finish implementing the fixed
18736 statement for the &x case.
18738 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18740 * class.cs (Property.Define, Method.Define): Remove newslot when
18743 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18744 wrong. NewSlot should only be used if the `new' keyword is present.
18746 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18747 locating our system dir. Sorry about this.
18749 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18751 * driver.cs (GetSystemDir): Compute correctly the location of our
18752 system assemblies. I was using the compiler directory instead of
18753 the library directory.
18755 2002-02-13 Ravi Pratap <ravi@ximian.com>
18757 * expression.cs (BetterFunction): Put back in what Miguel commented out
18758 since it is the correct fix. The problem is elsewhere ;-)
18760 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18761 parameters of the parms method are themselves compatible or not !
18763 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18764 to check that a class implements an interface before saying that an implicit
18765 conversion was allowed. Use ImplementsInterface to do the checking.
18767 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18769 * class.cs (Method.Define): Track whether we are an explicit
18770 implementation or not. And only call DefineMethodOverride if we
18771 are an explicit implementation.
18773 (Property.DefineMethod): Ditto.
18775 2002-02-11 Ravi Pratap <ravi@ximian.com>
18777 * expression.cs (BetterFunction): Catch hideous bug which was
18778 preventing us from detecting ambiguous calls due to implicit casts i.e
18781 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18783 * support.cs (Pair): Remove un-needed method. I figured why I was
18784 getting the error in cs-parser.jay, the variable in a foreach loop
18785 is readonly, and the compiler does not really treat this as a variable.
18787 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18788 instead of EQUALS in grammar.
18790 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18792 * expression.cs (Unary.DoResolve): Check whether the argument is
18795 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18797 * support.cs: Api for Pair to set a value. Despite the fact that
18798 the variables are public the MS C# compiler refuses to compile
18799 code that accesses the field if the variable is part of a foreach
18802 * statement.cs (Fixed): Begin implementation of the fixed
18805 (Block.AddVariable): Return the VariableInfo on success and null
18806 on failure instead of true/false.
18808 * cs-parser.jay (foreach): Catch errors on variables already
18809 defined (we were ignoring this value before) and properly unwind
18810 the block hierarchy
18812 (fixed_statement): grammar for the fixed statement.
18814 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18816 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18817 pointer types to be incretemented.
18819 (SizeOf): Implement.
18821 * cs-parser.jay (pointer_member_access): Implement
18822 expr->IDENTIFIER production.
18824 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18825 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18828 (Unary): Implement indirection.
18830 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18831 use in non-unsafe context).
18833 (SimpleName.DoResolve): Check for pointers in field access on safe
18836 (Expression.LoadFromPtr): Factor the load-indirect code in this
18837 function. This was duplicated in UnboxCast and ParameterReference
18839 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18841 * expression.cs (ComposedCast): report an error if a pointer cast
18842 is used in a safe region.
18844 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18845 pointer type casts in unsafe context.
18847 * codegen.cs (EmitContext): Set up IsUnsafe.
18849 * cs-parser.jay (non_expression_type): Add productions for pointer
18852 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18853 code. We should not use force into static mode if the method is
18854 not virtual. Fixes bug in MIS
18856 * statement.cs (Do.Emit, While.Emit, For.Emit,
18857 Statement.EmitBoolExpression): Add support to Do and While to
18858 propagate infinite loop as `I do return' semantics.
18860 Improve the For case to also test for boolean constants.
18862 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18863 to the list of attributes we can add.
18865 Remove `EmitContext' argument.
18867 * class.cs (Method.Define): Apply parameter attributes.
18868 (Constructor.Define): Apply parameter attributes.
18869 (MethodCore.LabelParameters): Move here the core of labeling
18872 * support.cs (ReflectionParameters.ParameterModifier,
18873 InternalParameters.ParameterModifier): Use IsByRef on the type and
18874 only return the OUT bit for these parameters instead of in/out/ref
18877 This is because I miss-understood things. The ParameterInfo.IsIn
18878 and IsOut represent whether the parameter has the [In] and [Out]
18881 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18883 * ecore.cs (FieldExpr.Emit): Release temporaries.
18885 * assign.cs (LocalTemporary.Release): new function.
18887 * codegen.cs (EmitContext.GetTemporaryStorage,
18888 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18889 temporary storage. Now we can "put back" localbuilders when we
18892 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18894 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18895 need to make a copy of the variable to generate verifiable code.
18897 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18899 * driver.cs: Compute dynamically the system directory.
18901 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18902 Slower, but more generally useful. Used by the abstract
18903 registering implementation.
18905 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18906 the rules for the special rule on Type/instances. First check if
18907 we have the same name, and if so, try that special static path
18908 rather than the instance path.
18910 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18912 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18915 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18916 Enum, ValueType, Delegate or Array for non-corlib compiles.
18918 * cs-tokenizer.cs: Catch long identifiers (645)
18920 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18923 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18924 fix, we were returning too early, so we were not registering
18925 pending methods from abstract classes.
18927 Do not register pending methods if the class is abstract.
18929 * expression.cs (Conditional.DoResolve): Report circular implicit
18930 conversions when we neecd to compute it for conditional
18933 (Is.DoResolve): If the expression is always of the provided type,
18934 flag warning 183. If the expression can not ever be of the
18935 provided type flag warning 184.
18937 * class.cs: Catch 169 as well.
18939 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18942 2002-01-18 Nick Drochak <ndrochak@gol.com>
18944 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18946 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18948 * interface.cs: (PopulateMethod): Check for pointers being defined
18949 only if the unsafe context is active.
18950 (PopulateProperty): ditto.
18951 (PopulateIndexer): ditto.
18953 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18954 specified. If pointers are present, make sure that they are
18955 present in an unsafe context.
18956 (Constructor, Constructor.Define): ditto.
18957 (Field, Field.Define): ditto.
18958 (Property, Property.Define): ditto.
18959 (Event, Event.Define): ditto.
18961 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18962 hashtable if there are classes or structs defined.
18964 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18965 code, as the constant resolution moved.
18967 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18968 the metadata, so we can flag error 133.
18970 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18971 pointer is being declared in an unsafe context.
18973 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18975 * modifiers.cs (Modifiers.Check): Require a Location argument.
18976 Report error 227 for Unsafe use.
18978 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18980 * statement.cs (For.Emit): If the test is null, then report that
18981 we do `return', as we wont reach anything afterwards.
18983 (Switch.SwitchGoverningType): Track the expression that matched
18986 * driver.cs: Allow negative numbers as an error code to flag.
18988 * cs-parser.jay: Handle 1551.
18990 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18992 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18994 * cs-parser.jay: Report 1518 (type declaration can only contain
18995 class, struct, interface, enum or delegate)
18997 (switch_label): Report 1523 (keywords `case' or `default' must
19000 (opt_switch_sections): Report 1522 (empty switch)
19002 * driver.cs: Report 1515 (response file specified multiple times)
19003 Report 1516 (Source file specified multiple times).
19005 * expression.cs (Argument.Resolve): Signal 1510
19007 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19008 access not allowed in static code)
19010 2002-01-11 Ravi Pratap <ravi@ximian.com>
19012 * typemanager.cs (IsPointerType): Utility method which we are going
19015 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19016 the object type, so we take care of that.
19018 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19020 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19021 added to non-params parameters :-)
19023 * typemanager.cs (CSharpName): Include 'void' type too.
19025 (void_ptr_type): Include in the set of core types.
19027 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19030 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19033 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19034 completely forgotten about it.
19036 2002-01-10 Ravi Pratap <ravi@ximian.com>
19038 * cs-parser.jay (pointer_type): Add. This begins our implementation
19039 of parsing rules for unsafe code.
19041 (unsafe_statement): Implement.
19043 (embedded_statement): Modify to include the above.
19045 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19047 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19048 if the current context is an unsafe one.
19050 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19051 are handled differently, we need separate rules for them.
19053 (local_variable_declaration): Update to use local_variable_pointer_type
19054 to allow variable declarations of unmanaged pointer types.
19056 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19057 in unsafe contexts.
19059 * ../errors/cs0214.cs : Add.
19061 2002-01-16 Nick Drochak <ndrochak@gol.com>
19063 * makefile: remove 'response' file when cleaning.
19065 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19067 * cs-parser.jay: Report 1524.
19069 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19071 * typemanager.cs (RegisterMethod): drop checking if we have
19072 registered this from here
19074 2002-01-12 Miguel de Icaza <miguel@ximian.com>
19076 * class.cs (Method.EmitDestructor): Implement calling our base
19079 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19080 value of InFinally.
19082 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19083 this routine and will wrap the call in a try/catch block. Deal
19086 2002-01-11 Miguel de Icaza <miguel@ximian.com>
19088 * ecore.cs (Expression.MemberLookup): instead of taking a
19089 parameter `same_type' that was used to tell whether we could
19090 access private members we compute our containing type from the
19093 (FieldExpr): Added partial support for volatile fields. This does
19094 not work for volatile fields exposed from assemblies, as I can not
19095 figure out how to extract the modreq from it.
19097 Updated all the source files to use this.
19099 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19100 because it is referenced by MemberLookup very often.
19102 2002-01-09 Ravi Pratap <ravi@ximian.com>
19104 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19105 TypeBuilder.GetCustomAttributes to retrieve what we need.
19107 Get rid of redundant default_member_attr_type as this is the same as
19108 default_member_type which already exists.
19110 * interface.cs, attribute.cs : Update accordingly.
19112 2002-01-08 Miguel de Icaza <miguel@ximian.com>
19114 * typemanager.cs: Enable IndexerPropertyName again. It does not
19115 work for TYpeBuilders though. Ravi, can you please fix this?
19117 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19119 * expression.cs (Argument.Emit): Handle the case of ref objects
19120 being passed to ref functions;
19122 (ParameterReference.EmitLoad): Loads the content of the pointer
19123 without dereferencing.
19125 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19127 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19129 2002-01-08 Ravi Pratap <ravi@ximian.com>
19131 * class.cs (Indexer.DefineMethod): Incorporate the interface
19132 type in the name of the method if we are doing explicit interface
19135 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19137 (BetterConversion): Fix extremely trivial bug where we were referring to
19138 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19141 * ../errors/bug16.cs : Add although we have fixed it.
19143 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19145 * expression.cs (BaseIndexer): Begin implementation.
19147 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19149 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19150 production directly to remove a shift/reduce, and implement
19151 explicit interface implementation.
19153 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19154 after a floating point suffix.
19156 * expression.cs (DoNumericPromotions): Improved the conversion for
19157 uint/uint. If we have a constant, we avoid doing a typecast to a
19160 * class.cs (Indexer): Implement explicit interface implementation
19163 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19165 * class.cs: make the default instance constructor public and hidebysig.
19167 2001-01-03 Ravi Pratap <ravi@ximian.com>
19169 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19170 so we can call it from elsewhere.
19172 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19173 we emit it internally if the class has a defined indexer; otherwise the user
19174 emits it by decorating the class definition with the DefaultMemberAttribute.
19176 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19177 attribute is not used on a type which defines an indexer.
19179 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19180 character when we skip whitespace.
19182 * ../errors/cs0646.cs : Add.
19184 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19186 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19189 * makefile: Add practical target `mcs3.exe' which builds the third
19190 generation compiler.
19192 * expression.cs (New): Fix structures constructor calling.
19194 * class.cs (Property, Method, Indexer): Emit Final flag on the
19195 method if we are an interface implementation and we are not
19198 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19199 whether this property is referencing a `base' method.
19201 * expression.cs (Invocation.EmitCall): take an extra argument:
19202 is_base, this is used to determine whether the `call' or
19203 `callvirt' opcode should be used.
19206 * delegate.cs: update EmitCall.
19208 * class.cs (Method.Define): Set NewSlot for the cases where we are
19209 not implementing an interface method.
19211 (Property.Define): ditto.
19213 2002-01-02 Miguel de Icaza <miguel@ximian.com>
19215 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19216 'r'. Allows mcs to parse itself fully.
19218 2002-01-02 Ravi Pratap <ravi@ximian.com>
19220 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19221 of the number of initializers that require the InitializeArray method.
19223 (CheckIndices): Store the Expression in all cases - not the plain value. Also
19224 update the above field where necessary.
19226 (MakeByteBlob): Update accordingly.
19228 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
19231 (EmitDynamicInitializers): Update in accordance with the new optimization.
19233 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19234 same OpCode applies.
19236 * cs-parser.jay : Fix some glaring errors I introduced.
19238 2002-01-01 Ravi Pratap <ravi@ximian.com>
19240 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19241 so that we can check for name clashes there too.
19243 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19244 for interface indexers.
19246 * interfaces.cs (Define): Emit the default member attribute.
19248 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19249 variable was being referred to while setting the value ;-)
19251 2002-01-01 Miguel de Icaza <miguel@ximian.com>
19253 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19254 byte-by-byte information when we know the data is zero.
19256 Make the block always a multiple of 4, because
19257 DefineInitializedData has a bug.
19259 * assign.cs: Fix, we should assign from the temporary, not from
19262 * expression.cs (MakeByteBlob): Fix my incorrect code.
19264 2001-12-31 Miguel de Icaza <miguel@ximian.com>
19266 * typemanager.cs (EnumToUnderlying): This function is used to get
19267 the underlying type from an enumeration, because it does not
19270 * constant.cs: Use the I4_S form for values between -128 and 127.
19272 * statement.cs (Block.LookupLabel): Looks up a label.
19273 (Block): Drop support for labeled blocks.
19275 (LabeledStatement): New kind of statement that represents a label
19278 (Goto): Finally implement this bad boy.
19280 * cs-parser.jay: Update to reflect new mechanism to implement
19283 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19285 * codegen.cs (EmitContext.This): a codegen property that keeps the
19286 a single instance of this instead of creating many different this
19289 * delegate.cs (Delegate.DoResolve): Update to use the property;
19291 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19293 * expression.cs (BaseAccess.DoResolve): Ditto.
19295 2001-12-29 Ravi Pratap <ravi@ximian.com>
19297 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19298 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19300 (InitCoreTypes): Update accordingly.
19302 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19303 so we can quickly store the state.
19305 (ApplyAttributes): Set the correct implementation flags
19306 for InternalCall methods.
19308 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19310 * expression.cs (EmitCall): if a method is not virtual, then do
19311 not use callvirt on it.
19313 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19314 user defined stuff) requires the use of stobj, which takes an
19315 address on the stack instead of an array and an index. So emit
19316 the Ldelema operation for it.
19318 (EmitStoreOpcode): Use stobj for valuetypes.
19320 (UnaryMutator.EmitCode): Use the right 1 value depending on
19321 whether we are dealing with int64/uint64, float or doubles.
19323 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19324 constructors that I implemented last night.
19326 (Constructor.IsDefault): Fix to work properly for static
19329 * cs-parser.jay (CheckDef): report method signature errors.
19330 Update error number 103 to be 132.
19332 * decl.cs: New AdditionResult enumeration value: MethodExists.
19333 Although we do this check for methods later on in the semantic
19334 analysis, catching repeated default constructors is so easy that
19335 we catch these here.
19337 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19340 (ParameterReference.EmitAssign, Emit): handle
19343 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19344 (ArrayAccess.EmitStoreOpcode): ditto.
19346 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19348 * expression.cs (MakeByteBlob): Complete all the missing types
19349 (uint, short, ushort, byte, sbyte)
19351 * class.cs: Only init instance field initializers on instance
19354 Rename `constructors' to instance_constructors.
19356 (TypeContainer.AddConstructor): Only add constructors to the list
19357 if it is not static.
19359 Make sure that we handle default_static_constructor independently
19360 everywhere where we handle instance_constructors
19362 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19364 * class.cs: Do not lookup or create a base initializer for a
19365 static constructor.
19367 (ConstructorInitializer.Resolve): use the proper type to lookup
19370 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19372 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19375 * decl.cs: CloseType is now an virtual method, the default
19376 implementation just closes this type.
19378 2001-12-28 Ravi Pratap <ravi@ximian.com>
19380 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19381 to PreserveSig by default. Also emit HideBySig on such methods.
19383 Basically, set the defaults to standard values.
19385 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19386 argument, if candidate is better, it can't be worse than the best !
19388 (Invocation): Re-write bits to differentiate between methods being
19389 applicable in their expanded form and their normal form - for params
19392 Get rid of use_standard everywhere as only standard conversions are allowed
19393 in overload resolution.
19395 More spec conformance.
19397 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19399 * driver.cs: Add --timestamp, to see where the compiler spends
19402 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19403 `this' in static code.
19405 (SimpleName.DoResolve): Implement in terms of a helper function
19406 that allows static-references to be passed upstream to
19409 (Expression.ResolveWithSimpleName): Resolve specially simple
19410 names when called by MemberAccess to implement the special
19413 (Expression.ImplicitReferenceConversion): Handle conversions from
19414 Null to reference types before others, as Null's type is
19417 * expression.cs (Invocation.EmitCall): Handle the special case of
19418 calling methods declared on a reference type from a ValueType
19419 (Base classes System.Object and System.Enum)
19421 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19422 the left hand side is a TypeExpr, not on every enumeration.
19424 (Binary.Resolve): If types are reference types, then do a cast to
19425 object on operators != and == of both arguments.
19427 * typemanager.cs (FindMembers): Extract instance and static
19428 members if requested.
19430 * interface.cs (PopulateProperty): Use void_type instead of null
19431 as the return type for the setter method.
19433 (PopulateIndexer): ditto.
19435 2001-12-27 Ravi Pratap <ravi@ximian.com>
19437 * support.cs (ReflectionParameters): Fix minor bug where we
19438 were examining the wrong parameter for the ParamArray attribute.
19440 Cope with requests for the type of the parameter at position
19441 greater than the params parameter's. We now return the element
19442 type of the params array as that makes more sense.
19444 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19445 accordingly as we no longer have to extract the element type
19448 (Invocation.OverloadResolve): Update.
19450 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19452 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19453 against IEnumerator, test whether the return value is a descendant
19454 of the IEnumerator interface.
19456 * class.cs (Indexer.Define): Use an auxiliary method to implement
19457 the other bits of the method definition. Begin support for
19458 explicit interface implementation.
19460 (Property.DefineMethod): Use TypeManager.void_type instead of null
19461 for an empty return value.
19463 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19465 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19466 dealing with a FieldExpr which is composed of a FieldBuilder, in
19467 the code path we did extract the constant, but we should have
19468 obtained the underlying value to be able to cast it (otherwise we
19469 end up in an infinite loop, this is what Ravi was running into).
19471 (ArrayCreation.UpdateIndices): Arrays might be empty.
19473 (MemberAccess.ResolveMemberAccess): Add support for section
19474 14.5.4.1 that deals with the special case of E.I when E is a type
19475 and something else, that I can be a reference to a static member.
19477 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19478 handle a particular array type to create byte blobs, it is just
19479 something we dont generate byteblobs for.
19481 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19484 * location.cs (Push): remove the key from the hashtable that we
19485 are about to add. This happens for empty files.
19487 * driver.cs: Dispose files after we have parsed them.
19489 (tokenize): new function that only runs the tokenizer on its
19490 input, for speed testing.
19492 2001-12-26 Ravi Pratap <ravi@ximian.com>
19494 * class.cs (Event.Define): Define the private field only if there
19495 are no accessors defined.
19497 * expression.cs (ResolveMemberAccess): If there is no associated
19498 field with the event, that means we have an event defined with its
19499 own accessors and we should flag error cs0070 since transforming
19500 ourselves into a field is not valid in that case.
19502 * ecore.cs (SimpleName.DoResolve): Same as above.
19504 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19505 and charset to sane values.
19507 2001-12-25 Ravi Pratap <ravi@ximian.com>
19509 * assign.cs (DoResolve): Perform check on events only if they
19510 are being accessed outside the declaring type.
19512 * cs-parser.jay (event_declarations): Update rules to correctly
19513 set the type of the implicit parameter etc.
19515 (add_accessor, remove_accessor): Set current local parameters.
19517 * expression.cs (Binary): For delegate addition and subtraction,
19518 cast the return value from the method into the appropriate delegate
19521 2001-12-24 Ravi Pratap <ravi@ximian.com>
19523 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19524 of these as the workaround is unnecessary.
19526 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19527 delegate data - none of that is needed at all.
19529 Re-write bits to extract the instance expression and the delegate method
19532 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19535 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19536 of attaching attributes instead of duplicating code everywhere.
19538 * everywhere : Update code to do attribute emission using the above method.
19540 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19542 * expression.cs (IsParamsMethodApplicable): if there are not
19543 parameters, return immediately.
19545 * ecore.cs: The 0 literal can be implicity converted to an enum
19548 (SimpleName.DoResolve): First lookup the type, then lookup the
19551 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19552 want to get its address. If the InstanceExpression is not
19553 addressable, store the result in a temporary variable, then get
19556 * codegen.cs: Only display 219 errors on warning level or above.
19558 * expression.cs (ArrayAccess): Make it implement the
19559 IMemoryLocation interface.
19561 (Binary.DoResolve): handle the operator == (object a, object b)
19562 and operator != (object a, object b) without incurring into a
19563 BoxedCast (because 5 != o should never be performed).
19565 Handle binary enumerator operators.
19567 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19568 value type, otherwise use Ldelem_ref.
19570 Use precomputed names;
19572 (AddressOf): Implement address of
19574 * cs-parser.jay (labeled_statement): Fix recursive block
19575 addition by reworking the production.
19577 * expression.cs (New.DoEmit): New has a special case:
19579 If we are dealing with a ValueType, we have a few
19580 situations to deal with:
19582 * The target of New is a ValueType variable, that is
19583 easy, we just pass this as the variable reference
19585 * The target of New is being passed as an argument,
19586 to a boxing operation or a function that takes a
19589 In this case, we need to create a temporary variable
19590 that is the argument of New.
19593 2001-12-23 Ravi Pratap <ravi@ximian.com>
19595 * rootcontext.cs (LookupType): Check that current_type is not null before
19596 going about looking at nested types.
19598 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19599 not implement the IAssignMethod interface any more.
19601 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19602 where we tranform them into FieldExprs if they are being resolved from within
19603 the declaring type.
19605 * ecore.cs (SimpleName.DoResolve): Do the same here.
19607 * assign.cs (DoResolve, Emit): Clean up code considerably.
19609 * ../errors/bug10.cs : Add.
19611 * ../errors/cs0070.cs : Add.
19613 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19615 * assign.cs : Get rid of EventIsLocal everywhere.
19617 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19619 * ecore.cs (ConvertIntLiteral): finished the implementation.
19621 * statement.cs (SwitchLabel): Convert the value we are using as a
19622 key before looking up the table.
19624 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19626 * codegen.cs (EmitTopBlock): Require a Location argument now.
19628 * cs-parser.jay (constructor_declarator): We need to setup
19629 current_local_parameters before we parse the
19630 opt_constructor_initializer, to allow the variables to be bound
19631 to the constructor arguments.
19633 * rootcontext.cs (LookupType): First lookup nested classes in our
19634 class and our parents before we go looking outside our class.
19636 * expression.cs (ConstantFold): Extract/debox the values at the
19639 * rootcontext.cs (EmitCode): Resolve the constants first before we
19640 resolve the types. This is not really needed, but it helps debugging.
19642 * statement.cs: report location.
19644 * cs-parser.jay: pass location to throw statement.
19646 * driver.cs: Small bug fix.
19648 * report.cs: Updated format to be 4-zero filled digits.
19650 2001-12-22 Ravi Pratap <ravi@ximian.com>
19652 * expression.cs (CheckIndices): Fix minor bug where the wrong
19653 variable was being referred to ;-)
19655 (DoEmit): Do not call EmitStaticInitializers when the
19656 underlying type is System.Object.
19658 2001-12-21 Ravi Pratap <ravi@ximian.com>
19660 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19661 and do the usual workaround for SRE.
19663 * class.cs (MyEventBuilder.EventType): New member to get at the type
19664 of the event, quickly.
19666 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19668 * assign.cs (Assign.DoResolve): Handle the case when the target
19669 is an EventExpr and perform the necessary checks.
19671 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19674 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19676 (EventExpr): Set the type in the constructor itself since we
19677 are meant to be born fully resolved.
19679 (EventExpr.Define): Revert code I wrote earlier.
19681 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19682 instance expression is null. The instance expression is a This in that case
19683 or a null, depending on whether it is a static method or not.
19685 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19686 refers to more than one method.
19688 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19689 and accordingly flag errors.
19691 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19693 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19695 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19697 * location.cs (ToString): Provide useful rutine.
19699 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19701 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19702 objects, return the actual integral boxed.
19704 * statement.cs (SwitchLabel): define an ILLabel for each
19707 (Switch.CheckSwitch): If the value is a Literal, extract
19708 the underlying literal.
19710 Also in the unused hashtable we had, add the SwitchLabel so we can
19711 quickly look this value up.
19713 * constant.cs: Implement a bunch of new constants. Rewrite
19714 Literal based on this. Made changes everywhere to adapt to this.
19716 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19717 dereferencing array only once, and also copes with enumrations.
19719 bytes are two bytes wide, not one.
19721 (Cast): Perform constant conversions.
19723 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19724 wrappers to the literals here.
19726 * expression.cs (DoNumericPromotions): long literals can converted
19727 to ulong implicity (this is taken care of elsewhere, but I was
19728 missing this spot).
19730 * ecore.cs (Expression.Literalize): Make the return type Literal,
19731 to improve type checking.
19733 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19735 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19737 * literal.cs: Revert code from ravi that checked the bounds. The
19738 bounds are sane by the definition of the type itself.
19740 * typemanager.cs: Fix implementation of ImplementsInterface. We
19741 need to actually look up in our parent hierarchy for interfaces
19744 * const.cs: Use the underlying type for enumerations
19746 * delegate.cs: Compute the basename for the delegate creation,
19747 that should fix the delegate test case, and restore the correct
19748 Type Lookup semantics in rootcontext
19750 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19751 referencing a nested type with the Reflection API is using the "+"
19754 * cs-parser.jay: Do not require EOF token at the end.
19756 2001-12-20 Ravi Pratap <ravi@ximian.com>
19758 * rootcontext.cs (LookupType): Concatenate type names with
19759 a '.' instead of a '+' The test suite passes again.
19761 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19762 field of the enumeration.
19764 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19765 the case when the member is an EventExpr.
19767 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19768 static has an associated instance expression.
19770 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19772 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19774 * class.cs (Event.Define): Register event and perform appropriate checks
19777 We define the Add and Remove methods even if the use provides none because
19778 in that case, we provide default implementations ourselves.
19780 Define a private field of the type of the event. This is done by the CSC compiler
19781 and we should be doing it too ;-)
19783 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19784 More methods we use in code we generate.
19786 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19789 (InitCoreTypes): Update accordingly for the above.
19791 * class.cs (Event.Emit): Generate code for default accessors that we provide
19793 (EmitDefaultMethod): Do the job in the above.
19795 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19798 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19800 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19801 builders even if we were missing one.
19803 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19804 pass the Basename as our class name instead of the Name. The
19805 basename will be correctly composed for us.
19807 * parameter.cs (Paramters): Now takes a Location argument.
19809 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19810 make all the code call directly LookupType in RootContext and take
19811 this chance to pass the Location information everywhere.
19813 * Everywhere: pass Location information.
19815 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19817 * class.cs (Constructor.Define): Updated way of detecting the
19818 length of the parameters.
19820 (TypeContainer.DefineType): Use basename as the type name for
19823 (TypeContainer.Define): Do not recursively define types here, as
19824 definition is taken care in order by the RootContext.
19826 * tree.cs: Keep track of namespaces in a per-file basis.
19828 * parameter.cs (Parameter.ComputeSignature): Update to use
19831 (Parameters.GetSignature): ditto.
19833 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19834 instead of a TypeContainer.
19836 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19837 resolve names. Because we need to be resolve in our context, not
19840 * driver.cs: Implement response files.
19842 * class.cs (TypeContainer.DefineType): If we are defined, do not
19843 redefine ourselves.
19845 (Event.Emit): Emit the code for add/remove handlers.
19846 (Event.Define): Save the MethodBuilders for add/remove.
19848 * typemanager.cs: Use pair here too.
19850 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19851 DictionaryEntry requires the first argument to be non-null.
19853 (enum_declaration): Compute full name for registering the
19856 (delegate_declaration): Instead of using
19857 formal_parameter_list, use opt_formal_parameter_list as the list
19860 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19861 (EventParsing): New property that controls whether `add' and
19862 `remove' are returned as tokens or identifiers (for events);
19864 2001-12-19 Ravi Pratap <ravi@ximian.com>
19866 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19867 use MyEventBuilder only and let it wrap the real builder for us.
19869 (MyEventBuilder): Revamp constructor etc.
19871 Implement all operations that we perform on EventBuilder in precisely the same
19874 (FindMembers): Update to use the EventBuilder member.
19876 (Event.Emit): Update accordingly.
19878 2001-12-18 Ravi Pratap <ravi@ximian.com>
19880 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19881 by calling the appropriate methods.
19883 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19886 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19888 2001-12-17 Ravi Pratap <ravi@ximian.com>
19890 * delegate.cs (Delegate.Populate): Check that the return type
19891 and various parameters types are indeed accessible.
19893 * class.cs (Constructor.Define): Same here.
19895 (Field.Define): Ditto.
19897 (Event.Define): Ditto.
19899 (Operator.Define): Check that the underlying Method defined itself
19900 correctly - so it's MethodBuilder should not be null.
19902 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19903 expression happens to be null.
19905 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19906 members but as of now we don't seem to be able to do anything really useful with it.
19908 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19909 not the EventBuilder.
19911 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19913 * cs-tokenizer.cs: Add support for defines.
19914 Add support for #if, #elif, #else, #endif
19916 (eval_var): evaluates a variable.
19917 (eval): stubbed for evaluating functions.
19919 * cs-parser.jay: Pass the defines information
19921 * driver.cs: Add --define command line option.
19923 * decl.cs: Move MemberCore here.
19925 Make it the base class for DeclSpace. This allows us to catch and
19926 report 108 and 109 for everything now.
19928 * class.cs (TypeContainer.Define): Extract all the members
19929 before populating and emit the warning 108 (new keyword required
19930 to override) instead of having each member implement this.
19932 (MemberCore.Define): New abstract method, we will be using this in
19933 the warning reporting engine in Populate.
19935 (Operator.Define): Adjust to new MemberCore protocol.
19937 * const.cs (Const): This does not derive from Expression, it is a
19938 temporary object we use to create fields, it is a MemberCore.
19940 * class.cs (Method.Define): Allow the entry point to be in a
19943 * driver.cs: Rewrite the argument handler to clean it up a bit.
19945 * rootcontext.cs: Made it just an auxiliary namespace feature by
19946 making everything static.
19948 * driver.cs: Adapt code to use RootContext type name instead of
19951 * delegate.cs: Remove RootContext argument.
19953 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19956 * class.cs (Event.Define): The lookup can fail.
19958 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19960 * expression.cs: Resolve the this instance before invoking the code.
19962 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19964 * cs-parser.jay: Add a production in element_access that allows
19965 the thing to become a "type" reference. This way we can parse
19966 things like "(string [])" as a type.
19968 Note that this still does not handle the more complex rules of
19972 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19974 * ecore.cs: (CopyNewMethods): new utility function used to
19975 assemble the list of methods from running FindMembers.
19977 (MemberLookup): Rework FindMembers so that
19979 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19981 * class.cs (TypeContainer): Remove Delegates who fail to be
19984 * delegate.cs (Populate): Verify that we dont get null return
19985 values. TODO: Check for AsAccessible.
19987 * cs-parser.jay: Use basename to emit error 574 (destructor should
19988 have the same name as container class), not the full name.
19990 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19991 possible representation.
19993 Also implements integer type suffixes U and L.
19995 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19997 * expression.cs (ArrayCreation.DoResolve): We need to do the
19998 argument resolution *always*.
20000 * decl.cs: Make this hold the namespace. Hold the root context as
20002 (LookupType): Move here.
20004 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20006 * location.cs (Row, Name): Fixed the code, it was always returning
20007 references to the first file.
20009 * interface.cs: Register properties defined through interfaces.
20011 * driver.cs: Add support for globbing on the command line
20013 * class.cs (Field): Make it derive from MemberCore as well.
20016 2001-12-15 Ravi Pratap <ravi@ximian.com>
20018 * class.cs (Event::Define): Check that the type of the event is a delegate
20019 type else flag error #66.
20021 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20024 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20025 values of EntryPoint, CharSet etc etc.
20027 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20029 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20030 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20031 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20032 which needs this to do its work.
20034 * ../errors/cs0066.cs : Add.
20036 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20038 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20041 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20042 clears out the parameters field.
20043 (MemberSignatureCompare): Cleanup
20045 (MemberCore): New base class used to share code between MethodCore
20048 (RegisterRequiredImplementations) BindingFlags.Public requires
20049 either BindingFlags.Instace or Static. Use instance here.
20051 (Property): Refactored code to cope better with the full spec.
20053 * parameter.cs (GetParameterInfo): Return an empty array instead
20056 * class.cs (Property): Abstract or extern properties have no bodies.
20058 * parameter.cs (GetParameterInfo): return a zero-sized array.
20060 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20061 method modifier validation to the typecontainer so we can reuse
20062 this on properties.
20064 (MethodCore.ParameterTypes): return an empty sized array of types.
20066 (Property.Define): Test property modifier validity.
20068 Add tests for sealed/override too.
20070 (Method.Emit): abstract or extern methods have no bodies.
20072 2001-12-14 Ravi Pratap <ravi@ximian.com>
20074 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20077 (Method::Define, ::Emit): Modify accordingly.
20079 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20081 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20083 * makefile: Pass in /unsafe.
20085 2001-12-13 Miguel de Icaza <miguel@ximian.com>
20087 * class.cs (MakeKey): Kill routine.
20089 * class.cs (TypeContainer.Define): Correctly define explicit
20090 method implementations (they require the full interface name plus
20093 * typemanager.cs: Deply the PtrHashtable here and stop using the
20094 lame keys. Things work so much better.
20096 This of course broke everyone who depended on `RegisterMethod' to
20097 do the `test for existance' test. This has to be done elsewhere.
20099 * support.cs (PtrHashtable): A hashtable that avoid comparing with
20100 the object stupid Equals method (because, that like fails all over
20101 the place). We still do not use it.
20103 * class.cs (TypeContainer.SetRequiredInterface,
20104 TypeContainer.RequireMethods): Killed these two routines and moved
20105 all the functionality to RegisterRequiredImplementations.
20107 (TypeContainer.RegisterRequiredImplementations): This routine now
20108 registers all the implementations required in an array for the
20109 interfaces and abstract methods. We use an array of structures
20110 which can be computed ahead of time to reduce memory usage and we
20111 also assume that lookups are cheap as most classes will not
20112 implement too many interfaces.
20114 We also avoid creating too many MethodSignatures.
20116 (TypeContainer.IsInterfaceMethod): Update and optionally does not
20117 clear the "pending" bit if we find that there are problems with
20120 (TypeContainer.VerifyPendingMethods): Update to report errors of
20121 methods that look like implementations but are not.
20123 (TypeContainer.Define): Add support for explicit interface method
20126 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20128 * typemanager.cs: Keep track of the parameters here instead of
20129 being a feature of the TypeContainer.
20131 * class.cs: Drop the registration of parameters here, as
20132 InterfaceMethods are also interface declarations.
20134 * delegate.cs: Register methods with the TypeManager not only with
20135 the TypeContainer. This code was buggy.
20137 * interface.cs: Full registation here.
20139 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20141 * expression.cs: Remove reducer for binary expressions, it can not
20144 * const.cs: Put here the code that used to go into constant.cs
20146 * constant.cs: Put here the code for constants, this is a new base
20147 class for Literals.
20149 * literal.cs: Make Literal derive from Constant.
20151 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20153 * statement.cs (Return.Emit): Report error 157 if the user
20154 attempts to return from a finally block.
20156 (Return.Emit): Instead of emitting a return, jump to the end of
20159 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20160 LocalBuilder to store the result of the function. ReturnLabel is
20161 the target where we jump.
20164 2001-12-09 Radek Doulik <rodo@ximian.com>
20166 * cs-parser.jay: remember alias in current namespace
20168 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20171 * class.cs (LookupAlias): lookup alias in my_namespace
20173 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20175 (LookupAlias): lookup alias in this and if needed in parent
20178 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20182 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20183 making things static. I need this to avoid passing the
20184 TypeContainer when calling ParameterType.
20186 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20187 that did string manipulation to compute the type and then call
20188 GetType. Use Parameter.ParameterType instead.
20190 * cs-tokenizer.cs: Consume the suffix for floating values.
20192 * expression.cs (ParameterReference): figure out whether this is a
20193 reference parameter or not. Kill an extra variable by computing
20194 the arg_idx during emission.
20196 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20197 function that returns whether a parameter is an out/ref value or not.
20199 (Parameter.ParameterType): The type of the parameter (base,
20200 without ref/out applied).
20202 (Parameter.Resolve): Perform resolution here.
20203 (Parameter.ExternalType): The full type (with ref/out applied).
20205 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20206 support for expressions on the using statement.
20208 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20210 * statement.cs (Using.EmitLocalVariableDecls): Split the
20211 localvariable handling of the using statement.
20213 (Block.EmitMeta): Keep track of variable count across blocks. We
20214 were reusing slots on separate branches of blocks.
20216 (Try.Emit): Emit the general code block, we were not emitting it.
20218 Check the type of the declaration to be an IDisposable or
20219 something that can be implicity converted to it.
20221 Emit conversions if required.
20223 * ecore.cs (EmptyExpression): New utility class.
20224 (Expression.ImplicitConversionExists): New utility function.
20226 2001-12-06 Miguel de Icaza <miguel@ximian.com>
20228 * statement.cs (Using): Implement.
20230 * expression.cs (LocalVariableReference): Support read only variables.
20232 * statement.cs: Remove the explicit emit for the Leave opcode.
20233 (VariableInfo): Add a readonly field.
20235 2001-12-05 Miguel de Icaza <miguel@ximian.com>
20237 * ecore.cs (ConvCast): new class used to encapsulate the various
20238 explicit integer conversions that works in both checked and
20239 unchecked contexts.
20241 (Expression.ConvertNumericExplicit): Use new ConvCast class to
20242 properly generate the overflow opcodes.
20244 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20246 * statement.cs: The correct type for the EmptyExpression is the
20247 element_type, not the variable type. Ravi pointed this out.
20249 2001-12-04 Ravi Pratap <ravi@ximian.com>
20251 * class.cs (Method::Define): Handle PInvoke methods specially
20252 by using DefinePInvokeMethod instead of the usual one.
20254 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20255 above to do the task of extracting information and defining the method.
20257 2001-12-04 Ravi Pratap <ravi@ximian.com>
20259 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20260 of the condition for string type.
20262 (Emit): Move that here.
20264 (ArrayCreation::CheckIndices): Keep string literals in their expression
20267 (EmitDynamicInitializers): Handle strings appropriately.
20269 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20271 * codegen.cs (EmitContext): Replace multiple variables with a
20272 single pointer to the current Switch statement.
20274 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20277 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20281 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20284 (Foreach.Emit): Foreach on arrays was not setting
20285 up the loop variables (for break/continue).
20287 (GotoCase): Semi-implented.
20289 2001-12-03 Ravi Pratap <ravi@ximian.com>
20291 * attribute.cs (CheckAttribute): Handle system attributes by using
20292 Attribute.GetAttributes to examine information we need.
20294 (GetValidPlaces): Same here.
20296 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20298 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20300 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20302 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20304 (Method::Emit): Handle the case when we are a PInvoke method.
20306 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20308 * expression.cs: Use ResolveWithSimpleName on compound names.
20310 2001-12-02 Ravi Pratap <ravi@ximian.com>
20312 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20313 before trying to reduce it.
20315 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20317 * constant.cs (LookupConstantValue): Implement.
20319 (EmitConstant): Use the above in emitting the constant.
20321 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20322 that are user-defined by doing a LookupConstantValue on them.
20324 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20327 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20329 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20331 (BaseAccess.DoResolve): Implement.
20333 (MemberAccess.DoResolve): Split this routine into a
20334 ResolveMemberAccess routine that can be used independently
20336 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20338 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20339 As that share bits of the implementation. Is returns a boolean,
20340 while As returns the Type that is being probed.
20342 2001-12-01 Ravi Pratap <ravi@ximian.com>
20344 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20345 instead of a Literal - much easier.
20347 (EnumInTransit): Remove - utterly useless :-)
20349 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20351 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20353 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20354 chain when we have no associated expression.
20356 2001-11-30 Ravi Pratap <ravi@ximian.com>
20358 * constant.cs (Define): Use Location while reporting the errror.
20360 Also emit a warning when 'new' is used and there is no inherited
20363 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20366 (LookupEnumValue): Implement to lookup an enum member's value and define it
20369 (Populate): Re-write accordingly to use the above routine.
20371 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20373 * expression.cs (This): Fix prototype for DoResolveLValue to
20374 override the base class DoResolveLValue.
20376 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20379 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20380 (we need to load the address of the field here). This fixes
20383 (FieldExpr.DoResolveLValue): Call the DoResolve
20384 function to initialize the Instance expression.
20386 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20387 correctly the GetEnumerator operation on a value type.
20389 * cs-parser.jay: Add more simple parsing error catches.
20391 * statement.cs (Switch): Add support for string switches.
20392 Handle null specially.
20394 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20396 2001-11-28 Ravi Pratap <ravi@ximian.com>
20398 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20400 (declare_local_constant): New helper function.
20402 * statement.cs (AddConstant): Keep a separate record of constants
20404 (IsConstant): Implement to determine if a variable is a constant.
20406 (GetConstantExpression): Implement.
20408 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20410 * statement.cs (IsVariableDefined): Re-write.
20412 2001-11-27 Ravi Pratap <ravi@ximian.com>
20414 * class.cs (TypeContainer::FindMembers): Look for constants
20415 in the case when we are looking for MemberTypes.Field
20417 * expression.cs (MemberAccess::DoResolve): Check that in the
20418 case we are a FieldExpr and a Literal, we are not being accessed
20419 by an instance reference.
20421 * cs-parser.jay (local_constant_declaration): Implement.
20423 (declaration_statement): Implement for constant declarations.
20425 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20427 * statement.cs (Switch): Catch double defaults.
20429 (Switch): More work on the switch() statement
20430 implementation. It works for integral values now, need to finish
20434 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20436 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20437 integer literals into other integer literals. To be used by
20440 2001-11-24 Ravi Pratap <ravi@ximian.com>
20442 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20445 (EmitDynamicInitializers): Cope with the above since we extract data
20446 directly from ArrayData now.
20448 (ExpectInitializers): Keep track of whether initializers are mandatory
20451 (Bounds): Make it a hashtable to prevent the same dimension being
20452 recorded for every element in that dimension.
20454 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20457 Also fix bug which was causing the indices to be emitted in the reverse
20460 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20462 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20463 unfinished. They do not work, because the underlying code is
20466 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20468 * cs-parser.jay: Remove bogus fixme.
20470 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20471 on Switch statement.
20473 2001-11-23 Ravi Pratap <ravi@ximian.com>
20475 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20478 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20479 parameter. Apparently, any expression is allowed.
20481 (ValidateInitializers): Update accordingly.
20483 (CheckIndices): Fix some tricky bugs thanks to recursion.
20485 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20486 I was being completely brain-dead.
20488 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20489 and re-write acordingly.
20491 (DelegateInvocation): Re-write accordingly.
20493 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20495 (MakeByteBlob): Handle types more correctly.
20497 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20498 initialization from expressions but it is incomplete because I am a complete
20501 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20503 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20504 on If. Basically, we have to return `true' (ie, we do return to
20505 our caller) only if both branches of the if return.
20507 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20508 short-circuit operators, handle them as short circuit operators.
20510 (Cast.DoResolve): Resolve type.
20511 (Cast.Cast): Take an expression as the target type.
20513 * cs-parser.jay (cast_expression): Remove old hack that only
20514 allowed a limited set of types to be handled. Now we take a
20515 unary_expression and we resolve to a type during semantic
20518 Use the grammar productions from Rhys to handle casts (this is
20519 not complete like Rhys syntax yet, we fail to handle that corner
20520 case that C# has regarding (-x), but we will get there.
20522 2001-11-22 Ravi Pratap <ravi@ximian.com>
20524 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20525 field which is an array type.
20527 * cs-parser.jay (declare_local_variables): Support array initialization too.
20529 * typemanager.cs (MakeKey): Implement.
20531 (everywhere): Use the above appropriately.
20533 * cs-parser.jay (for_statement): Update for array initialization while
20534 declaring variables.
20536 * ecore.cs : The error message was correct, it's the variable's names that
20537 were misleading ;-) Make the code more readable.
20539 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20540 the correct type etc.
20542 (ConvertExplicit): Handle Enum types by examining the underlying type.
20544 2001-11-21 Ravi Pratap <ravi@ximian.com>
20546 * parameter.cs (GetCallingConvention): Always return
20547 CallingConventions.Standard for now.
20549 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20551 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20552 and `r' after calling DoNumericPromotions.
20554 * ecore.cs: Fix error message (the types were in the wrong order).
20556 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20557 BindingFlags.Instance as well
20559 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20560 implicit int literal conversion in an empty cast so that we
20561 propagate the right type upstream.
20563 (UnboxCast): new class used to unbox value types.
20564 (Expression.ConvertExplicit): Add explicit type conversions done
20567 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20568 the target type before applying the implicit LongLiterals to ULong
20571 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20573 * cs-parser.jay (for_statement): Reworked the way For works: now
20574 we declare manually any variables that are introduced in
20575 for_initializer to solve the problem of having out-of-band code
20576 emition (that is what got for broken).
20578 (declaration_statement): Perform the actual variable declaration
20579 that used to be done in local_variable_declaration here.
20581 (local_variable_declaration): Do not declare anything, just pass
20582 the information on a DictionaryEntry
20584 2001-11-20 Ravi Pratap <ravi@ximian.com>
20586 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20587 re-write of the logic to now make it recursive.
20589 (UpdateIndices): Re-write accordingly.
20591 Store element data in a separate ArrayData list in the above methods.
20593 (MakeByteBlob): Implement to dump the array data into a byte array.
20595 2001-11-19 Ravi Pratap <ravi@ximian.com>
20597 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20600 * constant.cs (Define): Implement.
20602 (EmitConstant): Re-write fully.
20604 Pass in location info.
20606 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20609 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20610 DictionaryEntry since we need location info too.
20612 (constant_declaration): Update accordingly.
20614 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20615 code into another method : UpdateIndices.
20617 2001-11-18 Ravi Pratap <ravi@ximian.com>
20619 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20620 some type checking etc.
20622 2001-11-17 Ravi Pratap <ravi@ximian.com>
20624 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20625 bits to provide dimension info if the user skips doing that.
20627 Update second constructor to store the rank correctly.
20629 2001-11-16 Ravi Pratap <ravi@ximian.com>
20631 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20632 and try to implement.
20634 * ../errors/cs0150.cs : Add.
20636 * ../errors/cs0178.cs : Add.
20638 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20640 * statement.cs: Implement foreach on multi-dimensional arrays.
20642 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20643 name of the params argument.
20645 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20646 initializing the array.
20648 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20649 we can use this elsewhere.
20651 * statement.cs: Finish implementation of foreach for single
20654 * cs-parser.jay: Use an out-of-band stack to pass information
20655 around, I wonder why I need this.
20657 foreach_block: Make the new foreach_block the current_block.
20659 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20660 function used to return a static Parameters structure. Used for
20661 empty parameters, as those are created very frequently.
20663 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20665 2001-11-15 Ravi Pratap <ravi@ximian.com>
20667 * interface.cs : Default modifier is private, not public. The
20668 make verify test passes again.
20670 2001-11-15 Ravi Pratap <ravi@ximian.com>
20672 * support.cs (ReflectionParameters): Fix logic to determine
20673 whether the last parameter is a params one. Test 9 passes again.
20675 * delegate.cs (Populate): Register the builders we define with
20676 RegisterParameterForBuilder. Test 19 passes again.
20678 * cs-parser.jay (property_declaration): Reference $6 instead
20679 of $$ to get at the location.
20681 (indexer_declaration): Similar stuff.
20683 (attribute): Ditto.
20685 * class.cs (Property): Register parameters for the Get and Set methods
20686 if they exist. Test 23 passes again.
20688 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20689 call to EmitArguments as we are sure there aren't any params arguments.
20690 Test 32 passes again.
20692 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20693 IndexOutOfRangeException.
20695 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20696 Test 33 now passes again.
20698 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20700 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20701 broke a bunch of things. Will have to come up with a better way
20702 of tracking locations.
20704 * statement.cs: Implemented foreach for single dimension arrays.
20706 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20708 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20709 an error. This removes the lookup from the critical path.
20711 * cs-parser.jay: Removed use of temporary_loc, which is completely
20714 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20716 * support.cs (ReflectionParameters.ParameterModifier): Report
20717 whether the argument is a PARAMS argument or not.
20719 * class.cs: Set the attribute `ParamArrayAttribute' on the
20720 parameter argument.
20722 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20723 and cons_param_array_attribute (ConstructorInfo for
20724 ParamArrayAttribute).,
20726 * codegen.cs: Emit the return using the `Return' statement, that
20727 way we can report the error correctly for missing return values.
20729 * class.cs (Method.Emit): Clean up.
20731 * expression.cs (Argument.Resolve): Take another argument: the
20732 location where this argument is used. Notice that this is not
20733 part of the "Argument" class as to reduce the size of the
20734 structure (we know the approximate location anyways).
20736 Test if the argument is a variable-reference, if not, then
20737 complain with a 206.
20739 (Argument.Emit): Emit addresses of variables.
20741 (Argument.FullDesc): Simplify.
20743 (Invocation.DoResolve): Update for Argument.Resolve.
20745 (ElementAccess.DoResolve): ditto.
20747 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20748 method should be virtual, as this method is always virtual.
20750 (NewDelegate.DoResolve): Update for Argument.Resolve.
20752 * class.cs (ConstructorInitializer.DoResolve): ditto.
20754 * attribute.cs (Attribute.Resolve): ditto.
20756 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20758 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20760 * expression.cs (ParameterReference): Drop IStackStorage and implement
20761 IAssignMethod instead.
20763 (LocalVariableReference): ditto.
20765 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20766 IAssignMethod instead.
20768 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20770 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20771 enumerations that are used in heavily used structures derive from
20772 byte in a laughable and pathetic attempt to reduce memory usage.
20773 This is the kind of pre-optimzations that you should not do at
20774 home without adult supervision.
20776 * expression.cs (UnaryMutator): New class, used to handle ++ and
20777 -- separatedly from the other unary operators. Cleans up the
20778 code, and kills the ExpressionStatement dependency in Unary.
20780 (Unary): Removed `method' and `Arguments' from this class, making
20781 it smaller, and moving it all to SimpleCall, so I can reuse this
20782 code in other locations and avoid creating a lot of transient data
20783 strucutres when not required.
20785 * cs-parser.jay: Adjust for new changes.
20787 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20789 * enum.cs (Enum.Populate): If there is a failure during
20792 * cs-parser.jay (opt_enum_base): we used to catch type errors
20793 here, but this is really incorrect. The type error should be
20794 catched during semantic analysis.
20796 2001-12-11 Ravi Pratap <ravi@ximian.com>
20798 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20799 current_local_parameters as expected since I, in my stupidity, had forgotten
20802 * attribute.cs (GetValidPlaces): Fix stupid bug.
20804 * class.cs (Method::Emit): Perform check on applicability of attributes.
20806 (Constructor::Emit): Ditto.
20808 (Field::Emit): Ditto.
20810 (Field.Location): Store location information.
20812 (Property, Event, Indexer, Operator): Ditto.
20814 * cs-parser.jay (field_declaration): Pass in location for each field.
20816 * ../errors/cs0592.cs : Add.
20818 2001-11-12 Ravi Pratap <ravi@ximian.com>
20820 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20822 (InitCoreTypes): Update accordingly.
20824 (RegisterAttrType, LookupAttr): Implement.
20826 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20827 info about the same.
20829 (Resolve): Update to populate the above as necessary.
20831 (Error592): Helper.
20833 (GetValidPlaces): Helper to the above.
20835 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20837 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20839 2001-11-12 Ravi Pratap <ravi@ximian.com>
20841 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20843 * ../errors/cs0617.cs : Add.
20845 2001-11-11 Ravi Pratap <ravi@ximian.com>
20847 * enum.cs (Emit): Rename to Populate to be more consistent with what
20848 we expect it to do and when exactly it is called.
20850 * class.cs, rootcontext.cs : Update accordingly.
20852 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20853 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20855 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20857 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20858 of a fieldinfo using the above, when dealing with a FieldBuilder.
20860 2001-11-10 Ravi Pratap <ravi@ximian.com>
20862 * ../errors/cs0031.cs : Add.
20864 * ../errors/cs1008.cs : Add.
20866 * ../errrors/cs0543.cs : Add.
20868 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20871 (FindMembers): Implement.
20873 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20874 enums and delegates too.
20876 (enum_types): Rename to builder_to_enum.
20878 (delegate_types): Rename to builder_to_delegate.
20880 * delegate.cs (FindMembers): Implement.
20882 2001-11-09 Ravi Pratap <ravi@ximian.com>
20884 * typemanager.cs (IsEnumType): Implement.
20886 * enum.cs (Emit): Re-write parts to account for the underlying type
20887 better and perform checking etc.
20889 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20890 of the underlying type.
20892 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20895 * enum.cs (error31): Helper to report error #31.
20897 * cs-parser.jay (enum_declaration): Store location of each member too.
20899 * enum.cs (member_to_location): New hashtable.
20901 (AddEnumMember): Update location hashtable.
20903 (Emit): Use the location of each member while reporting errors.
20905 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20907 * cs-parser.jay: A for_initializer if is a
20908 local_variable_declaration really ammount to have an implicit
20909 block with the variable declaration and no initializer for for.
20911 * statement.cs (For.Emit): Cope with null initializers.
20913 This fixes the infinite loop on for initializers.
20915 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20917 * enum.cs: More cleanup.
20919 * ecore.cs: Remove dead code.
20921 * class.cs (Property.Emit): More simplification.
20922 (Event.Emit): ditto.
20924 Reworked to have less levels of indentation.
20926 2001-11-08 Ravi Pratap <ravi@ximian.com>
20928 * class.cs (Property): Emit attributes.
20938 * enum.cs (Emit): Ditto.
20940 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20943 * class.cs (Field, Event, etc.): Move attribute generation into the
20944 Emit method everywhere.
20946 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20947 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20948 as we had no way of defining nested enums !
20950 * rootcontext.cs : Adjust code accordingly.
20952 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20954 2001-11-07 Ravi Pratap <ravi@ximian.com>
20956 * expression.cs (EvalConstantExpression): Move into ecore.cs
20958 * enum.cs (Enum): Rename some members and make them public and readonly
20959 according to our convention.
20961 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20964 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20966 (Enum::Emit): Write a simple version for now which doesn't try to compute
20967 expressions. I shall modify this to be more robust in just a while.
20969 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20971 (TypeContainer::CloseType): Create the Enum types too.
20973 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20975 * expression.cs (EvalConstantExpression): Get rid of completely.
20977 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20978 user-defined values and other cases.
20980 (IsValidEnumLiteral): Helper function.
20982 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20983 out there in the case we had a literal FieldExpr.
20985 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20987 (Literalize): Revamp a bit to take two arguments.
20989 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20991 2001-11-06 Ravi Pratap <ravi@ximian.com>
20993 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20995 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20997 (Resolve): Use the above to ensure we have proper initializers.
20999 2001-11-05 Ravi Pratap <ravi@ximian.com>
21001 * expression.cs (Expression::EvalConstantExpression): New method to
21002 evaluate constant expressions.
21004 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21006 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21008 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21011 (Binary.ResolveOperator): Handle operator != (object a, object b)
21012 and operator == (object a, object b);
21014 (Binary.DoNumericPromotions): Indicate whether the numeric
21015 promotion was possible.
21017 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21020 Made the ArrayAccess implement interface IAssignMethod instead of
21021 IStackStore as the order in which arguments are passed reflects
21024 * assign.cs: Instead of using expr.ExprClass to select the way of
21025 assinging, probe for the IStackStore/IAssignMethod interfaces.
21027 * typemanager.cs: Load InitializeArray definition.
21029 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21030 static data that can be used to initialize arrays.
21032 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21034 * expression.cs: Handle operator== and operator!= for booleans.
21036 (Conditioal.Reduce): Implement reducer for the ?: operator.
21038 (Conditional.Resolve): Implement dead code elimination.
21040 (Binary.Resolve): Catch string literals and return a new
21041 concatenated string.
21043 (Unary.Reduce): Implement reduction of unary expressions.
21045 * ecore.cs: Split out the expression core handling here.
21047 (Expression.Reduce): New method used to perform constant folding
21048 and CSE. This is needed to support constant-expressions.
21050 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21051 targets, and optimize for !x.
21053 2001-11-04 Ravi Pratap <ravi@ximian.com>
21055 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21056 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21057 set custom atttributes.
21059 * literal.cs (Literal::GetValue): New abstract method to return the actual
21060 value of the literal, cast as an object.
21062 (*Literal): Implement GetValue method.
21064 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21065 expressions to the arraylist but objects of type Argument.
21067 * class.cs (TypeContainer::Emit): Emit our attributes too.
21069 (Method::Emit, Constructor::Emit): Ditto.
21071 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21072 to be ignoring earlier.
21074 2001-11-03 Ravi Pratap <ravi@ximian.com>
21076 * attribute.cs (AttributeSection::Define): Implement to do the business
21077 of constructing a CustomAttributeBuilder.
21079 (Attribute): New trivial class. Increases readability of code.
21081 * cs-parser.jay : Update accordingly.
21083 (positional_argument_list, named_argument_list, named_argument): New rules
21085 (attribute_arguments): Use the above so that we are more correct.
21087 2001-11-02 Ravi Pratap <ravi@ximian.com>
21089 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21090 to perform all checks for a method with a params parameter.
21092 (Invocation::OverloadResolve): Update to use the above method and therefore
21093 cope correctly with params method invocations.
21095 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
21098 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21099 constructors in our parent too because we can't afford to miss out on
21102 * attribute.cs (AttributeSection): New name for the class Attribute
21104 Other trivial changes to improve readability.
21106 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21107 use the new class names.
21109 2001-11-01 Ravi Pratap <ravi@ximian.com>
21111 * class.cs (Method::Define): Complete definition for params types too
21113 (Indexer::Define): Ditto.
21115 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21116 Cope everywhere with a request for info about the array parameter.
21118 2001-11-01 Ravi Pratap <ravi@ximian.com>
21120 * tree.cs (RecordNamespace): Fix up to check for the correct key.
21122 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
21123 local_variable_type to extract the string corresponding to the type.
21125 (local_variable_type): Fixup the action to use the new helper method.
21127 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21130 * expression.cs : Clean out code which uses the above.
21132 2001-10-31 Ravi Pratap <ravi@ximian.com>
21134 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21135 and bale out if necessary by returning a false.
21137 (RegisterProperty): Ditto.
21139 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21140 and print out appropriate error messages.
21142 * interface.cs (everywhere): Ditto.
21144 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21145 location to constructor.
21147 * class.cs (Property, Event, Indexer): Update accordingly.
21149 * ../errors/cs111.cs : Added.
21151 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21152 of a method, as laid down by the spec.
21154 (Invocation::OverloadResolve): Use the above method.
21156 2001-10-31 Ravi Pratap <ravi@ximian.com>
21158 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21159 now take a TypeContainer and a Parameters object.
21161 (ParameterData): Modify return type of ParameterModifier method to be
21162 Parameter.Modifier and not a string.
21164 (ReflectionParameters, InternalParameters): Update accordingly.
21166 * expression.cs (Argument::GetParameterModifier): Same here.
21168 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21169 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21170 symbol in it at all so maybe this is only for now.
21172 2001-10-30 Ravi Pratap <ravi@ximian.com>
21174 * support.cs (InternalParameters): Constructor now takes an extra argument
21175 which is the actual Parameters class.
21177 (ParameterDesc): Update to provide info on ref/out modifiers.
21179 * class.cs (everywhere): Update call to InternalParameters to pass in
21180 the second argument too.
21182 * support.cs (ParameterData): Add ParameterModifier, which is a method
21183 to return the modifier info [ref/out etc]
21185 (InternalParameters, ReflectionParameters): Implement the above.
21187 * expression.cs (Argument::ParameterModifier): Similar function to return
21188 info about the argument's modifiers.
21190 (Invocation::OverloadResolve): Update to take into account matching modifiers
21193 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21194 a new SetFormalParameters object which we pass to InternalParameters.
21196 2001-10-30 Ravi Pratap <ravi@ximian.com>
21198 * expression.cs (NewArray): Merge into the ArrayCreation class.
21200 2001-10-29 Ravi Pratap <ravi@ximian.com>
21202 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21203 NewUserdefinedArray into one as there wasn't much of a use in having
21206 * expression.cs (Argument): Change field's name to ArgType from Type.
21208 (Type): New readonly property which returns the proper type, taking into
21209 account ref/out modifiers.
21211 (everywhere): Adjust code accordingly for the above.
21213 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21214 whether we are emitting for a ref or out parameter.
21216 * expression.cs (Argument::Emit): Use the above field to set the state.
21218 (LocalVariableReference::Emit): Update to honour the flag and emit the
21221 * parameter.cs (Attributes): Set the correct flags for ref parameters.
21223 * expression.cs (Argument::FullDesc): New function to provide a full desc.
21225 * support.cs (ParameterData): Add method ParameterDesc to the interface.
21227 (ReflectionParameters, InternalParameters): Implement the above method.
21229 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21232 (Invocation::FullMethodDesc): Ditto.
21234 2001-10-29 Miguel de Icaza <miguel@ximian.com>
21236 * cs-parser.jay: Add extra production for the second form of array
21239 * expression.cs (ArrayCreation): Update to reflect the above
21242 * Small changes to prepare for Array initialization.
21244 2001-10-28 Miguel de Icaza <miguel@ximian.com>
21246 * typemanager.cs (ImplementsInterface): interface might be null;
21247 Deal with this problem;
21249 Also, we do store negative hits on the cache (null values), so use
21250 this instead of calling t.GetInterfaces on the type everytime.
21252 2001-10-28 Ravi Pratap <ravi@ximian.com>
21254 * typemanager.cs (IsBuiltinType): New method to help determine the same.
21256 * expression.cs (New::DoResolve): Get rid of array creation code and instead
21257 split functionality out into different classes.
21259 (New::FormArrayType): Move into NewBuiltinArray.
21261 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21264 (NewBuiltinArray): New class to handle creation of built-in arrays.
21266 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21267 account creation of one-dimensional arrays.
21269 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21271 (NewUserdefinedArray::DoResolve): Implement.
21273 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21275 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21276 we maintain inside the TypeManager. This is necessary to perform lookups on the
21279 (LookupType): Update to perform GetType on the module builders too.
21281 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21283 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21285 2001-10-23 Ravi Pratap <ravi@ximian.com>
21287 * expression.cs (New::DoResolve): Implement guts of array creation.
21289 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21291 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21293 * expression.cs: Fix bug I introduced lsat night that broke
21296 (Expression.Resolve): Report a 246 error (can not resolve name)
21297 if we find a SimpleName in the stream.
21299 (Expression.ResolveLValue): Ditto.
21301 (Expression.ResolveWithSimpleName): This function is a variant of
21302 ResolveName, this one allows SimpleNames to be returned without a
21303 warning. The only consumer of SimpleNames is MemberAccess
21305 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21307 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21308 might arrive here. I have my doubts that this is correct.
21310 * statement.cs (Lock): Implement lock statement.
21312 * cs-parser.jay: Small fixes to support `lock' and `using'
21314 * cs-tokenizer.cs: Remove extra space
21316 * driver.cs: New flag --checked, allows to turn on integer math
21319 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21320 Threading.Monitor.Exit
21322 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21324 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21325 Expression Class to be IndexerAccess.
21327 Notice that Indexer::DoResolve sets the eclass to Value.
21329 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21331 * class.cs (TypeContainer::Emit): Emit code for indexers.
21333 * assign.cs (IAssignMethod): New interface implemented by Indexers
21334 and Properties for handling assignment.
21336 (Assign::Emit): Simplify and reuse code.
21338 * expression.cs (IndexerAccess, PropertyExpr): Implement
21339 IAssignMethod, clean up old code.
21341 2001-10-22 Ravi Pratap <ravi@ximian.com>
21343 * typemanager.cs (ImplementsInterface): New method to determine if a type
21344 implements a given interface. Provides a nice cache too.
21346 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21349 (ConvertReferenceExplicit): Ditto.
21351 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21352 various methods, with correct names etc.
21354 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21355 Operator.UnaryNegation.
21357 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21358 we have a unary plus or minus operator.
21360 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21363 * everywhere : update accordingly.
21365 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21368 * class.cs (Method::Define): For the case where we are implementing a method
21369 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21370 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21372 2001-10-21 Ravi Pratap <ravi@ximian.com>
21374 * interface.cs (FindMembers): Implement to work around S.R.E
21377 * typemanager.cs (IsInterfaceType): Implement.
21379 (FindMembers): Update to handle interface types too.
21381 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21382 use IsAssignableFrom as that is not correct - it doesn't work.
21384 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21385 and accordingly override EmitStatement.
21387 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21388 using the correct logic :-)
21390 2001-10-19 Ravi Pratap <ravi@ximian.com>
21392 * ../errors/cs-11.cs : Add to demonstrate error -11
21394 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21396 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21397 then pass this as a hint to ResolveLValue.
21399 * expression.cs (FieldExpr): Add Location information
21401 (FieldExpr::LValueResolve): Report assignment to readonly
21404 (Expression::ExprClassFromMemberInfo): Pass location information.
21406 (Expression::ResolveLValue): Add new method that resolves an
21409 (Expression::DoResolveLValue): Default invocation calls
21412 (Indexers): New class used to keep track of indexers in a given
21415 (IStackStore): Renamed from LValue, as it did not really describe
21416 what this did. Also ResolveLValue is gone from this interface and
21417 now is part of Expression.
21419 (ElementAccess): Depending on the element access type
21421 * typemanager.cs: Add `indexer_name_type' as a Core type
21422 (System.Runtime.CompilerServices.IndexerNameAttribute)
21424 * statement.cs (Goto): Take a location.
21426 2001-10-18 Ravi Pratap <ravi@ximian.com>
21428 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21429 if two delegates are compatible.
21431 (NewDelegate::DoResolve): Update to take care of the case when
21432 we instantiate a delegate from another delegate.
21434 * typemanager.cs (FindMembers): Don't even try to look up members
21435 of Delegate types for now.
21437 2001-10-18 Ravi Pratap <ravi@ximian.com>
21439 * delegate.cs (NewDelegate): New class to take care of delegate
21442 * expression.cs (New): Split the delegate related code out into
21443 the NewDelegate class.
21445 * delegate.cs (DelegateInvocation): New class to handle delegate
21448 * expression.cs (Invocation): Split out delegate related code into
21449 the DelegateInvocation class.
21451 2001-10-17 Ravi Pratap <ravi@ximian.com>
21453 * expression.cs (New::DoResolve): Implement delegate creation fully
21454 and according to the spec.
21456 (New::DoEmit): Update to handle delegates differently.
21458 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21459 because of which we were printing out arguments in reverse order !
21461 * delegate.cs (VerifyMethod): Implement to check if the given method
21462 matches the delegate.
21464 (FullDelegateDesc): Implement.
21466 (VerifyApplicability): Implement.
21468 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21469 delegate invocations too.
21471 (Invocation::Emit): Ditto.
21473 * ../errors/cs1593.cs : Added.
21475 * ../errors/cs1594.cs : Added.
21477 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21479 2001-10-16 Ravi Pratap <ravi@ximian.com>
21481 * typemanager.cs (intptr_type): Core type for System.IntPtr
21483 (InitCoreTypes): Update for the same.
21485 (iasyncresult_type, asynccallback_type): Ditto.
21487 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21490 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21493 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21494 the builders for the 4 members of a delegate type :-)
21496 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21499 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21501 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21503 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21505 * statement.cs (Break::Emit): Implement.
21506 (Continue::Emit): Implement.
21508 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21509 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21510 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21511 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21514 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21515 properties that track the label for the current loop (begin of the
21516 loop and end of the loop).
21518 2001-10-15 Ravi Pratap <ravi@ximian.com>
21520 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21521 use of emitting anything at all.
21523 * class.cs, rootcontext.cs : Get rid of calls to the same.
21525 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21527 (Populate): Define the constructor correctly and set the implementation
21530 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21533 (AddDelegateType): Implement.
21535 (IsDelegateType): Implement helper method.
21537 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21539 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21540 and accordingly handle it.
21542 * delegate.cs (Populate): Take TypeContainer argument.
21543 Implement bits to define the Invoke method. However, I still haven't figured out
21544 how to take care of the native int bit :-(
21546 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21547 Qualify the name of the delegate, not its return type !
21549 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21552 (StandardConversionExists): Checking for array types turns out to be recursive.
21554 (ConvertReferenceExplicit): Implement array conversion.
21556 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21558 2001-10-12 Ravi Pratap <ravi@ximian.com>
21560 * cs-parser.jay (delegate_declaration): Store the fully qualified
21561 name as it is a type declaration.
21563 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21566 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21567 as TypeContainer::DefineType.
21569 (Populate): Method in which all the definition of the various methods (Invoke)
21572 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21575 (CloseDelegate): Finally creates the delegate.
21577 * class.cs (TypeContainer::DefineType): Update to define delegates.
21578 (Populate, Emit and CloseType): Do the same thing here too.
21580 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21581 delegates in all these operations.
21583 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21585 * expression.cs: LocalTemporary: a new expression used to
21586 reference a temporary that has been created.
21588 * assign.cs: Handle PropertyAccess back here, so that we can
21589 provide the proper semantic access to properties.
21591 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21592 a few more explicit conversions.
21594 * modifiers.cs: `NEW' modifier maps to HideBySig.
21596 * expression.cs (PropertyExpr): Make this into an
21597 ExpressionStatement, and support the EmitStatement code path.
21599 Perform get/set error checking, clean up the interface.
21601 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21602 them into toplevel access objects.
21604 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21606 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21609 * typemanager.cs: Keep track here of our PropertyBuilders again to
21610 work around lameness in SRE.
21612 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21614 * expression.cs (LValue::LValueResolve): New method in the
21615 interface, used to perform a second resolution pass for LValues.
21617 (This::DoResolve): Catch the use of this in static methods.
21619 (This::LValueResolve): Implement.
21621 (This::Store): Remove warning, assigning to `this' in structures
21624 (Invocation::Emit): Deal with invocation of
21625 methods on value types. We need to pass the address to structure
21626 methods rather than the object itself. (The equivalent code to
21627 emit "this" for structures leaves the entire structure on the
21628 stack instead of a pointer to it).
21630 (ParameterReference::DoResolve): Compute the real index for the
21631 argument based on whether the method takes or not a `this' pointer
21632 (ie, the method is static).
21634 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21635 value types returned from functions when we need to invoke a
21636 method on the sturcture.
21639 2001-10-11 Ravi Pratap <ravi@ximian.com>
21641 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21642 defining the type in the Modulebuilder or Typebuilder. This is to take
21643 care of nested types which need to be defined on the TypeBuilder using
21644 DefineNestedMethod.
21646 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21647 methods in RootContext, only ported to be part of TypeContainer.
21649 (TypeContainer::GetInterfaceOrClass): Ditto.
21651 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21653 * interface.cs (Interface::DefineInterface): New method. Does exactly
21654 what RootContext.CreateInterface did earlier, only it takes care of nested types
21657 (Interface::GetInterfaces): Move from RootContext here and port.
21659 (Interface::GetInterfaceByName): Same here.
21661 * rootcontext.cs (ResolveTree): Re-write.
21663 (PopulateTypes): Re-write.
21665 * class.cs (TypeContainer::Populate): Populate nested types too.
21666 (TypeContainer::Emit): Emit nested members too.
21668 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21669 instead just use the name argument passed in as it is already fully
21672 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21673 to TypeContainer mapping to see if a type is user-defined.
21675 * class.cs (TypeContainer::CloseType): Implement.
21677 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21678 the default constructor.
21680 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21683 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21685 * interface.cs (CloseType): Create the type here.
21687 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21690 Remove all the methods which are now in TypeContainer.
21692 2001-10-10 Ravi Pratap <ravi@ximian.com>
21694 * delegate.cs (Define): Re-write bits to define the delegate
21697 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21699 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21701 * expression.cs (ImplicitReferenceConversion): handle null as well
21702 as a source to convert to any reference type.
21704 * statement.cs (Return): Perform any implicit conversions to
21705 expected return type.
21707 Validate use of return statement.
21709 * codegen.cs (EmitContext): Pass the expected return type here.
21711 * class.cs (Method, Constructor, Property): Pass expected return
21712 type to EmitContext.
21714 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21716 * expression.cs: Make DoResolve take an EmitContext instead of a
21719 Replaced `l' and `location' for `loc', for consistency.
21721 (Error, Warning): Remove unneeded Tc argument.
21723 * assign.cs, literal.cs, constant.cs: Update to new calling
21726 * codegen.cs: EmitContext now contains a flag indicating whether
21727 code is being generated in a static method or not.
21729 * cs-parser.jay: DecomposeQI, new function that replaces the old
21730 QualifiedIdentifier. Now we always decompose the assembled
21731 strings from qualified_identifier productions into a group of
21734 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21736 * rootcontext.cs: Deal with field-less struct types correctly now
21737 by passing the size option to Define Type.
21739 * class.cs: Removed hack that created one static field.
21741 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21743 * statement.cs: Moved most of the code generation here.
21745 2001-10-09 Ravi Pratap <ravi@ximian.com>
21747 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21750 (ElementAccess): Remove useless bits for now - keep checks as the spec
21753 2001-10-08 Ravi Pratap <ravi@ximian.com>
21755 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21756 and start performing checks according to the spec.
21758 2001-10-07 Ravi Pratap <ravi@ximian.com>
21760 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21761 rank_specifiers instead.
21763 (rank_specifiers): Change the order in which the rank specifiers are stored
21765 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21767 * expression.cs (ElementAccess): Implement the LValue interface too.
21769 2001-10-06 Ravi Pratap <ravi@ximian.com>
21771 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21772 except that user defined conversions are not included.
21774 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21775 perform the conversion of the return type, if necessary.
21777 (New::DoResolve): Check whether we are creating an array or an object
21778 and accordingly do the needful.
21780 (New::Emit): Same here.
21782 (New::DoResolve): Implement guts of array creation.
21784 (New::FormLookupType): Helper function.
21786 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21788 * codegen.cs: Removed most of the code generation here, and move the
21789 corresponding code generation bits to the statement classes.
21791 Added support for try/catch/finalize and throw.
21793 * cs-parser.jay: Added support for try/catch/finalize.
21795 * class.cs: Catch static methods having the flags override,
21796 virtual or abstract.
21798 * expression.cs (UserCast): This user cast was not really doing
21799 what it was supposed to do. Which is to be born in fully resolved
21800 state. Parts of the resolution were being performed at Emit time!
21804 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21806 * expression.cs: Implicity convert the result from UserCast.
21808 2001-10-05 Ravi Pratap <ravi@ximian.com>
21810 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21811 prevented it from working correctly.
21813 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21814 merely ConvertImplicit.
21816 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21818 * typemanager.cs: Make the LookupTypeContainer function static,
21819 and not per-instance.
21821 * class.cs: Make static FindMembers (the one that takes a Type
21824 * codegen.cs: Add EmitForeach here.
21826 * cs-parser.jay: Make foreach a toplevel object instead of the
21827 inline expansion, as we need to perform semantic analysis on it.
21829 2001-10-05 Ravi Pratap <ravi@ximian.com>
21831 * expression.cs (Expression::ImplicitUserConversion): Rename to
21832 UserDefinedConversion.
21834 (Expression::UserDefinedConversion): Take an extra argument specifying
21835 whether we look for explicit user conversions too.
21837 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21839 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21841 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21842 with the appropriate arguments.
21844 * cs-parser.jay (cast_expression): Record location too.
21846 * expression.cs (Cast): Record location info.
21848 (Expression::ConvertExplicit): Take location argument.
21850 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21851 to determine if we are doing explicit conversions.
21853 (UserCast::Emit): Update accordingly.
21855 (Expression::ConvertExplicit): Report an error if everything fails.
21857 * ../errors/cs0030.cs : Add.
21859 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21861 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21862 virtual and newslot bits.
21864 * class.cs (TypeContainer::RegisterRequiredImplementations):
21865 Record methods we need.
21867 (TypeContainer::MakeKey): Helper function to make keys for
21868 MethodBases, since the Methodbase key is useless.
21870 (TypeContainer::Populate): Call RegisterRequiredImplementations
21871 before defining the methods.
21873 Create a mapping for method_builders_to_methods ahead of time
21874 instead of inside a tight loop.
21876 (::RequireMethods): Accept an object as the data to set into the
21877 hashtable so we can report interface vs abstract method mismatch.
21879 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21881 * report.cs: Make all of it static.
21883 * rootcontext.cs: Drop object_type and value_type computations, as
21884 we have those in the TypeManager anyways.
21886 Drop report instance variable too, now it is a global.
21888 * driver.cs: Use try/catch on command line handling.
21890 Add --probe option to debug the error reporting system with a test
21893 * report.cs: Add support for exiting program when a probe
21894 condition is reached.
21896 2001-10-03 Ravi Pratap <ravi@ximian.com>
21898 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21899 we do a forcible conversion regardless of type, to check if
21900 ForceConversion returns a null.
21902 (Binary::error19): Use location to report error.
21904 (Unary::error23): Use location here too.
21906 * ../errors/cs0019.cs : Check in.
21908 * ../errors/cs0023.cs : Check in.
21910 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21911 case of a non-null MethodInfo object with a length of 0 !
21913 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21914 an applicable member - according to the spec :-)
21915 Also fix logic to find members in base types.
21917 (Unary::ResolveOperator): Same here.
21919 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21920 as I was getting thoroughly confused between this and error19 :-)
21922 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21923 (::FindMostEncompassedType): Implement.
21924 (::FindMostEncompassingType): Implement.
21925 (::StandardConversionExists): Implement.
21927 (UserImplicitCast): Re-vamp. We now need info about most specific
21928 source and target types so that we can do the necessary conversions.
21930 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21931 mathematical union with no duplicates.
21933 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21935 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21936 in order from base classes to child classes, so that we can in
21937 child classes look up in our parent for method names and
21938 attributes (required for handling abstract, virtual, new, override
21939 constructs: we need to instrospect our base class, and if we dont
21940 populate the classes in order, the introspection might be
21941 incorrect. For example, a method could query its parent before
21942 the parent has any methods and would determine that the parent has
21943 no abstract methods (while it could have had them)).
21945 (RootContext::CreateType): Record the order in which we define the
21948 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21950 * class.cs (TypeContainer::Populate): Also method definitions can
21951 fail now, keep track of this.
21953 (TypeContainer::FindMembers): Implement support for
21954 DeclaredOnly/noDeclaredOnly flag.
21956 (Constructor::Emit) Return the ConstructorBuilder.
21958 (Method::Emit) Return the MethodBuilder.
21959 Check for abstract or virtual methods to be public.
21961 * rootcontext.cs (RootContext::CreateType): Register all the
21962 abstract methods required for the class to be complete and the
21963 interface methods that must be implemented.
21965 * cs-parser.jay: Report error 501 (method requires body if it is
21966 not marked abstract or extern).
21968 * expression.cs (TypeOf::Emit): Implement.
21970 * typemanager.cs: runtime_handle_type, new global type.
21972 * class.cs (Property::Emit): Generate code for properties.
21974 2001-10-02 Ravi Pratap <ravi@ximian.com>
21976 * expression.cs (Unary::ResolveOperator): Find operators on base type
21977 too - we now conform exactly to the spec.
21979 (Binary::ResolveOperator): Same here.
21981 * class.cs (Operator::Define): Fix minor quirk in the tests.
21983 * ../errors/cs0215.cs : Added.
21985 * ../errors/cs0556.cs : Added.
21987 * ../errors/cs0555.cs : Added.
21989 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21991 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21992 single integer which is really efficient
21994 2001-10-01 Ravi Pratap <ravi@ximian.com>
21996 * expression.cs (Expression::ImplicitUserConversion): Use location
21997 even in the case when we are examining True operators.
21999 * class.cs (Operator::Define): Perform extensive checks to conform
22000 with the rules for operator overloading in the spec.
22002 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22003 some of the other conversions mentioned in the spec.
22005 * typemanager.cs (array_type): New static member for the System.Array built-in
22008 (cloneable_interface): For System.ICloneable interface.
22010 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22011 we start resolving the tree and populating types.
22013 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22015 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22017 * expression.cs (Expression::ExprClassFromMemberInfo,
22018 Expression::Literalize): Create literal expressions from
22019 FieldInfos which are literals.
22021 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22022 type casts, because they were wrong. The test suite in tests
22025 (ImplicitNumericConversion): ushort to ulong requires a widening
22028 Int32 constant to long requires widening cast as well.
22030 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22031 for integers because the type on the stack is not i4.
22033 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22035 * expression.cs (report118): require location argument.
22037 * parameter.cs: Do not dereference potential null value.
22039 * class.cs: Catch methods that lack the `new' keyword when
22040 overriding a name. Report warnings when `new' is used without
22041 anything being there to override.
22043 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22045 * class.cs: Only add constructor to hashtable if it is non-null
22046 (as now constructors can fail on define).
22048 (TypeManager, Class, Struct): Take location arguments.
22050 Catch field instance initialization in structs as errors.
22052 accepting_filter: a new filter for FindMembers that is static so
22053 that we dont create an instance per invocation.
22055 (Constructor::Define): Catch errors where a struct constructor is
22058 * cs-parser.jay: Pass location information for various new
22061 * delegate.cs (Delegate): take a location argument.
22063 * driver.cs: Do not call EmitCode if there were problesm in the
22064 Definition of the types, as many Builders wont be there.
22066 * decl.cs (Decl::Decl): Require a location argument.
22068 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22069 into integers, and find the most appropiate integer for it.
22071 * literal.cs: Implement ULongLiteral.
22073 * rootcontext.cs: Provide better information about the location of
22074 failure when CreateType fails.
22076 2001-09-29 Miguel de Icaza <miguel@ximian.com>
22078 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22081 * expression.cs (Binary::CheckShiftArguments): Add missing type
22083 (Binary::ResolveOperator): Add type to the logical and and logical
22084 or, Bitwise And/Or and Exclusive Or code paths, it was missing
22087 (Binary::DoNumericPromotions): In the case where either argument
22088 is ulong (and most signed types combined with ulong cause an
22089 error) perform implicit integer constant conversions as well.
22091 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22093 * expression.cs (UserImplicitCast): Method should always be
22095 (Invocation::BetterConversion): Simplified test for IntLiteral.
22097 (Expression::ImplicitNumericConversion): Split this routine out.
22098 Put the code that performs implicit constant integer conversions
22101 (Expression::Resolve): Become a wrapper around DoResolve so we can
22102 check eclass and type being set after resolve.
22104 (Invocation::Badness): Remove this dead function
22106 (Binary::ResolveOperator): Do not compute the expensive argumnets
22107 unless we have a union for it.
22109 (Probe::Emit): Is needs to do an isinst and then
22110 compare against null.
22112 (::CanConvert): Added Location argument. If the Location argument
22113 is null (Location.Null), then we do not report errors. This is
22114 used by the `probe' mechanism of the Explicit conversion. We do
22115 not want to generate an error for something that the user
22116 explicitly requested to be casted. But the pipeline for an
22117 explicit cast first tests for potential implicit casts.
22119 So for now, if the Location is null, it means `Probe only' to
22120 avoid adding another argument. Might have to revise this
22123 (ClassCast): New class used to type cast objects into arbitrary
22124 classes (used in Explicit Reference Conversions).
22126 Implement `as' as well.
22128 Reverted all the patches from Ravi below: they were broken:
22130 * The use of `level' as a mechanism to stop recursive
22131 invocations is wrong. That was there just to catch the
22132 bug with a strack trace but not as a way of addressing
22135 To fix the problem we have to *understand* what is going
22136 on and the interactions and come up with a plan, not
22137 just get things going.
22139 * The use of the type conversion cache that I proposed
22140 last night had an open topic: How does this work across
22141 protection domains. A user defined conversion might not
22142 be public in the location where we are applying the
22143 conversion, a different conversion might be selected
22144 (ie, private A->B (better) but public B->A (worse),
22145 inside A, A->B applies, but outside it, B->A will
22148 * On top of that (ie, even if the above is solved),
22149 conversions in a cache need to be abstract. Ie, `To
22150 convert from an Int to a Short use an OpcodeCast', not
22151 `To convert from an Int to a Short use the OpcodeCast on
22152 the variable 5' (which is what this patch was doing).
22154 2001-09-28 Ravi Pratap <ravi@ximian.com>
22156 * expression.cs (Invocation::ConversionExists): Re-write to use
22157 the conversion cache
22159 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22160 cache all conversions done, not just user-defined ones.
22162 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22163 to determine if a conversion exists instead of acutually trying to
22164 perform the conversion. It's faster too.
22166 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22167 and only then attempt the implicit conversion.
22169 2001-09-28 Ravi Pratap <ravi@ximian.com>
22171 * expression.cs (ConvertImplicit): Use a cache for conversions
22172 already found. Check level of recursion and bail out if necessary.
22174 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22176 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22177 Export standard methods that we expect for string operations.
22179 * statement.cs (Block::UsageWarning): Track usage of variables and
22180 report the errors for not used variables.
22182 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22185 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22187 * codegen.cs: remove unnneded code
22189 * expression.cs: Removed BuiltinTypeAccess class
22191 Fix the order in which implicit conversions are
22194 The previous fixed dropped support for boxed conversions (adding a
22195 test to the test suite now)
22197 (UserImplicitCast::CanConvert): Remove test for source being null,
22198 that code is broken. We should not feed a null to begin with, if
22199 we do, then we should track the bug where the problem originates
22200 and not try to cover it up here.
22202 Return a resolved expression of type UserImplicitCast on success
22203 rather than true/false. Ravi: this is what I was talking about,
22204 the pattern is to use a static method as a "constructor" for
22207 Also, do not create arguments until the very last minute,
22208 otherwise we always create the arguments even for lookups that
22209 will never be performed.
22211 (UserImplicitCast::Resolve): Eliminate, objects of type
22212 UserImplicitCast are born in a fully resolved state.
22214 * typemanager.cs (InitCoreTypes): Init also value_type
22215 (System.ValueType).
22217 * expression.cs (Cast::Resolve): First resolve the child expression.
22219 (LValue): Add new method AddressOf to be used by
22222 Change the argument of Store to take an EmitContext instead of an
22223 ILGenerator, because things like FieldExpr need to be able to call
22224 their children expression to generate the instance code.
22226 (Expression::Error, Expression::Warning): Sugar functions for
22229 (Expression::MemberLookup): Accept a TypeContainer instead of a
22230 Report as the first argument.
22232 (Expression::ResolvePrimary): Killed. I still want to improve
22233 this as currently the code is just not right.
22235 (Expression::ResolveMemberAccess): Simplify, but it is still
22238 (Unary::Resolve): Catch errors in AddressOf operators.
22240 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22241 index to a byte for the short-version, or the compiler will choose
22242 the wrong Emit call, which generates the wrong data.
22244 (ParameterReference::Emit, ::Store): same.
22246 (FieldExpr::AddressOf): Implement.
22248 * typemanager.cs: TypeManager: made public variable instead of
22251 * driver.cs: document --fatal.
22253 * report.cs (ErrorMessage, WarningMessage): new names for the old
22254 Error and Warning classes.
22256 * cs-parser.jay (member_access): Turn built-in access to types
22257 into a normal simplename
22259 2001-09-27 Ravi Pratap <ravi@ximian.com>
22261 * expression.cs (Invocation::BetterConversion): Fix to cope
22262 with q being null, since this was introducing a bug.
22264 * expression.cs (ConvertImplicit): Do built-in conversions first.
22266 2001-09-27 Ravi Pratap <ravi@ximian.com>
22268 * expression.cs (UserImplicitCast::Resolve): Fix bug.
22270 2001-09-27 Ravi Pratap <ravi@ximian.com>
22272 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22273 I had introduced long ago (what's new ?).
22275 * expression.cs (UserImplicitCast::CanConvert): Static method to do
22276 the work of all the checking.
22277 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22278 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22280 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22281 that is the right way.
22283 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22284 overloading resolution. Use everywhere instead of cutting and pasting code.
22286 (Binary::ResolveOperator): Use MakeUnionSet.
22288 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22289 we have to convert to bool types. Not complete yet.
22291 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22293 * typemanager.cs (TypeManager::CSharpName): support ushort.
22295 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22296 to provide an expression that performsn an implicit constant int
22297 conversion (section 6.1.6).
22298 (Expression::ConvertImplicitRequired): Reworked to include
22299 implicit constant expression conversions.
22301 (Expression::ConvertNumericExplicit): Finished.
22303 (Invocation::Emit): If InstanceExpression is null, then it means
22304 that we perform a call on this.
22306 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22308 * expression.cs (Unary::Emit): Remove some dead code.
22309 (Probe): Implement Resolve and Emit for `is'.
22310 (Expression::ConvertImplicitRequired): Attempt to do constant
22311 expression conversions here. Maybe should be moved to
22312 ConvertImplicit, but I am not sure.
22313 (Expression::ImplicitLongConstantConversionPossible,
22314 Expression::ImplicitIntConstantConversionPossible): New functions
22315 that tell whether is it possible to apply an implicit constant
22316 expression conversion.
22318 (ConvertNumericExplicit): Started work on explicit numeric
22321 * cs-parser.jay: Update operator constants.
22323 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22324 (Parameters::GetSignature): Hook up VerifyArgs here.
22325 (Parameters::VerifyArgs): Verifies that no two arguments have the
22328 * class.cs (Operator): Update the operator names to reflect the
22329 ones that the spec expects (as we are just stringizing the
22332 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22333 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22334 previous usage did only work for our methods.
22335 (Expression::ConvertImplicit): Handle decimal implicit numeric
22336 conversions as well.
22337 (Expression::InternalTypeConstructor): Used to invoke constructors
22338 on internal types for default promotions.
22340 (Unary::Emit): Implement special handling for the pre/post
22341 increment/decrement for overloaded operators, as they need to have
22342 the same semantics as the other operators.
22344 (Binary::ResolveOperator): ditto.
22345 (Invocation::ConversionExists): ditto.
22346 (UserImplicitCast::Resolve): ditto.
22348 2001-09-26 Ravi Pratap <ravi@ximian.com>
22350 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22351 operator, return after emitting body. Regression tests pass again !
22353 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22354 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22355 (Invocation::OverloadResolve): Ditto.
22356 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22358 * everywhere : update calls to the above methods accordingly.
22360 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22362 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22364 * expression.cs (ExpressionStatement): New base class used for
22365 expressions that can appear in statements, so that we can provide
22366 an alternate path to generate expression that do not leave a value
22369 (Expression::Emit, and all the derivatives): We no longer return
22370 whether a value is left on the stack or not. Every expression
22371 after being emitted leaves a single value on the stack.
22373 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22374 facilties of ExpressionStatement if possible.
22376 * cs-parser.jay: Update statement_expression.
22378 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22380 * driver.cs: Change the wording of message
22382 2001-09-25 Ravi Pratap <ravi@ximian.com>
22384 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22385 the type of the expression to the return type of the method if
22386 we have an overloaded operator match ! The regression tests pass again !
22387 (Unary::ResolveOperator): Ditto.
22389 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22390 to find "op_Implicit", not "implicit" ;-)
22391 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22392 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22394 * everywhere : Correct calls to the above accordingly.
22396 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22397 (ConvertImplicit): Do user-defined conversion if it exists.
22399 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22401 * assign.cs: track location.
22402 (Resolve): Use implicit conversions on assignment.
22404 * literal.cs: Oops. Not good, Emit of short access values should
22405 pass (Bytes) or the wrong argument will be selected.
22407 * expression.cs (Unary::Emit): Emit code for -expr.
22409 (Unary::ResolveOperator): Handle `Substract' for non-constants
22410 (substract from zero from the non-constants).
22411 Deal with Doubles as well.
22413 (Expression::ConvertImplicitRequired): New routine that reports an
22414 error if no implicit conversion exists.
22416 (Invocation::OverloadResolve): Store the converted implicit
22417 expressions if we make them
22419 2001-09-24 Ravi Pratap <ravi@ximian.com>
22421 * class.cs (ConstructorInitializer): Take a Location argument.
22422 (ConstructorBaseInitializer): Same here.
22423 (ConstructorThisInitializer): Same here.
22425 * cs-parser.jay : Update all calls accordingly.
22427 * expression.cs (Unary, Binary, New): Take location argument.
22428 Update accordingly everywhere.
22430 * cs-parser.jay : Update all calls to the above to take a location
22433 * class.cs : Ditto.
22435 2001-09-24 Ravi Pratap <ravi@ximian.com>
22437 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22438 (Invocation::BetterConversion): Same here
22439 (Invocation::ConversionExists): Ditto.
22441 (Invocation::ConversionExists): Implement.
22443 2001-09-22 Ravi Pratap <ravi@ximian.com>
22445 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22446 Also take an additional TypeContainer argument.
22448 * All over : Pass in TypeContainer as argument to OverloadResolve.
22450 * typemanager.cs (CSharpName): Update to check for the string type and return
22453 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22456 2001-09-21 Ravi Pratap <ravi@ximian.com>
22458 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22459 (Invocation::BetterFunction): Implement.
22460 (Invocation::BetterConversion): Implement.
22461 (Invocation::ConversionExists): Skeleton, no implementation yet.
22463 Okay, things work fine !
22465 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22467 * typemanager.cs: declare and load enum_type, delegate_type and
22470 * expression.cs (Expression::Emit): Now emit returns a value that
22471 tells whether a value is left on the stack or not. This strategy
22472 might be reveted tomorrow with a mechanism that would address
22473 multiple assignments.
22474 (Expression::report118): Utility routine to report mismatches on
22477 (Unary::Report23): Report impossible type/operator combination
22480 (Unary::IsIncrementableNumber): Whether the type can be
22481 incremented or decremented with add.
22482 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22484 (Unary::ResolveOperator): Implement ++, !, ~,
22486 (Invocation::Emit): Deal with new Emit convetion.
22488 * All Expression derivatives: Updated their Emit method to return
22489 whether they leave values on the stack or not.
22491 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22492 stack for expressions that are statements.
22494 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22496 * expression.cs (LValue): New interface. Must be implemented by
22498 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22501 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22502 interface for generating code, simplifies the code.
22504 2001-09-20 Ravi Pratap <ravi@ximian.com>
22506 * expression.cs (everywhere): Comment out return statements in ::Resolve
22507 methods to avoid the warnings.
22509 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22511 * driver.cs (parse): Report error 2001 if we can not open the
22514 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22517 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22520 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22521 otherwise nested blocks end up with the same index.
22523 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22525 * expression.cs: Instead of having FIXMEs in the Resolve
22526 functions, throw exceptions so it is obvious that we are facing a
22529 * cs-parser.jay (invocation_expression): Pass Location information.
22531 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22532 Use a basename for those routines because .NET does not like paths
22535 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22538 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22540 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22541 are loading the correct data types (throws an exception if not).
22542 (TypeManager::InitCoreTypes): Use CoreLookupType
22544 * expression.cs (Unary::ResolveOperator): return the child
22545 expression for expressions which are just +expr.
22546 (Unary::ResolveOperator): Return negative literals for -LITERAL
22547 expressions (otherwise they are Unary {Literal}).
22548 (Invocation::Badness): Take into account `Implicit constant
22549 expression conversions'.
22551 * literal.cs (LongLiteral): Implement long literal class.
22552 (IntLiteral): export the `Value' of the intliteral.
22554 2001-09-19 Ravi Pratap <ravi@ximian.com>
22556 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22558 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22559 instead of 'Operator'
22561 * expression.cs (Binary::ResolveOperator): Update accordingly.
22562 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22565 * cs-parser.jay (unary_expression): Update to use the new names.
22567 * gen-treedump.cs (GetUnary): Same here.
22569 * expression.cs (Unary::Resolve): Implement.
22570 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22571 operators are found instead of making noise ;-)
22572 (Unary::ResolveOperator): New method to do precisely the same thing which
22573 Binary::ResolveOperator does for Binary expressions.
22574 (Unary.method, .Arguments): Add.
22575 (Unary::OperName): Implement.
22576 (Unary::ForceConversion): Copy and Paste !
22578 * class.cs (Operator::Define): Fix a small bug for the case when we have
22581 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22582 for the inbuilt operators. Only overloading works for now ;-)
22584 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22586 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22587 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22589 * expression.cs (This::Emit): Implement.
22590 (This::Resolve): Implement.
22591 (TypeOf:Resolve): Implement.
22592 (Expression::ResolveSimpleName): Add an implicit this to instance
22594 (MemberAccess::Resolve): Deal with Parameters and Fields.
22595 Bind instance variable to Field expressions.
22596 (FieldExpr::Instance): New field used to track the expression that
22597 represents the object instance.
22598 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22600 (FieldExpr::Emit): Implement.
22602 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22603 the last instruction contains a return opcode to avoid generating
22604 the last `ret' instruction (this generates correct code, and it is
22605 nice to pass the peverify output).
22607 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22608 initializer for static and instance variables.
22609 (Constructor::Emit): Allow initializer to be null in the case of
22610 static constructors. Only emit initializer for instance
22613 (TypeContainer::FindMembers): Return a null array if there are no
22616 Also fix the code for the MemberTypes.Method branch, as it was not
22617 scanning that for operators (or tried to access null variables before).
22619 * assign.cs (Assign::Emit): Handle instance and static fields.
22623 * driver.cs: Stop compilation if there are parse errors.
22625 * cs-parser.jay (constructor_declaration): Provide default base
22626 initializer for non-static constructors.
22627 (constructor_declarator): Do not provide a default base
22628 initializers if none was specified.
22629 Catch the fact that constructors should not have parameters.
22631 * class.cs: Do not emit parent class initializers for static
22632 constructors, that should be flagged as an error.
22634 2001-09-18 Ravi Pratap <ravi@ximian.com>
22636 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22637 Move back code into TypeContainer::Populate.
22639 2001-09-18 Ravi Pratap <ravi@ximian.com>
22641 * class.cs (TypeContainer::AddConstructor): Fix the check to
22642 compare against Name, not Basename.
22643 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22645 * cs-parser.jay : Update accordingly.
22647 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22648 for methods, don't forget to look into the operators too.
22649 (RegisterMethodBuilder): Helper method to take care of this for
22650 methods, constructors and operators.
22651 (Operator::Define): Completely revamp.
22652 (Operator.OperatorMethod, MethodName): New fields.
22653 (TypeContainer::Populate): Move the registering of builders into
22654 RegisterMethodBuilder.
22655 (Operator::Emit): Re-write.
22657 * expression.cs (Binary::Emit): Comment out code path to emit method
22658 invocation stuff for the case when we have a user defined operator. I am
22659 just not able to get it right !
22661 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22663 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22666 (Expression::MemberLookup): Provide a version that allows to
22667 specify the MemberTypes and BindingFlags.
22669 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22670 so it was not fetching variable information from outer blocks.
22672 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22673 Beforefieldinit as it was buggy.
22675 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22676 that Ravi put here.
22678 * class.cs (Constructor::Emit): Only emit if block is not null.
22679 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22680 deal with this by semantically definining it as if the user had
22683 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22684 constructors as we now "emit" them at a higher level.
22686 (TypeContainer::DefineDefaultConstructor): Used to define the
22687 default constructors if none was provided.
22689 (ConstructorInitializer): Add methods Resolve and Emit.
22691 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22693 2001-09-17 Ravi Pratap <ravi@ximian.com>
22695 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22696 the default constructor builder with our hashtable for methodbuilders
22699 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22700 and argument_count is 0 in which case we have a match.
22701 (Binary::ResolveOperator): More null checking and miscellaneous coding
22704 2001-09-17 Ravi Pratap <ravi@ximian.com>
22706 * rootcontext.cs (IsNameSpace): Compare against null.
22708 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22710 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22711 and Unary::Operator.
22713 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22716 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22717 we have overloaded operators.
22718 (Binary::ResolveOperator): Implement the part which does the operator overload
22721 * class.cs (Operator::Emit): Implement.
22722 (TypeContainer::Emit): Emit the operators we have too.
22724 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22725 the case when we have a user-defined operator.
22727 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22729 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22731 2001-09-16 Ravi Pratap <ravi@ximian.com>
22733 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22734 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22735 (Constructor::Emit): Implement.
22736 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22737 if we have no work to do.
22738 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22741 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22742 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22744 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22747 2001-09-15 Ravi Pratap <ravi@ximian.com>
22749 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22751 (Tree::RecordNamespace): Method to do what the name says ;-)
22752 (Tree::Namespaces): Property to get at the namespaces hashtable.
22754 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22757 * rootcontext.cs (IsNamespace): Fixed it :-)
22759 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22761 * class.cs (TypeContainer::FindMembers): Add support for
22763 (MethodCore): New class that encapsulates both the shared aspects
22764 of a Constructor and a Method.
22765 (Method, Constructor): Factored pieces into MethodCore.
22767 * driver.cs: Added --fatal which makes errors throw exceptions.
22768 Load System assembly as well as part of the standard library.
22770 * report.cs: Allow throwing exceptions on errors for debugging.
22772 * modifiers.cs: Do not use `parent', instead use the real type
22773 container to evaluate permission settings.
22775 * class.cs: Put Ravi's patch back in. He is right, and we will
22776 have to cope with the
22778 2001-09-14 Ravi Pratap <ravi@ximian.com>
22780 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22781 FamORAssem, not FamANDAssem.
22783 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22785 * driver.cs: Added --parse option that only parses its input files
22788 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22789 incorrect. IsTopLevel is not used to tell whether an object is
22790 root_types or not (that can be achieved by testing this ==
22791 root_types). But to see if this is a top-level *class* (not
22792 necessarly our "toplevel" container).
22794 2001-09-14 Ravi Pratap <ravi@ximian.com>
22796 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22797 parent instead of a direct call to GetType.
22799 2001-09-14 Ravi Pratap <ravi@ximian.com>
22801 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22802 Modifiers.TypeAttr. This should just be a call to that method.
22804 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22805 object so that we can determine if we are top-level or not.
22807 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22810 * enum.cs (Enum::Define): Ditto.
22812 * modifiers.cs (FieldAttr): Re-write.
22814 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22815 (TypeContainer::HaveStaticConstructor): New property to provide access
22816 to precisely that info.
22818 * modifiers.cs (MethodAttr): Re-write.
22819 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22821 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22822 of top-level types as claimed.
22824 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22826 * expression.cs (MemberLookup): Fruitless attempt to lookup
22827 constructors. Maybe I need to emit default constructors? That
22828 might be it (currently .NET emits this for me automatically).
22829 (Invocation::OverloadResolve): Cope with Arguments == null.
22830 (Invocation::EmitArguments): new function, shared by the new
22831 constructor and us.
22832 (Invocation::Emit): Handle static and instance methods. Emit
22833 proper call instruction for virtual or non-virtual invocations.
22834 (New::Emit): Implement.
22835 (New::Resolve): Implement.
22836 (MemberAccess:Resolve): Implement.
22837 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22838 to track instances.
22839 (FieldExpr::Resolve): Set type.
22841 * support.cs: Handle empty arguments.
22843 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22844 SimpleLookup): Auxiliary routines to help parse a qualifier
22847 Update qualifier_identifier rule.
22849 * codegen.cs: Removed debugging messages.
22851 * class.cs: Make this a global thing, this acts just as a "key" to
22852 objects that we might have around.
22854 (Populate): Only initialize method_builders_to_methods once.
22856 * expression.cs (PropertyExpr): Initialize type from the
22859 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22860 Resolve pattern. Attempt to implicitly convert value to boolean.
22863 * expression.cs: Set the type for the int32/int32 argument case.
22864 (Binary::ResolveOperator): Set the return type to boolean for
22865 comparission operators
22867 * typemanager.cs: Remove debugging print code.
22869 (Invocation::Resolve): resolve type.
22871 * class.cs: Allocate a MemberInfo of the correct size, as the code
22872 elsewhere depends on the test to reflect the correct contents.
22874 (Method::) Keep track of parameters, due to System.Reflection holes
22876 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22879 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22880 of the exact size and return that.
22882 (Class::LookupMethodByBuilder): New function that maps
22883 MethodBuilders to its methods. Required to locate the information
22884 on methods because System.Reflection bit us again.
22886 * support.cs: New file, contains an interface ParameterData and
22887 two implementations: ReflectionParameters and InternalParameters
22888 used to access Parameter information. We will need to grow this
22891 * expression.cs (Invocation::GetParameterData): implement a cache
22892 and a wrapper around the ParameterData creation for methods.
22893 (Invocation::OverloadResolve): Use new code.
22895 2001-09-13 Ravi Pratap <ravi@ximian.com>
22897 * class.cs (TypeContainer::EmitField): Remove and move into
22898 (Field::Define): here and modify accordingly.
22899 (Field.FieldBuilder): New member.
22900 (TypeContainer::Populate): Update accordingly.
22901 (TypeContainer::FindMembers): Implement.
22903 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22905 * statement.cs: (VariableInfo::VariableType): New field to be
22906 initialized with the full type once it is resolved.
22908 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22910 * parameter.cs (GetParameterInfo): Use a type cache to compute
22911 things only once, and to reuse this information
22913 * expression.cs (LocalVariableReference::Emit): Implement.
22914 (OpcodeCast::Emit): fix.
22916 (ParameterReference::Resolve): Implement.
22917 (ParameterReference::Emit): Implement.
22919 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22920 that are expressions need to stay as Expressions.
22922 * typemanager.cs (CSharpName): Returns the C# name of a type if
22925 * expression.cs (Expression::ConvertImplicit): New function that
22926 implements implicit type conversions.
22928 (Expression::ImplicitReferenceConversion): Implements implicit
22929 reference conversions.
22931 (EmptyCast): New type for transparent casts.
22933 (OpcodeCast): New type for casts of types that are performed with
22934 a sequence of bytecodes.
22936 (BoxedCast): New type used for casting value types into reference
22937 types. Emits a box opcode.
22939 (Binary::DoNumericPromotions): Implements numeric promotions of
22940 and computation of the Binary::Type.
22942 (Binary::EmitBranchable): Optimization.
22944 (Binary::Emit): Implement code emission for expressions.
22946 * typemanager.cs (TypeManager): Added two new core types: sbyte
22949 2001-09-12 Ravi Pratap <ravi@ximian.com>
22951 * class.cs (TypeContainer::FindMembers): Method which does exactly
22952 what Type.FindMembers does, only we don't have to use reflection. No
22953 implementation yet.
22955 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22956 typecontainer objects as we need to get at them.
22957 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22959 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22960 typecontainer object.
22962 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22963 of just a Report object.
22965 2001-09-11 Ravi Pratap <ravi@ximian.com>
22967 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22969 (TypeContainer::Populate): Now define the delegates of the type too.
22970 (TypeContainer.Delegates): Property to access the list of delegates defined
22973 * delegates.cs (Delegate::Define): Implement partially.
22975 * modifiers.cs (TypeAttr): Handle more flags.
22977 2001-09-11 Ravi Pratap <ravi@ximian.com>
22979 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22981 (Operator::Define): Re-write logic to get types by using the LookupType method
22982 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22983 (Indexer::Define): Ditto.
22984 (Event::Define): Ditto.
22985 (Property::Define): Ditto.
22987 2001-09-10 Ravi Pratap <ravi@ximian.com>
22989 * class.cs (TypeContainer::Populate): Now define operators too.
22990 (TypeContainer.Operators): New property to access the list of operators
22992 (Operator.OperatorMethodBuilder): New member to hold the method builder
22993 for the operator we are defining.
22994 (Operator::Define): Implement.
22996 2001-09-10 Ravi Pratap <ravi@ximian.com>
22998 * class.cs (Event::Define): Make the prefixes of the accessor methods
22999 addOn_ and removeOn_
23001 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23002 of the location being passed in too. Ideally, this should go later since all
23003 error reporting should be done through the Report object.
23005 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23006 (Populate): Iterate thru the indexers we have and define them too.
23007 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23008 for the get and set accessors.
23009 (Indexer::Define): Implement.
23011 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23013 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23014 my previous implementation, did not work.
23016 * typemanager.cs: Add a couple of missing types (the longs).
23018 * literal.cs: Use TypeManager.bool_type instead of getting it.
23020 * expression.cs (EventExpr): New kind of expressions.
23021 (Expressio::ExprClassFromMemberInfo): finish
23023 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23025 * assign.cs: Emit stores to static fields differently.
23027 2001-09-08 Ravi Pratap <ravi@ximian.com>
23029 * Merge in changes and adjust code to tackle conflicts. Backed out my
23030 code in Assign::Resolve ;-)
23032 2001-09-08 Ravi Pratap <ravi@ximian.com>
23034 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23035 instead Report.Error and also pass in the location.
23036 (CSharpParser::Lexer): New readonly property to return the reference
23037 to the Tokenizer object.
23038 (declare_local_variables): Use Report.Error with location instead of plain
23042 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23043 (Operator.CheckBinaryOperator): Ditto.
23045 * cs-parser.jay (operator_declarator): Update accordingly.
23047 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23048 (CheckBinaryOperator): Same here.
23050 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23051 on the name without any prefixes of namespace names etc. This is because we
23052 already might have something already fully qualified like
23053 'System.Console.WriteLine'
23055 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23057 2001-09-07 Ravi Pratap <ravi@ximian.com>
23059 * cs-tokenizer.cs (location): Return a string which also contains
23062 * expression.cs (ElementAccess): New class for expressions of the
23063 type 'element access.'
23064 (BaseAccess): New class for expressions of the type 'base access.'
23065 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23068 * cs-parser.jay (element_access): Implement action.
23069 (base_access): Implement actions.
23070 (checked_expression, unchecked_expression): Implement.
23072 * cs-parser.jay (local_variable_type): Correct and implement.
23073 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23075 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23077 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23078 name and the specifiers.
23080 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23082 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
23083 making them all public ;-)
23085 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23088 2001-09-07 Miguel de Icaza <miguel@ximian.com>
23090 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23092 (FieldExpr, PropertyExprs): New resolved expressions.
23093 (SimpleName::MemberStaticCheck): Perform static checks for access
23094 to non-static fields on static methods. Maybe this should be
23095 generalized for MemberAccesses.
23096 (SimpleName::ResolveSimpleName): More work on simple name
23099 * cs-parser.jay (primary_expression/qualified_identifier): track
23100 the parameter index.
23102 * codegen.cs (CodeGen::Save): Catch save exception, report error.
23103 (EmitContext::EmitBoolExpression): Chain to expression generation
23104 instead of temporary hack.
23105 (::EmitStatementExpression): Put generic expression code generation.
23107 * assign.cs (Assign::Emit): Implement variable assignments to
23108 local variables, parameters and fields.
23110 2001-09-06 Miguel de Icaza <miguel@ximian.com>
23112 * statement.cs (Block::GetVariableInfo): New method, returns the
23113 VariableInfo for a variable name in a block.
23114 (Block::GetVariableType): Implement in terms of GetVariableInfo
23116 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23117 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23119 2001-09-06 Ravi Pratap <ravi@ximian.com>
23121 * cs-parser.jay (operator_declaration): Continue on my quest : update
23122 to take attributes argument.
23123 (event_declaration): Ditto.
23124 (enum_declaration): Ditto.
23125 (indexer_declaration): Ditto.
23127 * class.cs (Operator::Operator): Update constructor accordingly.
23128 (Event::Event): Ditto.
23130 * delegate.cs (Delegate::Delegate): Same here.
23132 * enum.cs (Enum::Enum): Same here.
23134 2001-09-05 Ravi Pratap <ravi@ximian.com>
23136 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23138 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23140 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23141 being passed around as an arraylist.
23142 (Attributes::AddAttribute): Method to add attribute sections.
23144 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23145 (struct_declaration): Update accordingly.
23146 (constant_declaration): Update.
23147 (field_declaration): Update.
23148 (method_header): Update.
23149 (fixed_parameter): Update.
23150 (parameter_array): Ditto.
23151 (property_declaration): Ditto.
23152 (destructor_declaration): Ditto.
23154 * class.cs (Struct::Struct): Update constructors accordingly.
23155 (Class::Class): Ditto.
23156 (Field::Field): Ditto.
23157 (Method::Method): Ditto.
23158 (Property::Property): Ditto.
23159 (TypeContainer::OptAttribute): update property's return type.
23161 * interface.cs (Interface.opt_attributes): New member.
23162 (Interface::Interface): Update to take the extra Attributes argument.
23164 * parameter.cs (Parameter::Parameter): Ditto.
23166 * constant.cs (Constant::Constant): Ditto.
23168 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23169 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23170 the attributes as a parameter.
23171 (InterfaceProperty): Update constructor call.
23172 (InterfaceEvent): Ditto.
23173 (InterfaceMethod): Ditto.
23174 (InterfaceIndexer): Ditto.
23176 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23177 pass the attributes too.
23178 (interface_event_declaration): Ditto.
23179 (interface_property_declaration): Ditto.
23180 (interface_method_declaration): Ditto.
23181 (interface_declaration): Ditto.
23183 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23185 * class.cs (Method::Define): Track the "static Main" definition to
23186 create an entry point.
23188 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23189 EntryPoint if we find it.
23191 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23192 (EmitContext::ig): Make this variable public.
23194 * driver.cs: Make the default output file be the first file name
23195 with the .exe extension.
23197 Detect empty compilations
23199 Handle various kinds of output targets. Handle --target and
23200 rename -t to --dumper.
23202 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23203 methods inherited from Expression return now an Expression. This
23204 will is used during the tree rewriting as we resolve them during
23207 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23208 the spec. Missing entirely is the information about
23209 accessability of elements of it.
23211 (Expression::ExprClassFromMemberInfo): New constructor for
23212 Expressions that creates a fully initialized Expression based on
23213 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23216 (Invocation::Resolve): Begin implementing resolution of invocations.
23218 * literal.cs (StringLiteral): Implement Emit.
23220 2001-09-05 Ravi Pratap <ravi@ximian.com>
23222 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23225 2001-09-04 Ravi Pratap <ravi@ximian.com>
23227 * cs-parser.jay (attribute_arguments): Implement actions.
23228 (attribute): Fix bug in production. Implement action.
23229 (attribute_list): Implement.
23230 (attribute_target): Implement.
23231 (attribute_target_specifier, opt_target_specifier): Implement
23232 (CheckAttributeTarget): New method to check if the attribute target
23234 (attribute_section): Implement.
23235 (opt_attributes): Implement.
23237 * attribute.cs : New file to handle attributes.
23238 (Attribute): Class to hold attribute info.
23240 * cs-parser.jay (opt_attribute_target_specifier): Remove production
23241 (attribute_section): Modify production to use 2 different rules to
23242 achieve the same thing. 1 s/r conflict down !
23243 Clean out commented, useless, non-reducing dimension_separator rules.
23245 * class.cs (TypeContainer.attributes): New member to hold list
23246 of attributes for a type.
23247 (Struct::Struct): Modify to take one more argument, the attribute list.
23248 (Class::Class): Ditto.
23249 (Field::Field): Ditto.
23250 (Method::Method): Ditto.
23251 (Property::Property): Ditto.
23253 * cs-parser.jay (struct_declaration): Update constructor call to
23254 pass in the attributes too.
23255 (class_declaration): Ditto.
23256 (constant_declaration): Ditto.
23257 (field_declaration): Ditto.
23258 (method_header): Ditto.
23259 (fixed_parameter): Ditto.
23260 (parameter_array): Ditto.
23261 (property_declaration): Ditto.
23263 * constant.cs (Constant::Constant): Update constructor similarly.
23264 Use System.Collections.
23266 * parameter.cs (Parameter::Parameter): Update as above.
23268 2001-09-02 Ravi Pratap <ravi@ximian.com>
23270 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23271 (TypeContainer.delegates): New member to hold list of delegates.
23273 * cs-parser.jay (delegate_declaration): Implement the action correctly
23274 this time as I seem to be on crack ;-)
23276 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23278 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23279 tell whether an identifier represents a namespace.
23281 * expression.cs (NamespaceExpr): A namespace expression, used only
23282 temporarly during expression resolution.
23283 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23284 utility functions to resolve names on expressions.
23286 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23288 * codegen.cs: Add hook for StatementExpressions.
23290 * class.cs: Fix inverted test for static flag in methods.
23292 2001-09-02 Ravi Pratap <ravi@ximian.com>
23294 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23295 to make it coincide with MS' number.
23296 (Operator::CheckBinaryOperator): Ditto.
23298 * ../errors/errors.txt : Remove error numbers added earlier.
23300 * ../errors/cs1019.cs : Test case for error # 1019
23302 * ../errros/cs1020.cs : Test case for error # 1020
23304 * cs-parser.jay : Clean out commented cruft.
23305 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23306 used anywhere - non-reducing rule.
23307 (namespace_declarations): Non-reducing rule - comment out.
23309 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23310 with TypeContainer::AddEnum.
23312 * delegate.cs : New file for delegate handling classes.
23313 (Delegate): Class for declaring delegates.
23315 * makefile : Update.
23317 * cs-parser.jay (delegate_declaration): Implement.
23319 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23321 * class.cs (Event::Define): Implement.
23322 (Event.EventBuilder): New member.
23324 * class.cs (TypeContainer::Populate): Update to define all enums and events
23326 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23327 readonly fields for all these cases ?
23329 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23331 * class.cs (Property): Revamp to use the convention of making fields readonly.
23332 Accordingly modify code elsewhere.
23334 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23335 the Define method of the Property class.
23337 * class.cs : Clean up applied patch and update references to variables etc. Fix
23339 (TypeContainer::Populate): Update to define all the properties we have. Also
23340 define all enumerations.
23342 * enum.cs (Define): Implement.
23344 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23346 * cs-parser.jay (overloadable_operator): The semantic value is an
23347 enum of the Operator class.
23348 (operator_declarator): Implement actions.
23349 (operator_declaration): Implement.
23351 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23352 validity of definitions.
23353 (Operator::CheckBinaryOperator): Static method to check for binary operators
23354 (TypeContainer::AddOperator): New method to add an operator to a type.
23356 * cs-parser.jay (indexer_declaration): Added line to actually call the
23357 AddIndexer method so it gets added ;-)
23359 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23360 already taken care of by the MS compiler ?
23362 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23364 * class.cs (Operator): New class for operator declarations.
23365 (Operator::OpType): Enum for the various operators.
23367 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23369 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23370 ostensibly handle this in semantic analysis.
23372 * cs-parser.jay (general_catch_clause): Comment out
23373 (specific_catch_clauses, specific_catch_clause): Ditto.
23374 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23375 (catch_args, opt_catch_args): New productions.
23376 (catch_clause): Rewrite to use the new productions above
23377 (catch_clauses): Modify accordingly.
23378 (opt_catch_clauses): New production to use in try_statement
23379 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23380 and re-write the code in the actions to extract the specific and
23381 general catch clauses by being a little smart ;-)
23383 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23384 Hooray, try and catch statements parse fine !
23386 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23388 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23389 string from the hashtable of variables.
23391 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23392 I end up making that mistake ;-)
23393 (catch_clauses): Fixed gross error which made Key and Value of the
23394 DictionaryEntry the same : $1 !!
23396 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23398 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23400 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23401 when the add and remove accessors are specified.
23403 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23405 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23406 information about indexer_declarator.
23407 (indexer_declarator): Implement actions.
23408 (parsing_indexer): New local boolean used to keep track of whether
23409 we are parsing indexers or properties. This is necessary because
23410 implicit_parameters come into picture even for the get accessor in the
23411 case of an indexer.
23412 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23414 * class.cs (Indexer): New class for indexer declarations.
23415 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23416 (TypeContainer::indexers): New member to hold list of indexers for the
23419 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23421 * cs-parser.jay (add_accessor_declaration): Implement action.
23422 (remove_accessor_declaration): Implement action.
23423 (event_accessors_declaration): Implement
23424 (variable_declarators): swap statements for first rule - trivial.
23426 * class.cs (Event): New class to hold information about event
23428 (TypeContainer::AddEvent): New method to add an event to a type
23429 (TypeContainer::events): New member to hold list of events.
23431 * cs-parser.jay (event_declaration): Implement actions.
23433 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23435 * cs-parser.jay (dim_separators): Implement. Make it a string
23436 concatenating all the commas together, just as they appear.
23437 (opt_dim_separators): Modify accordingly
23438 (rank_specifiers): Update accordingly. Basically do the same
23439 thing - instead, collect the brackets here.
23440 (opt_rank_sepcifiers): Modify accordingly.
23441 (array_type): Modify to actually return the complete type string
23442 instead of ignoring the rank_specifiers.
23443 (expression_list): Implement to collect the expressions
23444 (variable_initializer): Implement. We make it a list of expressions
23445 essentially so that we can handle the array_initializer case neatly too.
23446 (variable_initializer_list): Implement.
23447 (array_initializer): Make it a list of variable_initializers
23448 (opt_array_initializer): Modify accordingly.
23450 * expression.cs (New::NType): Add enumeration to help us
23451 keep track of whether we have an object/delegate creation
23452 or an array creation.
23453 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23454 members to hold data about array creation.
23455 (New:New): Modify to update NewType
23456 (New:New): New Overloaded contructor for the array creation
23459 * cs-parser.jay (array_creation_expression): Implement to call
23460 the overloaded New constructor.
23462 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23464 * class.cs (TypeContainer::Constructors): Return member
23465 constructors instead of returning null.
23467 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23469 * typemanager.cs (InitCoreTypes): Initialize the various core
23470 types after we have populated the type manager with the user
23471 defined types (this distinction will be important later while
23472 compiling corlib.dll)
23474 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23475 on Expression Classification. Now all expressions have a method
23476 `Resolve' and a method `Emit'.
23478 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23479 generation from working. Also add some temporary debugging
23482 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23484 * codegen.cs: Lots of code generation pieces. This is only the
23485 beginning, will continue tomorrow with more touches of polish. We
23486 handle the fundamentals of if, while, do, for, return. Others are
23487 trickier and I need to start working on invocations soon.
23489 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23492 * codegen.cs (EmitContext): New struct, used during code
23493 emission to keep a context. Most of the code generation will be
23496 * cs-parser.jay: Add embedded blocks to the list of statements of
23497 this block. So code generation proceeds in a top down fashion.
23499 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23501 * statement.cs: Add support for multiple child blocks.
23503 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23505 * codegen.cs (EmitCode): New function, will emit the code for a
23506 Block of code given a TypeContainer and its ILGenerator.
23508 * statement.cs (Block): Standard public readonly optimization.
23509 (Block::Block constructors): Link children.
23510 (Block::Child): Child Linker.
23511 (Block::EmitVariables): Emits IL variable declarations.
23513 * class.cs: Drop support for MethodGroups here, delay until
23515 (Method::): Applied the same simplification that I did before, and
23516 move from Properties to public readonly fields.
23517 (Method::ParameterTypes): Returns the parameter types for the
23518 function, and implements a cache that will be useful later when I
23519 do error checking and the semantic analysis on the methods is
23521 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23522 and made a method, optional argument tells whether this is a class
23523 or a structure to apply the `has-this' bit.
23524 (Method::GetCallingConvention): Implement, returns the calling
23526 (Method::Define): Defines the type, a second pass is performed
23527 later to populate the methods.
23529 (Constructor::ParameterTypes): implement a cache similar to the
23530 one on Method::ParameterTypes, useful later when we do semantic
23533 (TypeContainer::EmitMethod): New method. Emits methods.
23535 * expression.cs: Removed MethodGroup class from here.
23537 * parameter.cs (Parameters::GetCallingConvention): new method.
23539 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23541 * class.cs (TypeContainer::Populate): Drop RootContext from the
23544 (Constructor::CallingConvention): Returns the calling convention.
23545 (Constructor::ParameterTypes): Returns the constructor parameter
23548 (TypeContainer::AddConstructor): Keep track of default constructor
23549 and the default static constructor.
23551 (Constructor::) Another class that starts using `public readonly'
23552 instead of properties.
23554 (Constructor::IsDefault): Whether this is a default constructor.
23556 (Field::) use readonly public fields instead of properties also.
23558 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23559 track of static constructors; If none is used, turn on
23560 BeforeFieldInit in the TypeAttributes.
23562 * cs-parser.jay (opt_argument_list): now the return can be null
23563 for the cases where there are no arguments.
23565 (constructor_declarator): If there is no implicit `base' or
23566 `this', then invoke the default parent constructor.
23568 * modifiers.cs (MethodAttr): New static function maps a set of
23569 modifiers flags into a MethodAttributes enum
23570 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23571 MethodAttr, TypeAttr to represent the various mappings where the
23572 modifiers are used.
23573 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23575 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23577 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23580 * interface.cs (PopulateIndexer): Implemented the code generator
23581 for interface indexers.
23583 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23585 * interface.cs (InterfaceMemberBase): Now we track the new status
23588 (PopulateProperty): Implement property population. Woohoo! Got
23589 Methods and Properties going today.
23591 Removed all the properties for interfaces, and replaced them with
23592 `public readonly' fields.
23594 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23596 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23597 initialize their hashtables/arraylists only when they are needed
23598 instead of doing this always.
23600 * parameter.cs: Handle refs and out parameters.
23602 * cs-parser.jay: Use an ArrayList to construct the arguments
23603 instead of the ParameterCollection, and then cast that to a
23606 * parameter.cs: Drop the use of ParameterCollection and use
23607 instead arrays of Parameters.
23609 (GetParameterInfo): Use the Type, not the Name when resolving
23612 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23614 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23615 and instead use public readonly fields.
23617 * class.cs: Put back walking code for type containers.
23619 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23621 * class.cs (MakeConstant): Code to define constants.
23623 * rootcontext.cs (LookupType): New function. Used to locate types
23626 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23628 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23629 this System.Reflection code is. Kudos to Microsoft
23631 * typemanager.cs: Implement a type cache and avoid loading all
23632 types at boot time. Wrap in LookupType the internals. This made
23633 the compiler so much faster. Wow. I rule!
23635 * driver.cs: Make sure we always load mscorlib first (for
23636 debugging purposes, nothing really important).
23638 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23639 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23641 * rootcontext.cs: Lookup types on their namespace; Lookup types
23642 on namespaces that have been imported using the `using' keyword.
23644 * class.cs (TypeContainer::TypeAttr): Virtualize.
23645 (Class::TypeAttr): Return attributes suitable for this bad boy.
23646 (Struct::TypeAttr): ditto.
23647 Handle nested classes.
23648 (TypeContainer::) Remove all the type visiting code, it is now
23649 replaced with the rootcontext.cs code
23651 * rootcontext.cs (GetClassBases): Added support for structs.
23653 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23655 * interface.cs, statement.cs, class.cs, parameter.cs,
23656 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23657 Drop use of TypeRefs, and use strings instead.
23659 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23663 * class.cs (Struct::Struct): set the SEALED flags after
23664 checking the modifiers.
23665 (TypeContainer::TypeAttr): new property, returns the
23666 TypeAttributes for a class.
23668 * cs-parser.jay (type_list): Oops, list production was creating a
23669 new list of base types.
23671 * rootcontext.cs (StdLib): New property.
23672 (GetInterfaceTypeByName): returns an interface by type name, and
23673 encapsulates error handling here.
23674 (GetInterfaces): simplified.
23675 (ResolveTree): Encapsulated all the tree resolution here.
23676 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23679 * driver.cs: Add support for --nostdlib, to avoid loading the
23680 default assemblies.
23681 (Main): Do not put tree resolution here.
23683 * rootcontext.cs: Beginning of the class resolution.
23685 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23687 * rootcontext.cs: Provide better error reporting.
23689 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23691 * rootcontext.cs (CreateInterface): Handle the case where there
23692 are no parent interfaces.
23694 (CloseTypes): Routine to flush types at the end.
23695 (CreateInterface): Track types.
23696 (GetInterfaces): Returns an array of Types from the list of
23697 defined interfaces.
23699 * typemanager.c (AddUserType): Mechanism to track user types (puts
23700 the type on the global type hash, and allows us to close it at the
23703 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23705 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23706 RecordInterface instead.
23708 * cs-parser.jay: Updated to reflect changes above.
23710 * decl.cs (Definition): Keep track of the TypeBuilder type that
23711 represents this type here. Not sure we will use it in the long
23712 run, but wont hurt for now.
23714 * driver.cs: Smaller changes to accomodate the new code.
23716 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23719 * rootcontext.cs (CreateInterface): New method, used to create
23720 the System.TypeBuilder type for interfaces.
23721 (ResolveInterfaces): new entry point to resolve the interface
23723 (CodeGen): Property, used to keep track of the code generator.
23725 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23727 * cs-parser.jay: Add a second production for delegate_declaration
23730 (enum_body): Put an opt_comma here instead of putting it on
23731 enum_body or enum_member_declarations so we can handle trailing
23732 commas on enumeration members. Gets rid of a shift/reduce.
23734 (type_list): Need a COMMA in the middle.
23736 (indexer_declaration): Tell tokenizer to recognize get/set
23738 * Remove old targets.
23740 * Re-add the parser target.
23742 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23744 * cs-parser.jay: Add precendence rules for a number of operators
23745 ot reduce the number of shift/reduce conflicts in the grammar.
23747 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23749 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23752 Get rid of old crufty code.
23754 * rootcontext.cs: Use this to keep track of the parsed
23755 representation and the defined types available to the program.
23757 * gen-treedump.cs: adjust for new convention.
23759 * type.cs: Split out the type manager, and the assembly builder
23762 * typemanager.cs: the type manager will live here now.
23764 * cil-codegen.cs: And the code generator here.
23766 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23768 * makefile: Fixed up for easy making.
23770 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23772 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23775 (unary_expression): Expand pre_increment_expression and
23776 post_decrement_expression to reduce a shift/reduce.
23778 2001-07-11 Simon Cozens
23780 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23782 Improve allow_keyword_as_indent name.
23784 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23786 * Adjustments for Beta2.
23788 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23790 * decl.cs: Added `Define' abstract method.
23791 (InTransit): new property, used to catch recursive definitions.
23793 * interface.cs: Implement `Define'.
23795 * modifiers.cs: Map Modifiers.constants to
23796 System.Reflection.TypeAttribute flags.
23798 * class.cs: Keep track of types and user-defined types.
23799 (BuilderInit): New method for creating an assembly
23800 (ResolveType): New function to launch the resolution process, only
23801 used by interfaces for now.
23803 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23804 that are inserted into the name space.
23806 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23808 * ARGH. I have screwed up my tree so many times due to the use of
23809 rsync rather than using CVS. Going to fix this at once.
23811 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23814 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23816 * Experiment successful: Use System.Type rather that our own
23819 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23821 * cs-parser.jay: Removed nsAliases from here.
23823 Use new namespaces, handle `using XXX;'
23825 * namespace.cs: Reimplemented namespace handling, use a recursive
23826 definition of the class. Now we can keep track of using clauses
23827 and catch invalid using clauses.
23829 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23831 * gen-treedump.cs: Adapted for all the renaming.
23833 * expression.cs (Expression): this class now has a Type property
23834 which returns an expression Type.
23836 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23837 `Type', as this has a different meaning now in the base
23839 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23841 * interface.cs, class.cs: Removed from all the sources the
23842 references to signature computation, as we can not do method
23843 signature computation during the parsing time, as we are not
23844 trying to solve at that point distinguishing:
23848 void a (NS.Blah x) {}
23851 Which depending on the context might be valid or not, as we do not
23852 know if Blah is the same thing as NS.Blah at that point.
23854 * Redid everything so the code uses TypeRefs now instead of
23855 Types. TypeRefs are just temporary type placeholders, that need
23856 to be resolved. They initially have a pointer to a string and the
23857 current scope in which they are used. This is used later by the
23858 compiler to resolve the reference to an actual Type.
23860 * DeclSpace is no longer a CIR.Type, and neither are
23861 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23862 are all DeclSpaces, but no Types.
23864 * type.cs (TypeRefManager): This implements the TypeRef manager,
23865 which keeps track of all the types that need to be resolved after
23866 the parsing has finished.
23868 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23870 * ARGH. We are going to have to store `foreach' as a class rather
23871 than resolving it, as we need to verify error 1579 after name
23872 resolution. *OR* we could keep a flag that says `This request to
23873 IEnumerator comes from a foreach statement' which we can then use
23874 to generate the error.
23876 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23878 * class.cs (TypeContainer.AddMethod): we now add methods to the
23879 MethodGroup instead of the method hashtable.
23881 * expression.cs: Add MethodGroup abstraction, which gets us one
23882 step closer to the specification in the way we handle method
23885 * cs-parser.jay (primary_expression): qualified_identifier now
23886 tried to match up an identifier to a local variable reference or
23887 to a parameter reference.
23889 current_local_parameters is now a parser global variable that
23890 points to the current parameters for the block, used during name
23893 (property_declaration): Now creates an implicit `value' argument to
23896 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23898 * parameter.cs: Do not use `param' arguments as part of the
23899 signature, per the spec.
23901 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23903 * decl.cs: Base class for classes, structs and interfaces. This
23904 is the "Declaration Space"
23906 * cs-parser.jay: Use CheckDef for checking declaration errors
23907 instead of having one on each function.
23909 * class.cs: Factor out some code for handling error handling in
23910 accordance to the "Declarations" section in the "Basic Concepts"
23911 chapter in the ECMA C# spec.
23913 * interface.cs: Make all interface member classes derive from
23914 InterfaceMemberBase.
23916 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23918 * Many things: all interfaces are parsed and generated in
23919 gen-treedump. Support for member variables, constructors,
23920 destructors, properties, constants is there.
23922 Beginning of the IL backend, but very little done, just there for
23925 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23927 * cs-parser.jay: Fix labeled statement.
23929 * cs-tokenizer.cs (escape): Escape " and ' always.
23930 ref_line, ref_name: keep track of the line/filename as instructed
23931 by #line by the compiler.
23934 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23936 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23937 to match the values in System.CodeDOM.
23939 Divid renamed to Divide.
23941 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23943 (Statements.set): remove.
23945 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23948 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23949 falseStatements always have valid values.
23951 * cs-parser.jay: Use System.CodeDOM now.