1 2006-09-21 Raja R Harinath <rharinath@novell.com>
3 * support.cs: Unify with gmcs version.
5 2006-09-20 Raja R Harinath <rharinath@novell.com>
7 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
10 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
11 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
12 * mcs.exe.sources: Add generic.cs.
14 * codegen.cs: Unify with gmcs version.
16 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
17 (EmitContext): Add GenericDeclContainer implementation.
18 * decl.cs (MemberCore, DeclSpace): Likewise.
19 * namespace.cs: Remove #ifdef GMCS_SOURCE.
21 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
22 MCS TypeManager has a corresponding dummy method.
24 2006-09-19 Martin Baulig <martin@ximian.com>
26 * expression.cs: Completely merged with the gmcs version.
28 2006-09-19 Martin Baulig <martin@ximian.com>
30 * expression.cs (Invocation): Merged with the gmcs version.
31 (ArrayAccess.GetStoreOpcode): Likewise.
33 2006-09-19 Martin Baulig <martin@ximian.com>
36 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
37 (TypeManager.IsGenericMethodDefinition): Likewise.
39 2006-09-19 Martin Baulig <martin@ximian.com>
42 (TypeManager.IsEqual): Moved the gmcs implementation here.
43 (TypeManager.DropGenericTypeArguments): Likewise.
44 (TypeManager.DropGenericMethodArguments): Likewise.
45 (TypeManager.GetTypeArguments): Moved here from gmcs.
46 (TypeManager.HasGenericArguments): Likewise.
48 2006-09-19 Martin Baulig <martin@ximian.com>
50 * expression.cs (Binary): Merged with the gmcs version.
52 2006-09-19 Martin Baulig <martin@ximian.com>
54 * expression.cs (Probe, As, Is): Merged with the gmcs version.
56 2006-09-19 Martin Baulig <martin@ximian.com>
58 * typemanager.cs: Merged with the gmcs version.
60 2006-09-16 Raja R Harinath <rharinath@novell.com>
62 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
63 * driver.cs: Likewise.
65 2006-09-16 Marek Safar <marek.safar@seznam.cz>
68 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
69 only if parent type is class.
70 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
73 2006-09-15 Marek Safar <marek.safar@seznam.cz>
76 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
78 * typemanager.cs(CSharpName): Converts NullType to null.
80 2006-09-15 Martin Baulig <martin@ximian.com>
83 (TypeManager.GetMethodName): Added mcs implementation.
84 (TypeManager.IsEqual): Likewise.
87 (SimpleName.RemoveGenericArity): Added dummy implementation.
89 * pending.cs: Merged with the gmcs version.
91 2006-09-15 Martin Baulig <martin@ximian.com>
93 * statement.cs: Merge with the gmcs version.
95 2006-09-15 Martin Baulig <martin@ximian.com>
97 * statement.cs (Switch): Merge with the gmcs implementation
98 (without nullables), which is newer.
100 2006-09-15 Martin Baulig <martin@ximian.com>
102 * statement.cs (Block.Variables): Make this public.
103 (ToplevelBlock.Parameters): Make this a property.
104 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
106 2006-09-15 Martin Baulig <martin@ximian.com>
108 * namespace.cs: Merge with the gmcs version.
110 2006-09-15 Martin Baulig <martin@ximian.com>
112 * decl.cs (MemberName): Minor code cleanups.
114 2006-09-15 Martin Baulig <martin@ximian.com>
116 * parameter.cs: Merge with the gmcs version.
118 2006-09-15 Martin Baulig <martin@ximian.com>
120 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
123 2006-09-15 Martin Baulig <martin@ximian.com>
125 * flowanalysis.cs: Merged from GMCS; added the generics code into
126 a `GMCS_SOURCE' conditional so we can share this file.
128 2006-09-08 Martin Baulig <martin@ximian.com>
130 * typemanager.cs (TypeManager.interlocked_type): New public field.
131 (TypeManager.int_interlocked_compare-exchange): New public field.
132 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
133 enumerator types here and call InitGenericCoreTypes().
134 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
135 after calling InitEnumUnderlyingTypes().
138 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
139 `classes_second_stage'.
141 2006-09-14 Marek Safar <marek.safar@seznam.cz>
143 * assign.cs, ecore.cs, expression.cs: Share error message text.
144 * class.cs (FieldMember.Define): Check for varible of static type.
145 * driver.cs (LoadAssembly): Uses error output for errors.
146 * statement.cs: Updated.
148 2006-09-08 Marek Safar <marek.safar@seznam.cz>
150 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
153 2006-09-07 Martin Baulig <martin@ximian.com>
156 (MainDriver): Revert r62663 from Marek; see #70506 for details.
158 2006-08-29 Miguel de Icaza <miguel@novell.com>
160 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
162 2006-08-17 Miguel de Icaza <miguel@novell.com>
164 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
165 #52019 and #79064, the use of the \uXXXX sequence in source code
166 to represent unicode characters.
168 2006-08-15 Marek Safar <marek.safar@seznam.cz>
170 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
172 * class.cs, ecore.cs, statement.cs: Merged to one error message.
174 2006-08-13 Miguel de Icaza <miguel@novell.com>
176 * assign.cs: Catch attempts to assign to a method groups in += and
179 2006-08-13 Marek Safar <marek.safar@seznam.cz>
182 * cs-parser.jay: Don't destroy current array type by typeof of array's.
184 2006-08-12 Marek Safar <marek.safar@seznam.cz>
186 * class.cs (Method.Define): Issue a warning when generic method looks like
188 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
191 2006-08-09 Marek Safar <marek.safar@seznam.cz>
193 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
195 * decl.cs (MemberCache.FindMembers): When container is interface we need to
196 search all base interfaces as a member can be ambiguous.
197 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
198 Constructor member type filter.
199 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
200 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
201 reporting for returned memberinfos.
202 * report.cs: Updated.
203 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
204 version to work on all runtimes.
205 (TypeManager.RealMemberLookup): Removed members filtering.
207 2006-08-08 Raja R Harinath <rharinath@novell.com>
209 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
210 (PropertyExpr.EmitAssign): Likewise.
211 * expression.cs (Indirection.EmitAssign): Likewise.
212 (LocalVariableReference.EmitAssign): Likewise.
213 (ParameterReference.EmitAssign): Likewise.
214 (Invocation.EmitArguments): Likewise.
215 (ArrayAccess.EmitAssign): Likewise.
216 (IndexerAccess.EmitAssign): Likewise.
217 (This.EmitAssign): Likewise.
218 (ConditionalLogicalOperator.Emit): Likewise.
221 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
222 instead of ArrayList. If the hashtable has a LocalBuilder, don't
223 leave it in after returning it.
224 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
226 2006-08-06 Marek Safar <marek.safar@seznam.cz>
228 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
231 2006-08-03 Raja R Harinath <rharinath@novell.com>
233 Fix cs0146-3.cs and cs0146-4.cs.
234 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
235 enclosing types don't depend on the current type.
237 2006-08-02 Raja R Harinath <rharinath@novell.com>
240 * class.cs (TypeContainer.DoDefineMembers): Use
241 FindBaseMemberWithSameName on Parent, since we're interested in
242 whether we hide inherited members or not.
243 (FindBaseMemberWithSameName): Make slightly more robust.
245 Fix the non-generic testcase from #77396
246 * decl.cs (DeclSpace.DeclContainer): Remove override.
248 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
249 declspaces for doppelgangers too.
250 (UsingEntry): Implement IResolveContext.
251 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
252 'this' as the resolve context.
253 (LocalAliasEntry): Likewise.
255 Implement parts of #77403
256 * roottypes.cs (RootDeclSpace): New. Used to represent the
257 toplevel declaration space. Each namespace declaration introduces
258 a "partial" root declaretion space.
259 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
260 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
261 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
262 from 'current_namespace.SlaveDeclSpace'.
263 (namespace_declaration): Likewise.
264 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
265 check. It can't happen now.
266 * decl.cs (DeclSpace.LookupType): Likewise.
267 * driver.cs (MainDriver): Sanity check.
269 2006-08-01 Raja R Harinath <rharinath@novell.com>
271 * decl.cs (DeclSpace.FindNestedType): Remove.
272 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
273 LookupTypeContainer to get the container of the nested type.
274 * class.cs (TypeContainer.FindNestedType): Make non-override.
276 2006-07-31 Raja R Harinath <rharinath@novell.com>
278 * decl.cs (DeclSpace.PartialContainer): Move field from ...
279 * class.cs (TypeContainer.PartialContainer): ... here.
280 (TypeContainer.AddBasesForPart): New helper.
281 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
283 * cs-parser.jay (current_class): Convert to DeclSpace.
284 (struct_declaration, interface_declaration, class_declaration):
285 Use AddBasesForPart instead of .Bases directly.
286 * const.cs, iterators.cs: Update to changes.
288 2006-07-28 Raja R Harinath <rharinath@novell.com>
290 * class.cs (TypeContainer.AddMemberType): Rename from
292 (TypeContainer.AddMember): Rename from AddToMemberContainer.
293 (AddTypeContainer): New. Combine AddClassOrStruct and
295 (AddPartial): Update. Add 'is_partial' argument.
296 * roottypes.cs: Update to changes.
297 * cs-parser.jay (push_current_class): New helper for handling
298 current_container and current_class.
299 (struct_declaration, interface_declaration, class_declaration):
302 2006-07-26 Raja R Harinath <rharinath@novell.com>
304 * roottypes.cs: Rename from tree.cs.
306 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
307 * tree.cs (Tree, ITreeDump): Remove types.
308 * rootcontext.cs (tree, Tree): Remove fields.
309 (root, ToplevelTypes): New.
310 * *.cs: Update to rename.
312 * tree.cs (Tree.RecordDecl): Remove.
313 (RootTypes.AddToTypeContainer): Record the toplevel type in its
315 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
317 2006-07-23 Raja R Harinath <harinath@gmail.com>
319 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
320 DoFlowAnalysis and OmitStructFlowAnalysis here.
321 (ec.With): Rename from WithUnsafe and generalize.
322 (ec.WithCheckState): Remove. All users can be handled by 'With'.
323 (ec.WithFlowAnalyis): New.
324 * ecore.cs, expression.cs, statement.cs: Update.
326 2006-07-22 Raja R Harinath <harinath@gmail.com>
328 * statement.cs (Block.ResolveMeta): Simplify slightly.
330 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
331 multiple boolean fields. Convert InUnsafe, constant_check_state,
332 check_state to flags.
333 (CheckState, ConstantCheckState): Update.
334 (InUnsafe): New read-only property.
335 (FlagsHandle): Rename from CheckStateHandle and convert to handle
337 (WithUnsafe): New helper similar to WithCheckState.
338 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
339 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
341 2006-07-21 Raja R Harinath <rharinath@novell.com>
343 Make comparisons use the same IL irrespective of whether they're
344 in a 'checked' or 'unchecked' context: one of the issues in #78899
345 * codegen.cs (EmitContext.CheckState): Make read-only property.
346 (EmitContext.ConstantCheckState): Likewise.
347 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
348 helper that implement a save/restore stack for CheckState
349 values. This is the only way to change check-state.
350 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
351 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
352 (CheckedExpr.EmitBranchable): New forwarding method.
353 (UnCheckedExpr): Likewise.
354 * statement.cs (Block.ResolveMeta): Use WithCheckState.
355 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
356 (Checked.Resolve, checked.DoEmit): Likewise.
358 2006-07-20 Miguel de Icaza <miguel@novell.com>
360 * anonymous.cs: Cache the resolved anonymous delegate, and return
361 this so that the ResolveTopBlock is only triggered once, not
364 Currently we trigger ResolvetopBlock twice due to a first pass of
365 argument check compatibility, and a second pass that does the
368 2006-07-15 Marek Safar <marek.safar@seznam.cz>
370 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
372 * rootcontext.cs (Reset): Add helper_classes.
374 2006-07-15 Marek Safar <marek.safar@seznam.cz>
377 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
380 2006-07-13 Miguel de Icaza <miguel@novell.com>
382 * statement.cs (Lock): Handle expressions of type
383 TypeManager.null_type specially. Fixes #78770
385 2006-07-08 Marek Safar <marek.safar@seznam.cz>
387 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
390 2006-07-08 Marek Safar <marek.safar@seznam.cz>
392 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
393 for accessors as well.
394 * ecore.cs (EventExpr): Add AccessorTable.
396 2006-07-01 Marek Safar <marek.safar@seznam.cz>
399 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
400 for CS0122 where appropriate.
401 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
403 (Filter): Assembly can be null in the case of top level attributes.
405 2006-06-25 Marek Safar <marek.safar@seznam.cz>
409 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
410 is done at global level.
412 2006-06-24 Marek Safar <marek.safar@seznam.cz>
414 A fix for #77002, Implemented TypeForwarder support.
416 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
417 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
418 * typemanager.cs (): Add type_forwarder_attr_type.
420 2006-06-24 Marek Safar <marek.safar@seznam.cz>
422 * report.cs: Add CS0469 warning.
424 2006-06-21 Martin Baulig <martin@ximian.com>
426 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
427 the `try'-block, so we also report CS0016 etc. there.
429 2006-06-21 Martin Baulig <martin@ximian.com>
432 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
434 2006-06-21 Martin Baulig <martin@ximian.com>
436 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
437 also report CS1686 for parameters.
439 2006-06-21 Martin Baulig <martin@ximian.com>
441 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
442 instead of an error if the value is not implicitly convertible to
443 the switch types; fixes #77964.
445 2006-06-21 Raja R Harinath <rharinath@novell.com>
448 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
449 FieldBuilder is null.
452 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
453 'left' and 'right' before error-checking.
455 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
457 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
459 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
460 (FieldExpr.DoResolve): likewise.
461 (PropertyExpr.InstanceResolve): likewise.
462 (EventExpr.InstanceResolve): likewise.
464 2006-06-04 Marek Safar <marek.safar@seznam.cz>
466 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
467 attribute applicable tests for attribute argument.
469 2006-06-02 Raja R Harinath <rharinath@novell.com>
472 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
473 (Binary.OverloadResolve_PredefinedIntegral): New.
474 (Binary.OverloadResolve_PredefinedFloating): New.
475 (Binary.OverloadResolve_PredefinedString): New.
476 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
477 Follow the standard more closely, and treat numeric promotions in
478 terms of overload resolution.
479 (Binary.CheckShiftArguments): Simplify.
481 2006-06-01 Raja R Harinath <rharinath@novell.com>
483 * flowanalysis.cs (MyBitVector): Simplify representation.
484 (MyBitVector.Clone): Avoid allocating BitArray.
485 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
486 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
487 (*): Update. Change all references to MyBitVector.And and
488 MyBitVector.Or to &= and |=.
490 2006-05-29 Raja R Harinath <rharinath@novell.com>
493 * cs-parser.jay (formal_parameter_list): Extend the pattern below
494 to param arguments too.
496 2006-05-26 Miguel de Icaza <miguel@novell.com>
498 * cs-parser.jay: Catch another parsing form for arglist being
499 followed by other arguments. Fixes #78313.
501 2006-05-24 Raja R Harinath <rharinath@novell.com>
503 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
504 checking of out parameters to ...
505 (FlowBranchingToplevel.Merge): ... here.
506 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
507 set, propagate the origin upward, and only complain if there was
509 (FlowBranchingException.AddContinueOrigin): Likewise.
510 (FlowBranchingException.AddReturnOrigin): Likewise.
511 (FlowBranchingException.AddGotoOrigin): Likewise.
513 2006-05-23 Raja R Harinath <rharinath@novell.com>
515 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
516 unreachable, skip it.
517 (FlowBranchingException.Merge): Always propagate jumps, even if
518 the finally block renders subsequent code unreachable.
520 2006-05-18 Raja R Harinath <rharinath@novell.com>
523 * statement.cs (Goto.Resolve): Move responsibility for resolving
524 'goto' to FlowBranching.AddGotoOrigin.
525 (Goto.SetResolvedTarget): New. Callback to set the
526 LabeledStatement that's the target of the goto.
527 (Goto.DoEmit): Use Leave instead of Br when crossing an
528 unwind-protect boundary.
529 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
530 LookupLabel and adjust to new semantics.
531 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
532 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
533 Goto.SetResolvedTarget to update target.
534 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
535 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
536 AddBreakOrigin & co. Delay propagation until ...
537 (FlowBranchingException.Merge): ... this.
539 * statement.cs (Block.Resolve): Always depend on flow-branching to
540 determine unreachability. Kill workaround that originally emitted
541 only one statement after an "unreachable" label (see infloop in
544 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
545 This is still "wrong", but anything better would probably need a
546 multi-pass algorithm.
547 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
548 usage vector. Force current usage vector to be reachable, to
549 optimistically signify backward jumps.
550 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
552 (FlowBranchingLabeled.Merge): New. If no backward jump was
553 detected, return the original salted-away usage vector instead,
554 updated with appropriate changes. Print unreachable warning if
556 * statement.cs (Block.Resolve): Don't print unreachable warning on
559 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
561 * driver.cs: Pass filename without path to AssemblyBuilder's
562 AddResourceFile. Fixes bug #78407.
564 2006-05-17 Raja R Harinath <rharinath@novell.com>
566 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
567 * flowanalysis.cs (FlowBranchingLabeled): ... here.
568 (FlowBranching.MergeChild): Overwrite
569 reachability information from Labeled branchings too.
571 2006-05-16 Raja R Harinath <rharinath@novell.com>
573 * statement.cs (Goto.Resolve): Merge jump origins here ...
574 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
576 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
577 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
578 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
579 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
581 * statement.cs (Goto.Resolve): ... not here.
582 (Goto.Emit): Remove CS1632 check.
584 2006-05-14 Marek Safar <marek.safar@seznam.cz>
586 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
589 2006-05-11 Raja R Harinath <rharinath@novell.com>
591 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
592 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
593 (FlowBranchingException.Label): Likewise.
595 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
597 (MyBitVector.Or): Use it to avoid losing information (Count).
598 (FlowBranching.MergeOrigins): Likewise.
600 * flowanalysis.cs (UsageVector.IsDirty): Remove.
601 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
602 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
603 (UsageVector.ToString): Simplify.
604 (UsageVector.MergeSiblings): Move here from ...
605 (FlowBranching.Merge): ... here.
606 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
609 2006-05-10 Raja R Harinath <rharinath@novell.com>
611 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
612 null bitvector is treated as all-true.
614 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
615 (MyBitVector): Rationalize invariants. 'vector != null' implies
616 that we have our own copy of the bitvector. Otherwise,
617 'InheritsFrom == null' implies all inherited bits are true.
619 2006-05-09 Marek Safar <marek.safar@seznam.cz>
621 * statement.cs (LocalInfo): Add IsConstant.
622 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
623 local variable for constants.
625 2006-05-09 Raja R Harinath <rharinath@novell.com>
627 * flowanalysis.cs (MyBitVector.Empty): New.
628 (MyBitVector): Don't allow InheritedFrom to be null.
629 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
630 (UsageVector, FlowBranching): Update to changes.
632 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
633 recursion. The 'Parent == null' condition isn't sufficient for
635 (FlowBranching.AddBreakOrigin): Likewise.
636 (FlowBranching.AddContinueOrigin): Likewise.
637 (FlowBranching.AddReturnOrigin): Likewise.
638 (FlowBranching.StealFinallyClauses): Likewise.
639 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
640 (FlowBranching.CheckOutParameters): Likewise.
641 (FlowBranchingToplevel): Terminate all the above recursions here.
642 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
643 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
645 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
647 (FlowBranchingToplevel): New. Empty for now.
648 (FlowBranching.MergeTopBlock): Update.
649 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
650 branching for the anonymous delegate.
651 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
653 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
654 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
655 information at the start of the merge. Reorganize.
657 2006-05-07 Marek Safar <marek.safar@seznam.cz>
659 * class.cs (MethodData.Define): Method cannot implement interface accessor.
661 2006-05-07 Marek Safar <marek.safar@seznam.cz>
663 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
664 to newly introduced ctor.
666 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
667 message to one place.
668 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
671 2006-05-07 Marek Safar <marek.safar@seznam.cz>
673 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
675 * ecore.cs (Expression.ResolveAsConstant): Updated.
677 * statement.cs (ResolveMeta): Updated.
679 2006-05-06 Marek Safar <marek.safar@seznam.cz>
681 * cs-parser.jay: __arglist cannot be used in initializer.
683 2006-05-06 Marek Safar <marek.safar@seznam.cz>
686 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
689 2006-05-05 Raja R Harinath <rharinath@novell.com>
691 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
692 (LabeledStatement): Add 'name' parameter.
693 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
694 (Block.AddLabel): Update to changes.
695 * cs-parser.jay (labeled_statement): Likewise.
697 * flowanalysis.cs (BranchingType.Labeled): New.
698 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
699 (FlowBranchingLabeled): New. Does nothing for now, but will
700 eventually handle 'goto' flows.
701 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
702 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
703 that's terminated ...
704 (Block.Resolve): ... here.
706 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
707 (UsageVector.MergeFinallyOrigins): Likewise.
708 (FlowBranching.InTryOrCatch): Likewise.
709 (FlowBranching.AddFinallyVector): Likewise.
710 (FlowBranchingException): Update to changes.
713 * statement.cs (Return.Resolve): Move error checking to ...
714 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
715 (FlowBranchingException): Handle return origins like break and
717 (FlowBranching.UsageVector.CheckOutParameters): Remove.
719 2006-05-04 Marek Safar <marek.safar@seznam.cz>
722 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
725 2006-05-04 Marek Safar <marek.safar@seznam.cz>
728 * class.cs (MethodData.Define): Do public accessor check only when method
729 implements an interface.
731 2006-05-04 Raja R Harinath <rharinath@novell.com>
733 Remove special handling of 'break'
734 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
735 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
736 (UsageVector.Break): Remove.
737 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
739 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
741 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
742 UsageVector.Breaks (). Don't set NeedsReturnLabel.
744 2006-05-03 Marek Safar <marek.safar@seznam.cz>
747 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
748 be the interface member.
750 2006-05-03 Marek Safar <marek.safar@seznam.cz>
753 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
754 for emitting small (int) values.
756 2006-05-03 Raja R Harinath <rharinath@novell.com>
759 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
760 control-flow passes through the 'finally' after merging-in all the
761 control-flows from 'try' and the 'catch' clauses.
763 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
764 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
765 always true at the only non-recursive entry point.
766 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
767 FlowBranchingBreakable.
768 (FlowBranchingLoop): Remove.
769 * statement.cs (Return.DoResolve): Update to changes.
772 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
773 (FlowBranching.CreateBranching): Handle it: create a
774 FlowBranchingContinuable.
775 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
776 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
777 except that it handles the 'continue' command.
778 (FlowBranching.UsageVector.MergeOrigins): Rename from
780 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
781 except that it overrides AddContinueOrigin.
782 (FlowBranchingException): Override AddContinueOrigin, similar to
784 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
785 Create a new branching around the embedded statement.
786 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
787 control flow after the embedded statement.
788 (Continue.Resolve): Move all error checking to AddContinueOrigin.
790 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
791 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
792 FlowBranchingBreakable.
793 (FlowBranchingSwitch): Remove.
796 * statement.cs (Break.Resolve): Simplify. Move responsibility for
797 error reporting to ...
798 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
799 Rename from 'AddBreakVector'. Add new location argument. Return
800 a bool indicating whether the 'break' crosses an unwind-protect.
801 (FlowBranchingException.AddBreakOrigin): Add.
802 (FlowBranchingException.Merge): Propagate 'break's to surrounding
803 flowbranching after updating with the effects of the 'finally'
805 (FlowBranchingBreakable): New common base class for
806 FlowBranchingLoop and FlowBranchingSwitch.
808 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
810 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
812 2006-05-02 Raja R Harinath <rharinath@novell.com>
814 * statement.cs (Do.Resolve): If the loop is infinite, set the
816 (While.Resolve, For.Resolve): Set a barrier after the embedded
817 statement. There's no direct control flow that goes from the end
818 of the embedded statement to the end of the loop.
819 * flowanalysis.cs (FlowBranching.Infinite): Remove.
820 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
821 above ensure that the reachability is correctly computed.
823 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
824 (UsageVector.MergeBreakOrigins): If the current path is
825 unreachable, treat it as if all parameters/locals are initialized.
826 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
827 infinite loops before merging-in break origins.
829 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
830 (Reachability.Reachable): Split part into ...
831 (Reachability.Unreachable): ... this. Simplify.
832 (Reachability.IsUnreachable): Use 'Unreachable' instead.
834 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
835 (Reachability.SetThrowsSometimes): Likewise.
836 (FlowBranchingBlock.MergeTopBlock): Don't compare against
837 TriState.Always, use corresponding property.
838 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
839 (Block.Resolve): Likewise. Remove some redundant checks.
841 2006-05-02 Raja R Harinath <harinath@gmail.com>
843 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
844 (Reachability.Meet): Don't bother checking AlwaysThrows --
845 barrier is always set.
846 (FlowBranchingBlock.Merge): Likewise.
848 2006-05-01 Raja R Harinath <harinath@gmail.com>
850 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
851 checks for unreachable.
853 2006-05-01 Marek Safar <marek.safar@seznam.cz>
856 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
858 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
859 whether field is really assigned.
861 2006-04-30 Raja R Harinath <harinath@gmail.com>
863 * flowanalysis.cs (Reachability): Make 4-argument constructor
865 (Reachability.Meet): Rename from 'And'. Remove static variant.
866 (Reachability.Always): Rename from the highly misleading
867 'Reachability.Never'.
868 (FlowBranching.Merge): Update to changes. Mark an impossible
869 situation with a 'throw'.
870 (*): Update to changes.
872 2006-04-29 Raja R Harinath <harinath@gmail.com>
874 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
876 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
877 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
878 (*): Update to changes.
879 * statement.cs: Update to changes.
881 2006-04-28 Marek Safar <marek.safar@seznam.cz>
884 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
886 2006-04-28 Raja R Harinath <harinath@gmail.com>
888 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
891 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
892 argument to two arguments: an usage-vector and a bool. Move call
893 to FlowBranching.Merge () ...
894 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
896 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
897 handling of loop and switch reachability to ...
898 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
900 2006-04-27 Raja R Harinath <harinath@gmail.com>
902 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
903 handling to FlowBranchingLoop.InLoop.
904 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
906 2006-04-26 Marek Safar <marek.safar@seznam.cz>
909 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
910 anonymous method is allowed from AnonymousContainer here.
912 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
914 2006-04-24 Raja R Harinath <rharinath@novell.com>
917 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
919 2006-04-23 Marek Safar <marek.safar@seznam.cz>
922 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
923 (DoubleConstant.Reduce): Ditto.
925 2006-04-23 Raja R Harinath <rharinath@novell.com>
927 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
928 Remove 'lvalue_right_side' argument. Move parts to ...
929 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
930 (LocalVariable.DoResolveLValue): ... these.
932 2006-04-21 Raja R Harinath <rharinath@novell.com>
935 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
936 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
937 (LocalVariableReference.DoResolveBase): Use it to implement new
939 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
940 (Argument.Resolve): Simplify. Move CS1510 check ...
941 * ecore.cs (Expression.ResolveLValue): ... here.
942 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
943 (PropertyExpr.DoResolveLValue): Likewise.
944 (FieldExpr.Report_AssignToReadonly): Likewise.
945 (FieldExpr.DoResolve): Add 'out_access' argument. Use
946 LValueMemberAccess or LValueMemberOutAccess on instance depending
948 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
949 DoResolve as appropriate.
951 2006-04-20 Raja R Harinath <rharinath@novell.com>
954 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
955 implicit conversions on 'out' and 'ref' arguments.
957 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
958 improve clarity. Remove dead code.
961 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
962 (Catch.Resolve): Resolve VarBlock if it exists.
964 2006-04-19 Miguel de Icaza <miguel@novell.com>
966 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
967 twice, this was some residual code, the enumerator was emitted
968 properly in the two branche of if later.
970 2006-04-19 Raja R Harinath <rharinath@novell.com>
972 * expression.cs (Cast.ResolveLValue): Remove. The result of a
973 cast is never an lvalue.
974 (Cast.DoResolve, Cast.ResolveRest): Combine.
975 (Argument.Emit): Simplify slightly. Move 'Expr is
976 IMemoryLocation' check ...
977 (Argument.Resolve): ... here.
978 (Argument.Error_LValueRequired): Remove. Inline into only user.
980 Simplifications. Fix cs0191-2.cs
981 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
982 CS1649 and CS1651 to ...
983 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
984 the actual selection of the error code and message to a lookup
985 table. Add a dummy return value to simplify callsites.
986 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
987 readonly fields of other instances of the same type. Move CS0197
989 * expression.cs (Argument.Resolve): ... here. Simplify code.
990 Ensure that ec.InRefOutArgumentResolving is only set during LValue
991 resolution of an out or ref argument. The code simplification
992 above uses this invariant.
994 2006-04-18 Raja R Harinath <rharinath@novell.com>
996 Possibly fix #77752. Fix cs1690-[4-7].cs.
997 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
998 CheckMarshallByRefAccess. Drop parameter.
999 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1001 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1003 * report.cs (AllWarnings): Add CS1690.
1004 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1006 (LocalVariableReference.DoResolveBase): Update.
1008 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1010 * class.cs (MethodOrOperator): Moved common parts from method class.
1011 detect obsolete attributes.
1012 (Method.Define): Simplified as it reuses code from base.
1013 (Constructor.ValidAttributeTargets): Fixed issue found during
1015 (Destructor.ValidAttributeTargets): Fixed issue found during
1017 (Operator): Finished refactoring set off by #78020. Operator class is now
1018 ordinary method class.
1020 * anonymous.cs: Updated.
1022 * decl.cs (DeclSpace): Add IsGeneric
1024 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1026 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1028 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1030 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1031 detect obsolete attributes.
1032 (Method.CreateEmitContext): Moved to MethodOrOperator.
1034 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1037 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1038 customized exception to make crash detection easier.
1039 (MethodOrOperator): Started to work on new base class for methods and
1041 (Method): Derives from MethodOrOperator.
1042 (Constructor.Emit): Emits its own attributes.
1043 (AbstractPropertyEventMethod.Emit): Ditto.
1044 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1046 (Operator.Emit): It's temporary more tricky than should be.
1048 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1050 * report.cs (InternalErrorException): Add ctor with inner exception.
1052 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1055 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1058 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1061 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1064 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1066 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1067 attribute is present and Guid not.
1068 (Interface.ApplyAttributeBuilder): Ditto.
1070 * attribute.cs: Add error message.
1072 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1076 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1077 sources (it's composite) so hold them in extra array as they are used in
1078 Emit phase only. It worked in the previous versions by mistake.
1079 (Attribute.Emit): Emit attribute for more owners when exist.
1081 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1082 it has now different behaviour.
1084 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1086 * constant.cs (Constant.IsDefaultInitializer): New method.
1088 * class.cs: Updated.
1090 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1091 re-initialize default values. It saves KBs almost for every assembly.
1092 Thanks Zoltan for the idea.
1093 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1094 (ArrayCreation.DoResolve): Resolve only once.
1095 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1096 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1098 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1100 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1103 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1105 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1106 in an embedded statement too.
1108 2006-04-01 Raja R Harinath <rharinath@novell.com>
1111 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1113 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1117 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1120 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1122 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1124 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1127 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1128 LocalTemporary change.
1130 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1132 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1133 initializers optimization.
1134 (ClassOrStruct.TypeAttr): Moved from modifiers.
1135 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1136 (FieldBase.ResolveInitializer): Resolves initializer.
1137 (FieldBase.HasDefaultInitializer): New property.
1139 * cs-parser.jay: Removed message.
1141 * expression.cs (CompilerGeneratedThis): New specialization.
1143 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1145 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1147 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1149 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1151 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1152 be now EnumConstants only.
1154 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1156 * attribute.cs, driver.cs: Reset more caches.
1158 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1160 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1162 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1164 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1165 for easier reuse. Updated all overrides.
1166 (IntegralConstant): New base class for all integral constants.
1167 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1168 of the constant range, report custom error.
1169 (UIntConstant.Reduce): Fixed uint conversion.
1171 * ecore.cs, literal.cs: Reduce updates.
1173 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1177 * class.cs (Constructor.Define): Removed extra if for default ctors.
1178 A patch from Atsushi Enomoto.
1180 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1182 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1183 GetAttributableValue.
1185 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1188 * convert.cs (ImplicitConversionRequired): Error message moved to
1191 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1192 automatic implicit conversion of an output value.
1193 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1195 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1197 (TypeOf.GetAttributableValue): Add extra handling for object type.
1199 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1200 special error message.
1202 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1204 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1206 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1207 compatible with MS runtime.
1209 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1211 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1212 attribute arguments here.
1214 * class.cs (Indexer.Define): The check was moved to attribute class.
1216 2006-03-22 Marek Safar <marek.safar@seznam.cz>
1218 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1219 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1222 2006-03-22 Raja R Harinath <rharinath@novell.com>
1224 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1225 mcs to keep code differences small.
1226 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1227 * typemanager.cs (parameter_default_value_attribute_type): New.
1228 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1231 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1233 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1235 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1237 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1239 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1242 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1244 * doc-bootstrap.cs : fix build.
1246 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1248 * expression.cs (StringConcat.Append): Issue a warning when empty string
1251 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1253 * assign.cs (CompoundAssign.ResolveSource): Removed.
1255 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1258 * class.cs (TypeContainer.FindMethods): Removed.
1259 (TypeContainer.CheckMemberUsage): Made static.
1261 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1263 * constant.cs (CheckRange): Removed unused type argument.
1264 (CheckUnsigned): Removed unused type argument.
1266 * cs-parser.jay: Updated after MemberAccess clean up.
1267 Uses Length for empty string test.
1269 * cs-tokenizer.cs: Uses Length for empty string test.
1270 (IsCastToken): Made static.
1271 (is_hex): Made static.
1272 (real_type_suffix): Made static.
1274 * decl.cs (SetupCache): Made static.
1275 (OnGenerateDocComment): Removed unused ds argument.
1277 * delegate.cs (VerifyDelegate): Removed unused argument.
1279 * doc.cs: Uses Length for empty string test.
1281 * driver.cs: Uses Length for empty string test.
1283 * enum.cs (IsValidEnumType): Made static
1285 * expression.cs (EnumLiftUp): Removed unused argument.
1286 (ResolveMethodGroup): Ditto.
1287 (BetterConversion): Ditto.
1288 (GetVarargsTypes): Ditto.
1289 (UpdateIndices): Ditto.
1290 (ValidateInitializers): Ditto.
1291 (MemberAccess.ctor): Ditto.
1292 (GetIndexersForType): Ditto.
1294 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1296 * iterators.cs: Updated after MemberAccess clean up.
1298 * location.cs: Uses Length for empty string test.
1300 * namespace.cs: Uses Length for empty string test.
1302 * report.cs (CheckWarningCode): Made static.
1304 * statement.cs (LabeledStatement): Removed unused argument.
1306 * typemanager.cs (FilterNone): Removed.
1308 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1310 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1313 * class.cs: Updated.
1315 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1317 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1319 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1323 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1324 reporting, it's more tricky than I thought.
1326 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1330 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1332 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1333 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1334 Add more error reporting; Fixed issue with params.
1336 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1338 * cs-parser.jay: AnonymousMethod requires host container.
1340 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1342 2006-03-18 Raja R Harinath <harinath@gmail.com>
1344 * class.cs: Change 'TypeContainer ds' constructor argument to
1345 'DeclSpace parent'. Some classes were missed below due to
1346 different naming convention.
1348 * class.cs (MemberCore.Parent): Delete. This makes the
1349 ParentContainer changes below enforceable by the compiler.
1351 Treat pointers to enclosing declaration space as 'DeclSpace', not
1353 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1354 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1356 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1358 (Block.AddThisVariable): Likewise.
1359 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1360 (AbstractPropertyEventMethod.Emit): Likewise.
1361 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1362 (GetMethod.Define, SetMethod.Define): Likewise.
1363 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1364 (DelegateMethod.EmitMethod): Likewise.
1366 Fix regression test-partial-13.cs.
1367 Rationalize use of PartialContainer. Ensure that the partial
1368 class semantics can be tied to type-correctness, i.e., any
1369 violation will cause a compile error.
1370 * class.cs, const.cs: Access all fields that belong to class
1371 TypeContainer via ParentContainer. Arguments of EmitContexts and
1372 Resolve()-like functions still use 'Parent'.
1374 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1375 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1376 (PropertyMethod.CheckModifiers): Remove unused argument.
1377 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1380 2006-03-17 Raja R Harinath <harinath@gmail.com>
1382 Make semantics of PartialContainer simpler.
1383 * decl.cs (DeclSpace.IsPartial): Remove.
1384 * class.cs (TypeContainer.IsPartial): Likewise.
1385 (TypeContainer..ctor): Set PartialContainer to point to self.
1386 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1387 (TypeContainer.FindNestedType): Likewise.
1388 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1390 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1392 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1394 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1396 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1399 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1401 * class.cs (Operator.Define): An error for base conversion was not
1404 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1406 * iterator.cs : yield break is allowed in try statement which has
1407 catch clauses. Fixed bug #77767.
1409 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1411 A fix for #77593, #77574.
1413 * class.cs (MethodCore.CheckBase): Another if for operator.
1415 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1417 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1420 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1421 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1424 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1427 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1428 Updated after another emitcontext usage was clean up. It should help us to
1429 synchronize with gmcs easier.
1431 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1435 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1436 (Event.Define): ditto
1437 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1439 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1440 Removed redundant code and set NewSlot for Invoke method too.
1442 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1443 (Parameters.MergeGenerated): New method. Use this method when you merge
1444 compiler generated argument with user arguments.
1446 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1448 * attribute.cs (ResolveAsTypeTerminal): Removed.
1450 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1451 specialization for predefined types; 30% speed up.
1452 Finally placed obsolete check to right place.
1453 (Expression.ResolveType): Removed.
1455 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1456 Updated after ResolveType was removed.
1458 * expression.cs (Cast.ctor): Check void cast.
1459 (Binary.ResolveAsTypeTerminal): Is never type.
1460 (Conditional.ResolveAsTypeTerminal): Is never type.
1462 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1464 2006-03-01 Raja R Harinath <rharinath@novell.com>
1467 * expression.cs (ParameterReference.DoResolveBase): Change return
1469 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1473 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1476 * typemanager.cs (GetFullNameSignature): Don't nullref on
1477 protected accessors.
1479 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1481 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1482 these two separated members to simplify the code.
1483 (Attribute.Resolve): Refactored to use new fields and methods.
1484 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1485 implemented obsolete attribute checking.
1486 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1487 implemented obsolete checking again. It look line never ending quest ;-)
1488 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1490 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1492 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1494 *class.cs (Property.Define): Add RegisterProperty call.
1496 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1497 argument groups (only 2).
1499 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1500 encoding expression to arguments.
1501 (Expression.ExprClassToResolveFlags): Just turned to property.
1503 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1504 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1505 optimized as well as implemented support for zero-length attributes.
1507 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1508 Add caching of PropertyInfo's.
1510 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1512 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1513 error multiple times.
1515 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1517 New partial class implementation.
1518 A fix for #77027, #77029, #77403
1520 * attribute.cs (Attributable): Made attributes protected.
1522 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1523 the replacements of ClassPart and PartialContainer.
1524 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1525 (TypeContainer.AddInterface): Ditto.
1526 (TypeContainer.AddPartial): The main method for partial classes. It checks
1527 for errors and merges ModFlags and attributes. At the end class is added to
1529 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1531 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1532 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1533 from the rest of partial classes.
1534 (TypeContainer.GetClassBases): Simplified.
1535 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1537 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1538 (TypeContainer.HasExplicitLayout): Uses Flags now.
1539 (PartialContainer): Removed.
1540 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1541 (StaticClass): Was merged with Class.
1542 (Class.GetClassBases): class and static class bases are verified here.
1543 (Class.TypeAttr): Added static attributes when class is static.
1544 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1545 (MemberBase): In some cases we need to call parent container for partial
1546 class. It should be eliminated but it's not easy now.
1548 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1550 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1551 partial classed to accumulate class comments.
1552 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1554 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1556 * driver.cs (MainDriver): Tree.GetDecl was removed.
1558 * modifiers.cs (Modifiers): Add partial modifier.
1560 * tree.cs (Tree.decl): Removed.
1561 (RootTypes): Started to use this class more often for root types
1564 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1568 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1569 external interface does not have an attribute.
1571 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1573 Another prerequisites for new partial classs implementation.
1575 * attribute.cs (Attribute.Equal): Implemented.
1576 (Attribute.Emit): Changed as attributes can be applied more than twice.
1577 (Attributes.Emit): Check for duplicate attributes here.
1579 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1580 as a parameter, clean-up.
1582 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1586 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1587 contains obsolete attribute check which can in some cases look for base
1588 type of current class which is not initialized yet.
1589 (TypeContainer.BaseType): Replacement of ptype.
1591 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1593 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1595 First of prerequisites for new partial classs implemention.
1597 * attribute.cs (Attributable): Extended by ResolveContext;
1598 Attributes finally have correct context for resolving in all cases.
1599 (AttachTo): Attribute owner is assigned here.
1601 * codegen.cs (IResolveContext): Introduce new interface to hold
1602 all information needed in resolving phase.
1603 (EmitContext): Implements IResolveContext; more clean-up needed here.
1605 * decl.cs (MemberCore): Implemented IResolveContext.
1607 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1608 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1609 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1610 Refactored to use new IResolveContext instead of EmitContext; cleanup
1612 2006-02-06 Miguel de Icaza <miguel@novell.com>
1614 * codegen.cs (EmitScopeInitFromBlock): check here the
1615 capture_context, there is no need to make two calls to the
1618 * anonymous.cs: Add some debugging messages that might help me
1619 track other instances of this problem in the future (the
1620 regression of test 467).
1622 * cs-parser.jay: track the variable block, as we need to initalize
1623 any captured variables declared in this block for the "catch"
1624 portion of the "Try" statement.
1626 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1627 scope initialization for captured variables.
1629 Also, move the emit for the variables after the block location has
1632 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1634 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1636 2006-02-02 Miguel de Icaza <miguel@novell.com>
1638 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1639 commit yesterday, the initialization for the roots is necessary.
1640 What is not necessary is the scope activation.
1642 2006-02-02 Raja R Harinath <rharinath@novell.com>
1644 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1645 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1647 (Argument.Resolve): Remove CS0206 checks.
1649 2006-02-01 Miguel de Icaza <miguel@novell.com>
1651 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1652 scopes for all the roots, the scopes will now be emitted when the
1653 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1655 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1656 code. This reduces a lot of existing cruft.
1658 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1659 that the ScopeInfo is generated as we enter the scope, not at the
1660 time of use, which is what we used to do before.
1662 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1663 every time a Block is about to be emitted if we have a
1666 2006-02-01 Raja R Harinath <rharinath@novell.com>
1668 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1670 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1672 * typemanager.cs (cons_param_array_attribute): Make private.
1673 (Reset): Set it to null.
1674 (InitCoreHelpers): Don't initialize it.
1675 (ConsParamArrayAttribute): New. Initialize it as needed.
1676 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1678 2006-01-31 Miguel de Icaza <miguel@novell.com>
1680 * expression.cs: There might be errors reported during the
1681 selection of applicable methods. If there are errors, do not
1682 continue execution as it will lead the compiler to crash.
1684 2006-01-30 Miguel de Icaza <miguel@novell.com>
1686 * expression.cs: Member access is not allowed on anonymous
1687 methods. Fixes #77402.
1689 2006-01-30 Raja R Harinath <rharinath@novell.com>
1692 * cs-parser.jay (VariableDeclaration): Don't set
1693 current_array_type to null.
1694 (field_declaration, event_declaration, declaration_statement):
1695 Set it to null here.
1697 2006-01-28 Raja R Harinath <harinath@gmail.com>
1699 * typemanager.cs (GenericParameterPosition): New.
1702 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1704 * doc.cs : To process "include" elements, first we should create
1705 another list than XmlNodeList, because it could result in node
1706 removal, which could result in that the XmlNodeList gives up
1709 (Also made code identical to gmcs again.)
1711 2006-01-25 Miguel de Icaza <miguel@novell.com>
1713 * ecore.cs: Introduce an error report that we were not catching
1714 before, if not silent, we must report the error. Gonzalo ran into
1717 2006-01-23 Miguel de Icaza <miguel@novell.com>
1719 A fix for bug: #76957
1721 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1722 ComputeMethodHost before creating the method, this is a new
1725 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1726 that this method references (RegisterScope). The actual scope
1727 where the method is hosted is computed with the ComputeMethodHost
1728 before we create the method.
1730 Moved the Deepest routine here.
1732 (AnonymousContainer.ComputeMethodHost): New routine used to
1733 compute the proper ScopeInfo that will host the anonymous method.
1735 (ScopeInfo): Deal with multiple roots. The problem was that we
1736 did not have a unique root where all ScopeInfos could be hanged
1737 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1740 Remove AdjustMethodScope which is now computed at the end. Remove
1741 LinkScope which did a partial link, instead link all ScopeInfos
1742 before code generation from the new "LinkScopes" routine.
1744 Simplify all the Add* routines as they no longer need to maintain
1745 the tree, they just need to record that they are using variables
1748 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1749 routines to produce the forest of ScopeInfo trees.
1751 * class.cs (TypeContainer.AppendMethod): This is just like
1752 AddMethod, but ensures that an interface implementation method
1753 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1754 methods, but at the end.
1756 We use this functionality to ensure that the generated MoveNext
1757 method in the iterator class is resolved/emitted before the
1758 enumerator methods created.
1760 This is required because the MoveNext method computes the right
1761 ScopeInfo for the method. And the other methods will eventually
1762 need to resolve and fetch information computed from the anonymous
1765 2006-01-21 Raja R Harinath <harinath@gmail.com>
1766 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1769 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1771 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1772 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1774 2006-01-18 Raja R Harinath <rharinath@novell.com>
1776 Fix #76656, cs0231-2.cs.
1777 * cs-parser.jay (formal_parameter_list): Make error case catch
1779 (parenthesized_expression_0): Add CS1026 check.
1780 (invocation_expression): Remove unused { $$ = lexer.Location }.
1782 2006-01-17 Raja R Harinath <rharinath@novell.com>
1785 * cs-parser.jay (statement_expression): Don't list out the
1786 individual statement-expressions. Convert syntax error into
1789 2006-01-16 Raja R Harinath <rharinath@novell.com>
1792 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1793 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1794 CheckIntermediateModification.
1795 (FieldExpr.DoResolve): Add new two-argument version that
1796 allows us to resolve the InstanceExpression as an lvalue.
1797 The one-argument variant is now just a wrapper.
1798 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1799 Resolve the lhs as an lvalue if the it has a value type.
1800 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1801 from Assign.DoResolve.
1802 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1803 resolved as an lvalue.
1804 (PropertyExpr.DoResolve): Update.
1805 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1806 has a value type. Move CS1612 check here from
1807 CheckIntermediateModification.
1808 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1809 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1810 'right_side' of a ResolveLValue on an 'out' argument.
1811 (EmptyExpression.LValueMemberAccess): New. Used as the
1812 'right_side' of a propagated ResolveLValue on a value type.
1813 (LocalVariableReference.DoResolveBase): Recognize
1814 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1816 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1817 EmptyExpression.Null.
1819 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1821 * typemanager.cs : added IsGenericParameter(). In mcs it always
1823 * doc.cs : for generic parameters, use GenericParameterPosition,
1826 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1828 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1830 2006-01-12 Miguel de Icaza <miguel@novell.com>
1832 This fixes the problem where we used ldfld instead of ldflda to
1833 load the "THIS" pointer on captured parameters, when THIS is a
1834 value type. See bug #77205.
1836 * iterators.cs (CapturedThisReference.Emit): Pass false to
1837 EmitThis (we do not need the address).
1839 * codegen.cs (EmitThis): it needs to know whether we need the
1840 address of `this' or not. This is used by value types.
1842 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1843 every other call passes false.
1845 2006-01-12 Raja R Harinath <rharinath@novell.com>
1848 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1850 * expression.cs (Invocation.OverloadResolve): Update.
1851 (Invocation.DoResolve): Avoid double resolution of invocation.
1853 2006-01-11 Raja R Harinath <rharinath@novell.com>
1856 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1857 unary negation of floating point types as 0-expr; negation cannot
1858 overflow in floating point types.
1861 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1862 on operands of 'void' type.
1865 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1866 and ExclusiveOr for boolean constants too.
1868 2006-01-09 Raja R Harinath <rharinath@novell.com>
1871 * expression.cs (Invocation.OverloadResolve): Replace reflected
1872 override methods with their base virtual methods, rather than
1874 * typemanager.cs (TypeManager.GetOverride): New.
1876 2006-01-05 Jb Evain <jbevain@gmail.com>
1878 * class.cs (Property.Define, Indexer.Define): do not tag the
1879 properties as SpecialName | RTSpecialName.
1881 2006-01-04 Miguel de Icaza <miguel@novell.com>
1883 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1884 doing a low-level comparission of parameter types. It was lacking
1885 a check for __argslist.
1887 2005-12-30 Miguel de Icaza <miguel@novell.com>
1889 * expression.cs (ParameterReference.DoResolveBase): Allow
1890 reference parameters if they are local to this block.
1892 This allows the ref and out parameters of a delegate to be used in
1893 an anonymous method, for example:
1895 delegate void set (out int x);
1897 set s = delegate (out int x){
1901 This is used by functionality introduced late in the C# language.
1903 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1904 method that take ref and out parameters.
1906 Fixes #77119 which was a late change in the spec.
1908 2005-12-23 Miguel de Icaza <miguel@novell.com>
1910 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1911 parent if its the same scope. Fixes #77060.
1913 2005-12-21 Miguel de Icaza <miguel@novell.com>
1915 * driver.cs: Report the case of no source files and no -out:
1918 2005-12-20 Raja R Harinath <rharinath@novell.com>
1921 * expression.cs (ComposedCast.GetSignatureForError): Define.
1923 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1927 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1928 ListDictionary, to contain the ExternAliasEntry entries (in
1929 addition to the NamespaceEntry.aliases hashtable). This field is
1930 shared between the original entry and its doppelganger (bodyless
1932 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1933 extern_aliases field.
1934 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1935 lookup in extern_aliases.
1937 2005-12-16 Raja R Harinath <rharinath@novell.com>
1940 * class.cs (TypeContainer.Mark_HasEquals): New.
1941 (TypeContainer.Mark_HasGetHashCode): New.
1942 (ClassPart): Override them.
1943 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1946 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1947 'parent' argument to the base constructor.
1949 Remove all mention of TypeContainer from decl.cs.
1950 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1951 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1952 (DeclSpace.DeclSpace): Likewise.
1953 (DeclSpace.DefineMembers): Remove unused argument.
1954 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1955 debugging check -- we don't care if the debug code throws an
1956 InvalidCastException instead of an InternalErrorException.
1957 * class.cs (TypeContainer.DefineMembers): Update to changes.
1958 (TypeContainer.DoDefineMembers): Likewise.
1959 (TypeContainer.GetMethods): Likewise.
1960 (PropertyMember.Define): Likewise.
1961 (MemberBase.Parent): New property that forwards to
1962 MemberCore.Parent, but ensures that we get a TypeContainer.
1963 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1964 (RootContext.PopulateTypes): Likewise. Remove special case code
1965 for !RootContext.StdLib: DefineMembers is idempotent.
1967 2005-12-14 Miguel de Icaza <miguel@novell.com>
1969 * convert.cs (ExplicitConversionCore): Check the return value from
1970 ExplicitConversionCore which can return null on failure. Fixes #76914
1972 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1974 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1976 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1978 * doc.cs : The search for referenced namespace was insufficient to
1979 get global one as it used to do. Fixed bug #76965.
1981 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1983 * doc.cs : check name in cref in the last phase that whether it is
1986 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1988 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1991 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1993 * doc.cs : so it turned out that we cannot skip override check for
1994 interface members. Fixed bug #76954.
1996 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1998 * cs-tokenizer.cs : fixed bug #75984:
1999 - #warning and #error should not be handled when the source line
2001 - #line is not checked strictly when the source line is disabled.
2002 - #define and #undef is on the other hand checked strictly at any
2005 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2007 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2010 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2012 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2014 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2016 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2017 (FieldBase.Initializer): Initializer is now optional.
2018 (EventField.Define): Only event field can have initializer.
2020 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2022 * const.cs (Const): Reuse initializer.
2024 * cs-parser.jay: Updated after FieldBase changes.
2025 Added current_array_type to simplify array initializers.
2027 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2029 * expression.cs, iterators.cs: Updated.
2031 * namespace.cs (NamespaceEntry): Made UsingFound private.
2033 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2035 * parameterCollection.cs: Obsolete, removed.
2036 * parser.cs: Obsolete, removed.
2038 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2041 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2043 * enum.cs (Enum.Define): Set obsolete context here.
2045 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2048 - FindDocumentedMember() now expects 1) paramList as null
2049 when "we don't have to check the number of parameters" and
2050 2) Type.EmptyTypes when "there is no arguments".
2051 - Introduced FoundMember struct to hold the exact type which was
2052 used to find the documented member (the above change broke
2053 test-xml-044; it might be better just to use DeclaringType than
2054 what MS does, like this change does, but it depends on usage.)
2056 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2058 * doc.cs : documented member might be from DeclaringType for nested
2059 types. Fixed bug #76782.
2061 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2063 * anonymous.cs: Have the param code handle leaving copies on the
2064 stack etc. Allows anonymous params to take part in the assignment
2065 code (++, +=, etc). Fixes bug #76550
2067 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2068 it down to the anon code.
2070 * iterators.cs: Use dummy var here
2072 * codegen.cs: Handle new vars
2074 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2077 * class.cs (MethodData.Define): Set proper Obsolete context.
2079 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2081 (FieldExpr.DoResolve): Ditto.
2083 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2086 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2087 parent is not obsolete.
2089 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2091 * doc.cs : (FindDocumentedMember) find parameterless members first
2092 and get CS0419 in the early stage. Fixed first case of bug #76727.
2094 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2097 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2098 no error was reported.
2100 *expression.cs (Binary.DoResolve): left can be null.
2102 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2105 * class.cs (MethodData.Emit): Parameters should be labeled first.
2107 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2110 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2112 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2114 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2116 * class.cs (MethodCore): Parameter clean up.
2117 (IMethodData): Added ParameterInfo.
2118 (MethodData): Parameter clean up.
2119 (Indexer.Define): Parameter clean up.
2131 * typemanager.cs: Parameter clean up.
2133 * delegate.cs (Define): Get rid of duplicated code.
2135 * expression.cs (ParameterReference): Removed useless parameters
2137 (Invocation): Ditto.
2139 * parameter.cs (ParamsParameter): New class, params specialization.
2140 (ArglistParameter): Attemp to separate arglist.
2141 (Parameter): Refactored to be reusable and faster.
2142 (Parameter.Modifier): Made understandable.
2143 (Parameters): Changed to be used as a class for `this' assembly
2144 parameters. Refactored to use new specialized classes.
2146 * support.cs (ParameterData): Added Types property.
2147 (InternalParameters): Deleted.
2149 2005-08-20 Martin Baulig <martin@ximian.com>
2151 Merging this patch from GMCS to fix #75867.
2153 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2154 scope if we don't already have it.
2156 2005-11-17 Martin Baulig <martin@ximian.com>
2159 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2160 inherit the scope from our parent. Fixes #76653.
2162 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2164 * doc.cs : the previous patch does not actually fix the bug.
2165 PropertyInfo override check is now implemented and really fixed it.
2166 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2168 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2170 * doc.cs : apply "override filter" also to properties.
2173 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2175 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2176 no need to check overrides. For classes, omit those results from
2177 interfaces since they must exist in the class. Fixed bug #76726.
2179 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2181 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2182 with different parameters. Fixed the second problem in #76685.
2184 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2186 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2187 get expected 'protected' access in CheckValidFamilyAccess()).
2190 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2192 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2193 Fixed bug #76705. CS1569 was incorrectly commented out.
2195 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2197 * doc.cs : use Invocation.IsOverride() to do real override check.
2198 * expression.cs : made Invocation.IsOverride() internal.
2200 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2202 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2203 TypeBuilder.FindMembers() and filter overriden base members out.
2206 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2208 * doc.cs : ref/out parameters are represented as '@' (instead of
2209 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2211 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2213 * doc.cs : when there was no '.' in cref to methods in doc comment,
2214 then parameters were missing in the output. Fixed bug #76691.
2216 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2218 * driver.cs : don't output docs when there is an error.
2221 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2224 Now it should detect indexers. Fixed primary concern in bug #76685.
2225 Fixed CS0419 message to not show the identical member signature in
2228 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2230 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2231 instead of Type.FindMembers() since it does not handle events.
2234 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2236 * codegen.cs: Fixed typo (speficied -> specified).
2238 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2241 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2243 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2245 * attribute.cs: Changed error message.
2247 * cs-tokenizer.cs: One more check.
2249 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2251 * statement.cs (Block.Resolve): Ignore empty statement.
2253 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2255 * report.cs: Made error/warning methods more strict to avoid
2258 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2259 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2260 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2261 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2263 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2265 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2266 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2268 * class.cs (TypeContainer.IsComImport): New property.
2269 (Constructor.Define): Create proper ctor for ComImport types.
2271 * expression.cs (New.CheckComImport): Fixed.
2273 2005-11-07 Miguel de Icaza <miguel@novell.com>
2275 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2276 that a parameter has been captured does not mean that we do not
2277 have to do the rest of the processing. This fixes the second part
2278 of #76592. If there was another anonymous method capturing
2279 values in the past, the Scope would never be set for the second
2280 method that captured the same parameter.
2282 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2283 properly manipulate the stack. Second part of fix for #76592.
2285 * expression.cs (New): Add support for invoking "new" on
2286 interfaces that have been flagged with the ComImport attribute and
2287 the CoClass. Fixes #76637
2289 * statement.cs (Try.DoEmit): When a variable is captured, do not
2290 try to emit the vi.LocalBuilder variable as it has been captured.
2291 Create a temporary variable and store the results on the
2292 FieldBuilder. Fixes #76642
2294 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2296 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2298 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2300 * expression.cs (Binary.DoResolve): Added && optimalization.
2302 * typemanager.cs (AddUserType): Removed useless argument.
2304 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2306 * statement.cs (Block.variables): Uses ListDictionary.
2308 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2311 * class.cs (PartialContainer.EmitType): Customized to emit
2312 security attributes.
2313 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2314 for partial classes.
2316 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2319 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2320 access has to be fixed.
2322 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2324 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2327 * ecore.cs (NullCast.Reduce): Implemented.
2329 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2332 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2334 (Foreach.Resolve): Catch null properly.
2336 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2338 * cs-tokenizer.cs: Warning text fix.
2340 * driver.cs: AllWarningNumbers exposed on public interface.
2342 * report.cs (): Reviewed warning numbers.
2343 (IsValidWarning): Use binary search.
2345 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2347 * driver.cs: Implemeted resource visibility.
2348 (Resources): New class for code sharing between /res: and
2351 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2354 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2357 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2360 * ecore.cs (NullCast): Child is contant only.
2362 * literal.cs (NullLiteral.Reduce): null can be converted to any
2365 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2367 * driver.cs: Use Encoding.Default as default code page instead
2370 2005-10-27 Raja R Harinath <rharinath@novell.com>
2373 * expression.cs (Invocation.Error_InvalidArguments): Handle
2374 __arglist parameters.
2375 (Invocation.VerifyArgumentsCompat): Likewise.
2376 * support.cs (ReflectionParameters.GetSignatureForError): Print
2377 __arglist parameters.
2378 (InternalParamters.GetSignatureForError): Likewise.
2379 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2381 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2383 * attribute.cs (GetPropertyValue): Made public.
2385 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2387 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2389 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2392 * driver.cs: Reflect method name change.
2394 * statement.cs (Try.Resolve): Warn when try has both general
2397 * typemanager.cs: runtime_compatibility_attr_type new predefined
2400 2005-10-26 Raja R Harinath <harinath@gmail.com>
2403 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2404 treat it as an empty parameter list.
2406 2005-10-26 Raja R Harinath <rharinath@novell.com>
2409 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2410 ResolveAsTypeStep silent.
2411 * statement.cs (Block.AddConstant): Mark block as used.
2412 (Block.ResolveMeta): Avoid piling on error messages
2413 if a constant initializer resolution fails.
2415 2005-10-25 Raja R Harinath <rharinath@novell.com>
2417 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2419 (NamespaceEntry.VerifyAllUsing): New.
2420 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2421 behaviour. Delegates actual resolution of alias to ...
2422 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2423 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2425 * driver.cs (Driver.MainDriver): Update.
2427 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2428 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2430 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2432 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2433 RootNamespace.DefineNamespacesForAll.
2435 2005-10-24 Raja R Harinath <harinath@gmail.com>
2437 * typemanager.cs (assemblies, external_aliases, modules)
2438 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2439 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2440 overhead. Move resposibility ...
2441 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2442 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2444 2005-10-23 Raja R Harinath <harinath@gmail.com>
2446 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2447 cached_namespaces. Improve usage.
2448 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2449 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2450 Move from GlobalRootNamespace and simplify.
2451 (RootNamespace.Global): Make instance variable.
2452 (RootNamespace.RootNamespace): Add "alias name" parameter.
2453 (GlobalRootNamespace): Simplify drastically.
2454 (Namespace.Lookup): Don't use GetNamespace.
2455 * typemanager.cs (GetRootNamespace): Rename from
2456 ComputeNamespaceForAlias.
2457 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2459 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2461 * anonymous.cs (AnonymousContainer): Don't crash when container
2464 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2466 * expression.cs (Binary.DoResolve): Warn when comparing same
2469 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2472 * expression.cs (Binary.DoResolve): It looks like there are no
2473 convetsion rules in enum context.
2475 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2477 Add support for extern alias qualifiers.
2478 * typemanager.cs: Move some LookupTypeReflection code
2479 to namespace.cs, to have cleaner code. Added some methods
2480 to help us keep track of the extern aliased references.
2481 * driver.cs: Add suport for extern alias assemblies on command
2482 line and check for their warnings/errors. Also keep track of the
2483 extern aliased assemblies.
2484 * namespace.cs: Move the global functionality of Namespace
2485 to GlobalRootNamespace/RootNamespace. Now the global namespace
2486 is GlobalRootNamespace.Globa. Also the code moved from
2487 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2488 Finally added LocalAliasEntry (AliasEntry before) and
2489 ExternAliasEntry, to handle alias statements.
2490 * cs-parser.jay: Add support in the grammar for extern alias
2492 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2493 Update callings to Namespace (now in GlobalRootNamespace).
2495 2005-10-18 Raja R Harinath <rharinath@novell.com>
2498 * class.cs (TypeContainer.DefineType): Move updating of
2499 topological sort earlier in the code.
2500 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2502 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2505 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2507 * constant.cs (Constant.TryReduce): Moved from Cast class.
2508 (Reduce): Made little bit more OO and fixed missing conversions.
2510 * ecore.cs (Reduce): Implemented.
2511 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2513 * literal.cs (Reduce): Implemented.
2515 * class.cs: Reverted Miguel's wrong commit.
2517 2005-10-14 Miguel de Icaza <miguel@novell.com>
2519 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2521 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2523 * cs-parser.jay, expression.cs : CS0214 was missing error location
2524 for constants. Fixed bug #76404.
2526 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2529 * convert.cs (ExplicitConversionCore): Fixed object->enum
2532 2005-10-10 Raja R Harinath <rharinath@novell.com>
2534 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2536 (PropertyExpr.EmitCall): Likewise.
2537 * expression.cs (Invocation.EmitArguments): Handle case where
2539 (Invocation.EmitCall): Avoid allocating temporary variable if
2540 there are no arguments.
2542 2005-10-07 Raja R Harinath <rharinath@novell.com>
2545 * convert.cs (ImplicitConversionStandard): Move conversion of
2546 void* to arbitrary pointer types ...
2547 (ExplicitConversionStandard): .. here.
2548 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2549 error to always print typenames.
2551 2005-10-07 Raja R Harinath <rharinath@novell.com>
2553 * convert.cs (GetConversionOperator): Rename from
2554 GetConversionOperators. Move operator selection code from ...
2555 (UserDefinedConversion): ... here.
2557 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2559 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2562 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2564 * assign.cs (Assign.DoResolve): Error method changed.
2566 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2568 * const.cs (ResolveValue): Reset in_transit immediately.
2570 * constant.cs: Error method changed.
2572 * convert.cs: Removed useless location parameter.
2573 (ExplicitNumericConversion): Don't do double enum check.
2574 (ExplicitConversionCore): Renamed from ExplicitConversion.
2575 (ExplicitUnsafe): Extracted from ExplicitConversion.
2576 (ExplicitConversion): Uses for error reporting.
2578 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2580 (ResolveBoolean): Uses common error method.
2581 (CastToDecimal): Get rid of ec.
2582 (CastFromDecimal): Optimized.
2583 (ConvCast): Get rid of ec.
2585 * enum.cs (ResolveValue): Reset in_transit immediately.
2586 (Emit): Return after first error.
2588 * expression.cs: Convert changes.
2590 * literal.cs: Error method changed.
2592 * statement.cs: Error method changed.
2594 2005-10-03 Raja R Harinath <rharinath@novell.com>
2596 * support.cs (SeekableStreamReader.Position): Don't error out when
2597 the requested position is just beyond the end of the current
2600 2005-09-28 Raja R Harinath <rharinath@novell.com>
2602 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2603 try to keep in sync with the byte count of the underlying Stream.
2604 However, this limits us to a window size of 2048 characters: i.e.,
2605 the maximum lookahead of our lexer/parser can be 2048 characters.
2607 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2610 * driver.cs: Fix compilation files with full root path.
2612 2005-09-25 Miguel de Icaza <miguel@novell.com>
2614 * report.cs (SymbolRelatedToPreviousError): Format the output so
2615 it does not use an open parenthesis that is never closed.
2617 * driver.cs: Follow coding guidelines
2619 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2622 * const.cs (Const.ResolveValue): Check for assigning non-null
2623 value to reference type.
2625 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2627 * anonymous.cs: Implemented ExprClassName.
2629 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2632 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2635 * class.cs (StaticClass.DefineContainerMembers): Report protected
2638 * codegen.cs: if(ed) PRODUCTION.
2640 * convert.cs (Error_CannotImplicitConversion): Better error
2643 * cs-parser.jay: More error checks.
2645 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2647 * driver.cs (CSCParseOption): Enabled wrong option check.
2649 * ecore.cs (Expression.ExprClassName): Turned to property.
2650 (MemberExpr.CheckIntermediateModification): For checking boxed
2651 value types modification.
2653 * statement.cs (Fixed.Resolve): Expression type must be
2654 convertible to fixed type.
2655 (CollectionForeach.GetEnumeratorFilter,TryType):
2656 Small refactoring for easier error checking.
2658 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2660 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2663 * class.cs (GeneratedBaseInitializer): New class for customization
2664 compiler generated initializers.
2665 (MemberBase.DoDefine): Check Obsolete attribute here.
2666 (FieldMember.DoDefine): Ditto.
2668 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2671 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2672 (MemberCore.GetObsoleteAttribute): Removed argument.
2673 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2674 (MemberCore.CheckObsoleteType): New helper.
2678 * statement.cs: Updates after MemberCore changes.
2680 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2681 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2683 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2684 obsolete attribute for compiler construct.
2685 (As.DoResolve): Cache result.
2687 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2689 2005-09-26 Raja R Harinath <rharinath@novell.com>
2692 * expression.cs (This.VerifyFixed): In a value type T, the type of
2693 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2694 value type R, 'this' is treated as a value parameter.
2696 2005-09-22 Miguel de Icaza <miguel@novell.com>
2698 * statement.cs (Lock): Use the TemporaryVariable class instead of
2699 manually using local variables as those do not work when variables
2702 * ecore.cs: Moved the TemporaryVariable class from being a nested
2703 class inside Foreach to be a public class that can be employed in
2706 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2708 * cs-parser.jay: interface_accessors replaced by
2709 accessor_declarations.
2711 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2714 * statement.cs (GotoCase.Resolve): Convert null constant to
2716 (SwitchLabel.ResolveAndReduce): Ditto.
2717 (SwitchLabel.NullStringCase): Custom null stamp.
2718 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2720 typemanager.cs (CSharpSignature): Don't skip first argument
2723 2005-09-18 Miguel de Icaza <miguel@novell.com>
2725 * driver.cs: Set InEmacs based on the environment variable EMACS.
2727 * location.cs (InEmacs): in this mode, do not report column
2728 location as it confuses Emacs.
2730 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2732 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2733 expression.cs, iterators.cs, literal.cs: Store constants and
2736 * class.cs (MemberBase.ShortName): Pass location.
2738 * cs-parser.jay: Some location fixes.
2740 * ecore.cs (Expression.Location): Made virtual.
2742 2005-09-05 Miguel de Icaza <miguel@novell.com>
2744 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2745 if the underlying types are the same, otherwise we need to produce
2746 code that will do the proper cast.
2748 This was exposed by Marek's constant rewrite which produced
2749 invalid code for the call site:
2752 void Method (X v) {}
2756 This fixes test-49.cs
2758 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2760 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2761 Type/Object should be allowed as well. Fixed bug #75968.
2763 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2765 * expression.cs : (Binary.DoResolve): when one is enum constant and
2766 another is constant 0, then return enum one *as enum type*.
2769 2005-09-02 Raja R Harinath <rharinath@novell.com>
2771 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2775 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2776 flow-branching for LocalVariableReferences in case we were invoked
2777 from a MemberAccess.
2778 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2780 (LocalVariableReference.DoResolveBase): ... this.
2781 (MemberAccess.Resolve): Do the check that was disabled during
2784 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2787 (PartialContainer.Create): check abstract/sealed/static strictly
2788 but abstract/sealed can exist only at one side. Fixed bug #75883.
2790 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2793 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2794 specified, don't default to UnmanagedType.I4.
2796 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2798 * expression.cs : conditional operator should check possibly
2799 incorrect assign expression. Fixed bug #75946.
2801 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2803 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2804 Reverting the change. gmcs is much complex than mcs on this matter.
2806 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2808 * cs-tokenizer.cs : To read another token ahead of the actual
2809 consumption, use new SavedToken and cache token instead of moving
2810 back the stream with SeekableStreamReader (it seemed problematic).
2812 driver.cs : Thus use StreamReader directly.
2813 * support.cs : Thus removed SeekableStreamReader.
2815 2005-08-30 Raja R Harinath <rharinath@novell.com>
2818 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2819 (ScopeInfo.EmitScopeType): Use it to construct field names from
2820 names of captured locals.
2823 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2824 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2825 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2826 (ExplicitConversion): Remove enum cases already handled by
2827 implicit conversion. Move implicit conversion check to the beginning.
2828 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2829 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2830 Don't treat System.Enum as a struct.
2832 2005-08-30 Jb Evain <jbevain@gmail.com>
2834 * attribute.cs: handles as expression in parameters.
2836 2005-08-30 Raja R Harinath <rharinath@novell.com>
2839 * class.cs (TypeContainer.VerifyClsName): Don't use a
2840 PartialContainer when verifying CLS compliance.
2841 (AbstractPropertyEventMethod): Set Parent here, ...
2842 (PropertyMethod): ... not here.
2844 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2846 * attribute.cs : escaped attribute name should not be allowed to be
2847 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2849 2005-08-29 Raja R Harinath <rharinath@novell.com>
2852 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2853 when converting a long constant to unsigned long.
2854 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2855 detect where IsApplicable and VerifyArgumentsCompat disagree.
2857 2005-08-29 Raja R Harinath <rharinath@novell.com>
2858 and Carlos Alberto Cortez <carlos@unixmexico.org>
2861 * class.cs (TypeContainer.CanElideInitializer): New helper.
2862 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2863 can safely emitting the initializer of a field.
2865 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2867 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2868 allowed inside a switch (without loop). Fixed bug #75433.
2870 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2872 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2873 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2875 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2877 * driver.cs : kinda reverting the default encoding changes (not exact
2878 revert since I noticed that "codepage:reset" might not work fine).
2880 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2882 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2883 Location. Now getter and setter store location correctly.
2884 (errors/cs0111-12.cs now reports the expected location.)
2886 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2888 * driver.cs : Use default encoding on the environment.
2889 Removed (now that) extra parameter for SeekableStreamReader.
2890 * support.cs : (SeekableStreamReader) third .ctor() argument for
2891 StreamReader is not required (always true). preamble size could
2892 be acquired in simpler and safe way.
2894 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2896 * cs-parser.jay: report CS0642 at warning level 3
2897 and report CS0642 for an if else statement also
2898 fixes bug #74745. Patch by John Luke (and a bit
2900 Removed extra CS0642 warning check for "while",
2902 * statement.cs: In Block.Resolve(), CS0642 check
2903 is reimplemented to check a sequence of an empty
2904 statement and a block.
2906 Both fix bug #66777.
2908 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2910 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2911 detection until I fix it.
2913 * cs-tokenizer.cs: Changed error message.
2915 * cs-parser.jay: Fixed 2 error locations.
2917 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2918 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2921 * enum.cs (GetSignatureForError): Fixed.
2923 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2927 * typemanager.cs (RegisterProperty): Removed.
2929 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2931 2005-08-24 Raja R Harinath <rharinath@novell.com>
2934 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2935 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2937 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2939 * expression.cs : tiny fix is required for not warning positive ulong.
2942 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2944 * expression.cs : add CS0652 check for constant and integral
2945 expression. Fixed bug #53974.
2947 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2949 * expression.cs : in DoNumericPromotions(), check if there is implicit
2950 conversion overload for string (to check CS0034). Fixed bug #52492.
2952 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2954 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2956 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2958 * ecore.cs : report location when it is *not* Null.
2960 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2966 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2967 correctly. Fixed bug #75721.
2969 2005-08-23 Raja R Harinath <rharinath@novell.com>
2971 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2972 loop that performs 'min (pos, char_count)'.
2975 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2976 converted value in Operator.OnesComplement.
2978 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2980 * anonymous.cs: If the anon method is pulled into a helper class,
2981 it needs to be `internal' not `private'. Fixes runtime behavior on
2984 2005-08-20 Martin Baulig <martin@ximian.com>
2986 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2987 scope if we don't already have it.
2989 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2990 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2993 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2996 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2999 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3001 The big constants rewrite
3002 Fix #75746, #75685 and more
3003 As a side effect saved 1MB for MWF ;-)
3005 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3006 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3007 enum based for corlib compilation.
3009 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3012 * class.cs (FixedField.Define): Use ResolveAsConstant.
3014 * const.cs (IConstant): Interface constants and enums.
3015 (Const.ResolveValue): New method for constant resolvning.
3016 (ExternalConstant): Constants from imported assemblies.
3018 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3019 conversion; like enums.
3020 (Constant.ToType): Converts this constant to different type.
3021 (Constant.Increment): Adds 1.
3023 * convert.cs (ImplicitConversionRequired): Simplified.
3025 * cs-parser.jay: Create EnumMember directly.
3027 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3029 * doc.cs (GenerateEnumDocComment): Removed.
3031 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3032 (ConvertIntLiteral): Removed.
3033 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3035 * enum.cs (EnumMember): Implement IConstant.
3036 (Enum.IsValidEnumConstant): Removed.
3037 (Enum.GetNextDefaultValue): Removed.
3038 (Enum.FindMembers): Updated.
3039 (Enum.GenerateDocComment): Iterate enum members.
3041 * expression.cs (Cast.TryReduce): Handle enums correctly.
3042 (New.Constantify): Made public.
3043 (MemberAccess.DoResolve): Removed contant specific if(s).
3045 * literal.cs (NullLiteral): Implement new abstract methods.
3047 * statement.cs (GotoCase.Resolve): Use new constant methods.
3048 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3050 * typemanager.cs (LookupEnum): Removed.
3051 (IsEnumType): Fixed to work with corlib.
3052 (RegisterConstant): Removed.
3053 (LookupConstant): Removed.
3054 (GetConstant): Changed to work with IConstant.
3056 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3058 * location.cs : Fixed overflown (>255) column number.
3060 2005-08-03 Raja R Harinath <rharinath@novell.com>
3062 First cut of the qualified-alias-member feature.
3063 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3065 * cs-parser.jay (DOUBLE_COLON): New token.
3066 (namespace_or_type_name): Add rule for recognizing
3067 qualified-alias-members.
3068 (primary_expression): Likewise.
3069 (element_access): Allow QualifiedAliasMember as a possible
3070 type-bearing expression.
3071 (local_variable_type, local_variable_pointer_type): Likewise.
3072 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3073 aliases in the current and enclosing namespace declarations.
3074 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3075 * decl.cs (MemberName.is_double_colon): New.
3076 (MemberName.MemberName): Add new constructor for alias-member.
3077 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3078 * expression.cs (QualifiedAliasMember): New expression type.
3080 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3082 * location.cs : it borked when no argument was specified.
3084 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3086 * location.cs : tiny ToString() format fix.
3088 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3090 * statement.cs : oops, it was missing.
3092 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3094 A set of fixes for precise line/column location.
3097 "token" field now holds a file/line "delta", a line number offset
3098 from the segment, and a column number. See also:
3099 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3100 December/009508.html
3101 Removed static IsNull. Use instance IsNull property instead.
3103 For some tokens it stores Location. For Identifier it stores
3104 LocatedToken which is a pair of string name and location.
3105 Column numbers are adjusted only at getChar().
3107 Use Location.ToString() for reporting (it now contains column).
3109 Largely modified to use LocatedToken instead of
3110 string (IDENTIFIER), and to acquire Location from some tokens.
3111 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3112 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3114 Now MemberName holds Location. DeclSpace.ctor() receives Location
3115 as a parameter. Removed extra parameters to all derived classes.
3116 Replaced Location.IsNull() with instance property.
3117 * assign.cs, expression.cs :
3118 Added .ctor() overload that omits Location.
3120 Added "nameEscaped" flag that indicates the identifier was escaped
3121 in the source file. This fixes bug #57047.
3123 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3125 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3126 New method, looking for lo-case imported cls type.
3128 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3131 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3133 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3135 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3137 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3139 Optimized to save 3.5 MB for SWF compilation.
3141 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3143 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3144 (PartialContainer.Create): Moved logic AddToContainer.
3145 (PartialContainer.MarkForDuplicationCheck): Shares name.
3147 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3150 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3152 (Namespace.GetSignatureForError): New method.
3154 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3155 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3157 2005-08-01 Raja R Harinath <rharinath@novell.com>
3160 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3161 member lookup rather than qualifier_type, since qualifier_type can
3164 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3166 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3169 2005-07-31 Miguel de Icaza <miguel@novell.com>
3171 * statement.cs: Copy the local exception into the exception
3172 captured local. Fixes 75674
3174 2005-07-31 Raja R Harinath <harinath@gmail.com>
3177 * expression.cs (Invocation.OverloadResolve): Don't report error
3178 CS1501 if error CS1502 has been reported.
3179 (New.DoResolve): Delegate CS1501 reporting to
3180 Invocation.OverloadResolve.
3183 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3184 invariant-meaning-in-block property in an enclosing block if
3187 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3189 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3190 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3191 (Switch.CheckSwitch): Just save 50kb for SWF.
3193 2005-07-27 Martin Baulig <martin@ximian.com>
3195 * anonymous.cs (CaptureContext.AddField): Added
3196 `AnonymousContainer am' argument; compute its toplevel scope if
3197 it's not already computed. Fixes #75649.
3199 2005-07-26 Raja R Harinath <rharinath@novell.com>
3202 * class.cs (Constructor.Emit): Reset block to null if the block
3205 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3207 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3209 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3211 * class.cs (MethodData.Define): Check whether accessor implementing
3212 interface is public.
3214 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3216 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3219 * namespace.cs (LookupType): Moved same type check to...
3221 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3224 2005-07-21 Raja R Harinath <rharinath@novell.com>
3226 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3227 already found a typebuilder.
3228 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3229 MemberNames, not strings.
3231 * const.cs (Error_ExpressionMustBeConst):
3232 Rename from Error_EpressionMustBeConst.
3233 * const.cs, class.cs, statement.cd: Update.
3235 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3239 * const.cs (Const.LookupConstantValue): Report missing contant expression
3241 (Error_EpressionMustBeConstant): Only one error method.
3243 * class.cs, statement.c: Updated.
3245 2005-07-20 Raja R Harinath <rharinath@novell.com>
3247 * statement.cs (Block.Flags): Add back HasVarargs.
3248 (Block.flags): Make protected.
3249 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3251 * typemanager.cs (types, typecontainers, user_types): Remove.
3252 (UserTypes, TypeContainers): Likewise.
3253 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3254 (CleanUp, Reset): Update.
3255 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3256 (GetNestedType): Use Type.GetNestedType.
3257 (CoreLookupType): Take two arguments, the namespace and the
3258 basename of the type. Update to use the Namespace.Lookup
3260 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3261 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3262 string concatenation and substring matches.
3263 * class.cs, enum.cs, delegate.cs: Update to changes.
3265 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3267 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3268 Expression and made virtual.
3270 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3271 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3273 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3275 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3278 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3281 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3284 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3285 AssemblyCultureAttribute is not used on executable.
3288 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3290 2005-07-16 Raja R Harinath <rharinath@novell.com>
3293 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3294 New. Reports CS0252/CS0253.
3295 Mostly taken from preliminary patch by Duncak Mak.
3296 (Binary.DoResolveOperator): Store results of operator lookup.
3297 Use them to detect if we need to warn about unintended reference
3300 2005-07-15 Raja R Harinath <rharinath@novell.com>
3303 * namespace.cs (Namespace.Lookup): Add back location parameter.
3304 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3305 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3307 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3308 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3309 (Namespace.LookupType): ... this.
3310 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3312 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3313 purported to handle pointers.
3314 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3317 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3319 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3322 2005-07-15 Raja R Harinath <rharinath@novell.com>
3324 * namespace.cs (Namespace.Lookup): Drop location parameter.
3325 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3326 (NamespaceEntry.Lookup): ... this.
3327 (NamespaceEntry.Error_AmbiguousTypeReference):
3328 Move here from DeclSpace.
3329 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3331 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3332 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3333 Move to NamespaceEntry.
3334 * delegate.cs, expression.cs: Update to changes.
3336 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3338 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3339 CheckAttributeType and refactored.
3340 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3341 ResolveAsTypeTerminal error handling.
3342 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3344 (GetSignatureForError): Print errors in same way.
3347 * codegen.cs: Reflect attribute GetSignatureForError change.
3350 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3352 * namespace.cs (UsingEntry): Refactored to make fields private.
3355 statement.cs: Error_UnexpectedKind has extra parameter.
3357 2005-07-14 Raja R Harinath <rharinath@novell.com>
3359 * ecore.cs (IAlias): Remove.
3360 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3361 that implement the interface.
3362 * namespace.cs (Namespace): Likewise.
3363 (Namespace.declspaces): Renamed from 'defined_names'.
3364 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3365 DeclSpace instead of an IAlias.
3366 * tree.cs (Tree.AddDecl): Update.
3368 2005-07-12 Raja R Harinath <rharinath@novell.com>
3370 * statement.cs (Block.Flags); Remove HasVarargs.
3371 (Block.HasVarargs): Move to ToplevelBlock.
3372 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3373 (Block.Variables): Make protected. Initialize variable hashtable
3375 (Block.AddVariable): Update.
3376 (Block.Resolve): Update to changes.
3377 (ToplevelBlock.HasVarargs): New boolean.
3378 (ToplevelBlock.ThisVariable): Move here from Block.
3379 (ToplevelBlock.AddThisVariable): Likewise.
3380 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3381 * expression.cs (This.ResolveBase): Update to changes.
3382 (ArglistAccess.DoResolve): Likewise.
3384 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3387 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3389 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3390 not used and not used & assigned.
3391 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3393 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3396 * expression.cs (Is.DoResolve): null is never provided type.
3398 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3401 * cs-parser.jay: Less strict event error rule to catch more errors.
3403 2005-07-08 Martin Baulig <martin@ximian.com>
3405 Fix test-iter-10.cs - distinguish whether we `yield' in a property
3406 gettter (allowed) or setter (not allowed).
3408 * class.cs (Accessor): Implement IIteratorContainer.
3409 (Accessor.Yields): New public field.
3410 (PropertyBase.PropertyMethod.Define): Handle iterators on a
3414 (get_accessor_declaration, set_accessor_declaration): Set the
3415 `yields' flag on the accessor, not the property.
3416 (property_declaration): Do the iterators check on a per-accessor
3417 basis and not for the whole property.
3419 2005-07-08 Martin Baulig <martin@ximian.com>
3421 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3422 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3424 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3427 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3428 (ExtractSecurityPermissionSet): Cope with self referencing security
3429 attributes properly.
3431 * driver.cs (SetOutputFile): Made public property OutputFile.
3433 2005-07-07 Raja R Harinath <rharinath@novell.com>
3436 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3437 has_nonstatic_fields. Make into a FieldBase pointer.
3438 (TypeContainer.AddField): Add CS0282 check.
3439 (TypeContainer.EmitType): Update.
3441 2005-07-06 Miguel de Icaza <miguel@novell.com>
3443 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3444 compare if they start with __.
3446 2005-07-06 Raja R Harinath <rharinath@novell.com>
3448 * statement.cs (Switch.SwitchGoverningType): Only look at
3449 UserCasts that don't need implicit standard conversions to one of
3450 the allowed switch types (Fixes test-322.cs).
3451 (LocalInfo.Resolve): Re-enable sanity-test.
3453 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3455 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3457 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3459 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3461 2005-07-06 Raja R Harinath <rharinath@novell.com>
3464 * ecore.cs (SimpleName.GetSignatureForError): Add.
3465 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3466 (MemberAccess.GetSignatureForError): Add.
3468 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3470 The big error and warning messages review.
3500 * typemanager.cs: Updated.
3502 * class.cs: (MethodCore.SetYields): Moved here to share.
3503 (PropertyMethod.Define): Moved iterator setup here.
3505 * iterators.cs: Add orig_method to have full access to parent
3508 2005-07-05 Raja R Harinath <rharinath@novell.com>
3510 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3511 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3512 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3513 variable of struct type.
3514 * expression.cs (Unary.ResolveOperator): Update to change.
3515 (Indirection.VerifyFixed): Likewise.
3516 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3517 (ParameterReference.VerifyFixed): Value parameters are fixed.
3518 (This.VerifyFixed): Treat 'this' as a value parameter.
3519 * statement.cs (LocalInfo.IsFixed): Remove.
3521 2005-07-01 Martin Baulig <martin@ximian.com>
3523 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3524 `ec.EmitThis ()' to get the correct scope.
3526 2005-07-01 Martin Baulig <martin@ximian.com>
3528 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3529 instance is a ParameterReference; fixes #75299.
3531 2005-07-01 Martin Baulig <martin@ximian.com>
3533 Reverted Marek's latest patch (r46725):
3534 - it contains structural changes which are neither mentioned in
3535 the ChangeLog nor explained anywhere; for example the additional
3536 argument of EmitContext's and Iterator's .ctor's and the
3537 TypeContainer.DefineMembers() change.
3538 - structural changes like this should go in in seperate patches
3539 and not be hidden in a huge patch which just seems to affect
3540 warnings and errors.
3541 a big and hard to understand patch.
3542 - it breaks iterators and causes regressions, for instance in
3545 2005-06-30 Raja R Harinath <rharinath@novell.com>
3548 * expression.cs (Indexers.map): Remove.
3549 (Indexers.Append): Filter out inaccessible setters and getters.
3550 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3553 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3555 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3556 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3557 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3558 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3560 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3563 * class.cs (FieldBase.GetInitializerExpression): One more field
3566 2005-06-28 Miguel de Icaza <miguel@novell.com>
3568 * pending.cs: Do not define a proxy if the base method is virtual,
3569 it will be picked up by the runtime (bug 75270).
3571 2005-06-08 Martin Baulig <martin@ximian.com>
3573 The big Iterators rewrite :-)
3575 * iterators.cs: Rewrite this to use the anonymous methods framework.
3577 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3578 before the TypeContainers; see 2test-21.cs.
3581 (TypeContainer.DefineType): Don't create a new EmitContext if we
3582 already have one (this only happens if we're an Iterator).
3583 (TypeContainer.Define): Also call Define() on all our iterators.
3584 (Method.CreateEmitContext): Added support for iterators.
3587 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3588 (AnonymousContainer.CreateMethodHost): Moved here from
3589 AnonymousMethod and made abstract.
3590 (AnonymousContainer.CreateScopeType): New abstract method.
3591 (AnonymousContainer.IsIterator): New public property.
3592 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3593 get the ScopeTypeBuilder rather than manually defining it here.
3594 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3597 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3598 before RootContext.DefineTypes().
3600 * codegen.cs (EmitContext.RemapToProxy): Removed.
3601 (EmitContext.CurrentAnonymousMethod): Changed type from
3602 AnonymousMethod -> AnonymousContainer.
3603 (EmitContext.ResolveTopBlock): Protect from being called twice.
3604 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3605 (EmitContext.EmitThis): Removed the iterators hacks; use the
3606 anonymous methods framework for that.
3609 (ToplevelBlock.Container): Make this a property, not a field.
3610 (ToplevelBlock.ReParent): New public method; move the
3611 ToplevelBlock into a new container.
3612 (Foreach.TemporaryVariable): Simplify.
3614 2005-06-05 Martin Baulig <martin@ximian.com>
3616 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3617 (Block.AddTemporaryVariable): New public method; creates a new
3618 `LocalInfo' for a temporary variable.
3619 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3621 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3622 non-iterator variables.
3624 2005-06-05 Martin Baulig <martin@ximian.com>
3626 * statement.cs (Foreach.TemporaryVariable): Create the
3627 LocalBuilder in the Emit phase and not in Resolve since in some
3628 situations, we don't have an ILGenerator during Resolve; see
3629 2test-19.cs for an example.
3631 2005-06-04 Martin Baulig <martin@ximian.com>
3633 **** Merged r45395 from GCS ****
3635 The big Foreach rewrite - Part II.
3637 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3638 with `PropertyInfo ienumerator_getcurrent'.
3640 * codegen.cs (VariableStorage): Removed.
3643 (Foreach): Derive from Statement, not ExceptionStatement.
3644 (Foreach.CollectionForeach): New nested class. Moved all the code
3645 dealing with collection foreach here.
3646 (Foreach.ForeachHelperMethods): Removed.
3647 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3649 2005-05-23 Martin Baulig <martin@ximian.com>
3651 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3652 don't need to. Fix #75014.
3654 2005-05-20 Martin Baulig <martin@ximian.com>
3656 Merged r44808 from GMCS.
3658 * class.cs (TypeContainer.CircularDepException): Removed.
3659 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3660 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3661 (CS0146) and interface (CS0529) dependencies here.
3663 2005-06-21 Raja R Harinath <rharinath@novell.com>
3665 * expression.cs (Invocation.EmitCall): Fix initialization
3666 'this_call' to reflect current behaviour. Fix indentation.
3668 * convert.cs (FindMostEncompassedType): Add two trivial special
3669 cases (number_of_types == 0 || number_of_types == 1).
3670 (FindMostEncompasingType): Likewise.
3672 2005-06-17 Raja R Harinath <rharinath@novell.com>
3674 Some cleanups preparing for the fix of #75283.
3675 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3677 (EventExpr.InstanceResolve): Likewise.
3678 (EventExpr.DoResolve): Remove redundant checks.
3680 2005-06-10 Duncan Mak <duncan@novell.com>
3682 * cs-tokenizer.cs (process_directives): New flag for controlling
3683 the processing of preprocessor directives.
3684 (x_token): After seeing a '#', return Token.NONE instead of going
3685 to handle_preprocessing_directive() when not processing
3686 directives. This avoids unnecessary processing during the token peek in
3691 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3692 the existing error reporting methods instead of Report.Error.
3694 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3695 after Raja's rewrite.
3697 2005-06-08 Miguel de Icaza <miguel@novell.com>
3699 * class.cs: Small fix.
3701 2005-06-08 Raja R Harinath <rharinath@novell.com>
3704 * class.cs (GetPartialBases): Fix return value check of
3707 2005-06-07 Raja R Harinath <rharinath@novell.com>
3709 Ensure that partial classes are registered in their enclosing
3710 namespace. Initial part of fix of #75160.
3711 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3712 Register declspace with namespace here, not in
3713 DeclSpace.RecordDecl.
3714 * cs-parser.jay: Pass namespace to RecordDecl.
3715 * class.cs (PartialContainer.Create): Likewise.
3716 (ClassPart.DefineType): New sanity-check. Throws an exception if
3718 * decl.cs (Declspace.RecordDecl): Remove.
3719 * namespace.cs (NamespaceEntry.DefineName): Remove.
3721 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3723 * rootcontext.cs: Reset TargetExt as well.
3725 2005-06-03 Raja R Harinath <rharinath@novell.com>
3727 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3730 2005-06-02 Raja R Harinath <rharinath@novell.com>
3732 Fix #75080, cs0119.cs.
3733 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3735 (Expression.Resolve): ... this. Use it. Remove bogus code
3736 allowing ExprClass.Type and ExprClass.Namespace for
3737 ResolveFlags.VariableOrValue.
3738 (Expression.Resolve) [1-argument variant]: Change default resolve
3739 flags based on language version.
3740 (Expression.Error_UnexpectedKind): Use a simple string array
3741 rather than an ArrayList.
3742 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3744 (TypeOfVoid.DoResolve): Likewise.
3745 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3746 flags argument -- it always has the same value.
3748 2005-05-31 Raja R Harinath <rharinath@novell.com>
3751 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3752 Use it in the error message.
3753 * assign.cs, expression.cs, statement.cs: Update.
3755 2005-05-30 Raja R Harinath <rharinath@novell.com>
3758 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3759 the "almostMatchedMember" case too.
3760 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3761 that failed the accessibility checks to 'almost_match'.
3763 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3765 * attribute.cs: Use internal MethodBuilder methods to set
3766 ExactSpelling and SetLastError on PInvoke methods, instead
3767 of passing them via charset. Fixes #75060.
3769 2005-05-27 Raja R Harinath <rharinath@novell.com>
3771 * parameter.cs (Parameter): Remove TODO comment.
3772 (Parameter.DefineParameter): Remove Location parameter.
3773 (Parameters.LabelParameters): Likewise.
3774 * class.cs (Constructor.Emit): Update to change.
3775 (MethodData.Emit): Likewise.
3776 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3777 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3779 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3782 Removed Parameters.Location and added Parameter.Location instead.
3783 Removed Location parameter from Emit() and GetSignature().
3790 Modified all related calls.
3792 2005-05-26 Raja R Harinath <rharinath@novell.com>
3794 Improve user-defined conversion handling.
3795 * convert.cs (GetConversionOperators): Rewrite. Return only the
3796 applicable operators.
3797 (AddConversionOperators): New. Helper for GetConversionOperators.
3798 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3799 there is only one most encompassed/encompassing type.
3800 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3801 "applicable operator" handling.
3802 (UserConversion): Move cache here from GetConversionOperators.
3803 Directly cache the chosen operator, rather than the whole
3805 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3806 case. Allow conversion of decimal to sbyte and byte too.
3807 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3808 New static methods. Used to avoid allocating EmptyExpressions in
3811 2005-05-24 Duncan Mak <duncan@novell.com>
3813 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3814 another class, used in Convert.ExplicitNumericConversion.
3815 (CastToDecimal): New class, similar to above, but casts to
3816 System.Decimal, used in Convert.ImplicitNumericConversion and also
3817 in explicit convesion from double/float to decimal.
3819 * convert.cs (ImplicitNumericConversion): Handle implicit
3820 conversions to System.Decimal.
3821 (ExplicitNumericConversion): handle explicit conversions to
3826 2005-05-20 Miguel de Icaza <miguel@novell.com>
3828 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3829 know the type at this stage, just break through. Fixes #75008
3831 2005-05-19 Martin Baulig <martin@ximian.com>
3834 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3835 to disable error reporting.
3837 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3838 here since we don't want to report an error; see the new test-336.cs.
3840 2005-05-19 Raja R Harinath <rharinath@novell.com>
3842 * statement.cs (ToplevelBlock.GetParameterReference)
3843 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3844 Move here from class Block.
3845 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3846 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3848 2005-05-18 Martin Baulig <martin@ximian.com>
3853 (FlowBranching.Reachability): Add non-static public And() and Or()
3855 (FlowBranchingSwitch): New class; do the `break_origins' thing
3856 like in FlowBranchingLoop.
3857 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3858 reachability, not just locals and parameters.
3859 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3860 switch; MergeBreakOrigins() now takes care of that.
3862 2005-05-18 Martin Baulig <martin@ximian.com>
3864 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3865 a loop and may leave it, reset the barrier; fixes #74974.
3867 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3869 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3872 * cs-parser.jay: Catch more lexical errors.
3874 * report.cs: Add one more Error method.
3877 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3879 2005-05-17 Martin Baulig <martin@ximian.com>
3881 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3884 2005-05-16 Raja R Harinath <rharinath@novell.com>
3886 Fix test-382.cs. Emit values of decimal constants.
3887 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3889 (TypeContainer.AddField): ... this.
3890 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3891 with initializers to include 'Const's.
3892 (ClassPart.RegisterFieldForInitialization): Forward to
3894 * const.cs (Const.Const): Pass initializer to base class.
3895 (Const.Define): In case of decimal constants, register them for
3896 initialization in a static constructor.
3898 2005-05-14 Martin Baulig <martin@ximian.com>
3900 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3901 do not call ResolveUnreachable() on unreachable statements in
3902 here, see the comment in the source code.
3904 2005-05-13 Raja R Harinath <rharinath@novell.com>
3907 * expression.cs (BinaryResolveOperator): If one of the operands of
3908 an equality comparison is 'null' and the other is a pointer type,
3909 convert the null to a NullPointer.
3910 * convert.cs (ImplicitReferenceConversion): If the expression is a
3911 NullLiteral and the target type is a pointer type, return a
3912 NullPointer instead.
3913 (ImplicitConversionStandard): Likewise.
3915 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3917 * cs-parser.jay: Set readonly context based on special constructs.
3919 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3920 readonly variable error handling.
3922 * rootcontext.cs (EmitCode): Don't verify members when error
3925 * statement.cs (LocalInfo): Add reaodnly context information.
3926 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3928 2005-05-13 Raja R Harinath <rharinath@novell.com>
3930 * statement.cs (Block.Resolve): Revert change below. Modify fix
3931 for #74041 to initialize 'resolved' to false only for explicit
3932 blocks. Fixes #74873.
3934 2005-05-12 Raja R Harinath <harinath@gmail.com>
3937 * typemanager.cs (unmanaged_enclosing_types): New.
3938 (IsUnmanagedType): Avoid infloops by using
3939 'unmanaged_enclosing_types' to talk with recursive invocations.
3941 2005-05-13 Martin Baulig <martin@ximian.com>
3943 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3944 instance variable, not a local. Fix #74873.
3945 (Block.ResolveUnreachable): Set it to true here.
3947 2005-05-11 Duncan Mak <duncan@novell.com>
3949 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3950 continuing to process for 'arg'.
3951 (handle_preprocessing_directive): Check the argument of the #endif
3952 directive and report error CS1025 if there are any trailing
3955 According to the C# spec, having even whitespace after the #endif
3956 directive is illegal; however, because we call arg.TrimEnd ()
3957 beforehand, we have the same behavior as csc, allowing whitespace
3958 after the directive.
3962 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3966 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3967 (Constructor.GetObsoleteAttribute): Implemented correctly.
3969 2005-05-10 Martin Baulig <martin@ximian.com>
3971 * support.cs (ReflectionParameters.ParameterModifier): Use
3972 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3973 and `ParameterAttributes.In'. Fixes #74884.
3975 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3977 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3979 * expression.cs (Argument.GetParameterModifier): Turned to property.
3980 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3982 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3985 2005-05-09 Raja R Harinath <rharinath@novell.com>
3988 * decl.cs (MemberCache.AddMethods): Register override methods,
3989 rather than non-override methods.
3990 * typemanager.cs (RegisterOverride): New.
3991 (IsOverride): Update.
3993 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3997 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3998 recursive declaration.
4000 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4002 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4004 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4006 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4008 2005-05-05 Raja R Harinath <rharinath@novell.com>
4011 * decl.cs (DeclSpace.FamilyAccessible):
4012 Use TypeManager.IsNestedFamilyAccessible.
4014 Fix reopened #64812.
4015 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4018 2005-05-04 Raja R Harinath <rharinath@novell.com>
4019 Abin Thomas <projectmonokochi@rediffmail.com>
4020 Anoob V E <projectmonokochi@rediffmail.com>
4021 Harilal P R <projectmonokochi@rediffmail.com>
4024 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4025 allow access to all static members.
4027 2005-05-04 Martin Baulig <martin@ximian.com>
4029 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4031 2005-05-04 Martin Baulig <martin@ximian.com>
4035 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4036 section at the end; make things work if `default' is not the last
4039 2005-05-04 Martin Baulig <martin@ximian.com>
4043 * statement.cs (Switch): Replaced the `got_default' field with a
4044 `default_section' one.
4045 (Switch.CheckSwitch): Set `default_section' here.
4046 (Switch.Resolve): If we're a constant switch and the constant is
4047 not found, use the default section.
4049 2005-05-03 Martin Baulig <martin@ximian.com>
4051 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4053 * statement.cs (Foreach.ArrayForeach): New nested class.
4054 (Foreach.TemporaryVariable): New nested class.
4055 (Foreach.EmitArrayForeach): Removed; this is now in the new
4058 2005-05-03 Raja R Harinath <rharinath@novell.com>
4060 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4062 (VerifyPendingMethods): Revert change below.
4064 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4065 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4066 that used to trigger warning -28. Remove warning -28.
4067 * expression.cs (Invocation.OverloadResolve): Use
4068 TypeManager.IsOverride to distinguish override methods.
4071 * pending.cs (VerifyPendingMethods): If a base type implements the
4072 requested interface, don't bother checking individual methods of
4073 the base type. As a side-effect, this prevents the creation of
4074 unnecessary proxies.
4076 2005-05-02 Martin Baulig <martin@ximian.com>
4080 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4081 Also `And' the locals if the old vector is null.
4082 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4083 null; in this case we basically reset all the variables.
4085 2005-05-02 Martin Baulig <martin@ximian.com>
4089 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4090 Added `FlowBranching branching' argument; always `and' the
4091 variables instead of `or'ing them unless we're an infinite loop.
4093 * statement.cs (While.Resolve): Create a new sibling unless we're
4096 2005-05-02 Martin Baulig <martin@ximian.com>
4100 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4101 arguments; use it instead of creating a new TopLevelBlock.
4102 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4103 our ConstructorInitializer.
4106 (TopLevelBlock.TopLevelBranching): New public property.
4107 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4108 and create our `TopLevelBranching'.
4110 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4111 anonymous method host, use `block.TopLevelBranching' rather than
4112 creating a new branching.
4114 2005-04-20 Miguel de Icaza <miguel@novell.com>
4116 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4117 a ScopeInfo, if any of the current children is a child of the new
4118 entry, move those children there.
4120 2005-04-30 Martin Baulig <martin@ximian.com>
4122 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4123 at the beginning of a SwitchSection. Fix #73335.
4125 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4128 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4130 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4131 (FieldExpr.DoResolve): Obsolete members are ignored for field
4134 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4136 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4137 of arrays detection.
4139 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4141 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4143 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4146 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4148 * cs-parser.jay: Use the prefered version of -unsafe in error
4151 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4153 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4156 2005-04-20 John Luke <john.luke@gmail.com>
4158 * driver.cs: fix typo in error message, --outout to --output
4160 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4162 * codegen.cs (InRefOutArgumentResolving): New field.
4164 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4165 fields outside contructor.
4167 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4169 2005-04-19 Miguel de Icaza <miguel@novell.com>
4171 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4172 parameter code was not completed ever, so it was not as up-to-date
4173 as local variables. Must finish it.
4175 The bug fix was to compare the Toplevel of the block, not the
4176 current block. Thanks for Ben for pointing this out.
4178 2005-04-19 Raja R Harinath <rharinath@novell.com>
4180 * decl.cs (AddMethods): Use the declaring type of the problem
4181 method to determine if we want to squash a warning.
4183 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4185 * attribute.cs: Removed debug output.
4187 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4189 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4192 2005-04-18 Raja R Harinath <rharinath@novell.com>
4195 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4196 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4197 all null comparisons against reference types.
4199 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4202 * class.cs (TypeContainer.CircularDepException) New nested
4204 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4205 (TypeContainer.DefineType): Removed error, reset InTransit before
4207 (Class.DefineType): Throw exception when is in Transit.
4208 Catch exception and report error.
4209 (Struct.DefineType): Throw exception when is in Transit.
4210 Catch exception and report error.
4211 (Interface.DefineType): Throw exception when is in Transit.
4212 Catch exception and report error.
4214 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4215 handle nested exception handlers.
4217 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4220 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4221 InFinally and InCatch storage.
4223 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4224 (Catch.Resolve): Set and Restore ec.InCatch.
4225 (Try.Resolve): Set and Restore ec.InFinally.
4226 (Try.HasCatch): True when try has catch.
4228 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4230 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4231 for the same event member, so exclude such cases from warning 419.
4234 2005-04-16 Miguel de Icaza <miguel@novell.com>
4236 * expression.cs (Binary.ResolveOperator): Apply patch from John
4237 Luke to fix bug 59864: operators &, | and ^ on enumerations
4238 require that the same enum type on both sides.
4240 * driver.cs: Add warnings to old flag usage, this is to assist
4241 people who produce Makefiles and hope that the Makefiles will be
4244 * class.cs (TypeContainer.EmitType): Moved the definition of the
4245 special $PRIVATE$ field from the resolve phase to the Emit phase.
4246 During resolve we do not know if we are a struct with
4247 HasExplicitLayout, we know this only after the attributes for the
4250 Set the FieldOffset to zero on the dummy field that we create for
4251 the class. Fixes 74590.
4253 2005-04-16 Raja R Harinath <rharinath@novell.com>
4256 * ecore.cs (PropertyExpr.resolved): New.
4257 (DoResolve): Use it to handle a case of double resolution here.
4258 Handle a case of identical-name-and-type-name.
4259 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4260 resolution by storing the results of expression resolution back
4261 into the "probes" array.
4263 2005-04-15 Raja R Harinath <rharinath@novell.com>
4265 Fix cs0208-7.cs and cs0208-8.cs.
4266 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4267 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4268 error reporting to point out the reason a struct is not unmanaged.
4270 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4272 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4273 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4275 2005-04-13 Raja R Harinath <rharinath@novell.com>
4278 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4279 IdenticalNameAndTypeName here.
4280 (EventExpr.InstanceResolve): Likewise.
4282 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4284 C# 2.0 DefaultCharSetAttribute implementation
4286 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4287 which allows us to set GlobalNamespace for every resolve.
4288 (Attribute.ResolveArguments): Cut from Resolve.
4289 (Attribute.GetCharSetValue): Returns CharSet named argument.
4290 (Attribute.DefinePInvokeMethod): Gets default charset from
4292 (GlobalAttribute.ResolveAsTypeStep): Override.
4293 (GlobalAttribute.ResolveArguments): Override.
4295 * class.cs (TypeAttr): Is protected.
4297 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4298 (ModuleClass.DefaultCharSetType): New memeber.
4299 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4301 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4302 charset from module.
4304 * delegate.cs (TypeAttr): Override.
4305 (Delegate.DefineType): Use this TypeAttr.
4307 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4308 at very early stage (before types are defined) to resolve model
4309 module attributes. It will probably not work with corlib but it
4312 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4313 charset from module.
4315 * typemanager.cs (default_charset_type): New type.
4317 2005-04-13 Raja R Harinath <rharinath@novell.com>
4319 * decl.cs (MemberCache.AddMethods): Don't warn if
4320 System.Object.Finalize has buggy MethodAttributes.
4322 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4325 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4327 * doc.cs : detect ambiguous reference to overloaded members.
4328 Fixed bug #71603. MS 1.1 csc does not detect it.
4330 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4332 * doc.cs : delegates must not be referenced with parameters.
4335 2005-04-12 Miguel de Icaza <miguel@novell.com>
4337 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4339 2005-04-10 Miguel de Icaza <miguel@novell.com>
4341 * driver.cs (MainDriver): Stop processing if the CLS stage found
4344 (CompilerCallableEntryPoint.InvokeCompiler): Always
4345 reset after execution; Take a TextWriter argument for the
4348 * report.cs: Use the error stream instead of hardcoding stderr.
4350 2005-04-09 Miguel de Icaza <miguel@novell.com>
4352 * class.cs: Reduce code paths to test, too small of an
4353 optimization to make it worth the extra testing. Always perform
4356 2005-04-08 Raja R Harinath <rharinath@novell.com>
4359 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4360 operators that had errors reported on them.
4362 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4364 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4366 (Attribute.Resolve): Add named argument type checking.
4368 * class.cs (FixedField.Define): Use IsPrimitiveType
4370 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4372 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4373 unsafe parameter types.
4375 * statement.cs (Using.ResolveExpression): Add better error description.
4377 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4379 2005-04-08 Raja R Harinath <rharinath@novell.com>
4382 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4383 AttributeUsageAttribute in the emitcontext of the attribute class,
4384 not in the emitcontext of the attributable entity it was attached to.
4385 * cs-parser.jay: Use 'current_class', not 'current_container',
4386 when creating a GlobalAttribute.
4388 2005-04-08 Alp Toker <alp@atoker.com>
4390 * pending.cs: The fix to #58413 failed to compile methods implementing
4391 interfaces with/without params modifiers and vice versa, even though
4392 params modifiers aren't part of the signature. Make the modifier check
4393 less strict as in csc.
4395 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4396 Anoob V E <projectmonokochi@rediffmail.com>
4397 Harilal P R <projectmonokochi@rediffmail.com>
4400 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4401 modifiers of pending methods.
4402 (PendingImplementation.PendingImplementation): Initialize it.
4403 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4404 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4405 with ParameterData. Add check for modifiers.
4406 * class.cs (MethodData.Define): Update to changes.
4408 2005-04-07 Raja R Harinath <rharinath@novell.com>
4410 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4412 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4414 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4417 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4420 * typemanager.cs: Registered RequiredAttributeAttribute.
4422 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4424 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4425 Warning CS0169 is back at level 3.
4426 (IMethodData.SetMemberIsUsed): New method.
4428 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4429 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4431 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4433 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4435 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4438 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4441 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4442 to avoid the problems with nested types.
4444 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4445 Anoob V.E <projectmonokochi@rediffmail.com>
4446 Harilal P.R <projectmonokochi@rediffmail.com>
4447 Raja R Harinath <rharinath@novell.com>
4450 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4452 * typemanager (GetConstructor): Make public.
4454 2005-04-05 John Luke <john.luke@gmail.com>
4455 Raja R Harinath <rharinath@novell.com>
4458 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4459 struct too. Return false quicker in a few cases.
4460 (VerifyUnManaged): Use it.
4462 2005-04-05 Raja R Harinath <rharinath@novell.com>
4465 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4466 not 'unreachable_seen'.
4468 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4470 * attribute.cs (Attribute.GetValue): Removed unused.
4472 * codegen.cs (CodeGen.TrimExt): Removed unused.
4474 * cs-parser.jay (output): Removed unused.
4476 * cs-tokenizer.cs (hex_digits): Removed unused.
4478 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4480 * expression.cs (Indirection.LoadExprValue): Removed unused.
4481 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4483 * iterators.cs (Iterator.param_types): Removed unused.
4485 * statement.cs (Goto.block): Removed unused.
4486 (ToplevelBlock.did): Removed unused.
4487 (Switch.ResolveConstantSwitch): Removed unused.
4489 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4491 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4494 2005-04-01 Raja R Harinath <rharinath@novell.com>
4496 Fix #74232 and cs0208-3.cs.
4497 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4498 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4499 unmanaged type. Don't use FieldBuilders when 't' is a
4500 TypeBuilder. Use ModFlags and MemberType fields.
4501 * class.cs (MemberBase.member_type): Rename from MemberType.
4502 (MemberBase.MemberType): New property. Determines member_type on
4504 (MemberBase.DoDefine): Don't initialize MemberType here.
4505 (FieldMember.Define): Likewise.
4507 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4510 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4511 Attributes are emitted there.
4513 2005-04-01 Raja R Harinath <rharinath@novell.com>
4515 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4516 keyword in 'partial enum' too.
4517 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4519 Report from Kamil Skalski <nazgul@omega.pl>.
4522 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4523 have partial containers too.
4525 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4526 in block' checks to Block.CheckInvariantMeaningInBlock.
4527 * statement.cs (Block.GetKnownVariableInfo): Make private.
4528 (Block.IsVariableUsedInChildBlock): Remove.
4529 (Block.IsVariableUsedInBlock): Likewise.
4530 (Block.CheckInvariantMeaningInBlock): New. Show location of
4531 conflicting declaration.
4532 (Block.AddVariable): Make error messages less long-winded and more
4533 specific. Show location of conflicting declaration.
4534 * parameter.cs (Parameters.Location): New readonly property.
4536 2005-03-31 Raja R Harinath <rharinath@novell.com>
4538 Clean up semantics of invoking ResolveMemberAccess.
4539 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4540 can have an instance, ensure that we pass in a non-TypeExpression
4541 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4542 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4543 argument. Update to changes and simplify.
4544 (FieldExpr.Emitinstance): Remove CS0120 check.
4545 (PropertyExpr.EmitInstance): Likewise.
4546 * expression.cs (Argument.Resolve): Likewise.
4547 (Invocation.DoResolve): Update to changes in semantics of
4550 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4553 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4556 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4558 2005-03-31 Raja R Harinath <rharinath@novell.com>
4560 Fix difference in behaviour with commandline invocation.
4561 * driver.cs (Driver.Reset): New.
4562 (CompilerCallableEntryPoint): Call it.
4564 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4565 variable" warnings if the boolean expression failed to resolve.
4567 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4569 * attribute.cs: Fix the union of several permissions when some of them
4570 are unrestricted (so the result isn't an unrestricted permission set).
4573 2005-03-30 Raja R Harinath <rharinath@novell.com>
4575 * ecore.cs (MemberExpr): New class. Convert from interface
4577 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4578 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4580 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4581 (MethodGroupExpr.IsExplicitImpl): Remove.
4582 (Expression.GetFieldFromEvent): Remove.
4583 (SimpleName.MemberStaticCheck): Remove.
4584 (SimpleName.DoSimpleNameResolve): Update to changes.
4585 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4586 (MemberAccess.IdenticalNameAndTypeName): Remove.
4587 (MemberAccess.error176): Move to MemberExpr.
4588 (MemberAccess.DoResolve): Update to changes.
4589 (BaseAccess.DoResolve): Likewise.
4591 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4593 C# 2.0 Conditional attribute class implementation
4595 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4596 Analyzes class whether it has attribute which has ConditionalAttribute
4597 and its condition is not defined.
4599 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4600 (Class.IsExcluded): New method. Search for at least one defined
4601 condition in ConditionalAttribute of attribute class.
4603 2005-03-30 Raja R Harinath <rharinath@novell.com>
4605 * ecore.cs (PropertyExpr): Derive from Expression, not
4606 ExpressionStatement.
4607 (PropertyExpr.EmitStatement): Remove.
4609 2005-03-29 Raja R Harinath <rharinath@novell.com>
4612 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4613 internal field "value__" of an enum be private. The examples for
4614 "value__" that I found on MSDN all used FieldAttributes.Private.
4616 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4617 Don't mention IL method attribute names.
4619 Fix #47991. Remove a TODO.
4620 * statement.cs (Block.Toplevel): Make into a field.
4621 (Block.Parameters): Move into ToplevelBlock.
4622 (Block.known_variables): Rename from child_variable_names.
4623 (Block.Block): Remove variants that take Parameters. Initialize
4624 'Toplevel' with the immediately surrounding toplevel block.
4625 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4626 LocalInfo parameter.
4627 (Block.GetKnownVariableInfo): New.
4628 (Block.IsVariableNameUsedInChildBlock): Update.
4629 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4630 the block, even though it may not be in scope.
4631 (Block.AddVariable): Remove Parameters parameter. Use
4632 Toplevel.Parameters instead.
4633 (Block.AddConstant): Remove Parameters parameter.
4634 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4635 (Block.IsParamaterReference): Likewise.
4636 (Block.IsLocalParameter): Likewise. Simplify a lot.
4637 (ToplevelBlock.Parameters): New. Moved from Block.
4638 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4639 initialize Parameters to a non-null value.
4640 * cs-parser.jay: Update to changes.
4641 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4642 simple names that mean different things in the same block. Use
4643 Block.IsVariableNameUsedInBlock.
4645 2005-03-28 Raja R Harinath <rharinath@novell.com>
4647 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4648 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4649 GetTypeHandle. It is possible for a reflected type to derive from
4650 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4651 System.Array during mscorlib compilation).
4652 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4653 contain a method_hash, don't create one either. Don't create a
4654 deep copy of the base cache's method_hash.
4655 (MemberCache.SetupCache): Rename back from DeepCopy.
4656 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4657 already initialized. If we see an override function, add its
4658 underlying base virtual function to the member_hash too.
4660 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4662 2005-03-26 Raja R Harinath <harinath@acm.org>
4665 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4666 fails to resolve, ensure that the LHS is still resolved as an
4669 2005-03-25 Raja R Harinath <harinath@acm.org>
4671 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4673 (Enum.current_ec): Remove.
4674 (Enum.LookupEnumValue): Remove EmitContext argument.
4675 Just uses the one created during DefineType.
4676 (Enum.FindMembers): Update.
4677 * expression.cs (MemberAccess.DoResolve): Update.
4679 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4681 * assign.cs (Assign.DoResolve): Check for CS1717 when
4682 source and target are same (uses Equals).
4684 * expression.cs (LocalVariableReference, ParameterReference,
4685 This): Implemented Equals, GetHashCode.
4687 * statement.cs (Block.GetParameterReference): Removed useless
4690 2005-03-22 Raja R Harinath <rharinath@novell.com>
4693 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4694 blocks before deciding whether the error is cs0136 or cs0128.
4696 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4697 (using_alias_directive, using_namespace_directive): Pass
4698 MemberName, not an expression to Namespace.UsingAlias and
4700 (MakeName): Use the MemberName of the namespace.
4701 * namespace.cs (Namespace.MemberName): New.
4702 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4703 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4705 * decl.cs (MemberName.Name): Make readonly.
4706 (MemberName.FromDotted): New "constructor".
4707 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4708 (MemberCore.Name): Compute from MemberName on demand.
4709 (MemberCore.SetMemberName): Provide a way to change the
4711 (MemberCore.AddToContainer): Don't take a fullname parameter.
4712 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4713 fully qualified name of the container to the member name.
4714 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4715 only if the type is a member of the root container.
4716 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4717 MemberName.Left rather than searching for an embedded ".".
4718 (PartialContainer.CreatePart): Update to changes in RootContext.
4719 (MemberBase.ShortName): Turn into a property. Use
4720 MemberCore.SetMemberName.
4721 (MemberBase.ExplicitInterfaceName): Remove.
4722 (MemberBase.UpdateMemberName): Remove.
4723 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4724 (PropertyBase.SetMemberName): New override.
4725 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4726 (Tree.GetDecl): New.
4727 (Tree.AllDecls): Rename from Decls.
4728 * attribute.cs, enum.cs, report.cs: Update to changes.
4729 * driver.cs (MainDriver): Use MemberName.FromDotted on
4730 RootContext.MainClass.
4732 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4734 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4737 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4739 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4741 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4742 property accessor modifiers.
4744 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4745 fixed buffer attribute (CS1716).
4746 (PropertyMethod.HasCustomAccessModifier): When property accessor
4747 has custom modifier.
4749 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4751 (PropertyExpr.DoResolveLValue): Add CS0272.
4753 2005-03-17 Miguel de Icaza <miguel@novell.com>
4755 * convert.cs: When converting to a pointer, use the proper Conv.U
4756 or Conv.I depending on the source data type.
4758 * cs-tokenizer.cs: Make the size for large decimal constants,
4761 2005-03-17 Martin Baulig <martin@ximian.com>
4763 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4764 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4766 2005-03-17 Martin Baulig <martin@ximian.com>
4768 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4769 to bool so we can return an error condition.
4770 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4773 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4775 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4778 2005-03-16 Raja R Harinath <rharinath@novell.com>
4780 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4781 Refactor to avoid traversing the list of assemblies, and to avoid
4782 string concatenation.
4783 * typemanager.cs (guid_attr_type): Remove.
4784 (negative_hits, pointers, references): Remove hashes.
4786 (GetConstructedType): New. Uses type_hash to handle constructed
4787 types (arrays, references, pointers).
4788 (GetReferenceType, GetPointerType): Use it.
4789 (GetNestedType): New. Uses type_hash to handle nested types of
4791 (LookupType, LookupTypeDirect): Remove.
4792 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4793 'types' hash and LookupTypeReflection directly.
4794 (params_string, params_object): Use GetConstructedType.
4795 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4797 (Namespace.Lookup): Use cached_types.
4798 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4799 provided by old TypeManager.LookupType.
4800 * rootcontext.cs (MakeFQN): Remove.
4801 * decl.cs (DeclSpace.MakeFQN): Likewise.
4802 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4803 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4804 TypeManager.GetConstructedType.
4805 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4807 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4809 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4812 * cs-parser.jay: Reports CS1527 for any namespace element.
4814 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4817 * expression.cs (ParameterReference.IsAssigned): Changed error to
4819 (Error_WrongNumArguments): Moved CS0245 detection here.
4821 * statement.cs (Return.Resolve): Add CS1622 report.
4823 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4825 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4827 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4829 * attribute.cs expression.cs: Get rid of some allocations.
4831 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4833 * doc.cs : just eliminate the latest change.
4835 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4837 * doc.cs : commented out the latest change. It breaks xml-030.cs
4839 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4841 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4842 fail. So invoke CreateType() in FindDocumentedType().
4844 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4846 * cs-tokenizer.cs : added IsKeyword().
4847 * doc.cs : Detect keyword incorrectly used as identifier.
4848 Allow identifiers prefixed by @.
4850 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4852 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4853 It caused exception in namespace resolving (again!).
4855 * class.cs (Class.ctor): Removed exit.
4856 (PropertyMethod.ctor): ditto.
4858 * codegen.cs (Codegen.Reset): Reset static data.
4859 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4861 * cs-tokenizer.cs (Cleanup): Removed.
4863 * driver.cs (GetSystemDir): Rewrote to one line command.
4864 It caused problem with unloaded dynamic modules.
4865 (UnixParseOption): Removed Exit.
4866 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4867 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4868 Now can be mcs used as library.
4870 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4873 * location.cs (Reset): Reset static data.
4875 * namespace.cs (Reset): Reset static data.
4877 * report.cs (Report.Reset): Reset static data.
4879 * rootcontext.cs (RootContext.Reset): Reset static data.
4881 * tree.cs (RootTypes.ctor): Use Location.Null
4883 * typemanager.cs (TypeManager.Reset): Reset static data.
4884 (CoreLookupType): Removed Exit.
4885 (TypeHandle.Reset): Reset static data.
4887 2005-03-10 Raja R Harinath <rharinath@novell.com>
4890 * typemanager.cs (ComputeNamespaces): Import namespaces from
4891 referenced modules too.
4893 2005-03-09 Raja R Harinath <rharinath@novell.com>
4895 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4898 2005-03-09 Raja R Harinath <rharinath@novell.com>
4900 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4901 enclosing DeclSpace. This ensures that a name-lookup populates
4902 more caches and there are fewer 'TypeExpression's. Carve out
4903 nested type lookup into ...
4904 (LookupNestedTypeInHierarchy): ... this.
4906 2005-03-09 Raja R Harinath <rharinath@novell.com>
4908 Clean up a few partial-class semantics.
4909 Fixes test-357.cs and cs1618-2.cs.
4910 * cs-parser.jay (struct_declaration): Use 'current_class' as
4911 parent of newly-created struct. Remove call to Register ().
4912 Use 'pop_current_class' to complete handing the current struct.
4913 (interface_declaration): Likewise.
4914 (class_declaration): Likewise.
4915 (enum_declaration): Use 'current_class' as parent of newly created
4917 (delegate_declaration): Likewise.
4918 (pop_current_class): New function. This is used to handle closing
4919 up the 'current_class' and 'current_container', and pointing them
4920 to the enclosing class/container.
4921 (CSharpParser): Initialize 'current_class' too.
4922 * decl.cs (MemberCore): Add check for invariant: a partial
4923 container is not a parsed entity, and thus does not enclose any
4925 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4926 (DeclSpace.BaseTypeExpr): Use it.
4927 (DeclSpace.LookupType): Add check for invariant.
4928 * class.cs (TypeContainer): Add check for invariant: a nested
4929 class should have the same NamespaceEntry as its enclosing class.
4930 (TypeContainer.EmitFieldInitializers): Make virtual.
4931 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4933 (TypeContainer.Register): Remove.
4934 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4935 null. Use TypeResolveEmitContext for resolving base types and
4936 interfaces. Move initialization of Parts.TypeBuilder here from
4938 (TypeContainer.DefineNestedTypes): ... here.
4939 (PartialContainer): Take a Namespace not a NamespaceEntry.
4940 (PartialContainer.Create): Don't use Register. Call the
4941 appropriate Add... function directly.
4942 (ClassPart): Take both the PartialContainer and the enclosing
4943 class as constructor arguments.
4944 (ClassPart.EmitFieldInitializers): Override.
4945 (ClassPart.PartFindNestedTypes): Remove.
4946 (FieldBase.GetInitializerExpression): Resolve the initializer
4947 expression in the emit context of the enclosing class.
4948 * tree.cs (RootTypes): Remove Register ().
4950 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4952 * cs-parser.jay: Removed CS0134.
4954 * driver.cs: Removed CS1901.
4956 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4957 for predefined types.
4959 2005-03-07 Duncan Mak <duncan@novell.com>
4961 * codegen.cs (Save): Catch UnauthorizedAccessException as
4962 well. Fixes bug #73454.
4964 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4966 * cs-tokenizer.cs (xtoken): Add CS1035.
4968 * class.cs (MethodData.Define): Add CS0683.
4969 (FieldMember.ctor): Add CS0681.
4971 2005-03-07 Raja R Harinath <rharinath@novell.com>
4973 * ecore.cs (SimpleName.DoResolve): Rename from
4974 SimpleName.DoResolveAllowStatic.
4975 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4976 Pass 'intermediate' flag to MemberStaticCheck.
4977 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4978 of "intermediate" lookups via MemberAccess.
4979 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4980 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4982 2005-03-07 Raja R Harinath <rharinath@novell.com>
4985 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4986 slipped in because of variable names that are identical to a
4987 builtin type's BCL equivalent ('string String;', 'int Int32;').
4988 (PropertyExpr.EmitInstance): Likewise.
4990 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4992 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4994 * report.cs (warning_ignore_table): Made public.
4996 2005-03-04 Raja R Harinath <rharinath@novell.com>
4999 * class.cs (MethodData.Emit): Pass 'container' to
5000 container.GetObsoleteAttribute instead of 'container.Parent'.
5002 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5004 * cs-parser.jay: Add 1534 error test.
5006 * iterators.cs (Yield.CheckContext): Add error 1629.
5007 (Iterator.ctor): Save unsafe modifier.
5008 (MoveNextMethod.DoEmit): Restore unsafe context.
5010 * namespace.cs (UsingAlias): Better error message.
5012 2005-03-03 Dan Winship <danw@novell.com>
5014 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5015 the warning message [#73219]
5017 2005-03-03 Raja R Harinath <rharinath@novell.com>
5019 Fix compile with MCS 1.0.0.0.
5020 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5021 w_restore to not depend on string constant folding.
5023 2005-03-03 Raja R Harinath <rharinath@novell.com>
5025 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5026 CS0246 check to users who passed 'silent = false'.
5027 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5029 (SimpleName.SimpleNameResolve): Update.
5030 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5031 (MemberAccess.IdenticalNameAndTypeName): Update.
5032 * doc.cs (FindDocumentedTypeNonArray): Update.
5034 2005-03-03 Raja R Harinath <rharinath@novell.com>
5036 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5037 * parameters.cs (ComputeAndDefineParameters): Remove.
5038 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5039 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5040 Use GetParameterInfo.
5042 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5044 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5046 2005-03-02 Raja R Harinath <rharinath@novell.com>
5048 Unify DeclSpace.LookupType and DeclSpace.FindType.
5049 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5050 is in charge of defining nested types on demand.
5051 (DeclSpace.LookupType): Use it when the current_type is a
5052 TypeBuilder. Use LookupTypeDirect for reflected types.
5053 (DeclSpace.FindType): Remove.
5054 (DeclSpace.LookupInterfaceOrClass): Likewise.
5055 (DeclSpace.DefineTypeAndParents): Likewise.
5056 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5057 DeclSpace.LookupType.
5058 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5059 * typemanager.cs (LookupType): Simplify.
5060 (AddUserType): Remove type from negative_hits.
5061 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5062 * class.cs (TypeContainer.FindMembers): Move handling of nested
5064 (TypeContainer.FindMembers_NestedTypes): ... here.
5065 (TypeContainer.FindNestedType): Implement override.
5066 (ClassPart.FindNestedType): Delegate to PartialContainer.
5067 (ClassPart.PartFindNestedType): Looks up the nested types of the
5070 2005-03-02 Martin Baulig <martin@ximian.com>
5072 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5073 static constructor in static classes.
5075 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5077 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5078 sizeParamIndex is not specified.
5080 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5083 * report.cs (WarningMessage.IsEnabled): Missing null check.
5085 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5087 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5088 in the fields and not in the properties.
5090 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5092 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5095 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5097 * attribute.cs: Small refactoring (improved robustness).
5098 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5099 (ValidateGuid): Removed.
5100 (Resolve): Removed referenced to above mentioned.
5101 (GetAttributeUsage): Made private and changed to work without
5103 (GetIndexerAttributeValue): Don't crash.
5104 (GetConditionalAttributeValue): Ditto.
5105 (GetClsCompliantAttributeValue): Ditto.
5106 (ExtractSecurityPermissionSet): All attributes exceptions are
5108 (GetPropertyValue): New helper.
5109 (GetMethodImplOptions): New method.
5110 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5111 some missing properties.
5113 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5114 (Method.ApplyAttributeBuilder): Updated.
5116 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5119 2005-02-28 Raja R Harinath <rharinath@novell.com>
5122 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5123 non-simple types (array, pointer, reference).
5125 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5127 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5129 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5131 (Method.CheckBase): Catch wrong destructor here.
5132 (MethodData.Define): Add errors 550, 668.
5134 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5136 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5138 * pending.cs (VerifyPendingMethods): Add error 551.
5140 * typemanager.cs (CSharpName): Next error report helper.
5142 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5144 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5145 attributes. Removed useless attribute double check.
5146 It saves almost 2MBs for corlib.
5148 2005-02-25 Raja R Harinath <rharinath@novell.com>
5151 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5152 called twice in case of error.
5154 2005-02-23 Chris Toshok <toshok@ximian.com>
5156 Fix compiler portions of #72827.
5157 * statement.cs (Block.Emit): call Begin/EndScope on the
5158 EmitContext instead of the ILGenerator.
5160 * codegen.cs (EmitContext.BeginScope): new method, call
5161 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5163 (EmitContext.BeginScope): same, but EndScope and CloseScope
5165 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5166 offset and call the superclass's OpenScope(int) with it.
5167 (SymbolWriter.CloseScope): get the current il
5168 offset and call superclass's CloseScope(int) with it.
5170 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5172 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5173 CS1677 for out and ref as well.
5175 * class.cs (Method.Define): Add error CS1599 detection.
5177 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5179 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5181 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5183 * support.cs.cs (ModifierDesc): New helper method.
5185 2005-02-23 Raja R Harinath <rharinath@novell.com>
5186 Abin Thomas <projectmonokochi@rediffmail.com>
5187 Anoob V E <projectmonokochi@rediffmail.com>
5188 Harilal P R <projectmonokochi@rediffmail.com>
5191 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5192 MemberLookup (used for error reporting) actually returns a result.
5193 Fix error report number (122, not 112).
5195 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5196 Anoob V E <projectmonokochi@rediffmail.com>
5197 Harilal P R <projectmonokochi@rediffmail.com>
5200 * pending.cs (PendingImplementation.GetAbstractMethods):
5201 Find NonPublic members too.
5203 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5205 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5208 * class.cs (MethodCore.CheckMethodAgainstBase):
5209 Add error 239 report.
5211 2005-02-21 Raja R Harinath <rharinath@novell.com>
5214 * expression.cs (Invocation.IsApplicable): Make public.
5215 (Invocation.IsParamsMethodApplicable): Likewise.
5216 * delegate.cs (Delegate.VerifyApplicability): Don't use
5217 Invocation.VerifyArgumentCompat for parameter applicability
5218 testing. Use Invocation.IsApplicable and
5219 Invocation.IsParamsMethodApplicable.
5221 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5223 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5225 * class.cs (Operator.Define): Add error 217 report.
5227 2005-02-21 Raja R Harinath <rharinath@novell.com>
5229 * namespace.cs (UsingEntry.Resolve): Undo change below.
5231 2005-02-21 Raja R Harinath <rharinath@novell.com>
5234 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5235 disable the error message when the extended MemberLookup also
5237 (Expression.MemberLookupFinal): Update.
5238 (SimpleName.DoSimpleNameResolve): Update.
5239 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5240 Don't use MemberLookupFinal.
5241 (New.DoResolve): Update.
5242 (BaseAccess.CommonResolve): Update.
5244 2005-02-21 Raja R Harinath <rharinath@novell.com>
5247 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5248 occured previously, don't resolve again.
5250 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5253 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5254 argument. Call ResolveAttributeUsage for unresolved.
5255 when types doesn't match ctor arguments.
5257 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5258 for nested attribute classes.
5259 (Class.attribute_usage): Removed.
5260 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5261 for attribute class.
5263 * ecore.cs (IsAttribute): Removed.
5265 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5267 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5269 (attribute_types): Removed.
5270 (EmitCode): Global attributes are emited as the latest.
5272 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5274 * class.cs (EmitFieldInitializers): Don't emit field initializer
5275 for default values when optimilization is on.
5277 * constant.cs (Constant.IsDefaultValue): New property.
5279 * driver.cs: Add /optimize handling.
5283 * literal.cs: Implement new IsDefaultValue property.
5285 * rootcontext.cs (Optimize): New field, holds /optimize option.
5287 2005-02-18 Raja R Harinath <rharinath@novell.com>
5289 Fix crasher in re-opened #72347.
5290 * namespace.cs (Namespace.Lookup): Return null if
5291 DeclSpace.DefineType returns null.
5294 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5296 2005-02-18 Raja R Harinath <rharinath@novell.com>
5298 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5299 now returns null if it cannot resolve to an lvalue.
5300 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5301 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5302 returned null. Remove check for SimpleName.
5303 (EventExpr.DoResolveLValue): New.
5304 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5305 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5307 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5309 (Unary.ResolveOperator): Move CS0211 check ...
5310 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5312 (Unary.DoResolveLValue): Simplify.
5313 (AddressOf.DoResolveLValue): New.
5314 (ArrayAccess.DoResolveLValue): New.
5316 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5318 * attribute.cs (Attribute.Resolve): Add arguments casting for
5319 when types doesn't match ctor arguments.
5321 2005-02-16 Raja R Harinath <rharinath@novell.com>
5323 Fix parts of #63202.
5324 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5325 lookup of operator in base type. Ensure that all checks happen
5326 when the operator resolves to an "op_..." method.
5328 2005-02-15 Raja R Harinath <rharinath@novell.com>
5331 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5332 'ignore_cs0104' parameter. Pass it to ...
5333 (NamespaceEntry.Lookup): ... this.
5334 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5335 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5336 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5337 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5338 Update. Request that cs0104 errors be ignored.
5339 (ComposedCast.ResolveAsTypeStep): Update.
5341 2005-02-14 Raja R Harinath <rharinath@novell.com>
5344 * expression.cs (Invocation.BetterFunction): Remove support for
5345 comparing virtual functions and their overrides.
5346 (Invocation.IsOverride): New.
5347 (Invocation.OverloadResolve): Don't consider 'override' functions
5348 during candidate selection. Store them in a lookaside list.
5349 If the selected method is a 'virtual' function, use the list to
5350 find any overrides that are closer to the LHS type.
5352 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5354 * expression.cs (New.DoResolve): Add complex core type reduction.
5355 (New.Constantify): Converts complex core type syntax like 'new int ()'
5358 2005-02-14 Raja R Harinath <rharinath@novell.com>
5360 * decl.cs (EntryType.EntryType): New constructor to create an
5361 updated copy of a cache entry.
5362 (MemberCache.AddMethods): Use it.
5363 (MemberCache.ClearDeclaredOnly): Remove.
5364 (MemberCache.MemberCache): Update.
5366 2005-02-11 Miguel de Icaza <miguel@novell.com>
5368 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5369 variable. This one is represents the actual low-level declaration
5370 of the method, as opposed to the semantic level `IsStatic'.
5372 An anonymous method which is hosted into a static method might be
5373 actually an instance method. IsStatic would reflect the
5374 container, while MethodIsStatic represents the actual code
5377 * expression.cs (ParameterReference): Use the new MethodIsStatic
5378 instead of IsStatic.
5380 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5381 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5382 set on the current EmitContext.
5384 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5385 resolve our casted expression as an LValue. This triggers the
5386 proper LValue processing that is later required by Assign.
5390 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5392 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5394 C# 2.0 Fixed buffer implementation
5396 * anonymous.cs: Update after RegisterHelperClass renaming.
5398 * attribute.cs (AttributeTester.fixed_buffer_cache):
5399 Cache of external fixed buffers.
5400 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5401 implementation if field is fixed buffer else null.
5404 (TypeContainer.AddField): Accept FieldMember instead of Field.
5405 (FieldBase.IsFieldClsCompliant): Extracted code from
5406 VerifyClsCompliance descendant customization.
5407 (FixedField): New class handles fixed buffer fields.
5408 (FixedFieldExternal): Keeps information about imported fixed
5410 (IFixedField): Make access to internal or external fixed buffer
5413 * cs-parser.jay: Add fixed buffer parsing.
5415 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5418 * expression.cs (Indirection): Extended implementation to accept
5420 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5421 (ElementAccess.MakePointerAccess): Get type as parameter.
5422 (DoResolve): Add fixed buffer field expression conversion.
5423 (DoResolveLValue): Ditto.
5424 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5425 (ArrayPtr): Derives from FixedBufferPtr.
5426 (ArrayPtr.Emit): Add extra emit for array elements.
5428 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5430 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5431 for compiler generated types.
5432 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5434 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5435 and consume less memory.
5436 (Fixed.Resolve): Add fixed buffer case.
5438 * typemanager.cs (compiler_generated_attr_ctor,
5439 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5440 (HasElementType): Add our own implementation to work on every
5443 2005-02-11 Miguel de Icaza <miguel@novell.com>
5445 * anonymous.cs (CaptureContext): Track whether `this' has been
5448 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5449 only captured `this' if it was implicitly done (instance
5450 methods/variables were used).
5452 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5453 `this' must be captured.
5455 2005-01-30 Miguel de Icaza <miguel@novell.com>
5457 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5458 is null it means that there has been no need to capture anything,
5459 so we just create a sibling.
5461 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5463 Just a partial fix. The other half is fairly elusive.
5465 2005-02-10 Raja R Harinath <rharinath@novell.com>
5467 Fix #52586, cs0121-4.cs.
5468 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5469 and return a hashtable.
5470 (MemberCache.ClearDeclaredOnly): New.
5471 (MemberCache.MemberCache): Update to change. Make a deep copy of
5472 the method_hash of a base type too.
5473 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5474 type methods. Overwrite entries with the same MethodHandle so
5475 that the ReflectedType is correct. The process leaves in base
5476 virtual functions and their overrides as distinct entries.
5477 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5478 matters since it was boxed in a ArrayList before.
5479 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5481 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5482 case of a virtual function and its override (choose the overload
5484 (Invocation.OverloadResolve): Avoid 'override' members during
5485 'applicable_type' calculation.
5487 2005-02-09 Raja R Harinath <rharinath@novell.com>
5489 Combine two near-redundant caches.
5490 * typemanager.cs (method_params): Rename from method_internal_params.
5491 (TypeManager.GetParameterData): New. Replace
5492 Invocation.GetParameterData.
5493 (TypeManager.LookupParametersByBuilder): Remove.
5494 * expression.cs (Invocation.method_parameter_cache): Remove.
5495 (Invocation.GetParameterData): Remove.
5497 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5500 2005-02-08 Raja R Harinath <rharinath@novell.com>
5503 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5504 TypeManager.multicast_delegate_type is null, resolve it by looking
5505 up "System.MulticastDelegate".
5506 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5508 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5509 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5510 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5513 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5514 (LabeledStatement.AddReference): New. Set 'referenced'.
5515 (Goto.Resolve): Use it.
5517 2005-02-05 John Luke <john.luke@gmail.com>
5519 * driver.cs: remove duplicate -doc line in Usage ()
5521 2005-02-04 Raja R Harinath <rharinath@novell.com>
5523 * location.cs (Location.AddFile): Fix CS2002 error report.
5525 2005-02-02 Martin Baulig <martin@ximian.com>
5527 * delegate.cs (Delegate.DefineType): Report an internal error if
5528 TypeManager.multicast_delegate_type is null. See bug #72015 for
5531 2005-02-02 Raja R Harinath <rharinath@novell.com>
5533 Fix a crasher in a variant of #31984.
5534 * const.cs (Constant.CheckBase): New override that defers the
5535 new-or-override check in case the base type hasn't been populated
5537 (Constant.Define): Ensure the new-or-override check is performed.
5539 2005-02-01 Duncan Mak <duncan@ximian.com>
5541 * const.cs (LookupConstantValue): Check that `ce' is not null
5542 before calling GetValue ().
5544 2005-02-01 Raja R Harinath <rharinath@novell.com>
5546 Fix test-334.cs (#69519).
5547 * cs-parser.jay (using_alias_directive): Pass in an expression to
5548 NamespaceEntry.UsingAlias.
5549 (using_namespace_directive): Pass in an expression to
5550 NamespaceEntry.Using.
5551 (namespace_name): Don't flatten to a string.
5552 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5553 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5555 (NamespaceEntry.UsingEntry): Likewise.
5556 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5558 (NamespaceEntry.LookupForUsing): Remove.
5559 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5561 (NamespaceEntry.Lookup): Remove support for dotted names.
5563 2005-02-01 Raja R Harinath <rharinath@novell.com>
5565 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5567 (NamespaceEntry.ImplicitParent): Compute on demand.
5568 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5569 parallels the current.
5570 (NamespaceEntry.LookupForUsing): Use it.
5571 (NamespaceEntry.Lookup): If the current namespace-entry is
5572 implicit, don't search aliases and using tables.
5574 2005-02-01 Raja R Harinath <rharinath@novell.com>
5577 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5579 (TypeContainer.BaseCache): Compute on demand.
5580 (TypeContainer.FindMembers): Define constants and types if they're
5581 not already created.
5582 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5584 * const.cs (Constant.Define): Make idempotent.
5586 2005-01-29 Miguel de Icaza <miguel@novell.com>
5588 * pending.cs: Produce better code (no nops produced by using Ldarg
5591 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5592 i - 1' it should be arg + 1.
5596 2005-01-28 Raja R Harinath <rharinath@novell.com>
5598 * attribute.cs (Attribute.CheckAttributeType): Make private
5600 (Attribute.ResolveType): Make virtual.
5601 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5602 handling of RootContext.Tree.Types.
5604 2005-01-27 Raja R Harinath <rharinath@novell.com>
5606 Update attribute-handling to use the SimpleName/MemberAccess
5608 * cs-parser.jay (attribute): Pass in an expression to the
5609 constructors of Attribute and GlobalAttribute.
5610 * attribute.cs (Attribute): Take an expression for the name.
5611 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5612 passed in attribute name expression.
5613 (Attribute.CheckAttributeType): Use it.
5614 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5615 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5616 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5617 argument to prevent error messages if the lookup fails.
5619 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5621 * expression.cs (Indirection): Implemented IVariable interface
5622 to support indirection in AddressOf operator.
5623 (PointerArithmetic.Emit): Add optimalization for case where
5624 result can be precomputed.
5626 2005-01-26 Martin Baulig <martin@ximian.com>
5628 * class.cs (TypeContainer.AttributeTargets): Return the correct
5629 AttributeTargets depending on our `Kind' instead of throwing an
5630 exception; fixes #71632.
5632 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5635 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5638 2005-01-25 Raja R Harinath <rharinath@novell.com>
5641 * expression.cs (MemberAccess.DoResolve): Don't complain with
5642 cs0572 when the LHS of a member access has identical name and type
5645 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5648 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5650 Create custom PermissionSet only for PermissionSetAttribute.
5652 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5655 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5656 delegates in static class.
5658 2005-01-24 Martin Baulig <martin@ximian.com>
5660 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5661 merging an implicit block, just use its reachability.
5663 * statement.cs (Block.Resolve): Make the unreachable code check
5664 work wrt. implicit blocks; see test-337 from #63842.
5666 2005-01-21 Alp Toker <alp@atoker.com>
5668 * cs-parser.jay: destructor_declaration's container is PartialContainer
5669 not Class when partial types are used, so use Kind prop instead of
5672 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5674 * cs-parser.jay: Improve error reporting when an interface
5677 2005-01-20 Dick Porter <dick@ximian.com>
5679 * support.cs: SeekableStreamReader fix from Sandor Dobos
5680 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5681 chars are read. Fixes bug 70369.
5683 2005-01-20 Raja R Harinath <rharinath@novell.com>
5685 * cs-parser.jay (catch_clause): Simplify current_block handling
5688 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5690 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5691 code with ImplicitStandardConversion to handle the implicit
5692 conversion of method groups into valid delegate invocations.
5694 The problem is that in parameter handling we were using this code
5695 path. Fixes bug #64698
5697 2005-01-19 Raja R Harinath <rharinath@novell.com>
5699 * cs-parser.jay: Fix several infelicities.
5700 - Avoid assigning to the parser value stack. Code like
5701 '$3 = null' is unclean. Synthesize a value for the code block
5703 - Avoid using oob_stack for storing location information. Use ...
5704 (_mark_): ... this. New (empty) rule. Saves the current location
5706 (foreach_statement): Avoid using oob_stack for current_block
5707 handling. Use technique used in for_statement and
5708 using_statement. Synthesize a value for the code block to store
5709 additional intermediate information.
5711 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5713 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5714 of a different type is only allowed to private fields of a
5715 containing type, not on fields of a base class.
5717 See test-174.cs and error cs0122-9.cs
5719 2005-01-13 Raja R Harinath <rharinath@novell.com>
5721 Fix test-335.cs (bug #58126).
5722 * cs-parser.jay (argument): Split out non-expression parts of the
5723 rule into 'non_simple_argument'.
5724 (invocation_expression): Support parenthesized invocations with
5725 multiple arguments, and with single non-simple arguments.
5727 2005-01-13 Raja R Harinath <rharinath@novell.com>
5729 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5732 2005-01-12 Raja R Harinath <rharinath@novell.com>
5734 Fix cs0038-1.cs, cs1640-6.cs.
5735 * ecore.cs (Expression.Resolve): Remove special-case for
5736 SimpleName in error-handling.
5737 (Expression.almostMatchedMembers): Relax access permission to
5739 (Expression.MemberLookupFailed): Handle duplicates in
5740 almostMatchedMembers list.
5741 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5742 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5743 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5744 overload if the passed in MemberInfo is a MethodBase.
5746 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5749 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5750 for non-CAS & merge permission sets properly.
5752 2005-01-11 Raja R Harinath <rharinath@novell.com>
5754 Improve standard-compliance of simple name and member access
5755 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5756 * ecore.cs (FullNamedExpression): New abstract base class
5757 for Namespaces and TypeExpressions.
5758 (ResolveFlags.SimpleName): Remove.
5759 (SimpleName): Remove support for dotted names.
5760 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5761 DeclSpace.FindType and DeclSpace.LookupType.
5762 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5763 (Expression.ExprClassName): Make member function.
5764 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5765 a namespace. Remove creation of dotted "SimpleName"s.
5766 (MemberAccess.DoResolve): Likewise.
5767 * decl.cs (DeclSpace.Cache): Make private.
5768 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5769 (DeclSpace.FindType): Update.
5770 (DeclSpace.LookupType): Move here from RootContext. Return a
5771 FullNamedExpression.
5772 * namespace.cs (Namespace): Derive from FullNamedExpression
5773 so that it can be part of expression resolution.
5774 (Namespace.Lookup): Return an FullNamedExpression.
5775 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5777 * rootcontext.cs (NamespaceLookup): Remove.
5778 (LookupType): Move to DeclSpace.
5779 * attribute.cs (CheckAttributeType): Update.
5780 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5781 (FindDocumentedTypeNonArray): Likewise.
5783 2005-01-11 Raja R Harinath <rharinath@novell.com>
5785 Fix cs0509.cs, cs1632.cs.
5786 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5787 is the same as IsInterface.
5788 (TypeContainer.GetClassBases): Likewise.
5789 * statement.cs (LabeledStatement.ig): New field.
5790 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5792 (LabeledStatement.DoEmit): Check that the label was created with
5793 the same ILGenerator.
5795 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5798 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5799 accessors to its properties.
5801 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5802 from accessors to property.
5804 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5807 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5810 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5812 * attribute.cs: Check for null and empty strings.
5814 I have lost another battle to Paolo.
5816 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5819 * class.cs (PropertyMethod): Set Parent field in ctors.
5820 (SetMethod.InternalParameters): Add unsafe switch hack.
5821 Override MarkForDuplicationCheck where it is appropriate.
5823 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5824 It says whether container allows members with the same name.
5826 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5827 Removed is_method parameter.
5829 2005-01-06 Duncan Mak <duncan@ximian.com>
5831 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5832 because the previous change led to incorrect reporting of CS1032
5833 ("Cannot define/undefine preprocessor symbols after first token in
5834 file"). Instead of using `tokens_seen' as the only flag that
5835 triggers CS1040, introduce `comments_seen'. This new flag is used
5836 to signify having seen comments on the current line, so it is
5837 unset after a newline.
5839 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5841 * doc.cs : When searching for a type, find nested type too.
5842 This fixes bug #71040.
5844 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5847 - Warn missing member comment on those classes which also does not
5848 have doc comments. Fixed bug #71041.
5849 - Don't warn missing doc comment on default constructor.
5852 2005-01-06 Duncan Mak <duncan@ximian.com>
5854 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5855 comments, set `tokens_seen' to true. This allows us to detect
5856 misplaced preprocessor directives (i.e. not at the beginning of
5857 the a line, nor after whitespaces). In that case, report error
5858 CS1040. This fixes bug #56460.
5860 * cs-parser.jay (interface_member_declaration): Add checks for
5861 IsExplicitImpl, and report CS0541 error if an interface member is
5862 defined as an explicit interface declaration.
5864 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5867 * class.cs (PropertyMethod): Set Parent field in ctors.
5868 (SetMethod.InternalParameters): Add unsafe switch hack.
5870 * decl.cs (MemberCore.Parent): Cannot be readonly.
5872 2005-01-06 Raja R Harinath <rharinath@novell.com>
5874 * decl.cs (DeclSpace.ResolveType): Remove.
5875 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5876 Merge in code from ...
5877 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5878 * class.cs, enum.cs: Update to changes.
5880 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5882 * anonymous.cs: Ensure that we init the scope of our parent if it
5883 has not been initialized yet.
5885 2004-12-30 Duncan Mak <duncan@ximian.com>
5887 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5888 if field.FieldBuilder is null. Fixes #70758.
5890 * convert.cs: Fixed some typos and updated some of the comments.
5891 (ImplicitStandardConversionExists):
5892 (TryImplicitIntConversion): If `target_type' is an interface and
5893 the type of `ic' implements this interface, return true or a new
5894 BoxedCast instead of null. This fixes #70468.
5896 2004-12-29 Duncan Mak <duncan@ximian.com>
5898 * expression.cs (Argument.Emit): Check that Expr is
5899 IMemoryLocation before casting to it, and report CS1510 otherwise.
5903 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5905 * statement.cs (Block.ThisVariable): remove the recursion here, to
5906 make the --profile more sane.
5908 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5910 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5911 assembly, by JB Evain.
5913 2004-12-17 Raja R Harinath <rharinath@novell.com>
5915 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5916 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5917 "parent" refers to enclosing type/class. "base" refers to superclass.
5919 2004-12-17 Raja R Harinath <rharinath@novell.com>
5921 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5922 Ensure that we only have GlobalAttributes.
5923 * attribute.cs (Attribute.Emit): Make non-virtual.
5924 (GlobalAttribute.Emit): Remove.
5925 (Attribute.Resolve): Make virtual.
5926 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5927 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5928 the argument. Don't create one.
5929 (Attribute.GetObsoleteAttribute): Likewise.
5930 (Attribute.GetClsCompliantAttributeValue): Likewise.
5931 * class.cs, decl.cs: Update to changes.
5933 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5935 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5937 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5939 * statement.cs (Foreach.Resolve): Add error 186 report.
5941 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5943 * expression.cs (Conditional.DoResolve): Add warning 429.
5945 * statement.cs (If.Resolve): Add warning 665.
5947 2004-12-16 Raja R Harinath <rharinath@novell.com>
5949 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5950 except when in the parser, and in GlobalAttribute.
5951 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5952 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5953 RootContext.Tree.Types.NamespaceEntry once work is done.
5954 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5955 and resets RootContext.Tree.Types.NamespaceEntry.
5957 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5959 * cs-parser.jay: Don't create a block for every variable.
5961 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5963 * location.cs: Provide extra information.
5965 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5966 variables from the captured environment, it is the ldarg_0.
5968 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5970 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5973 * class.cs: Changed warning level for 169 to avoid developer
5974 displeasure from warning flooding. It will be changed back when they
5975 fix most of current BCL warnings.
5977 * RootContext.cs: Pushed default WarningLevel to 3.
5979 * statement.cs: Removed unused variable.
5981 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5983 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5984 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5985 Add error 502 report.
5986 (StaticClass.DefineType): Add error 441 report.
5987 (Class.AllowedModifiersProp): New virtual property as temporary
5988 extension to AllowedModifiers.
5989 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5990 to share implementation with StaticClass and don't call virtual
5993 * driver.cs (MainDriver): Add error 1558 test.
5995 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5996 report. Moved error 36 test here.
5998 * statement.cs (Throw.Resolve): Add error 724 report.
6000 * typemanager.cs: Add out_attribute_type core type.
6002 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6004 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6006 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6008 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6011 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6013 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6014 Add error 3023 report.
6015 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6017 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6020 2004-12-12 John Luke <john.luke@gmail.com>
6022 * driver.cs (AddArgs): take -- into account when
6023 adding arguments, fixes bug 65710
6025 2004-12-12 Martin Baulig <martin@ximian.com>
6027 * expression.cs (Unary.TryReduceNegative): Added support for
6028 SByteConstant and ByteConstant.
6029 (Unary.Reduce): Check error values from TryReduceNegative().
6031 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6033 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6034 and report exception as error 182.
6036 2004-12-10 Raja R Harinath <rharinath@novell.com>
6038 * driver.cs (Main): Fix message when there are warnings.
6040 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6042 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6044 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6046 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6047 Reduced number of warnings.
6049 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6051 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6053 * driver.cs: Removed message.
6055 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6057 2004-12-08 <vargaz@freemail.hu>
6059 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6061 2004-12-08 Martin Baulig <martin@ximian.com>
6063 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6064 instead of a CS3002 for properties and indexer.
6066 2004-12-08 Martin Baulig <martin@ximian.com>
6068 * decl.cs (MemberName.ToString): Make this work again.
6070 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6072 * attribute.cs (Resolve): Add error 591 detection.
6074 * class.cs (FieldMember.Define): Add error 1547 detection.
6075 (Indexer.Define): Add error 620 detection.
6076 (Operator.Define): Add error 590 detection.
6078 * ecore.cs: Missing argument for error 79.
6080 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6083 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6086 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6089 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6091 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6092 Some operator comments were suppressed.
6093 * doc.cs : Implicit/explicit operator name in doc comments are like
6094 "op_Explicit(type)~returnType", so added suffix handling.
6096 2004-12-07 Martin Baulig <martin@ximian.com>
6099 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6100 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6101 (DeclSpace.ec): New protected field; store the EmitContext here.
6102 (DeclSpace.EmitContext): New public property; moved here from
6104 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6107 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6108 (Enum.Emit): Don't create a new EmitContext.
6110 * delegate.cs (Delegate.DefineType): Always create the
6113 * iterators.cs (Iterators.DefineIterator): Create a new
6114 EmitContext and store it in `ec'.
6116 2004-08-24 Martin Baulig <martin@ximian.com>
6119 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6120 this for accessibility checks.
6121 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6122 IsNestedFamilyAccessible.
6123 (TypeManager.IsSubclassOf): New method, do what the name actually
6126 2004-12-06 Raja R Harinath <rharinath@novell.com>
6128 Fix crash on cs0657-17.cs.
6129 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6130 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6131 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6132 the case where the NamespaceEntry gets overwritten.
6134 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6136 Fixed #69195, #56821
6137 * ecore.cs (ResolveBoolean): Tiny refactoring.
6139 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6140 of right expression resolving when left is false constant and
6141 operator is LogicalAnd OR true constant and operator is LogicalOr.
6143 * statement.cs (ResolveUnreachable): Always reports warning.
6145 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6147 * class.cs: Distinguish between 1721 and 1722 (just a little help
6148 for the programmer).
6150 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6152 * delegate.cs: Only allow this on new versions of the language.
6154 2004-12-02 Duncan Mak <duncan@ximian.com>
6156 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6158 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6159 here as a static method. Take an additional bool out parameter
6160 `must_do_cs1540_check' for signaling to InstanceResolve.
6161 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6162 member field from PropertyExpr class and made it an argument of
6164 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6165 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6166 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6167 and `remove_accessor' as well as InstanceResolve: report CS0122
6172 2004-12-03 Raja R Harinath <rharinath@novell.com>
6174 Fix test-327.cs, test-328.cs, and put in early infrastructure
6175 for eventually fixing #52697.
6176 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6177 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6179 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6180 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6181 (VerifyUsing, error246): Update.
6182 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6183 'NamespaceEntry.LookupNamespaceOrType'.
6185 2004-12-03 Martin Baulig <martin@ximian.com>
6187 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6188 method as our child, call AnonymousMethod.Compatible() on it.
6190 2004-12-03 Raja R Harinath <rharinath@novell.com>
6192 Disable XML documentation support in 'basic' profile.
6193 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6194 Redirect XmlElement to System.Object.
6195 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6196 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6197 * mcs.exe.sources: Add doc-bootstrap.cs.
6198 * doc-bootstrap.cs: New file. Contains empty stub implementation
6201 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6203 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6204 comments are allowed.
6206 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6208 * delegate.cs: Add checks for subtypes in paramaters and return values
6209 in VerifyMethod () to add support for Covariance/Contravariance
6212 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6214 * report.cs: Remove extra closing parenthesis.
6216 * convert.cs (Error_CannotImplicitConversion): If the name of the
6217 types are the same, provide some extra information.
6219 * class.cs (FieldBase): Use an unused bit field from the field to
6220 encode the `has_offset' property from the FieldMember. This saves
6221 a couple of Ks on bootstrap compilation.
6223 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6224 method as our child, return the AnonymousMethod resolved
6227 * expression.cs (New.DoResolve): Allow return values from
6228 NewDelegate to also include AnonymousMethods.
6232 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6235 * attribute.cs (Resolve): Improved implementation of params
6236 attribute arguments.
6238 * support.cs (ParameterData): Add HasParams to be faster.
6240 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6242 all things are for /doc support:
6244 * doc.cs: new file that supports XML documentation generation.
6245 * mcs.exe.sources: added doc.cs.
6247 Handle /doc command line option.
6248 Report error 2006 instead of 5 for missing file name for /doc.
6249 Generate XML documentation when required, after type resolution.
6251 Added support for picking up documentation (/// and /** ... */),
6252 including a new XmlCommentState enumeration.
6254 Added lines to fill Documentation element for field, constant,
6255 property, indexer, method, constructor, destructor, operator, event
6256 and class, struct, interface, delegate, enum.
6257 Added lines to warn incorrect comment.
6259 Added Documentation field (passed only when /doc was specified).
6261 Added DocComment, DocCommentHeader, GenerateDocComment() and
6262 OnGenerateDocComment() and some supporting private members for
6263 /doc feature to MemberCore.
6265 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6267 Added overriden DocCommentHeader.
6269 Added overriden DocCommentHeader and GenerateDocComment().
6271 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6273 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6274 unwrapping the enumeration values, chain to
6275 DoConstantNumericPromotions again, so we can promote things to the
6276 fundamental types (takes care of enums that are bytes, sbytes).
6280 2004-12-01 Raja R Harinath <rharinath@novell.com>
6282 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6283 Fix long-standing bug in type-lookup. Use FindType instead of
6284 LookupType when ec.ResolvingTypeTree.
6285 (Attribute.ResolveType, Attribute.Resolve)
6286 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6288 (Attributes.Search): Remove internal version. Update.
6289 (Attributes.SearchMulti): Update.
6290 (Attributes.GetClsCompliantAttribute): Remove.
6291 (Attributes.GetIndexerNameAttribute): Remove.
6292 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6293 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6294 * class.cs (Indexer.Define): Likewise.
6296 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6299 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6300 MarshallByReference members access.
6302 * expression.cs: Use CheckMarshallByRefAccess;
6303 Better error CS0197 message.
6305 * report.cs: Print whole related error message.
6307 2004-11-30 Raja R Harinath <rharinath@novell.com>
6309 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6310 the current directory to help debugging.
6312 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6314 * class (GetClassBases): Better error 60 report.
6315 (EventProperty): Disabled warning 67 detection.
6317 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6320 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6322 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6325 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6328 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6330 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6332 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6334 * attribute.cs (Attribute.Resolve): Refine error reporting and
6335 report a cs0117 if the identifier does not exist, to distinguish
6336 from 0617 which is a miss-use of the actual identifier.
6338 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6339 between cs0070 and cs0079.
6341 * class.cs (MemberBase.DoDefine): When reporting a wrong
6342 accessibility level, we use MethodCore to compare instead of
6343 Method (this was a regression in some refactoring effort).
6345 So now we correctly report cs0056 again.
6347 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6348 testing the target_type (which was known to be object_type) and
6349 not the source type (which is anonymous_method).
6351 Fixed reporting of error cs1660.
6353 * expression.cs (UserCast.Source): Expose the underlying cast.
6355 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6356 allowed types to find a match to int32 first (most common).
6358 In addition, it ignores any ImplicitUserConversions that did an
6359 internal implicit conversion (as the switch statement allows only
6360 one integral conversion to exist).
6362 * class.cs (PartialContainer.Create): rename `name' to
6363 `member_name' for clarity. Then replace the string calls with a
6364 call to MemberName.GetPartialName, as now using
6365 MemberName.ToString is an error (this is due to the side effects
6366 it had, that were fixed in the past).
6368 This will restore the error reporting on a number of partial class
6369 errors that were missusing this (and getting an exception as a
6370 results, which is now just a plain textual warning, because
6371 yyparse debug output would crash otherwise).
6373 2004-11-26 Raja R Harinath <rharinath@novell.com>
6375 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6377 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6379 * rootcontext.cs (LookupType): Make sure to cache lookups that
6380 don't give us a negative result. This saves about 5% of corlib
6383 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6385 * report.cs (AbstractMessage.Print): messages are sent to stderr
6387 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6388 non-interface in the list of interfaces (at this point, either
6389 parent was properly set, or a base class is being listed in the
6390 interfaces section).
6392 This flags error 1722, and resolves the crash from bug 69259.
6394 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6396 * statement.cs (Using.EmitExpressionFinally): make this work right
6397 for valuetypes. Fixes 69926.
6399 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6401 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6402 converted to an enum" here, before we try to change the underlying
6403 type. This code exists, but it is a different code path than the
6404 one used while encoding constants.
6406 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6407 old bug: when converting from the null literal to a pointer,
6408 return an EmptyCast, not the NullLiteral.
6410 This fixes #69921, the recent null_type changes probably made this
6413 (ImplicitReferenceConversionExists): In addition, resynchronized
6414 the code here, so it matches the same code in
6415 ImplicitReferenceConversionExists for the `from any class-type S
6416 to any interface-type T'.
6419 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6421 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6423 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6425 * cs-parser.jay: Use verbosity accordingly.
6427 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6429 * expression.cs (Unary.ResolveOperator): Do not report warning;
6430 AddressOf reads from variable.
6432 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6434 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6438 * attribute.cs (Attributable): Removed CheckTargets.
6439 (Attributes.Emit): Explicit attribute targets are tested here.
6441 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6442 not enabled for interfaces.
6444 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6445 (GetAssemblyName): Ouch next bug there.
6447 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6449 * expression.cs: Error 275 added.
6451 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6453 Fix bug #69177 (Implemented decimal constant support)
6455 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6456 (BinaryFold): Add DecimalConstant.
6458 * const.cs (Define): Decimal constant
6460 (ChangeType): Add decimal type handling.
6461 (LookupConstantValue): Don't set value for decimal type but
6462 emit DecimalConstantAttribute. Needed for constant optimization.
6464 * constant.cs (ToDecimal): New method.
6465 (ConvertToDecimal): New method.
6466 (IntConstant): Implemented ConvertToDecimal.
6467 (DecimalConstant.Emit): Emit optimized version for decimals in
6470 * expression.cs (ResolveOperator): Changed order of constant
6471 reduction to work correctly with native types which have
6472 overloaded operators.
6473 (ResolveMemberAccess): Extract constant value from attribute
6476 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6478 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6479 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6480 (ChangeType): Decimal is special.
6481 (TypeToCoreType): Add decimal type.
6483 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6485 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6488 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6490 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6493 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6495 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6497 * pending.cs (PendingImplementation): Grab only interfaces.
6499 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6501 * statement.cs (ForeachHelperMethods): Add location member and
6502 error 202 detection.
6504 2004-11-19 Raja R Harinath <rharinath@novell.com>
6506 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
6507 automatically handled by executable.make.
6508 (PROGRAM): Make profile-specific.
6510 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6512 * expression.cs (DoResolveBase): Fixed wrong warning for out
6515 2004-11-18 Martin Baulig <martin@ximian.com>
6517 Merged latest changes into gmcs. Please keep this comment in
6518 here, it makes it easier for me to see what changed in MCS since
6519 the last time I merged.
6521 2004-11-17 Raja R Harinath <rharinath@novell.com>
6523 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6524 (TypeHandle.GetMemberCache): New.
6525 (TypeHandle.TypeHandle): Update.
6526 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6527 (TypeManager.LookupParentInterfacesCache):
6528 Rename from LookupInterfaceCache. Optimize slightly.
6529 (TypeManager.MemberLookup_FindMembers): Update.
6530 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6532 (AddCacheContents): Rename from AddHashtable.
6533 * class.cs (TypeContainer.parent_container): Remove.
6534 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6535 (TypeContainer.DoDefineMembers): Don't initialize it.
6536 Update to name changes.
6538 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6540 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6541 that factors the code to check access modifiers on override.
6543 (PropertyBase): Use the code here.
6545 Patch from Lluis S'anchez, fixes bug #69361.
6547 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6549 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6550 routine that is used to report the use of a captured variable
6551 whose address has been taken.
6553 There are two checks: one when variables are being captured and
6554 the other check is when the address of a variable is taken.
6556 (because an anonymous methods might be resolved before *or* after
6557 the address has been taken) and
6559 * expression.cs (Conditional.DoResolve): Remove the special
6560 casing that Martin added to trueExpr and falseExpr being both
6561 NullLiteral. We get the right behavior now just by introducing
6562 the null_type into the compiler.
6564 * convert.cs (ExplicitConversion): Change the code to use
6565 null_type instead of testing `expr is NullLiteral'.
6566 (ImplicitConversionStandard): use null_type too.
6567 (ImplicitReferenceConversionExists): use null_type too.
6568 (ImplicitReferenceConversion): use null_type too.
6570 * literal.cs: The type of `NullLiteral' is now null_type instead
6572 (Resolve): Set the type here.
6574 * typemanager.cs: Introduce null_type.
6576 2004-11-17 Martin Baulig <martin@ximian.com>
6578 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6579 direction, like FindMembers() does. Fixes #69546, testcase is in
6582 2004-11-16 Martin Baulig <martin@ximian.com>
6584 This is based on a patch from Marek Safar, see bug #69082.
6585 Fixes bugs #63705 and #67130.
6587 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6588 method; create a MemberCache for an interface type and cache the
6591 * decl.cs (IMemberContainer.ParentContainer): Removed.
6592 (IMemberContainer.ParentCache): New property.
6593 (MemberCache.SetupCacheForInterface): Removed.
6594 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6595 to create a cache for an interface's "parent".
6597 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6600 2004-11-16 Martin Baulig <martin@ximian.com>
6602 Merged back from gmcs; these changes already went into gmcs a
6603 couple of weeks ago.
6606 (TypeManager.AddUserType): Removed the `ifaces' argument.
6607 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6609 (TypeManager.AddUserInterface): Removed.
6610 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6612 (TypeManager.GetInterfaces): Likewise.
6613 (TypeManager.GetExplicitInterfaces): Likewise.
6615 * ecore.cs (TypeExpr.GetInterfaces): Removed.
6617 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6618 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6620 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6622 * statement.cs: Avoid adding bools to a hashtable.
6624 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6626 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6627 calling an unsafe method from a safe location.
6629 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6632 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6634 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6636 * namespace.cs (VerifyUsing): use GetPartialName instead of
6639 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6641 * statement.cs (Return.Resolve): Fix regression in typo: if
6642 `in_exc', we have to request a NeedReturnLabel, this was a typo
6643 introduced in the anonymous method check-in. Fixes #69131.
6645 * Indexers were using the ShortName when defining themselves,
6646 causing a regression in the compiler bootstrap when applying the
6647 patch from 2004-11-02 (first part), now they use their full name
6648 and the bug is gone.
6650 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6652 * driver.cs: Strip the path from the names of embedded resources. Fixes
6655 2004-11-04 Raja R Harinath <rharinath@novell.com>
6657 Fix error message regression: cs0104-2.cs.
6658 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6659 (AliasEntry.Resolve): Update.
6660 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6662 (RootContext.LookupType): Update.
6664 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6666 * cs-parser.jay: Add support for handling accessor modifiers
6667 * class: Add support port accessor modifiers and error checking,
6668 define PropertyMethod.Define as virtual (not abstract anymore)
6669 * ecore.cs: Add checking for proeprties access with access modifiers
6670 * iterators.cs: Modify Accessor constructor call based in the modified
6672 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6674 * expression.cs (StringConcat): Handle being called twice,
6675 as when we have a concat in a field init with more than two
6678 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6680 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6681 special case explicit implementations, we should always produce
6682 the .property or .event declaration.
6684 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6685 since it will not return correct data if people use this
6686 unresolved in the presence of using statements (see test-313).
6688 * class.cs (MethodData.Define): If we are an explicit interface
6689 implementation, set the method name to the full name of the
6690 interface plus the name of the method.
6692 Notice that using the method.MethodName.GetFullName() does not
6693 work, as it will only contain the name as declared on the source
6694 file (it can be a shorthand in the presence of using statements)
6695 and not the fully qualifed type name, for example:
6699 class D : ICloneable {
6700 object ICloneable.Clone () {
6704 Would produce a method called `ICloneable.Clone' instead of
6705 `System.ICloneable.Clone'.
6707 * namespace.cs (Alias.Resolve): Use GetPartialName.
6709 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6711 * cs-parser.jay: Add error 1055 report.
6713 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6715 * assign.cs (Assign.DoResolve): Only do the transform of
6716 assignment into a New if the types are compatible, if not, fall
6717 through and let the implicit code deal with the errors and with
6718 the necessary conversions.
6720 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6722 * cs-parser.jay: Add error 1031 report.
6724 * cs-tokenizer.cs: Add location for error 1038.
6726 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6728 * cs-parser.jay: Add error 1016 report.
6730 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6732 * cs-parser.jay: Add errors 1575,1611 report.
6734 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6736 * cs-parser.jay: Add error 1001 report.
6738 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6741 * attribute.cs (GetMarshal): Add method argument for
6742 caller identification.
6744 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6745 agument for GetMarshal and RuntimeMissingSupport.
6747 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6749 * attribute.cs (ExtractSecurityPermissionSet): Removed
6750 TypeManager.code_access_permission_type.
6752 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6754 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6756 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6757 for obsolete use of a variable here. Fixes regression on errors
6758 cs0619-25 and cs0619-26.
6760 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6762 Fix #62358, implemented security attribute encoding.
6764 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6765 Tests permitted SecurityAction for assembly or other types.
6766 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6767 data from SecurityPermissionAttribute to PermisionSet class.
6769 * class.cs (ApplyAttributeBuilder): Added special handling
6770 for System.Security.Permissions.SecurityAttribute based types.
6772 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6773 special handling for System.Security.Permissions.SecurityAttribute
6776 * enum.cs (ApplyAttributeBuilder): Added special handling
6777 for System.Security.Permissions.SecurityAttribute based types.
6779 * parameter.cs (ApplyAttributeBuilder): Added special handling
6780 for System.Security.Permissions.SecurityAttribute based types.
6782 * rootcontext.cs: Next 2 core types.
6784 * typemanager.cs (TypeManager.security_permission_attr_type):
6785 Built in type for the SecurityPermission Attribute.
6786 (code_access_permission_type): Build in type.
6788 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6790 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6791 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6792 all of this information into
6793 EmitContext.EmitCapturedVariableInstance.
6795 * codegen.cs (EmitCapturedVariableInstance): move here the
6796 funcionality of emitting an ldarg.0 in the presence of a
6797 remapping. This centralizes the instance emit code.
6799 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6800 then emit a load of this: it means that we have reached the
6801 topmost ScopeInfo: the one that contains the pointer to the
6802 instance of the class hosting the anonymous method.
6804 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6805 captures to the topmost CaptureContext.
6807 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6809 * expression.cs (LocalVariableReference): Move the knowledge about
6810 the iterators into codegen's EmitCapturedVariableInstance.
6812 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6814 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6815 all code paths return a value from an anonymous method (it is the
6816 same as the 161 error, but for anonymous methods).
6818 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6820 The introduction of anonymous methods in the compiler changed
6821 various ways of doing things in the compiler. The most
6822 significant one is the hard split between the resolution phase
6823 and the emission phases of the compiler.
6825 For instance, routines that referenced local variables no
6826 longer can safely create temporary variables during the
6827 resolution phase: they must do so from the emission phase,
6828 since the variable might have been "captured", hence access to
6829 it can not be done with the local-variable operations from the runtime.
6833 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6834 is a toplevel block.
6836 (ToplevelBlock): A new kind of Block, these are the blocks that
6837 are created by the parser for all toplevel method bodies. These
6838 include methods, accessors and anonymous methods.
6840 These contain some extra information not found in regular blocks:
6841 A pointer to an optional CaptureContext (for tracking captured
6842 local variables and parameters). A pointer to the parent
6845 (Return.Resolve): Catch missmatches when returning a value from an
6846 anonymous method (error 1662).
6847 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6850 (Break.Resolve): ditto.
6852 (SwitchLabel): instead of defining the labels during the
6853 resolution phase, we now turned the public ILLabel and ILLabelCode
6854 labels into methods called GetILLabelCode() and GetILLabel() that
6855 only define the label during the Emit phase.
6857 (GotoCase): Track the SwitchLabel instead of the computed label
6858 (its contained therein). Emit the code by using
6859 SwitchLabel.GetILLabelCode ().
6861 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6862 whether the Local has been captured or not.
6864 (LocalInfo.IsCaptured): New property, used to tell whether the
6865 local has been captured.
6867 * anonymous.cs: Vastly updated to contain the anonymous method
6870 The main classes here are: CaptureContext which tracks any
6871 captured information for a toplevel block and ScopeInfo used to
6872 track the activation frames for various local variables.
6874 Each toplevel block has an optional capture context associated
6875 with it. When a method contains an anonymous method both the
6876 toplevel method and the anonymous method will create a capture
6877 context. When variables or parameters are captured, they are
6878 recorded on the CaptureContext that owns them, for example:
6882 MyDelegate d = delegate {
6887 Here `a' will be recorded as captured on the toplevel
6888 CapturedContext, the inner captured context will not have anything
6889 (it will only have data if local variables or parameters from it
6890 are captured in a nested anonymous method.
6892 The ScopeInfo is used to track the activation frames for local
6893 variables, for example:
6895 for (int i = 0; i < 10; i++)
6896 for (int j = 0; j < 10; j++){
6897 MyDelegate d = delegate {
6902 At runtime this captures a single captured variable `i', but it
6903 captures 10 different versions of the variable `j'. The variable
6904 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6905 recorded on a child.
6907 The toplevel ScopeInfo will also track information like the `this'
6908 pointer if instance variables were referenced (this is necessary
6909 as the anonymous method lives inside a nested class in the host
6910 type of the method).
6912 (AnonymousMethod): Expanded to track the Toplevel, implement
6913 `AnonymousMethod.Compatible' to tell whether an anonymous method
6914 can be converted to a target delegate type.
6916 The routine now also produces the anonymous method content
6918 (AnonymousDelegate): A helper class that derives from
6919 DelegateCreation, this is used to generate the code necessary to
6920 produce the delegate for the anonymous method that was created.
6922 * assign.cs: API adjustments for new changes in
6923 Convert.ImplicitStandardConversionExists.
6925 * class.cs: Adjustments to cope with the fact that now toplevel
6926 blocks are of type `ToplevelBlock'.
6928 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6929 insteda of standard blocks.
6931 Flag errors if params arguments are passed to anonymous methods.
6933 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6934 `CurrentAnonymousMethod' which points to the current Anonymous
6935 Method. The variable points to the AnonymousMethod class that
6936 holds the code being compiled. It is set in the new EmitContext
6937 created for the anonymous method.
6939 (EmitContext.Phase): Introduce a variable and an enumeration to
6940 assist in enforcing some rules about when and where we are allowed
6941 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6942 only one that enfonces this right now).
6944 (EmitContext.HaveCaptureInfo): new helper method that returns
6945 whether we have a CapturedContext initialized.
6947 (EmitContext.CaptureVariable): New method used to register that a
6948 LocalInfo must be flagged for capturing.
6950 (EmitContext.CapturedParameter): New method used to register that a
6951 parameters must be flagged for capturing.
6953 (EmitContext.CapturedField): New method used to register that a
6954 field must be flagged for capturing.
6956 (EmitContext.HaveCapturedVariables,
6957 EmitContext.HaveCapturedFields): Return whether there are captured
6958 variables or fields.
6960 (EmitContext.EmitMethodHostInstance): This is used to emit the
6961 instance for the anonymous method. The instance might be null
6962 (static methods), this (for anonymous methods that capture nothing
6963 and happen to live side-by-side with the current method body) or a
6964 more complicated expression if the method has a CaptureContext.
6966 (EmitContext.EmitTopBlock): Routine that drives the emission of
6967 code: it will first resolve the top block, then emit any metadata
6968 and then emit the code. The split is done so that we can extract
6969 any anonymous methods and flag any captured variables/parameters.
6971 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6972 during this phase, the ILGenerator should not be used as labels
6973 and local variables declared here might not be accessible to any
6974 code that is part of an anonymous method.
6976 Exceptions to this include the temporary variables that are
6977 created by some statements internally for holding temporary
6980 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6983 (EmitContext.TemporaryReturn): This method is typically called
6984 from the Emit phase, and its the only place where we allow the
6985 ReturnLabel to be defined other than the EmitMeta. The reason is
6986 that otherwise we would have to duplicate a lot of logic in the
6987 Resolve phases of various methods that today is on the Emit
6990 (EmitContext.NeedReturnLabel): This no longer creates the label,
6991 as the ILGenerator is not valid during the resolve phase.
6993 (EmitContext.EmitThis): Extended the knowledge in this class to
6994 work in anonymous methods in addition to iterators.
6996 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6997 code is necessary on the stack to access the instance to a local
6998 variable (the variable will be accessed as a field).
7000 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7001 EmitContext.EmitAddressOfParameter): Routines to support
7002 parameters (not completed at this point).
7004 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7005 will also remove the parameters.
7007 * convert.cs (Convert): Define a `ConstantEC' which points to a
7008 null. This is just to prefity some code that uses
7009 ImplicitStandardConversion code and do not have an EmitContext
7012 The idea is to flag explicitly that at that point in time, it is
7013 known that the conversion will not trigger the delegate checking
7014 code in implicit conversions (which requires a valid
7017 Everywhere: pass new EmitContext parameter since
7018 ImplicitStandardConversionExists now requires it to check for
7019 anonymous method conversions.
7021 (Convert.ImplicitStandardConversionExists): If the type of an
7022 expression is the anonymous_method_type, and the type is a
7023 delegate, we invoke the AnonymousMethod.Compatible method to check
7024 whether an implicit conversion is possible.
7026 (Convert.ImplicitConversionStandard): Only do implicit method
7027 group conversions if the language level is not ISO_1.
7029 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7030 MethodInfo for the Invoke method. used by Delegate and
7033 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7034 method conversions if the target type is a delegate.
7036 Removed extra debugging nops.
7038 (LocalVariableReference): Turn the `local_info' into a public
7041 Add `prepared' field, the same hack used for FieldExprs to cope
7042 with composed assignments, as Local variables do not necessarily
7043 operate purely on the stack as they used to: they can be captured
7046 Add `temp' for a temporary result, like fields.
7048 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7050 It now copes with Local variables that are captured and emits the
7051 proper instance variable to load it from a field in the captured
7054 (ParameterReference.DoResolveBase): During the resolve phase,
7055 capture parameters if we are in an anonymous method.
7057 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7058 anonymous method, use the EmitContext helper routines to emit the
7059 parameter reference.
7061 * iterators.cs: Set RemapToProxy to true/false during the
7064 * parameters.cs (GetParameterByName): New helper method.
7066 * typemanager.cs (anonymous_method_type) a new type that
7067 represents an anonyous method. This is always an internal type,
7068 used as a fencepost to test against the anonymous-methodness of an
7071 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7073 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7075 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7077 2004-10-18 Martin Baulig <martin@ximian.com>
7079 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7080 `Type' directly, but call ResolveType() on it.
7081 (Catch.Resolve): Likewise.
7082 (Foreach.Resolve): Likewise.
7084 2004-10-18 Martin Baulig <martin@ximian.com>
7086 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7087 `Type' directly, but call ResolveType() on it.
7088 (Probe.DoResolve): Likewise.
7089 (ArrayCreation.LookupType): Likewise.
7090 (TypeOf.DoResolve): Likewise.
7091 (SizeOf.DoResolve): Likewise.
7093 2004-10-18 Martin Baulig <martin@ximian.com>
7095 * expression.cs (Invocation.BetterFunction): Put back
7096 TypeManager.TypeToCoreType().
7098 2004-10-18 Raja R Harinath <rharinath@novell.com>
7100 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7103 2004-10-18 Martin Baulig <martin@ximian.com>
7105 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
7106 `Type' directly, but call ResolveType() on it.
7108 2004-10-18 Martin Baulig <martin@ximian.com>
7110 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7111 `Type' directly, but call ResolveType() on it.
7112 (MemberBase.DoDefine): Likewise.
7114 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7115 `Type' directly, but call ResolveType() on it.
7116 (ComposedCast.DoResolveAsTypeStep): Likewise.
7118 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7119 `Type' directly, but call ResolveType() on it.
7121 2004-10-17 John Luke <john.luke@gmail.com>
7123 * class.cs (Operator.GetSignatureForError): use CSharpName
7125 * parameter.cs (Parameter.GetSignatureForError): Returns
7126 correct name even if was not defined.
7128 2004-10-13 Raja R Harinath <rharinath@novell.com>
7131 * class.cs (TypeContainer.EmitContext): New property.
7132 (DefineNestedTypes): Create an emitcontext for each part.
7133 (MethodCore.DoDefineParameters): Use container's emitcontext.
7134 Pass type array to InternalParameters.
7135 (MemberBase.DoDefine): Use container's emitcontext.
7136 (FieldMember.Define): Likewise.
7137 (Event.Define): Likewise.
7138 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7139 Pass type array to InternalParameters.
7140 (SetIndexerMethod.GetParameterInfo): Likewise.
7141 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7142 * delegate.cs (Define): Pass emitcontext to
7143 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7144 array to InternalParameters.
7145 * expression.cs (ParameterReference.DoResolveBase): Pass
7146 emitcontext to GetParameterInfo.
7147 (ComposedCast.DoResolveAsTypeStep): Remove check on
7148 ec.ResolvingTypeTree.
7149 * parameter.cs (Parameter.Resolve): Change argument to
7150 EmitContext. Use ResolveAsTypeTerminal.
7151 (Parameter.GetSignature): Change argument to EmitContext.
7152 (Parameters.ComputeSignature): Likewise.
7153 (Parameters.ComputeParameterTypes): Likewise.
7154 (Parameters.GetParameterInfo): Likewise.
7155 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7156 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7157 * support.cs (InternalParameters..ctor): Remove variant that takes
7159 * typemanager.cs (system_intptr_expr): New.
7160 (InitExpressionTypes): Initialize it.
7162 2004-10-12 Chris Toshok <toshok@ximian.com>
7164 * cs-parser.jay: fix location for try_statement and catch_clause.
7166 2004-10-11 Martin Baulig <martin@ximian.com>
7168 * report.cs: Don't make --fatal abort on warnings, we have
7169 -warnaserror for that.
7171 2004-10-07 Raja R Harinath <rharinath@novell.com>
7173 More DeclSpace.ResolveType avoidance.
7174 * decl.cs (MemberCore.InUnsafe): New property.
7175 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7176 with newly created EmitContext.
7177 (FieldMember.Define): Likewise.
7178 * delegate.cs (Delegate.Define): Likewise.
7179 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7180 only if normal name-lookup fails.
7181 (TypeExpr.DoResolve): Enable error-checking.
7182 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7183 (SizeOf.DoResolve): Likewise.
7184 (ComposedCast.DoResolveAsTypeStep): Likewise.
7185 (StackAlloc.DoResolve): Likewise.
7186 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7187 (Block.Unsafe): New property.
7188 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7189 (Unsafe): Set 'unsafe' flag of contained block.
7190 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7191 (Fixed.Resolve): Likewise.
7192 (Catch.Resolve): Likewise.
7193 (Using.ResolveLocalVariableDecls): Likewise.
7194 (Foreach.Resolve): Likewise.
7196 2004-10-05 John Luke <john.luke@gmail.com>
7198 * cs-parser.jay: add location to error CS0175
7200 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7202 * ecore.cs (Expression.Constantity): Add support for turning null
7205 * const.cs (Const.Define): Allow constants to be reference types
7206 as long as the value is Null.
7208 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7210 * namespace.cs (NamespaceEntry.Using): No matter which warning
7211 level is set, check if this namespace name has already been added.
7213 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7215 * expression.cs: reftype [!=]= null should always use br[true,false].
7218 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7221 * attribute.cs: Enum conversion moved to
7222 GetAttributeArgumentExpression to be applied to the all
7225 2004-10-01 Raja R Harinath <rharinath@novell.com>
7227 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7228 * class.c (TypeContainer.DefineType): Flag error if
7229 base types aren't accessible due to access permissions.
7230 * decl.cs (DeclSpace.ResolveType): Move logic to
7231 Expression.ResolveAsTypeTerminal.
7232 (DeclSpace.ResolveTypeExpr): Thin layer over
7233 Expression.ResolveAsTypeTerminal.
7234 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7235 Refactor code into NestedAccess. Use it.
7236 (DeclSpace.NestedAccess): New.
7237 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7238 argument to silence errors. Check access permissions.
7239 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7240 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7241 (Cast.DoResolve): Likewise.
7242 (New.DoResolve): Likewise.
7243 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7244 (TypeOf.DoResolve): Likewise.
7246 * expression.cs (Invocation.BetterConversion): Return the Type of
7247 the better conversion. Implement section 14.4.2.3 more faithfully.
7248 (Invocation.BetterFunction): Make boolean. Make correspondence to
7249 section 14.4.2.2 explicit.
7250 (Invocation.OverloadResolve): Update.
7251 (Invocation): Remove is_base field.
7252 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7253 (Invocation.Emit): Likewise.
7255 2004-09-27 Raja R Harinath <rharinath@novell.com>
7257 * README: Update to changes.
7259 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7261 * cs-parser.jay: Reverted 642 warning fix.
7263 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7266 * decl.cs (FindMemberWithSameName): Indexer can have more than
7269 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7271 * expression.cs (LocalVariableReference.DoResolveLValue):
7272 Do not report warning 219 for out values.
7273 (EmptyExpression.Null): New member to avoid extra allocations.
7275 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7277 * cs-parser.jay: Fix wrong warning 642 report.
7279 * cs-tokenizer.cs (CheckNextToken): New helper;
7280 Inspect next character if is same as expected.
7282 2004-09-23 Martin Baulig <martin@ximian.com>
7284 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7285 (Convert.ImplicitReferenceConversionExists): Likewise.
7287 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7289 * class.cs (Operator.Define): Add error 448 and 559 report.
7291 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7293 * class.cs (MemberBase.IsTypePermitted): New protected
7294 method for checking error CS0610.
7296 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7298 * class.cs (TypeContainer.HasExplicitLayout): New property
7299 Returns whether container has StructLayout attribute set Explicit.
7300 (FieldMember): New abstract class for consts and fields.
7301 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7302 (Field): Reuse FieldMember.
7304 * const.cs (Const): Reuse FieldMember.
7306 * rootcontext.cs: EmitConstants call moved to class.
7308 2004-09-22 Martin Baulig <martin@ximian.com>
7310 Thanks to Peter Sestoft for this bug report.
7312 * expression.cs (Conditional): If both the `trueExpr' and the
7313 `falseExpr' is a NullLiteral, return a NullLiteral.
7315 2004-09-22 Martin Baulig <martin@ximian.com>
7317 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7318 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7319 for the "get_Current" call.
7321 2004-09-22 Martin Baulig <martin@ximian.com>
7323 Marek and me just fixed one of our oldest bugs: #28562 :-)
7325 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7327 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7328 we're an EnumConstant, just return that.
7329 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7330 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7331 to get the value which'll actually be written into the attribute.
7332 However, we have to use GetValue() to access the attribute's value
7335 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7337 * constant.cs (Constant.IsNegative): New abstract property
7340 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7341 (StackAlloc.DoResolve): Reused IsNegative.
7343 2004-09-21 Martin Baulig <martin@ximian.com>
7345 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7346 if we're used in an iterator, we may be called from different
7349 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7350 we actually have an exception block.
7352 2004-09-20 John Luke <jluke@cfl.rr.com>
7354 * class.cs, cs-parser.jay: Improve the error report for 1520:
7355 report the actual line where the error happens, not where the
7358 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7359 Pass location information that was available elsewhere.
7361 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
7363 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7364 runtime to delay sign assemblies.
7366 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7368 * cs-parser.jay: Do not report the stack trace, this is barely
7371 2004-08-22 John Luke <john.luke@gmail.com>
7373 * driver.cs : check that a resource id is not already used
7374 before adding it, report CS1508 if it is, bug #63637
7376 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7378 * ecore.cs: Removed dead code.
7380 2004-09-18 Marek Safar <marek.safar@seznam.cz>
7382 * class.cs: Do not report warning CS0067 on the interfaces.
7384 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7386 * cs-parser.jay: Add error 504 report.
7388 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7390 * rootcontext.cs: WarningLevel is 4 by default now.
7392 * statement.cs (Fixed.Resolve): Do not null
7395 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7398 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7399 deep search when property is not virtual.
7400 (PropertyExpr.ResolveAccessors): Make one call for both
7403 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7406 * statement.cs: Error 152 report constains also location.
7408 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7411 * const.cs: Explicitly set constant as static.
7413 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7416 * cs-parser.jay: Add error 1017 report.
7418 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7420 Fixed bug #59980, #64224
7421 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7423 * typemanager.cs (IsSpecialMethod): Simplified
7425 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7427 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7428 condition with better params.
7430 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7433 * attribute.cs (Resolve): Property has to have both
7436 2004-09-14 Martin Baulig <martin@ximian.com>
7438 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7440 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7443 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7444 called and is obsolete then this member suppress message
7445 when call is inside next [Obsolete] method or type.
7447 * expression.cs: Use TestObsoleteMethodUsage member.
7449 2004-09-14 Martin Baulig <martin@ximian.com>
7451 * cs-parser.jay: Sync a bit with the GMCS version.
7453 2004-09-14 Martin Baulig <martin@ximian.com>
7455 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7456 (CSharpParser.yacc_verbose_flag): New public field.
7458 * genericparser.cs: Removed.
7460 2004-09-14 Raja R Harinath <rharinath@novell.com>
7462 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7464 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7466 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7468 2004-09-10 Martin Baulig <martin@ximian.com>
7470 Backported my MemberName changes from GMCS into MCS.
7472 - we are now using a special `MemberName' class instead of using
7473 strings; in GMCS, the `MemberName' also contains the type
7476 - changed the grammar rules a bit:
7477 * the old `member_name' is now a `namespace_or_type_name':
7478 The rule is that we use `namespace_or_type_name' everywhere
7479 where we expect either a "member name" (GetEnumerator) or a
7480 "member name" with an explicit interface name
7481 (IEnumerable.GetEnumerator).
7482 In GMCS, the explicit interface name may include type arguments
7483 (IEnumerable<T>.GetEnumerator).
7484 * we use `member_name' instead of just `IDENTIFIER' for
7486 The rule is that we use `member_name' wherever a member may
7487 have type parameters in GMCS.
7489 * decl.cs (MemberName): New public class.
7490 (MemberCore.MemberName): New public readonly field.
7491 (MemberCore.ctor): Take a `MemberName' argument, not a string.
7492 (DeclSpace): Likewise.
7494 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7495 * enum.cs (Enum.ctor): Likewise.
7497 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7499 (AliasEntry.ctor): Take a MemberName, not an Expression.
7500 (AliasEntry.UsingAlias): Likewise.
7502 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7503 (IMethodData.MemberName): Changed type from string to MemberName.
7504 (MemberBase.ExplicitInterfaceName): Likewise.
7505 (AbstractPropertyEventMethod.SetupName): Make this private.
7506 (AbstractPropertyEventMethod.ctor): Added `string prefix'
7507 argument; compute the member name here.
7508 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7509 on the `member.MemberName' and the `prefix'.
7511 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7513 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7514 thus, we get a `MemberName' instead of a `string'. These
7515 declarations may have type parameters in GMCS.
7516 (interface_method_declaration, delegate_declaration): Likewise.
7517 (class_declaration, interface_declaration): Likewise.
7518 (method_header): Use `namespace_or_type_name' instead of
7519 `member_name'. We may be an explicit interface implementation.
7520 (property_declaration, event_declaration): Likewise.
7521 (member_name): This is now just an `IDENTIFIER', not a
7522 `namespace_or_type_name'.
7523 (type_name, interface_type): Removed.
7524 (namespace_or_type_name): Return a MemberName, not an Expression.
7525 (primary_expression): Use `member_name' instead of `IDENTIFIER';
7526 call GetTypeExpression() on the MemberName to get an expression.
7527 (IndexerDeclaration.interface_type): Changed type from string to
7529 (MakeName): Operate on MemberName's instead of string's.
7531 2004-09-13 Raja R Harinath <rharinath@novell.com>
7534 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7535 (NamespaceEntry.Lookup): Add new argument to flag if we want the
7536 lookup to avoid symbols introduced by 'using'.
7537 * rootcontext.cs (NamespaceLookup): Update.
7539 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7541 * class.cs (TypeContainer.DoDefineMembers): Do not call
7542 DefineDefaultConstructor for static classes.
7544 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7546 * attribute.cs (Attribute.Resolve): Add error 653 report.
7548 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7550 (Method.ApplyAttributeBuilder): Add error 685 report.
7551 (Operator.Define): Add error 564 report.
7553 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7555 * expression.cs (Invocation.DoResolve): Add error
7558 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7561 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7563 * class.cs (ConstructorInitializer.Resolve):
7564 Wrong error number (515->516).
7566 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7568 * class.cs (Indexer.Define): Add error 631 report.
7570 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7572 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7574 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7576 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7578 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7580 * cs-parser.jay: Added error CS0241 report.
7582 2004-09-10 Raja R Harinath <rharinath@novell.com>
7584 * cs-parser.jay (fixed_statement): Introduce a scope for the
7585 declaration in the 'fixed' statement.
7587 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7589 * cs-parser.jay: Added CS0230 error report.
7591 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7593 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7595 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7597 * expression.cs (Argument.Resolve): Added error CS0192 and
7600 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7602 C# 2.0 #pragma warning feature
7604 * cs-tokenizer.cs (PreProcessPragma): New method;
7605 Handles #pragma directive.
7607 * report.cs (WarningRegions): New class; Support
7608 class for #pragma warning directive. It tests whether
7609 warning is enabled for a given line.
7611 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7613 * const.cs: Add more descriptive error report, tahnks to
7616 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7618 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7620 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7622 * expression.cs: Apply patch from Ben: Remove dead code from
7623 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7624 as that code just threw an exception anwyays.
7626 * const.cs: Remove the call to the turnintoconstant, for details
7629 * literal.cs: The type of the null-literal is the null type; So
7630 we use a placeholder type (literal.cs:System.Null, defined here)
7633 * expression.cs (Conditional.DoResolve): Remove some old code that
7634 is no longer needed, conversions have been fixed.
7636 (ArrayCreationExpression.DoResolve): Return false if we fail to
7637 resolve the inner expression.
7639 2004-09-07 Raja R Harinath <rharinath@novell.com>
7642 * cs-parser.jay (delegate_declaration): Record a delegate
7643 declaration as a type declaration.
7644 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7646 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7648 * parameter.cs: Do not crash if the type can not be resolved.
7650 * expression.cs: Report errors with unsafe pointers, fixes #64896
7652 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7654 * expression.cs: Pointer arith always needs to do a conv.i
7655 if the operand is a long. fix 65320
7657 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7659 Fixed cs0619-37.cs, cs0619-38.cs
7661 * enum.cs (GetObsoleteAttribute): Removed.
7663 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7664 on Enum member is double staged. The first is tested member
7667 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7669 Fixed #56986, #63631, #65231
7671 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7672 adds member to name container.
7673 (TypeContainer.AddToTypeContainer): New method, adds type to
7675 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7676 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7677 AddOperator): Simplified by reusing AddToMemberContainer.
7678 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7680 (Method.CheckForDuplications): Fixed implementation to test all
7682 (MemberBase): Detection whether member is explicit interface
7683 implementation is now in constructor.
7684 (MemberBase.UpdateMemberName): Handles IndexerName.
7685 (Accessor): Changed to keep also location information.
7686 (AbstractPropertyEventMethod): Is derived from MemberCore.
7687 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7688 will be emited or not.
7689 (PropertyBase.AreAccessorsDuplicateImplementation):
7690 Tests whether accessors are not in collision with some method.
7691 (Operator): Is derived from MethodCore to simplify common
7694 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7696 (DeclSpace.AddToContainer): Adds the member to defined_names
7697 table. It tests for duplications and enclosing name conflicts.
7699 * enum.cs (EnumMember): Clean up to reuse the base structures
7701 2004-09-03 Martin Baulig <martin@ximian.com>
7703 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7704 into TypeContainer, to make partial classes work again.
7706 2004-09-03 Martin Baulig <martin@ximian.com>
7708 * rootcontext.cs (RootContext.V2): Removed.
7710 2004-03-23 Martin Baulig <martin@ximian.com>
7712 * expression.cs (Invocation.OverloadResolve): Added `bool
7713 may_fail' argument and use it instead of the Location.IsNull() hack.
7715 2004-09-03 Martin Baulig <martin@ximian.com>
7717 Merged latest changes into gmcs. Please keep this comment in
7718 here, it makes it easier for me to see what changed in MCS since
7719 the last time I merged.
7721 2004-09-03 Raja R Harinath <rharinath@novell.com>
7724 * expression.cs (BetterConversion): Don't allow either conversion
7725 to be null. Remove redundant implicit conversion test when 'q ==
7726 null' -- when this function is invoked, we already know that the
7727 implicit conversion exists.
7728 (BetterFunction): Assume that 'best' is non-null. Remove
7729 redundant reimplementation of IsApplicable when 'best' is null.
7730 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7731 number of arguments.
7732 (IsAncestralType): Extract from OverloadResolve.
7733 (OverloadResolve): Make robust to the MethodGroupExpr being
7734 unsorted. Implement all the logic of Section 14.5.5.1, and
7735 support overloading of methods from multiple applicable types.
7736 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7738 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7739 (RealError, Warning): Append type of report to related symbol.
7741 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7743 * enum.cs: Fixed CLS-Compliance checks for enum members.
7744 Error tests cs3008-8.cs, cs3014-8.cs
7746 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7748 Fixed bug #62342, #63102
7749 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7750 like ImplementMethod.
7752 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7754 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7757 2004-09-02 Martin Baulig <martin@ximian.com>
7759 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7760 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7763 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7765 C# 2.0 Static classes implemented
7767 * class.cs (TypeContainer): instance_constructors,
7768 initialized_fields, initialized_static_fields,
7769 default_constructor, base_inteface_types are protected to be
7770 accessible from StaticClass.
7771 (TypeContainer.DefineDefaultConstructor): New virtual method
7772 for custom default constructor generating
7773 (StaticClass): New class to handle "Static classes" feature.
7775 * cs-parser.jay: Handle static keyword on class like instance
7778 * driver.cs: Added "/langversion" command line switch with two
7779 options (iso-1, default).
7781 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7783 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7785 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7787 * delegate.cs: Style.
7789 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7791 * delegate.cs: Add seperate instance expr field for miguel.
7793 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7795 * PointerArithmetic (Resolve): make sure we are not doing
7796 pointer arith on void*. Also, make sure we are resolved
7797 by not setting eclass until resolve.
7799 All callers: Make sure that PointerArithmetic gets resolved.
7801 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7803 * ArrayCreation (LookupType): If the type does not resolve
7804 to an array, give an error.
7806 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7808 * statement.cs (Try.Resolve): Fixed bug #64222
7810 2004-08-27 Martin Baulig <martin@ximian.com>
7813 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7816 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7818 * ecore.cs (Constantify): Get underlying type via
7819 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7820 Windows in special cases.
7822 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7824 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7825 for obtaining also private methods.
7826 (GetRemoveMethod): Used GetRemoveMethod (true)
7827 for obtaining also private methods.
7829 2004-08-24 Martin Baulig <martin@ximian.com>
7831 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7832 MethodAttributes.HideBySig for operators.
7834 2004-08-23 Martin Baulig <martin@ximian.com>
7836 Back to the old error reporting system :-)
7838 * report.cs (Message): Removed.
7839 (Report.MessageData, ErrorData, WarningData): Removed.
7840 (Report.Error, Warning): Back to the old system.
7842 2004-08-23 Martin Baulig <martin@ximian.com>
7844 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7846 * class.cs (TypeContainer.ParentContainer): New public virtual
7847 method; replaces the explicit interface implementation.
7848 (ClassPart.ParentContainer): Override.
7850 2004-08-23 Martin Baulig <martin@ximian.com>
7852 * statement.cs (Switch): Added support for constant switches; see
7853 #59428 or test-285.cs.
7855 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7858 * statement.cs (GetEnumeratorFilter): Removed useless
7859 logic because C# specs is strict. GetEnumerator must be
7862 2004-08-22 Martin Baulig <martin@ximian.com>
7864 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7865 a switch and may break, reset the barrier. Fixes #59867.
7867 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7869 CLS-Compliance speed up (~5% for corlib)
7871 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7872 New method. Tests container for CLS-Compliant names
7874 * class.cs (TypeContainer.VerifyClsName): New method.
7875 Checks whether container name is CLS Compliant.
7876 (Constructor): Implements IMethodData.
7878 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7879 low-case table for CLS Compliance test.
7880 (MemberCache.VerifyClsParameterConflict): New method.
7881 Checks method parameters for CS3006 error.
7883 * enum.cs (EnumMember): Is derived from MemberCore.
7884 (Enum.VerifyClsName): Optimized for better performance.
7886 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7888 * report.cs: Renamed Error_T to Error and changed all
7891 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7893 * class.cs (TypeContainer.IndexerArrayList): New inner class
7894 container for indexers.
7895 (TypeContainer.DefaultIndexerName): New constant for default
7896 indexer name. Replaced all "Item" with this constant.
7897 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7899 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7900 DefaultMemberAttribute constructor.
7902 2004-08-05 Martin Baulig <martin@ximian.com>
7904 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7907 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7909 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7910 multi platforms problem.
7912 * compiler.csproj: Included shared files.
7914 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7916 Fix bug 60333, 55971 in the more general way
7917 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7918 Added arg_type argument for constant conversion.
7919 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7921 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7924 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7925 OperatorArrayList, MethodCoreArrayList for typecontainer
7926 containers. Changed class member types to these new types.
7927 (MethodArrayList.DefineMembers): Added test for CS0659.
7929 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7931 * cfold.cs: Synchronize the folding with the code in expression.cs
7932 Binary.DoNumericPromotions for uint operands.
7934 * attribute.cs: Revert patch from Raja, it introduced a regression
7935 while building Blam-1.2.1 (hard to isolate a test case).
7937 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7941 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7943 (MethodCore.parent_method): New member. The method we're overriding
7944 if this is an override method.
7945 (MethodCore.CheckBase): Moved from Method class and made common.
7946 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7948 (MethodCore.CheckForDuplications): New abstract method. For custom
7949 member duplication search in a container
7950 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7951 method and its return type.
7952 (Event.conflict_symbol): New member. Symbol with same name in the
7956 (MemberCache.FindMemberWithSameName): New method. The method
7957 is looking for conflict with inherited symbols.
7959 2004-08-04 Martin Baulig <martin@ximian.com>
7961 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7963 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7965 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7967 * report.cs (Message): New enum for better error, warning reference in
7969 (MessageData): New inner abstract class. It generally handles printing of
7970 error and warning messages.
7971 Removed unused Error, Warning, Message methods.
7973 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7975 Fix for cs0592-8.cs test
7977 (Attributable.ValidAttributeTargets): Made public.
7978 (Attribute.ExplicitTarget): New member for explicit target value.
7979 (Attribute.CheckTargets): Now we translate explicit attribute
7980 target to Target here.
7982 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7984 * ecore.cs (MethodGroupExpr): new IsBase property.
7986 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7988 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7989 rather than an instance expr.
7991 (DelegateCreation.Emit): Use the method group rather than
7992 the instance expression. Also, if you have base.Foo as the
7993 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7995 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7997 (NewDelegate.DoResolve): Only check for the existance of Invoke
7998 if the method is going to be needed. Use MethodGroupExpr.
8000 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8002 * expression.cs: For pointer arith., make sure to use
8003 the size of the type, not the size of the pointer to
8006 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8009 * class.cs (Class): Added error CS0502 test.
8011 2004-08-03 John Luke <jluke@cfl.rr.com>
8012 Raja R Harinath <rharinath@novell.com>
8015 * attribute.cs (Attribute.complained_before): New flag.
8016 (Attribute.ResolveType, Attribute.Resolve),
8017 (Attribute.DefinePInvokeMethod): Set it.
8018 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8020 2004-08-03 Martin Baulig <martin@ximian.com>
8022 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8023 use a user-defined operator; we still need to do numeric
8024 promotions in case one argument is a builtin type and the other
8025 one has an implicit conversion to that type. Fixes #62322.
8027 2004-08-02 Martin Baulig <martin@ximian.com>
8029 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8030 (LocalInfo.IsThis): New public property.
8031 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8033 2004-08-01 Martin Baulig <martin@ximian.com>
8035 * class.cs (TypeContainer.GetClassBases): Don't set the default
8036 here since we may get called from GetPartialBases().
8037 (TypeContainer.DefineType): If GetClassBases() didn't return a
8038 parent, use the default one.
8040 2004-07-30 Duncan Mak <duncan@ximian.com>
8042 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8044 2004-07-30 Martin Baulig <martin@ximian.com>
8046 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8048 * class.cs (SourceMethod): New public class, derive from the
8049 symbol writer's ISourceMethod.
8050 (Method): Use the new symbol writer API.
8052 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8053 as argument and use the new symbol writer.
8056 (SourceFile): Implement the symbol writer's ISourceFile.
8057 (Location.SymbolDocument): Removed.
8058 (Location.SourceFile): New public property.
8060 * symbolwriter.cs: Use the new symbol writer API.
8062 2004-07-30 Raja R Harinath <rharinath@novell.com>
8064 * Makefile (install-local): Remove. Functionality moved to
8067 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8069 * Makefile: Install mcs.exe.config file together with mcs.exe.
8070 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8071 correct runtime version.
8073 2004-07-25 Martin Baulig <martin@ximian.com>
8076 (TypeContainer.RegisterOrder): Removed, this was unused.
8077 (TypeContainer, interface_order): Removed.
8078 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8079 TypeContainer as argument since we can also be called with a
8080 `PartialContainer' for a partial class/struct/interface.
8081 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8082 of checking whether we're an `Interface' - we could be a
8084 (PartialContainer.Register): Override; call
8085 AddClass()/AddStruct()/AddInterface() on our parent.
8087 * cs-parser.jay (interface_member_declaration): Add things to the
8088 `current_container', not the `current_class'.
8090 * rootcontext.cs (RegisterOrder): The overloaded version which
8091 takes an `Interface' was unused, removed.
8093 * typemanager.cs (TypeManager.LookupInterface): Return a
8094 `TypeContainer', not an `Interface'.
8095 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8096 contain a `PartialContainer' for an interface, so check it's
8097 `Kind' to figure out what it is.
8099 2004-07-25 Martin Baulig <martin@ximian.com>
8101 * class.cs (Class.DefaultTypeAttributes): New public constant.
8102 (Struct.DefaultTypeAttributes): Likewise.
8103 (Interface.DefaultTypeAttributes): Likewise.
8104 (PartialContainer.TypeAttr): Override this and add the
8105 DefaultTypeAttributes.
8107 2004-07-25 Martin Baulig <martin@ximian.com>
8109 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8110 we can just use the `Parent' field instead.
8112 2004-07-25 Martin Baulig <martin@ximian.com>
8114 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8116 2004-07-25 Martin Baulig <martin@ximian.com>
8118 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8119 our parts before defining any methods.
8120 (TypeContainer.VerifyImplements): Make this virtual.
8121 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8122 on our PartialContainer.
8124 2004-07-25 Martin Baulig <martin@ximian.com>
8126 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8128 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8129 argument, we can just use the `Parent' field instead.
8132 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8133 (MemberBase.DoDefine): Likewise.
8135 2004-07-24 Martin Baulig <martin@ximian.com>
8137 * decl.cs (MemberCore.Parent): New public field.
8138 (DeclSpace.Parent): Moved to MemberCore.
8140 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8141 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8143 (FieldBase, Field, Operator): Likewise.
8144 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8145 (EventField, Event): Likewise.
8147 2004-07-23 Martin Baulig <martin@ximian.com>
8149 * class.cs (PartialContainer): New public class.
8150 (ClassPart): New public class.
8151 (TypeContainer): Added support for partial classes.
8152 (TypeContainer.GetClassBases): Splitted some of the functionality
8153 out into GetNormalBases() and GetPartialBases().
8155 * cs-tokenizer.cs (Token.PARTIAL): New token.
8156 (Tokenizer.consume_identifier): Added some hacks to recognize
8157 `partial', but only if it's immediately followed by `class',
8158 `struct' or `interface'.
8160 * cs-parser.jay: Added support for partial clases.
8162 2004-07-23 Martin Baulig <martin@ximian.com>
8164 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8165 a `DeclSpace' and also made it readonly.
8166 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8167 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8168 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8170 * cs-parser.jay: Pass the `current_class', not the
8171 `current_container' (at the moment, this is still the same thing)
8172 to a new Method, Property, Event, Indexer or Constructor.
8174 2004-07-23 Martin Baulig <martin@ximian.com>
8176 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8177 and removed the `current_interface' one.
8178 (struct_declaration, class_declaration, interface_declaration):
8179 Set `current_class' to the newly created class/struct/interface;
8180 set their `Bases' and call Register() before parsing their body.
8182 2004-07-23 Martin Baulig <martin@ximian.com>
8184 * class.cs (Kind): New public enum.
8185 (TypeContainer): Made this class abstract.
8186 (TypeContainer.Kind): New public readonly field.
8187 (TypeContainer.CheckDef): New public method; moved here from
8189 (TypeContainer.Register): New public abstract method.
8190 (TypeContainer.GetPendingImplementations): New public abstract
8192 (TypeContainer.GetClassBases): Removed the `is_class' and
8193 `is_iface' parameters.
8194 (TypeContainer.DefineNestedTypes): Formerly known as
8196 (ClassOrStruct): Made this class abstract.
8198 * tree.cs (RootTypes): New public type.
8200 2004-07-20 Martin Baulig <martin@ximian.com>
8202 * tree.cs (Tree.RecordNamespace): Removed.
8203 (Tree.Namespaces): Removed.
8205 * rootcontext.cs (RootContext.IsNamespace): Removed.
8207 * cs-parser.jay (namespace_declaration): Just create a new
8208 NamespaceEntry here.
8210 2004-07-20 Martin Baulig <martin@ximian.com>
8212 * statement.cs (ExceptionStatement): New abstract class. This is
8213 now used as a base class for everyone who's using `finally'.
8214 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8215 our local variables before using them.
8217 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8218 virtual method. This is used by Yield.Resolve() to "steal" an
8219 outer block's `finally' clauses.
8220 (FlowBranchingException): The .ctor now takes an ExceptionStatement
8223 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8224 version which takes an ExceptionStatement. This version must be
8225 used to create exception branchings.
8228 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8229 (Iterator.EmitMoveNext): Added exception support; protect the
8230 block with a `fault' clause, properly handle 'finally' clauses.
8231 (Iterator.EmitDispose): Run all the `finally' clauses here.
8233 2004-07-20 Martin Baulig <martin@ximian.com>
8235 * iterator.cs: This is the first of a set of changes in the
8236 iterator code. Match the spec more closely: if we're an
8237 IEnumerable, then GetEnumerator() must be called. The first time
8238 GetEnumerator() is called, it returns the current instance; all
8239 subsequent invocations (if any) must create a copy.
8241 2004-07-19 Miguel de Icaza <miguel@ximian.com>
8243 * expression.cs: Resolve the constant expression before returning
8246 2004-07-19 Martin Baulig <martin@ximian.com>
8248 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8249 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8250 the return type of the new EmitContext.
8252 2004-07-18 Martin Baulig <martin@ximian.com>
8254 * class.cs (Property.Define): Fix iterators.
8256 * iterators.cs (Iterator.Define): Moved the
8257 `container.AddInterator (this)' call here from the .ctor; only do
8258 it if we resolved successfully.
8260 2004-07-17 Miguel de Icaza <miguel@ximian.com>
8262 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8263 `true' for preprocessing directives that we parse. The return
8264 value indicates whether we should return to regular tokenizing or
8265 not, not whether it was parsed successfully.
8267 In the past if we were in: #if false ... #line #endif, we would
8268 resume parsing after `#line'. See bug 61604.
8270 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8271 building: IsEnumType should return true only for enums, not for
8272 enums or System.Enum itself. This fixes #61593.
8274 Likely what happened is that corlib was wrong: mcs depended on
8275 this bug in some places. The bug got fixed, we had to add the
8276 hack, which caused bug 61593.
8278 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8279 that was a workaround for the older conditions.
8281 2004-07-16 Ben Maurer <bmaurer@ximian.com>
8283 * assign.cs: IAssignMethod has a new interface, as documented
8284 inline. All assignment code now uses this new api.
8286 * ecore.cs, expression.cs: All classes which implement
8287 IAssignMethod now use the new interface.
8289 * expression.cs (Invocation): add a hack to EmitCall so that
8290 IndexerAccess can be the target of a compound assignment without
8291 evaluating its arguments twice.
8293 * statement.cs: Handle changes in Invocation api.
8295 2004-07-16 Martin Baulig <martin@ximian.com>
8297 * iterators.cs: Rewrote this. We're now using one single Proxy
8298 class for both the IEnumerable and the IEnumerator interface and
8299 `Iterator' derives from Class so we can use the high-level API.
8301 * class.cs (TypeContainer.AddIterator): New method.
8302 (TypeContainer.DoDefineType): New protected virtual method, which
8303 is called from DefineType().
8304 (TypeContainer.DoDefineMembers): Call DefineType() and
8305 DefineMembers() on all our iterators.
8306 (TypeContainer.Emit): Call Emit() on all our iterators.
8307 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8309 * codegen.cs (EmitContext.CurrentIterator): New public field.
8311 2004-07-15 Martin Baulig <martin@ximian.com>
8314 (TypeManager.not_supported_exception_type): New type.
8316 2004-07-14 Martin Baulig <martin@ximian.com>
8318 * iterators.cs: Use real error numbers.
8320 2004-07-14 Martin Baulig <martin@ximian.com>
8322 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8323 requires this to be a System.Collection.IEnumerable and not a
8324 class implementing that interface.
8325 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8327 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8329 * class.cs: Fixed previous fix, it broke some error tests.
8331 2004-07-12 Martin Baulig <martin@ximian.com>
8333 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8336 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8338 * assign.cs (LocalTemporary): Add new argument: is_address,If
8339 `is_address' is true, then the value that we store is the address
8340 to the real value, and not the value itself.
8342 * ecore.cs (PropertyExpr): use the new local temporary
8343 stuff to allow us to handle X.Y += z (where X is a struct)
8345 2004-07-08 Martin Baulig <martin@ximian.com>
8347 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8348 not always return, just like we're doing in Using.Resolve().
8350 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8352 * cs-parser.jay (fixed_statement): flag this as Pinned.
8354 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8356 * typemanager.cs (TypeManager): Removed MakePinned method, this
8357 mechanism is replaced with the .NET 2.x compatible mechanism of
8358 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8360 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8361 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8362 `IsFixed' property which has a different meaning.
8364 2004-07-02 Raja R Harinath <rharinath@novell.com>
8366 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8367 visible from inside a nested class, not just the names of the
8368 immediately enclosing class.
8371 2004-06-24 Raja R Harinath <rharinath@novell.com>
8373 * expression.cs (BetterConversion): Remove buggy special-case
8374 handling of "implicit constant expression conversions". At this
8375 point, we already know that the conversion is possible -- we're
8376 only checking to see which is better.
8378 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8380 * cs-parser.jay: Added error CS0210 test.
8382 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8384 * cs-parser.jay: Added error CS0134 test.
8386 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8389 * cs-parser.jay: Added error CS0145 test.
8391 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8393 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8395 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8397 * expression.cs (StackAlloc.Resolve): The argument may not
8398 be a constant; deal with this case.
8400 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8402 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8403 GetIndexerAttributeValue.
8404 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8406 * class.cs (Indexer.Define): Added error tests for CS0415,
8409 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8411 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8414 2004-06-23 Martin Baulig <martin@ximian.com>
8416 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8417 neither return nor throw, reset the barrier as well. Fixes #60457.
8419 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8421 * class.cs : EventAttributes is now set to None by default.
8422 This fixes bug #60459.
8424 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8427 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8428 Don't throw exception but return null (it's sufficient now).
8430 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8432 * typemanager.cs (GetArgumentTypes): Faster implementation.
8434 2004-06-18 Martin Baulig <martin@ximian.com>
8436 * attribute.cs (Attribute.Resolve): Check whether we're an
8437 EmptyCast which a Constant child. Fixes #60333.
8439 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8441 * statement.cs (EmitCollectionForeach): Account for the fact that
8442 not all valuetypes are in areas which we can take the address of.
8443 For these variables, we store to a temporary variable. Also, make
8444 sure that we dont emit a `callvirt' on a valuetype method.
8446 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8448 * expression.cs (StackAlloc.DoReSolve): Added test for
8449 negative parameter (CS0247).
8451 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8454 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8456 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8459 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8462 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8464 Fix bug #58254 & cs1555.cs, cs1556.cs
8465 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8467 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8469 * cs-parser.jay: Added error CS1669 test for indexers.
8471 2004-06-11 Martin Baulig <martin@ximian.com>
8473 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8474 call this twice: for params and varargs methods.
8476 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8479 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8481 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8483 * attribute.cs (Attribute.GetValidTargets): Made public.
8486 (AbstractPropertyEventMethod): New class for better code sharing.
8487 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8489 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8491 2004-06-11 Raja R Harinath <rharinath@novell.com>
8494 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8495 that the call to Resolve is part of a MemberAccess.
8496 (Expression.Resolve): Use it for SimpleName resolution.
8497 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8498 Add 'intermediate' boolean argument.
8499 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
8500 error message when the SimpleName can be resolved ambiguously
8501 between an expression and a type.
8502 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8504 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8505 call on the left-side.
8507 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8510 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8512 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8514 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8516 2004-06-11 Martin Baulig <martin@ximian.com>
8518 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8519 varargs methods if applicable.
8521 2004-06-11 Martin Baulig <martin@ximian.com>
8523 * expression.cs (Invocation.EmitCall): Don't use
8524 `method.CallingConvention == CallingConventions.VarArgs' since the
8525 method could also have `CallingConventions.HasThis'.
8527 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8529 * class.cs (Event.GetSignatureForError): Implemented.
8530 Fixed crash in error test cs3010.cs
8532 2004-06-10 Miguel de Icaza <miguel@ximian.com>
8534 * cs-tokenizer.cs: Change the way we track __arglist to be
8535 consistent with the other keywords.
8537 2004-06-09 Miguel de Icaza <miguel@ximian.com>
8539 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8542 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
8544 * codegen.cs: Check that all referenced assemblies have a strongname
8545 before strongnaming the compiled assembly. If not report error CS1577.
8546 Fix bug #56563. Patch by Jackson Harper.
8547 * typemanager.cs: Added a method to return all referenced assemblies.
8548 Fix bug #56563. Patch by Jackson Harper.
8550 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8553 (Method.ApplyAttributeBuilder): Moved and added conditional
8554 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8557 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8559 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8562 * class.cs: (EventField.attribute_targets): Changed default target.
8564 2004-06-08 Martin Baulig <martin@ximian.com>
8566 * expression.cs (Invocation.EmitCall): Enable varargs methods.
8568 2004-06-08 Martin Baulig <martin@ximian.com>
8570 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8572 2004-06-07 Martin Baulig <martin@ximian.com>
8574 Added support for varargs methods.
8576 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8579 * cs-parser.jay: Added support for `__arglist'.
8581 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8583 * expression.cs (Argument.AType): Added `ArgList'.
8584 (Invocation): Added support for varargs methods.
8585 (ArglistAccess): New public class.
8586 (Arglist): New public class.
8588 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8590 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
8591 a method's top-level block if the method has varargs.
8593 * support.cs (ReflectionParameters, InternalParameters): Added
8594 support for varargs methods.
8596 2004-06-07 Miguel de Icaza <miguel@ximian.com>
8598 * class.cs: Provide location in indexer error report.
8600 * driver.cs: Use standard names.
8602 * namespace.cs: Catch the use of using after a namespace has been
8603 declared also on using aliases.
8605 2004-06-03 Raja R Harinath <rharinath@novell.com>
8608 * typemanager.cs (closure_private_ok, closure_invocation_type)
8609 (closure_qualifier_type, closure_invocation_assembly)
8610 (FilterWithClosure): Move to ...
8611 (Closure): New internal nested class.
8612 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8613 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8614 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8615 (MemberLookup, MemberLookupFailed): Use it.
8616 * expression.cs (New.DoResolve): Treat the lookup for the
8617 constructor as being qualified by the 'new'ed type.
8618 (Indexers.GetIndexersForTypeOrInterface): Update.
8620 2004-06-03 Marek Safar <marek.safar@seznam.cz>
8623 (GetConditionalAttributeValue): New method. Returns
8624 condition of ConditionalAttribute.
8625 (SearchMulti): New method. Returns all attributes of type 't'.
8626 Use it when attribute is AllowMultiple = true.
8627 (IsConditionalMethodExcluded): New method.
8630 (Method.IsExcluded): Implemented. Returns true if method has conditional
8631 attribute and the conditions is not defined (method is excluded).
8632 (IMethodData): Extended interface for ConditionalAttribute support.
8633 (PropertyMethod.IsExcluded): Implemented.
8636 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8639 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8642 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
8644 * expression.cs (ArrayCreationExpression): Make this just an
8645 `expression'. It can't be a statement, so the code here was
8648 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8651 * typemanager.cs (GetFullNameSignature): New method for
8654 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8657 * class.cs (MemberBase.GetSignatureForError): New virtual method.
8658 Use this method when MethodBuilder is null.
8659 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8660 Added test for error CS0626 (MONO reports error for this situation).
8661 (IMethodData.GetSignatureForError): Extended interface.
8663 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8666 (AttributeTester.GetObsoleteAttribute): Returns instance of
8667 ObsoleteAttribute when type is obsolete.
8670 (TypeContainer.VerifyObsoleteAttribute): Override.
8671 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8672 (MethodCode.VerifyObsoleteAttribute): Override.
8673 (MemberBase.VerifyObsoleteAttribute): Override.
8676 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8677 and report proper error.
8680 Delegate.VerifyObsoleteAttribute): Override.
8683 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8684 and report proper error.
8685 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8688 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8692 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8693 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8694 Added test for ObsoleteAttribute.
8697 (Catch): Derived from Statement.
8699 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8701 Fixed bug #59071 & cs0160.cs
8703 * statement.cs (Try.Resolve): Check here whether order of catch
8704 clauses matches their dependencies.
8706 2004-05-31 Miguel de Icaza <miguel@ximian.com>
8708 * Reverted patch to namespace.cs (Use lookuptypedirect). This
8709 caused a regression: #59343. Referencing nested classes from an
8710 assembly stopped working.
8712 2004-05-31 Martin Baulig <martin@ximian.com>
8714 MCS is now frozen for beta 2.
8716 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8718 * convert.cs: add a trivial cache for overload operator resolution.
8720 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8722 * decl.cs: If possible, use lookuptypedirect here. We can only do
8723 this if there is no `.' after the namespace. Avoids using
8724 LookupType, which does lots of slow processing.
8725 (FindNestedType) New method, does what it says :-).
8726 * namespace.cs: use LookupTypeDirect.
8727 * rootcontext.cs: use membercache, if possible.
8728 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8730 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8733 According to the spec,
8735 In a member access of the form E.I, if E is a single identifier,
8736 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8737 field, property, localvariable, or parameter with the same type as
8738 the meaning of E as a type-name (§3.8), then both possible
8739 meanings of E are permitted.
8741 We did not check that E as a simple-name had the same type as E as
8744 This trivial check gives us 5-7% on bootstrap time.
8746 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8748 * expression.cs (Invocation.OverloadResolve): Avoid the
8749 use of hashtables and boxing here by allocating on demand.
8751 2004-05-30 Martin Baulig <martin@ximian.com>
8753 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8754 we're doing a silent lookup. Don't try to lookup nested types in
8755 TypeManager.object_type (thanks to Ben Maurer).
8757 2004-05-30 Martin Baulig <martin@ximian.com>
8759 Committing a patch from Ben Maurer.
8761 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8763 2004-05-29 Martin Baulig <martin@ximian.com>
8765 * class.cs (IMethodData.ShouldIgnore): New method.
8767 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8768 `Location' argument, we don't need it anywhere. Use
8769 `IMethodData.ShouldIgnore ()' instead of
8770 `MethodData.GetMethodFlags ()'.
8771 (TypeManager.AddMethod): Removed.
8772 (TypeManager.AddMethod2): Renamed to AddMethod.
8774 2004-05-29 Martin Baulig <martin@ximian.com>
8776 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8778 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8779 converting from a class type S to an interface type and we already
8780 have an object on the stack, don't box it again. Fixes #52578.
8782 2004-05-29 Martin Baulig <martin@ximian.com>
8784 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8785 Added support for `params' parameters. Fixes #59267.
8787 2004-05-29 Martin Baulig <martin@ximian.com>
8789 * literal.cs (NullPointer): Provide a private .ctor which sets
8790 `type' to TypeManager.object_type. Fixes #59048.
8792 2004-05-29 Martin Baulig <martin@ximian.com>
8794 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8795 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8797 * ecore.cs (EventExpr.instance_expr): Make the field private.
8799 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8801 Fixed bug #50080 & cs0214-2.cs
8802 * expression.cs (Cast.DoResolve): Check unsafe context here.
8804 * statement.cs (Resolve.DoResolve): Likewise.
8806 2004-05-26 Martin Baulig <martin@ximian.com>
8808 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8810 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8811 (RootContext.LookupType): Pass down the `silent' flag.
8813 2004-05-25 Martin Baulig <martin@ximian.com>
8816 (MethodGroupExpr.IdenticalTypeName): New public property.
8817 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8818 expression actually refers to a type.
8820 2004-05-25 Martin Baulig <martin@ximian.com>
8822 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8823 for #56176 and made it actually work.
8825 2004-05-25 Martin Baulig <martin@ximian.com>
8827 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8828 (FieldExpr, PropertyExpr): Override and implement
8829 CacheTemporaries. Fixes #52279.
8831 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8833 * location.cs: In the new compiler listing a file twice is a
8834 warning, not an error.
8836 2004-05-24 Martin Baulig <martin@ximian.com>
8838 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8839 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8841 2004-05-24 Martin Baulig <martin@ximian.com>
8843 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8844 walking the `using' list. Fixes #53921.
8846 2004-05-24 Martin Baulig <martin@ximian.com>
8848 * const.cs (Const.LookupConstantValue): Added support for
8849 EmptyCast's; fixes #55251.
8851 2004-05-24 Martin Baulig <martin@ximian.com>
8853 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8854 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8855 which does the CS0135 check. The reason is that we first need to
8856 check whether the variable actually exists.
8858 2004-05-24 Martin Baulig <martin@ximian.com>
8860 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8861 than RootContext.LookupType() to find the explicit interface
8864 2004-05-24 Raja R Harinath <rharinath@novell.com>
8866 * Makefile: Simplify. Use executable.make.
8867 * mcs.exe.sources: New file. List of sources of mcs.exe.
8869 2004-05-24 Anders Carlsson <andersca@gnome.org>
8873 Use the invariant culture when doing String.Compare for CLS case
8876 2004-05-23 Martin Baulig <martin@ximian.com>
8878 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8879 don't have any dots. Fixes #52622, added cs0246-8.cs.
8881 * namespace.cs (NamespaceEntry.Lookup): Likewise.
8883 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8885 * class.cs (MemberBase.Define): Reuse MemberType member for
8886 resolved type. Other methods can use it too.
8888 2004-05-23 Martin Baulig <martin@ximian.com>
8890 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8891 the variable also exists in the current block (otherwise, we need
8892 to report a CS0103). Fixes #58670.
8894 2004-05-23 Martin Baulig <martin@ximian.com>
8896 * flowanalysis.cs (Reachability.Reachable): Compute this
8897 on-the-fly rather than storing it as a field.
8899 2004-05-23 Martin Baulig <martin@ximian.com>
8901 * flowanalysis.cs (Reachability.And): Manually compute the
8902 resulting `barrier' from the reachability.
8904 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8907 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8908 instance of ObsoleteAttribute when symbol is obsolete.
8911 (IMethodData): Extended interface for ObsoleteAttribute support.
8913 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8915 * attribute.cs: Fix bug #55970
8917 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8921 (GetObsoleteAttribute): New method. Creates the instance of
8923 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8924 ObsoleteAttribute when member is obsolete.
8925 (AttributeTester.Report_ObsoleteMessage): Common method for
8926 Obsolete error/warning reporting.
8929 (TypeContainer.base_classs_type): New member for storing parent type.
8932 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8933 for this MemberCore.
8935 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8937 * attribute.cs, const.cs: Fix bug #58590
8939 2004-05-21 Martin Baulig <martin@ximian.com>
8941 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8942 out parameters if the end of the method is unreachable. Fixes
8945 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8947 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8948 Hari was right, why extra method.
8950 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8952 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8954 2004-05-20 Martin Baulig <martin@ximian.com>
8956 Merged this back from gmcs to keep the differences to a minumum.
8958 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8959 instead of a Declspace.
8960 (Attribute.ResolveType): Likewise.
8961 (Attributes.Search): Likewise.
8962 (Attributes.Contains): Likewise.
8963 (Attributes.GetClsCompliantAttribute): Likewise.
8965 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8967 (MethodData.ApplyAttributes): Take an EmitContext instead of a
8970 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8972 Fix bug #58688 (MCS does not report error when the same attribute
8975 * attribute.cs (Attribute.Emit): Distinction between null and default.
8977 2004-05-19 Raja R Harinath <rharinath@novell.com>
8979 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8980 of a top-level attribute without an attribute target.
8981 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8983 (Attribute.Conditional_GetConditionName),
8984 (Attribute.Obsolete_GetObsoleteMessage): Update.
8985 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8986 part of ScanForIndexerName.
8987 (Attribute.CanIgnoreInvalidAttribute): New function.
8988 (Attribute.ScanForIndexerName): Move to ...
8989 (Attributes.ScanForIndexerName): ... here.
8990 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8991 (Attributes.Search): New internal variant that can choose not to
8992 complain if types aren't resolved. The original signature now
8994 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8995 complaints suppressed.
8996 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8997 only if it not useful.
8998 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8999 top-level for attributes that are shared between the assembly
9000 and a top-level class.
9001 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9002 * class.cs: Update to reflect changes.
9003 (DefineIndexers): Fuse loops.
9004 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9005 a couple more variants of attribute names.
9007 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9009 Fix bug #52585 (Implemented explicit attribute declaration)
9012 (Attributable.ValidAttributeTargets): New abstract method. It gets
9013 list of valid attribute targets for explicit target declaration.
9014 (Attribute.Target): It holds target itself.
9015 (AttributeSection): Removed.
9016 (Attribute.CheckTargets): New method. It checks whether attribute
9017 target is valid for the current element.
9020 (EventProperty): New class. For events that are declared like
9021 property (with add and remove accessors).
9022 (EventField): New class. For events that are declared like field.
9025 * cs-parser.jay: Implemented explicit attribute target declaration.
9027 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9028 Override ValidAttributeTargets.
9031 (ReturnParameter): Class for applying custom attributes on
9033 (ParameterAtribute): New class. Class for applying custom
9034 attributes on the parameter type.
9036 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9038 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9041 (Method): Allow UNSAFE here.
9043 * modifiers.cs: Support unsafe reporting.
9045 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9047 * decl.cs: Fix bug #58478.
9049 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9051 * statement.cs: When checking for unreachable code on an EmptyStatement,
9052 set the location. Fixes bug #58488.
9054 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9056 * driver.cs: Add -pkg handling.
9058 From Gonzalo: UseShelLExecute=false
9060 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9063 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9065 (Attribute.IsClsCompliaceRequired): Moved to base for better
9067 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9068 when attribute is AttributeUsageAttribute.
9069 (Attribute.GetValidTargets): Simplified.
9070 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9071 attribute for this type.
9072 (Attribute.ApplyAttributes): Method renamed to Emit and make
9074 (GlobalAttributeSection): New class for special handling of global
9075 attributes (assembly, module).
9076 (AttributeSection.Emit): New method.
9078 * class.cs: Implemented Attributable abstract methods.
9079 (MethodCore.LabelParameters): Moved to Parameter class.
9080 (Accessor): Is back simple class.
9081 (PropertyMethod): Implemented Attributable abstract class.
9082 (DelegateMethod): Implemented Attributable abstract class.
9083 (Event): New constructor for disctintion between normal Event
9084 and Event with accessors.
9086 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9088 * codegen.cs, const.cs, decl.cs, delegate.cs:
9089 (CommonAssemblyModulClass): Implemented Attributable abstract class
9092 * enum.cs: Implement IAttributeSupport interface.
9093 (EnumMember): New class for emum members. Implemented Attributable
9097 (ParameterBase): Is abstract.
9098 (ReturnParameter): New class for easier [return:] attribute handling.
9100 * typemanager.cs: Removed builder_to_attr.
9102 2004-05-11 Raja R Harinath <rharinath@novell.com>
9105 * attribute.cs (Attribute.GetPositionalValue): New function.
9106 * class.cs (TypeContainer.VerifyMembers): New function.
9107 (TypeContainer.Emit): Use it.
9108 (ClassOrStruct): New base class for Class and Struct.
9109 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9110 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9112 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9113 then each non-static field should have a FieldOffset attribute.
9114 Otherwise, none of the fields should have a FieldOffset attribute.
9115 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9116 and FieldOffset attributes.
9117 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9118 (TypeManager.field_offset_attribute_type): New core types.
9119 (TypeManager.InitCoreTypes): Initialize them.
9121 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9123 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9124 Return correct type.
9127 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9129 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9130 be implicitly converted to ulong.
9132 * expression.cs: The logic for allowing operator &, | and ^ worked
9133 was wrong, it worked before because we did not report an error in
9134 an else branch. Fixes 57895.
9136 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9137 allow volatile fields to be reference types.
9139 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9141 * driver.cs: Add support for /debug-
9143 2004-05-07 Raja R Harinath <rharinath@novell.com>
9145 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9146 Add a 'complain' parameter to silence errors.
9147 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9148 silently overlooked type-resolutions.
9149 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9151 (Attributes.Search): New function.
9152 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9153 (Attributes.GetAttributeFullName): Remove hack.
9154 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9155 Update to reflect changes.
9156 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9157 Use Attributes.Search instead of nested loops.
9159 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9162 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9163 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9164 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9166 * report.cs: (Report.Warning): Renamed to Warning_T because of
9167 parameter collision.
9169 2004-05-05 Raja R Harinath <rharinath@novell.com>
9171 * expression.cs (MemberAccess.ResolveMemberAccess):
9172 Exit with non-zero status after Report.Error.
9173 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9175 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9177 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9179 * support.cs: Don't hang when the file is empty.
9181 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9183 * support.cs: In SeekableStreamReader, compute the preamble size of the
9184 underlying stream. Position changes should take into account that initial
9187 2004-05-03 Todd Berman <tberman@sevenl.net>
9189 * driver.cs: remove unused GetSysVersion function.
9191 2004-05-03 Todd Berman <tberman@sevenl.net>
9193 * driver.cs: Remove the hack from saturday, as well as the hack
9194 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9195 link_paths to get that bit proper.
9197 2004-05-01 Todd Berman <tberman@sevenl.net>
9199 * driver.cs: Try a LoadFrom before a Load, this checks the current
9200 path. This is currently a bug in mono that is be fixed, however, this
9201 provides a workaround for now. This will be removed when the bug
9204 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9206 * CryptoConvert.cs: Updated to latest version. Fix issue with
9207 incomplete key pairs (#57941).
9209 2004-05-01 Todd Berman <tberman@sevenl.net>
9211 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9214 2004-04-30 Jackson Harper <jackson@ximian.com>
9216 * codegen.cs: Open keys readonly.
9218 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9220 * typemanager.cs: don't report cyclic struct layout when a struct
9221 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9222 which has 2 Pango.Rectangle fields.
9224 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9226 * expression.cs: Handle IntPtr comparisons with IL code
9227 rather than a method call.
9229 2004-04-29 Martin Baulig <martin@ximian.com>
9231 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9232 the list of PropertyInfo's in class hierarchy and find the
9233 accessor. Fixes #56013.
9235 2004-04-29 Martin Baulig <martin@ximian.com>
9237 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9239 2004-04-29 Martin Baulig <martin@ximian.com>
9241 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9243 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9245 2004-04-29 Martin Baulig <martin@ximian.com>
9247 * class.cs (ConstructorInitializer.Resolve): Check whether the
9248 parent .ctor is accessible. Fixes #52146.
9250 2004-04-29 Martin Baulig <martin@ximian.com>
9252 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9254 * statement.cs (Using.EmitLocalVariableDecls): Use
9255 TypeManager.idisposable_type, not typeof (IDisposable).
9256 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9258 2004-04-29 Martin Baulig <martin@ximian.com>
9260 * class.cs (Event.Define): Don't emit the field and don't set
9261 RTSpecialName and SpecialName for events on interfaces. Fixes
9264 2004-04-29 Raja R Harinath <rharinath@novell.com>
9266 Refactor Attribute.ApplyAttributes.
9267 * attribute.cs (Attributable): New base class for objects that can
9268 have Attributes applied on them.
9269 (Attribute): Make AttributeUsage fields public.
9270 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9271 (Attribute.IsInternalCall): New property.
9272 (Attribute.UsageAttr): Convert to a public read-only property.
9273 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9274 (Attribute.ResolveType, Attribute.Resolve)
9275 (Attribute.ScanForIndexerName): Update to reflect changes.
9276 (Attribute.CheckAttributeTarget): Re-format.
9277 (Attribute.ApplyAttributes): Refactor, to various
9278 Attributable.ApplyAttributeBuilder methods.
9279 * decl.cs (MemberCore): Make Attributable.
9280 * class.cs (Accessor): Make Attributable.
9281 (MethodData.ApplyAttributes): Use proper attribute types, not
9283 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9284 (TypeContainer.ApplyAttributeBuilder)
9285 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9286 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9287 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9288 (Operator.ApplyAttributeBuilder): New factored-out methods.
9289 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9290 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9291 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9292 * parameter.cs (ParameterBase): New Attributable base class
9293 that can also represent Return types.
9294 (Parameter): Update to the changes.
9296 2004-04-29 Jackson Harper <jackson@ximian.com>
9298 * driver.cs: Prefer the corlib system version when looking for
9299 assemblies in the GAC. This is still a hack, but its a better hack
9302 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9304 * decl.cs, enum.cs: Improved error 3005 reporting.
9306 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9307 (related_symbols): New private member for list of symbols
9308 related to reported error/warning.
9310 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9312 2004-04-29 Martin Baulig <martin@ximian.com>
9314 * ecore.cs (Expression.Constantify): If we're an enum and
9315 TypeManager.TypeToCoreType() doesn't give us another type, use
9316 t.UnderlyingSystemType. Fixes #56178.
9318 2004-04-29 Martin Baulig <martin@ximian.com>
9320 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9321 interfaces and for each interface, only add members directly
9322 declared in that interface. Fixes #53255.
9324 2004-04-28 Martin Baulig <martin@ximian.com>
9326 * expression.cs (ConditionalLogicalOperator): Use a temporary
9327 variable for `left' to avoid that we evaluate it more than once;
9330 2004-04-28 Martin Baulig <martin@ximian.com>
9332 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9335 2004-04-28 Martin Baulig <martin@ximian.com>
9337 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9340 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9341 whether the type is not void (CS1547).
9343 2004-04-28 Martin Baulig <martin@ximian.com>
9345 * expression.cs (Unary.DoResolveLValue): Override this and report
9346 CS0131 for anything but Operator.Indirection.
9348 2004-04-28 Martin Baulig <martin@ximian.com>
9350 Committing a patch from Ben Maurer; see bug #50820.
9352 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9355 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9358 2004-04-28 Martin Baulig <martin@ximian.com>
9360 Committing a patch from Ben Maurer; see bug #50820.
9362 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9365 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9368 2004-04-28 Martin Baulig <martin@ximian.com>
9370 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9371 (Block.AddLabel): Call DoLookupLabel() to only search in the
9374 2004-04-28 Martin Baulig <martin@ximian.com>
9376 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9377 comparing StringConstants and NullLiterals in Equality and Inequality.
9379 2004-04-28 Jackson Harper <jackson@ximian.com>
9381 * driver.cs: Attempt to load referenced assemblies from the
9382 GAC. This is the quick and dirty version of this method that
9383 doesnt take into account versions and just takes the first
9384 canidate found. Will be good enough for now as we will not have more
9385 then one version installed into the GAC until I update this method.
9387 2004-04-28 Martin Baulig <martin@ximian.com>
9389 * typemanager.cs (TypeManager.CheckStructCycles): New public
9390 static method to check for cycles in the struct layout.
9392 * rootcontext.cs (RootContext.PopulateTypes): Call
9393 TypeManager.CheckStructCycles() for each TypeContainer.
9394 [Note: We only need to visit each type once.]
9396 2004-04-28 Martin Baulig <martin@ximian.com>
9398 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9400 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9401 success and added `out object value'. Use a `bool resolved' field
9402 to check whether we've already been called rather than
9403 `ConstantValue != null' since this breaks for NullLiterals.
9405 2004-04-28 Raja R Harinath <rharinath@novell.com>
9407 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9408 setting of this flag, since the 'set' method may be non-public.
9410 2004-04-28 Raja R Harinath <rharinath@novell.com>
9412 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9413 check on current_vector.Block.
9415 2004-04-27 Martin Baulig <martin@ximian.com>
9417 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9418 a field initializer. Fixes #56459.
9420 2004-04-27 Martin Baulig <martin@ximian.com>
9422 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9423 we're not attempting to use an indexer. Fixes #52154.
9425 2004-04-27 Martin Baulig <martin@ximian.com>
9427 * statement.cs (Return): Don't create a return label if we don't
9428 need it; reverts my change from January 20th. Thanks to Ben
9431 2004-04-27 Martin Baulig <martin@ximian.com>
9433 According to the spec, `goto' can only leave a nested scope, but
9436 * statement.cs (Block.LookupLabel): Only lookup in the current
9437 block, don't recurse into parent or child blocks.
9438 (Block.AddLabel): Check in parent and child blocks, report
9439 CS0140/CS0158 if we find a duplicate.
9440 (Block): Removed this indexer for label lookups.
9441 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9442 this already does the error reporting for us.
9445 (FlowBranching.UsageVector.Block): New public variable; may be null.
9446 (FlowBranching.CreateSibling): Added `Block' argument.
9447 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9448 label for the target of a `goto' and check whether we're not
9449 leaving a `finally'.
9451 2004-04-27 Martin Baulig <martin@ximian.com>
9453 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9454 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9457 2004-04-27 Martin Baulig <martin@ximian.com>
9459 * statement.cs (Block.AddLabel): Also check for implicit blocks
9460 and added a CS0158 check.
9462 2004-04-27 Martin Baulig <martin@ximian.com>
9464 * flowanalysis.cs (FlowBranchingLoop): New class.
9465 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9466 UsageVector's instead of an ArrayList.
9467 (FlowBranching.Label): Likewise.
9468 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9469 (FlowBranching.AddBreakVector): New method.
9471 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9473 * attribute.cs: Small regression fix: only convert the type if we
9474 the type is different, fixes System.Drawing build.
9476 2004-04-27 Martin Baulig <martin@ximian.com>
9478 * attribute.cs (Attribute.Resolve): If we have a constant value
9479 for a named field or property, implicity convert it to the correct
9482 2004-04-27 Raja R Harinath <rharinath@novell.com>
9484 * statement.cs (Block.Block): Implicit blocks share
9485 'child_variable_names' fields with parent blocks.
9486 (Block.AddChildVariableNames): Remove.
9487 (Block.AddVariable): Mark variable as "used by a child block" in
9488 every surrounding block.
9489 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9490 been used in a child block, complain about violation of "Invariant
9491 meaning in blocks" rule.
9492 * cs-parser.jay (declare_local_variables): Don't use
9493 AddChildVariableNames.
9494 (foreach_statement): Don't create an implicit block: 'foreach'
9497 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9499 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9500 converting from 0L to ulong. Fixes 57522.
9502 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9504 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9505 derived class hides via 'new' keyword field from base class (test-242.cs).
9506 TODO: Handle this in the more general way.
9508 * class.cs (CheckBase): Ditto.
9510 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9512 * decl.cs (caching_flags): New member for storing cached values
9514 (MemberCore.Flags): New enum where bit flags for caching_flags
9516 (MemberCore.cls_compliance): Moved to caching_flags.
9517 (DeclSpace.Created): Moved to caching_flags.
9519 * class.cs: Use caching_flags instead of DeclSpace.Created
9521 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9523 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9524 if we are only a derived class, not a nested class.
9526 * typemanager.cs: Same as above, but do this at the MemberLookup
9527 level (used by field and methods, properties are handled in
9528 PropertyExpr). Allow for the qualified access if we are a nested
9531 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9533 * class.cs: Refactoring.
9534 (IMethodData): New inteface; Holds links to parent members
9535 to avoid member duplication (reduced memory allocation).
9536 (Method): Implemented IMethodData interface.
9537 (PropertyBase): New inner classes for get/set methods.
9538 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9539 (Event): New inner classes for add/remove methods.
9540 (Event.DelegateMethod): Implemented IMethodData interface.
9542 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9543 EmitContext (related to class.cs refactoring).
9545 2004-04-21 Raja R Harinath <rharinath@novell.com>
9547 * delegate.cs (Delegate.VerifyApplicability): If the number of
9548 arguments are the same as the number of parameters, first try to
9549 verify applicability ignoring any 'params' modifier on the last
9553 2004-04-16 Raja R Harinath <rharinath@novell.com>
9555 * class.cs (TypeContainer.AddIndexer): Use
9556 'ExplicitInterfaceName' to determine if interface name was
9557 explicitly specified. 'InterfaceType' is not initialized at this time.
9558 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9559 Indexers array is already in the required order. Initialize
9560 'IndexerName' only if there are normal indexers.
9561 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9562 (TypeContainer.Emit): Emit DefaultMember attribute only if
9563 IndexerName is initialized.
9566 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9568 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9571 2004-04-15 Raja R Harinath <rharinath@novell.com>
9573 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9577 * attribute.cs (Attribute.Resolve): Check for duplicate named
9581 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9583 * iterators.cs (MarkYield): track whether we are in an exception,
9584 and generate code accordingly. Use a temporary value to store the
9585 result for our state.
9587 I had ignored a bit the interaction of try/catch with iterators
9588 since their behavior was not entirely obvious, but now it is
9589 possible to verify that our behavior is the same as MS .NET 2.0
9593 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9595 * iterators.cs: Avoid creating temporaries if there is no work to
9598 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9599 Enumerations, use TypeManager.EnumToUnderlying and call
9602 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9605 (This.Emit): Use EmitContext.EmitThis to emit our
9608 (This.EmitAssign): Ditto.
9610 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9611 codepaths, we will move all the functionality into
9614 (FieldExpr.EmitAssign): Ditto.
9616 This fixes several hidden bugs that I uncovered while doing a code
9617 review of this today.
9619 * codegen.cs (EmitThis): reworked so the semantics are more clear
9620 and also support value types "this" instances.
9622 * iterators.cs: Changed so that for iterators in value types, we
9623 do not pass the value type as a parameter.
9625 Initialization of the enumerator helpers is now done in the caller
9626 instead of passing the parameters to the constructors and having
9627 the constructor set the fields.
9629 The fields have now `assembly' visibility instead of private.
9631 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9633 * expression.cs (Argument.Resolve): Check if fields passed as ref
9634 or out are contained in a MarshalByRefObject.
9636 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9637 another compiler type.
9639 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9641 * class.cs (Indexer.Define): use the new name checking method.
9642 Also, return false on an error.
9643 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9644 (is_identifier_[start/part]_character): make static.
9646 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9648 * expression.cs (Binary.ResolveOperator): Do no append strings
9649 twice: since we can be invoked more than once (array evaluation)
9650 on the same concatenation, take care of this here. Based on a fix
9651 from Ben (bug #56454)
9653 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9655 * codegen.cs: Fix another case where CS1548 must be reported (when
9656 delay-sign isn't specified and no private is available #56564). Fix
9657 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9658 error when MCS is used on the MS runtime and we need to delay-sign
9659 (which seems unsupported by AssemblyBuilder - see #56621).
9661 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9663 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9664 (TypeManager.ComputeNamespaces): Faster implementation for
9667 * compiler.csproj: Updated AssemblyName to mcs.
9669 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9671 * rootcontext.cs: Add new types to the boot resolution.
9673 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9674 MulticastDelegate is not allowed.
9676 * typemanager.cs: Add new types to lookup: System.TypedReference
9679 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9680 check for TypedReference or ArgIterator, they are not allowed.
9682 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9683 makes us properly catch 1510 in some conditions (see bug 56016 for
9686 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9688 * CryptoConvert.cs: update from corlib version
9691 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9693 * class.cs (Indexer.Define): Check indexername declaration
9695 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9697 * attribute.cs (IsClsCompliant): Fixed problem with handling
9698 all three states (compliant, not-compliant, undetected).
9700 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9702 * attribute.cs (Attribute): Location is now public.
9703 (Resolve): Store resolved arguments (pos_values) in attribute class.
9704 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9705 (GetClsCompliantAttributeValue): New method that gets
9706 CLSCompliantAttribute value.
9707 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9708 if exists else null.
9709 (AttributeTester): New class for CLS-Compliant verification routines.
9711 * class.cs (Emit): Add CLS-Compliant verification.
9712 (Method.GetSignatureForError): Implemented.
9713 (Constructor.GetSignatureForError): Implemented
9714 (Constructor.HasCompliantArgs): Returns if constructor has
9715 CLS-Compliant arguments.
9716 (Constructor.Emit): Override.
9717 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9718 is needed to test only parameters.
9719 (FieldBase.GetSignatureForError): Implemented.
9720 (TypeContainer): New member for storing base interfaces.
9721 (TypeContainer.FindMembers): Search in base interfaces too.
9723 * codegen.cs (GetClsComplianceAttribute): New method that gets
9724 assembly or module CLSCompliantAttribute value.
9725 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9727 (ModuleClass.Emit): Add error 3012 test.
9729 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9731 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9732 state for all decl types.
9733 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9734 if CLS-Compliant tests are required.
9735 (IsClsCompliaceRequired): New method. Analyze whether code
9736 must be CLS-Compliant.
9737 (IsExposedFromAssembly): New method. Returns true when MemberCore
9738 is exposed from assembly.
9739 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9740 value or gets cached value.
9741 (HasClsCompliantAttribute): New method. Returns true if MemberCore
9742 is explicitly marked with CLSCompliantAttribute.
9743 (IsIdentifierClsCompliant): New abstract method. This method is
9744 used to testing error 3005.
9745 (IsIdentifierAndParamClsCompliant): New method. Common helper method
9746 for identifier and parameters CLS-Compliant testing.
9747 (VerifyClsCompliance): New method. The main virtual method for
9748 CLS-Compliant verifications.
9749 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9750 null. I don't know why is null (too many public members !).
9751 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9752 and get value of first CLSCompliantAttribute that found.
9754 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9755 (VerifyClsCompliance): Override and add extra tests.
9757 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9758 clscheck- disable CLS-Compliant verification event if assembly is has
9759 CLSCompliantAttribute(true).
9761 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9762 ApllyAttribute is now called in emit section as in the other cases.
9763 Possible future Emit integration.
9764 (IsIdentifierClsCompliant): New override.
9765 (VerifyClsCompliance): New override.
9766 (GetEnumeratorName): Returns full enum name.
9768 * parameter.cs (GetSignatureForError): Implemented.
9770 * report.cs (WarningData): New struct for Warning message information.
9771 (LocationOfPreviousError): New method.
9772 (Warning): New method. Reports warning based on the warning table.
9773 (Error_T): New method. Reports error based on the error table.
9775 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9776 verifications are done here.
9778 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9780 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9781 CLSCompliantAttribute.
9782 (all_imported_types): New member holds all imported types from other
9784 (LoadAllImportedTypes): New method fills static table with exported types
9785 from all referenced assemblies.
9786 (Modules): New property returns all assembly modules.
9788 2004-03-30 Miguel de Icaza <miguel@ximian.com>
9790 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9791 throwing a parser error.
9793 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9794 which removes the hardcoded get_/set_ prefixes for properties, as
9795 IL allows for the properties to be named something else.
9799 * expression.cs: Do not override operand before we know if it is
9802 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9804 * typemanager.cs: support for pinned variables.
9806 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9808 * decl.cs, typemanager.cs: Avoid using an arraylist
9809 as a buffer if there is only one result set.
9811 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9813 * expression.cs: Make sure you cant call a static method
9814 with an instance expression, bug #56174.
9816 2004-03-29 Miguel de Icaza <miguel@ximian.com>
9818 * class.cs (IsDuplicateImplementation): Improve error reporting to
9819 flag 663 (method only differs in parameter modifier).
9821 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9822 in preprocessor directives.
9824 * location.cs (LookupFile): Allow for the empty path.
9826 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
9827 better approach for some of that patch, but its failing with the
9828 CharSet enumeration. For now try/catch will do.
9830 * typemanager.cs: Do not crash if a struct does not have fields.
9833 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9835 * expression.cs: cs0213, cant fix a fixed expression.
9838 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9840 * cs-parser.jay: detect invalid embeded statements gracefully.
9843 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9845 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9848 the invocation type may not be a subclass of the tye of the item/
9849 The type of the item must be a subclass of the invocation item.
9854 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
9856 * attribute.cs: Added methods to get a string and a bool from an
9857 attribute. Required to information from AssemblyKeyFileAttribute,
9858 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9859 * codegen.cs: Modified AssemblyName creation to include support for
9860 strongnames. Catch additional exceptions to report them as CS1548.
9861 * compiler.csproj: Updated include CryptoConvert.cs.
9862 * compiler.csproj.user: Removed file - user specific configuration.
9863 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
9864 Mono.Security assembly. The original class is maintained and tested in
9865 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9866 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9867 like CSC 8.0 (C# v2) supports.
9868 * Makefile: Added CryptoConvert.cs to mcs sources.
9869 * rootcontext.cs: Added new options for strongnames.
9871 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
9873 * driver.cs: For --expect-error, report error code `2'
9874 if the program compiled with no errors, error code `1' if
9875 it compiled with an error other than the one expected.
9877 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
9879 * compiler.csproj: Updated for Visual Studio .NET 2003.
9880 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9881 * compiler.sln: Updated for Visual Studio .NET 2003.
9883 2004-03-24 Ravi Pratap M <ravi@ximian.com>
9885 * expression.cs: Fix bug #47234. We basically need to apply the
9886 rule that we prefer the conversion of null to a reference type
9887 when faced with a conversion to 'object' (csc behaviour).
9889 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9891 * statement.cs: Shorter form for foreach, eliminates
9892 a local variable. r=Martin.
9894 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9896 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9897 checks if we can use brtrue/brfalse to test for 0.
9898 * expression.cs: use the above in the test for using brtrue/brfalse.
9901 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9903 * expression.cs: Rewrite string concat stuff. Benefits:
9905 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9906 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9907 rather than a concat chain.
9909 * typemanager.cs: Add lookups for more concat overloads.
9911 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9913 * expression.cs: Emit shorter il code for array init.
9930 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
9932 * statement.cs: Before, two switch blocks would be merged if the
9933 total size of the blocks (end_item - begin_item + 1) was less than
9934 two times the combined sizes of the blocks.
9936 Now, it will only merge if after the merge at least half of the
9941 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
9943 * class.cs : csc build fix for GetMethods(). See bug #52503.
9945 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
9947 * expression.cs: Make sure fp comparisons work with NaN.
9948 This fixes bug #54303. Mig approved this patch a long
9949 time ago, but we were not able to test b/c the runtime
9952 2004-03-19 Miguel de Icaza <miguel@ximian.com>
9954 * ecore.cs (TypExpr.GetHashCode): implement this overload.
9956 2004-03-19 Martin Baulig <martin@ximian.com>
9958 * class.cs (MemberCore.IsDuplicateImplementation): Report the
9959 error here and not in our caller.
9961 2004-03-19 Martin Baulig <martin@ximian.com>
9963 * interface.cs: Completely killed this file.
9964 (Interface): We're now a TypeContainer and live in class.cs.
9966 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9967 argument; we're now also called for interfaces.
9968 (TypeContainer.DefineMembers): Allow this method being called
9970 (TypeContainer.GetMethods): New public method; formerly known as
9971 Interface.GetMethod(). This is used by PendingImplementation.
9972 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9973 it's now private and non-static.
9974 (Interface): Moved this here; it's now implemented similar to
9976 (Method, Property, Event, Indexer): Added `bool is_interface'
9977 argument to their .ctor's.
9978 (MemberBase.IsInterface): New public field.
9980 * cs-parser.jay: Create normal Method, Property, Event, Indexer
9981 instances instead of InterfaceMethod, InterfaceProperty, etc.
9982 (opt_interface_base): Removed; we now use `opt_class_base' instead.
9983 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9985 2004-03-19 Martin Baulig <martin@ximian.com>
9987 * class.cs (MethodCore.IsDuplicateImplementation): New private
9988 method which does the CS0111 checking.
9989 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9990 Use IsDuplicateImplementation().
9992 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9994 * decl.cs (FindMemberToOverride): New method to find the correct
9995 method or property to override in the base class.
9997 - Make Method/Property use the above method to find the
9998 version in the base class.
9999 - Remove the InheritableMemberSignatureCompare as it is now
10002 This patch makes large code bases much faster to compile, as it is
10003 O(n) rather than O(n^2) to do this validation.
10005 Also, it fixes bug 52458 which is that nested classes are not
10006 taken into account when finding the base class member.
10008 Reviewed/Approved by Martin.
10010 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10012 * interface.cs: In all interface classes removed redundant
10013 member initialization.
10015 2004-03-16 Martin Baulig <martin@ximian.com>
10017 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10019 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10021 * decl.cs (DefineTypeAndParents): New helper method to define a
10022 type's containers before the type itself is defined; This is a
10023 bug exposed by the recent changes to Windows.Forms when an
10024 implemented interface was defined inside a class that had not been
10027 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10029 (Check): Loop correctly to report errors modifiers
10030 (UNSAFE was not in the loop, since it was the same as TOP).
10032 * interface.cs: Every interface member now takes a ModFlags,
10033 instead of a "is_new" bool, which we set on the base MemberCore.
10035 Every place where we called "UnsafeOk" in the interface, now we
10036 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10037 the unsafe settings from the member declaration instead of the
10038 container interface.
10040 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10042 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10043 `set_indexer_name' to the pending bits (one per type).
10045 We fixed a bug today that was picking the wrong method to
10046 override, since for properties the existing InterfaceMethod code
10047 basically ignored the method name. Now we make sure that the
10048 method name is one of the valid indexer names.
10050 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10052 * support.cs (SeekableStreamReader): Keep track of stream byte
10053 positions and don't mix them with character offsets to the buffer.
10055 Patch from Gustavo Giráldez
10057 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10059 * interface.cs (InterfaceSetGetBase): Removed double member
10060 initialization, base class does it as well.
10062 2004-03-13 Martin Baulig <martin@ximian.com>
10064 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10065 when compiling corlib.
10067 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10069 * convert.cs (ExplicitConversion): We were reporting an error on
10070 certain conversions (object_type source to a value type, when the
10071 expression was `null') before we had a chance to pass it through
10072 the user defined conversions.
10074 * driver.cs: Replace / and \ in resource specifications to dots.
10077 * class.cs: Add check for duplicate operators. Fixes 52477
10079 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10081 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10082 that are in the middle of the statements, not only at the end.
10085 * class.cs (TypeContainer.AddField): No longer set the
10086 `HaveStaticConstructor' flag, now we call it
10087 `UserDefineStaticConstructor' to diferentiate the slightly
10088 semantic difference.
10090 The situation is that we were not adding BeforeFieldInit (from
10091 Modifiers.TypeAttr) to classes that could have it.
10092 BeforeFieldInit should be set to classes that have no static
10097 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10099 And most importantly Zoltan's comment:
10101 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10103 "I think beforefieldinit means 'it's ok to initialize the type sometime
10104 before its static fields are used', i.e. initialization does not need
10105 to be triggered by the first access to the type. Setting this flag
10106 helps the JIT to compile better code, since it can run the static
10107 constructor at JIT time, and does not need to generate code to call it
10108 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10109 this flag for lots of classes like String.
10111 csc sets this flag if the type does not have an explicit static
10112 constructor. The reasoning seems to be that if there are only static
10113 initalizers for a type, and no static constructor, then the programmer
10114 does not care when this initialization happens, so beforefieldinit
10117 This bug prevents the AOT compiler from being usable, since it
10118 generates so many calls to mono_runtime_class_init that the AOT code
10119 is much slower than the JITted code. The JITted code is faster,
10120 because it does not generate these calls if the vtable is type is
10121 already initialized, which is true in the majority of cases. But the
10122 AOT compiler can't do this."
10124 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10126 * class.cs (MethodData.Emit): Refactor the code so symbolic
10127 information is generated for destructors; For some reasons we
10128 were taking a code path that did not generate symbolic information
10131 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10133 * class.cs: Create a Constructor.CheckBase method that
10134 takes care of all validation type code. The method
10135 contains some code that was moved from Define.
10137 It also includes new code that checks for duplicate ctors.
10138 This fixes bug #55148.
10140 2004-03-09 Joshua Tauberer <tauberer@for.net>
10142 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10143 a { ... }-style array creation invokes EmitStaticInitializers
10144 which is not good for reference-type arrays. String, decimal
10145 and now null constants (NullCast) are not counted toward
10146 static initializers.
10148 2004-03-05 Martin Baulig <martin@ximian.com>
10150 * location.cs (SourceFile.HasLineDirective): New public field;
10151 specifies whether the file contains or is referenced by a "#line"
10153 (Location.DefineSymbolDocuments): Ignore source files which
10154 either contain or are referenced by a "#line" directive.
10156 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10158 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10159 direct access to our parent, so check the method inline there.
10161 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10163 * expression.cs (Invocation.EmitCall): Miguel's last commit
10164 caused a regression. If you had:
10169 In Foo the implict this would be null.
10171 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10173 * expression.cs (Invocation.EmitCall): If the method is not
10174 virtual, do not emit a CallVirt to it, use Call.
10176 * typemanager.cs (GetFullNameSignature): Improve the method to
10177 cope with ".ctor" and replace it with the type name.
10179 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10180 as an argument the ConstructorBuilder where it is being defined,
10181 to catch the recursive constructor invocations.
10183 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10185 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10186 routines to check if a type is an enumerable/enumerator allow
10187 classes that implement the IEnumerable or IEnumerator interfaces.
10189 * class.cs (Property, Operator): Implement IIteratorContainer, and
10190 implement SetYields.
10192 (Property.Define): Do the block swapping for get_methods in the
10193 context of iterators. We need to check if Properties also
10194 include indexers or not.
10196 (Operator): Assign the Block before invoking the
10197 OperatorMethod.Define, so we can trigger the Iterator code
10200 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10201 Property and Operator classes are not created when we parse the
10202 declarator but until we have the block completed, so we use a
10203 singleton SimpleIteratorContainer.Simple to flag whether the
10204 SetYields has been invoked.
10206 We propagate this setting then to the Property or the Operator to
10207 allow the `yield' to function.
10209 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10211 * codegen.cs: Implemented attribute support for modules.
10212 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10213 Assembly/Module functionality.
10215 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10216 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10217 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10219 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10221 * interface.cs (FindMembers): The operation is performed on all base
10222 interfaces and not only on the first. It is required for future CLS Compliance patch.
10224 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10226 * statement.cs, codegen.cs:
10227 This patch deals with patterns such as:
10229 public class List : IEnumerable {
10231 public MyEnumerator GetEnumerator () {
10232 return new MyEnumerator(this);
10235 IEnumerator IEnumerable.GetEnumerator () {
10239 public struct MyEnumerator : IEnumerator {
10244 Before, there were a few things we did wrong:
10245 1) we would emit callvirt on a struct, which is illegal
10246 2) we emited ldarg when we needed to emit ldarga
10247 3) we would mistakenly call the interface methods on an enumerator
10248 type that derived from IEnumerator and was in another assembly. For example:
10250 public class MyEnumerator : IEnumerator
10252 Would have the interface methods called, even if there were public impls of the
10253 method. In a struct, this lead to invalid IL code.
10255 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10257 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10260 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10262 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10264 * cs-parser.jay: Fix small regression: we were not testing V2
10265 compiler features correctly.
10267 * interface.cs: If the emit context is null, then create one
10269 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10271 * decl.cs (GetSignatureForError): New virtual method to get full name
10272 for error messages.
10274 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10275 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10277 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10278 Duplicated members and code in these classes has been removed.
10279 Better encapsulation in these classes.
10281 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10283 * assign.cs (Assign.DoResolve): When dealing with compound
10284 assignments, there is a new rule in ECMA C# 2.4 (might have been
10285 there before, but it is documented here) that states that in:
10289 If b is of type int, and the `op' is a shift-operator, then the
10290 above is evaluated as:
10294 * expression.cs (Binary.ResolveOperator): Instead of testing for
10295 int/uint/long/ulong, try to implicitly convert to any of those
10296 types and use that in pointer arithmetic.
10298 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10299 method to print information for from the type, not from the
10300 null-method we were given.
10302 2004-02-01 Duncan Mak <duncan@ximian.com>
10304 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10305 parsing for cmd, fixes bug #53694.
10307 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10309 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10310 in the member name duplication tests. Property and operator name duplication
10311 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10313 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10315 * interface.cs (PopulateMethod): Fixed crash when interface method
10316 returns not existing type (error test cs0246-3.cs).
10318 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10320 * cs-parser.jay (interface_accessors): Re-write actions to also
10321 store attributes attached to get and set methods. Fix spelling
10324 (inteface_property_declaration): Modify accordingly.
10326 (InterfaceAccessorInfo): New helper class to store information to pass
10327 around between rules that use interface_accessors.
10329 * interface.cs (Emit): Apply attributes on the get and set
10330 accessors of properties and indexers too.
10332 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10333 right MethodBuilder when applying attributes to the get and set accessors.
10335 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10337 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10339 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10341 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10343 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10345 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10346 changes that treat `yield' specially when present before `break'
10347 or `return' tokens.
10349 * cs-tokenizer.cs: yield is no longer a keyword.
10351 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10353 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10354 setting for default constructors.
10355 For default constructors are almost every time set wrong Modifier. The
10356 generated IL code has been alright. But inside mcs this values was
10357 wrong and this was reason why several of my CLS Compliance tests
10360 2004-01-22 Martin Baulig <martin@ximian.com>
10362 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10363 not a QualifiedIdentifier. This is what `type_name_expression'
10364 was previously doing.
10365 (type_name_expression): Removed; the code is now in
10366 `namespace_or_type_name'.
10367 (qualified_identifier): Removed, use `namespace_or_type_name'
10369 (QualifiedIdentifier): Removed this class.
10371 2004-01-22 Martin Baulig <martin@ximian.com>
10373 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10374 not a string as alias name.
10376 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10378 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10379 #52730 bug, and instead compute correctly the need to use a
10380 temporary variable when requesting an address based on the
10381 static/instace modified of the field and the constructor.
10383 2004-01-21 Martin Baulig <martin@ximian.com>
10385 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10386 class and namespace before looking up aliases. Fixes #52517.
10388 2004-01-21 Martin Baulig <martin@ximian.com>
10390 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10391 assinged in a 'try'; fixes exception4.cs.
10393 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10394 * class.cs : Implemented parameter-less constructor for TypeContainer
10396 * decl.cs: Attributes are now stored here. New property OptAttributes
10398 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10400 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10402 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10404 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10405 (CSharpSignature): New method for indexer and property signature.
10407 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10409 * pending.cs (IsVirtualFilter): Faster implementation.
10411 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10413 * typemanager.cs: Avoid inclusion of same assembly more than once.
10415 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10417 * cs-parser.jay: Fixed problem where the last assembly attribute
10418 has been applied also to following declaration (class, struct, etc.)
10420 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10422 * class.cs: Added error CS0538, CS0539 reporting.
10423 Fixed crash on Microsoft runtime when field type is void.
10425 * cs-parser.jay: Added error CS0537 reporting.
10427 * pending.cs: Added error CS0535 reporting.
10428 Improved error report for errors CS0536, CS0534.
10430 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10432 Merge a few bits from the Anonymous Method MCS tree.
10434 * statement.cs (ToplevelBlock): New class for toplevel methods,
10435 will hold anonymous methods, lifted variables.
10437 * cs-parser.jay: Create toplevel blocks for delegates and for
10438 regular blocks of code.
10440 2004-01-20 Martin Baulig <martin@ximian.com>
10442 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10443 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10444 and `NeedExplicitReturn'; added `IsLastStatement'.
10445 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10446 have a `ReturnLabel' or we're not unreachable.
10448 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10449 child's reachability; don't just override ours with it. Fixes
10450 #58058 (lluis's example).
10451 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10452 InFinally(), InLoop(), InSwitch() and
10453 BreakCrossesTryCatchBoundary() methods.
10455 * statement.cs (Return): Do all error checking in Resolve().
10456 Unless we are the last statement in a top-level block, always
10457 create a return label and jump to it.
10458 (Break, Continue): Do all error checking in Resolve(); also make
10459 sure we aren't leaving a `finally'.
10460 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10461 statement in a top-level block.
10462 (Block.Flags): Added `IsDestructor'.
10463 (Block.IsDestructor): New public property.
10465 2004-01-20 Martin Baulig <martin@ximian.com>
10467 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10469 2004-01-20 Martin Baulig <martin@ximian.com>
10471 * statement.cs (Statement.ResolveUnreachable): New public method.
10472 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10473 (Block.Resolve): Resolve unreachable statements.
10475 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10477 * expression.cs: We need to fix the case where we do
10478 not have a temp variable here.
10480 * assign.cs: Only expression compound assignments need
10481 temporary variables.
10483 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10485 * flowanalysis.cs: Reduce memory allocation in a few ways:
10486 - A block with no variables should not allocate a bit
10488 - A method with no out parameters does not need any tracking
10489 for assignment of the parameters, so we need not allocate
10492 public readonly Type[] VariableTypes;
10493 public readonly string[] VariableNames;
10494 Are redundant. The data is already stored in the variable
10495 map, so we need not allocate another array for it.
10496 - We need to add alot of checks for if (params | locals) == null
10497 due to the first two changes.
10499 2004-01-18 Miguel de Icaza <miguel@ximian.com>
10501 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10502 implement IMemoryLocation, we store a copy on a local variable and
10503 take the address of it. Patch from Benjamin Jemlich
10505 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10506 to use a special "type_name_expression" rule which reduces the
10507 number of "QualifiedIdentifier" classes created, and instead
10508 directly creates MemberAccess expressions.
10510 2004-01-17 Miguel de Icaza <miguel@ximian.com>
10512 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10513 that fixes #52853. Null literal assignment to ValueType
10515 * class.cs (MethodData.Emit): Instead of checking the name of the
10516 method to determine if its a destructor, create a new derived
10517 class from Method called Destructor, and test for that.
10519 * cs-parser.jay: Create a Destructor object instead of a Method.
10521 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10525 2004-01-16 Miguel de Icaza <miguel@ximian.com>
10527 * expression.cs (Binary.ResolveOperator): Perform an implicit
10528 conversion from MethodGroups to their delegate types on the
10529 Addition operation.
10531 * delegate.cs: Introduce a new class DelegateCreation that is the
10532 base class for `NewDelegate' and `ImplicitDelegateCreation',
10533 factor some code in here.
10535 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10536 conversion from MethodGroups to compatible delegate types.
10538 * ecore.cs (Expression.Resolve): Do not flag error 654
10539 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10540 we allow conversions from MethodGroups to delegate types now.
10542 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10543 assignments in v2 either.
10545 2004-01-10 Miguel de Icaza <miguel@ximian.com>
10547 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10548 static read-only fields in ctors.
10550 Applied patch from Benjamin Jemlich
10552 * expression.cs (UnaryMutator): Avoid leaking local variables.
10554 2004-01-09 Miguel de Icaza <miguel@ximian.com>
10556 * cs-tokenizer.cs (IsCastToken): Allow the various native types
10557 here to return true, as they can be used like this:
10559 (XXX) int.MEMBER ()
10561 Fixed 49836 and all the other dups
10563 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
10565 * driver.cs: Implement /win32res and /win32icon.
10567 2004-01-08 Miguel de Icaza <miguel@ximian.com>
10569 * cs-parser.jay: Add a rule to improve error handling for the
10570 common mistake of placing modifiers after the type.
10572 2004-01-07 Miguel de Icaza <miguel@ximian.com>
10574 * cs-parser.jay (interface_event_declaration): Catch
10575 initialization of events on interfaces, and report cs0068
10577 * cs-parser.jay (interface_event_declaration): Catch
10578 initialization of events.
10580 * ecore.cs: Better report missing constructors.
10582 * expression.cs (Binary.ResolveOperator): My previous bug fix had
10583 the error reporting done in the wrong place. Fix.
10585 * expression.cs (Binary.ResolveOperator): Catch the
10586 operator + (E x, E y) error earlier, and later allow for implicit
10587 conversions in operator +/- (E e, U x) from U to the underlying
10590 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10591 52596, if the container class is abstract, the default constructor
10592 is protected otherwise its public (before, we were always public).
10594 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10597 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10598 Jemlich that fixes bug #52597, MCS was generating invalid code for
10599 idisposable structs. Thanks to Ben for following up with this
10602 2004-01-06 Miguel de Icaza <miguel@ximian.com>
10604 * driver.cs: Allow assemblies without code to be generated, fixes
10607 2004-01-07 Nick Drochak <ndrochak@gol.com>
10609 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10611 2004-01-05 Miguel de Icaza <miguel@ximian.com>
10613 * cs-parser.jay: Add rules to improve error reporting if fields or
10614 methods are declared at the namespace level (error 116)
10616 * Add rules to catch event add/remove
10618 2004-01-04 David Sheldon <dave-mono@earth.li>
10620 * expression.cs: Added matching ")" to error message for
10623 2004-01-03 Todd Berman <tberman@gentoo.org>
10625 * ecore.cs, attribute.cs:
10626 Applying fix from #52429.
10628 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10630 * ecore.cs, expression.cs, statement.cs:
10631 Total rewrite of how we handle branching. We
10632 now handle complex boolean expressions with fewer
10633 jumps. As well if (x == 0) no longer emits a ceq.
10635 if (x is Foo) is much faster now, because we generate
10638 Overall, we get a pretty big improvement on our benchmark
10639 tests. The code we generate is smaller and more readable.
10641 I did a full two-stage bootstrap. The patch was reviewed
10642 by Martin and Miguel.
10644 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10646 * cs-parser.jay: Make primary_expression not take a QI.
10647 we dont need this because the member_access rule covers
10648 us here. So we replace the rule with just IDENTIFIER.
10650 This has two good effects. First, we remove a s/r conflict.
10651 Second, we allocate many fewer QualifiedIdentifier objects.
10653 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10655 * attribute.cs: Handle MarshalAs attributes as pseudo, and
10656 set the correct information via SRE. This prevents
10657 hanging on the MS runtime. Fixes #29374.
10659 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10661 * convert.cs: correctly handle conversions to value types
10662 from Enum and ValueType as unboxing conversions.
10664 Fixes bug #52569. Patch by Benjamin Jemlich.
10666 2004-01-02 Ravi Pratap <ravi@ximian.com>
10668 * expression.cs (BetterConversion): Prefer int -> uint
10669 over int -> ulong (csc's behaviour). This fixed bug #52046.
10671 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10673 * decl.cs (MemberCache.FindMembers): now returns a
10676 * typemanager.cs: In general, go with with ^^.
10677 (CopyNewMethods): take an IList.
10678 (RealMemberLookup): Only allocate an arraylist
10679 if we copy from two sets of methods.
10681 This change basically does two things:
10682 1) Fewer array lists allocated due to CopyNewMethods.
10683 2) the explicit cast in MemberList costed ALOT.
10685 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10687 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10688 a hashtable to avoid needless string allocations when an identifier is
10689 used more than once (the common case).
10691 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10693 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10694 is broken, it will not return anything. So, we
10695 have to use the information we have in mcs to
10698 * typemanager.cs: Add a cache for GetInterfaces,
10699 since this will now be used more often (due to ^^)
10701 (GetExplicitInterfaces) New method that gets the
10702 declared, not effective, interfaces on a type
10703 builder (eg, if you have interface IFoo, interface
10704 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10707 This patch makes MCS able to bootstrap itself on
10710 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10712 * expression.cs: Remove the Nop's that Miguel put
10715 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10717 * report.cs, codegen.cs: Give the real stack trace to
10718 the error when an exception is thrown.
10720 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10722 * decl.cs: only allocate hashtables for ifaces if
10725 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10727 * expression.cs: fix the error from cs0121-2.cs
10728 (a parent interface has two child interfaces that
10729 have a function with the same name and 0 params
10730 and the function is called through the parent).
10732 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10734 * class.cs, rootcontext.cs, typmanager.cs: do not
10737 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10739 * codegen.cs: remove stack for the ec flow branching.
10740 It is already a linked list, so no need.
10742 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10744 * Makefile: Allow custom profiler here.
10746 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10748 * typemanager.cs (LookupType):
10749 - Use a static char [], because split takes
10750 a param array for args, so it was allocating
10752 - Do not store true in a hashtable, it boxes.
10754 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10756 * flowanalysis.cs: bytify common enums.
10758 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10760 * modifiers.cs: Add a new set of flags for the
10761 flags allowed on explicit interface impls.
10762 * cs-parser.jay: catch the use of modifiers in
10763 interfaces correctly.
10764 * class.cs: catch private void IFoo.Blah ().
10766 All related to bug #50572.
10768 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10770 * decl.cs: Rewrite the consistant accessability checking.
10771 Accessability is not linear, it must be implemented in
10772 a tableish way. Fixes #49704.
10774 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10776 * expression.cs: Handle negation in a checked context.
10777 We must use subtraction from zero. Fixes #38674.
10779 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10781 * class.cs: Ignore static void main in DLLs.
10782 * rootcontext.cs: Handle the target type here,
10783 since we are have to access it from class.cs
10784 * driver.cs: account for the above.
10786 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10788 * report.cs: Give line numbers and files if available.
10790 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10792 * driver.cs: Implement /addmodule.
10794 * typemanager.cs: Change 'modules' field so it now contains Modules not
10797 2003-12-20 Martin Baulig <martin@ximian.com>
10799 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10800 (FieldBase.IsAssigned): Removed this field.
10801 (FieldBase.SetAssigned): New public method.
10802 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10804 2003-12-20 Martin Baulig <martin@ximian.com>
10806 * expression.cs (LocalVariableReference.DoResolve): Don't set
10807 `vi.Used' if we're called from DoResolveLValue().
10809 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10810 returns the usage vector it just merged into the current one -
10811 pass this one to UsageWarning().
10812 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10813 of the `EmitContext', don't call this recursively on our children.
10815 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
10817 * driver.cs: Implement /target:module.
10819 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10821 * support.cs (CharArrayHashtable): New helper class.
10823 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
10824 char arrays, not strings, so we can avoid creating a string in
10825 consume_identifier if the identifier is a keyword.
10827 2003-12-16 Martin Baulig <martin@ximian.com>
10829 * statement.cs (LocalInfo.Assigned): Removed this property.
10830 (LocalInfo.Flags): Removed `Assigned'.
10831 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10832 and uses flow analysis.
10833 (Block.UsageWarning): Made this method private.
10834 (Block.Resolve): Call UsageWarning() if appropriate.
10836 * expression.cs (LocalVariableReference.DoResolve): Always set
10837 LocalInfo.Used here.
10839 2003-12-13 Martin Baulig <martin@ximian.com>
10841 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10842 any value here; we're now using flow analysis to figure out
10843 whether a statement/block returns a value.
10845 2003-12-13 Martin Baulig <martin@ximian.com>
10847 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10849 (FlowBranching.MergeFinally): Don't call
10850 `branching.CheckOutParameters()' here, this is called in
10852 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10853 when adding the `finally' vector.
10855 2003-12-13 Martin Baulig <martin@ximian.com>
10858 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10859 actually work and also fix #48962.
10861 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10863 * decl.cs: Do not check System.Object for nested types,
10864 since we know it does not have any. Big bang for buck:
10867 Run 1: 8.35 seconds
10868 Run 2: 8.32 seconds
10869 corlib: 17.99 seconds
10871 Run 1: 8.17 seconds
10872 Run 2: 8.17 seconds
10873 corlib: 17.39 seconds
10875 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10877 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10878 time we are returning 0 members, so we save alot here.
10880 2003-12-11 Martin Baulig <martin@ximian.com>
10882 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10883 `MergeChild()', also just take the `FlowBranching' as argument;
10884 call Merge() on it and return the result.
10885 (FlowBranching.Merge): We don't need to do anything if we just
10888 2003-12-11 Martin Baulig <martin@ximian.com>
10890 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10891 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10892 Maurer for this idea.
10894 2003-12-11 Martin Baulig <martin@ximian.com>
10896 * flowanalysis.cs (MergeResult): This class is now gone; we now
10897 use the `UsageVector' for this. The reason for this is that if a
10898 branching just has one sibling, we don't need to "merge" them at
10899 all - that's the next step to do.
10900 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10903 2003-12-11 Martin Baulig <martin@ximian.com>
10905 Reworked flow analyis and made it more precise and bug-free. The
10906 most important change is that we're now using a special `Reachability'
10907 class instead of having "magic" meanings of `FlowReturns'. I'll
10908 do some more cleanups and optimizations and also add some more
10909 documentation this week.
10911 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10912 largely reworked this class.
10913 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10914 the new `Reachability' class instead of having "magic" values here.
10915 (FlowBranching): We're now using an instance of `Reachability'
10916 instead of having separate `Returns', `Breaks' etc. fields.
10918 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10919 based on flow analysis; ignore the return value of block.Emit ().
10921 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10923 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10924 if they are private.
10926 2003-12-09 Martin Baulig <martin@ximian.com>
10928 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10929 call them directly on the UsageVector.
10931 2003-12-09 Martin Baulig <martin@ximian.com>
10933 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10934 Changed return type from `FlowReturns' to `Reachability'.
10936 2003-12-09 Martin Baulig <martin@ximian.com>
10938 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10939 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10940 `Reachable' fields with a single `Reachability' one.
10942 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10944 * class.cs (FindMembers): Remove foreach's.
10949 Run 1: 8.74 seconds
10950 Run 2: 8.71 seconds
10953 Run 1: 8.64 seconds
10954 Run 2: 8.58 seconds
10957 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10962 This patch does a few things:
10963 1. EmptyStatement is now a singleton, so it is never reallocated.
10964 2. All blah is EmptyStatement constructs have been changed to
10965 blah == EmptyStatement.Value, which is much faster and valid
10966 now that EmptyStatement is a singleton.
10967 3. When resolving a block, rather than allocating a new array for
10968 the non-empty statements, empty statements are replaced with
10969 EmptyStatement.Value
10970 4. Some recursive functions have been made non-recursive.
10971 Mainly the performance impact is from (3), however (1) and (2) are needed for
10972 this to work. (4) does not make a big difference in normal situations, however
10973 it makes the profile look saner.
10978 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10979 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10980 Total memory allocated: 56397 KB
10983 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10984 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10985 Total memory allocated: 55666 KB
10987 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10989 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10990 than the hashtable in a hashtable version
10992 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10993 we always end up concating a string. This results in a huge perf
10994 loss, because many strings have to be tracked by the GC. In this
10995 patch, we first use a hashtable that works with two keys, so that
10996 the strings do not need to be concat'ed.
11000 Run 1: 8.74 seconds
11001 Run 2: 8.71 seconds
11004 Run 1: 8.65 seconds
11005 Run 2: 8.56 seconds
11007 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11009 * Makefile: Add a new target `do-time' that does a quick and simple
11010 profile, leaving easy to parse output.
11012 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11014 * codegen.cs (Init): Create the dynamic assembly with
11015 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11017 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11019 * support.cs: Make the PtrHashtable use only one
11020 instance of its comparer.
11022 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11024 * typemanager.cs: Fix lookup of GetNamespaces.
11026 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11028 * expression.cs: Removed redundant line.
11030 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11031 ArrayLists, use for loops with bounds.
11033 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11036 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11037 arraylists, use for loop with bounds.
11039 The above three changes give us a 0.071 second performance
11040 improvement out of 3.294 seconds down to 3.223. On my machine
11041 the above changes reduced the memory usage by 1,387 KB during
11042 compiler bootstrap.
11044 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11045 QualifiedIdentifiers. Before we created a new string through
11046 concatenation, and mostly later on, the result would be
11047 manipulated by DecomposeQI through string manipulation.
11049 This reduced the compiler memory usage for bootstrapping from
11050 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11051 compile times in 0.05 seconds.
11053 2003-11-28 Dick Porter <dick@ximian.com>
11055 * support.cs: Do string compares with the Invariant culture.
11063 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11064 the comparison is done with the Invariant culture.
11066 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11068 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11069 GetEnumerator method.
11071 (ProbeCollectionType): Iterate starting at the most specific type
11072 upwards looking for a GetEnumerator
11074 * expression.cs: Shift count can be up to 31 for int/uint and 63
11077 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11079 * statement.cs (Block.LookupLabel): Also look for the label on the
11080 children blocks. Use a hash table to keep track of visited
11083 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11084 we actually did transform the other operand, otherwise fall back
11085 to the common codepath that casts to long.
11087 * cs-tokenizer.cs: Use the same code pattern as the int case.
11088 Maybe I should do the parsing myself, and avoid depending on the
11089 Parse routines to get this done.
11091 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11093 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11094 which fixes bug 51347. This time test it.
11096 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11097 attributes for example can not tell the difference between these.
11098 The difference was only a syntax feature of the language.
11100 * attribute.cs: Apply attributes to delegates.
11102 * delegate.cs: Call the apply attributes method.
11104 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11106 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11107 comparing 0 vs Byte.MinValue, not the value
11109 (ImplicitConversionRequired): When reporting a conversion error,
11110 use error 31 to print out the constant error instead of the
11113 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11114 which fixes bug 51347.
11116 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11118 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11119 which fixes the -warnaserror command line option.
11121 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11123 * cfold.cs (DoNumericPromotions): During constant folding of
11124 additions on UIntConstant, special case intconstants with
11125 IntConstants like we do on the expression binary operator.
11127 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11129 * convert.cs (ImplicitReferenceConversion): We were missing a case
11130 (System.Enum are not value types or class types, so we need to
11131 classify them separatedly).
11133 * driver.cs: We do not support error 2007.
11135 2003-11-12 Jackson Harper <jackson@ximian.com>
11137 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11138 system directory. Also use the full file name so users can
11139 libraries names mscorlib-o-tron.dll in a non system dir.
11141 2003-11-10 Martin Baulig <martin@ximian.com>
11143 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11144 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11145 calling `ResolveType()' on them, directly assign their `Type'.
11147 2003-11-08 Martin Baulig <martin@ximian.com>
11149 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11150 return value and the `out parent' parameter.
11151 (TypeContainer.DefineType): Moved the CS0644 check into
11152 GetClassBases(). Don't pass the interface types to the
11153 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11154 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11156 * ecore.cs (TypeExpr.IsAttribute): New property.
11157 (TypeExpr.GetInterfaces): New method.
11159 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11160 TypeExpr instead of a Type.
11161 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11162 (Interface.DefineType): Don't pass the interface types to the
11163 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11164 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11166 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11167 instead of a `Type[]'.
11168 (TypeManager.RegisterBuilder): Likewise.
11169 (TypeManager.AddUserInterface): Likewise.
11170 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11171 `Type[]' and also return a `TypeExpr[]'.
11172 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11174 2003-11-08 Martin Baulig <martin@ximian.com>
11176 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11179 2003-11-08 Martin Baulig <martin@ximian.com>
11181 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11182 TypeManager.ResolveExpressionTypes().
11184 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11185 instead of an Expression.
11186 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11187 (TypeExpression): New public class; formerly known as `TypeExpr'.
11189 * expression.cs (ComposedCast): Derive from TypeExpr.
11191 * typemanager.cs (TypeManager.system_*_expr): These are now
11192 TypExpr's instead of Expression's.
11193 (TypeManager.ResolveExpressionTypes): New public static function;
11194 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11197 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11199 * expression.cs (New.DoResolve): Do not dereference value that
11200 might be a null return.
11202 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11203 sure that the constant value has the right type. Fixes an
11204 unreported bug, similar to 50425.
11206 * const.cs (Const.LookupConstantValue): Call
11207 ImplicitStandardConversionExists before doing a conversion to
11208 avoid havng the TypeManager.ChangeType do conversions.
11210 Reduced the number of casts used
11212 (Const.ChangeType): New routine to enable reuse of the constant
11213 type changing code from statement.
11215 * typemanager.cs (ChangeType): Move common initialization to
11216 static global variables.
11220 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11221 every value type to go through, even if it was void. Fix that.
11223 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11224 character of the define, and the is_identifier_part_character for
11225 the rest of the string.
11227 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11229 * expression.cs (UnaryMutator.EmitCode): When I updated
11230 LocalVariableReference.DoResolve, I overdid it, and dropped an
11231 optimization done on local variable references.
11233 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11235 * ecore.cs: Convert the return from Ldlen into an int.
11237 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11239 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11240 the accessibility, this is a special case for toplevel non-public
11241 classes (internal for instance).
11243 2003-10-20 Nick Drochak <ndrochak@gol.com>
11245 * ecore.cs: Fix typo and build. Needed another right paren.
11247 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11249 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11250 `internal' case regular and protected, but not allowing protected
11251 to be evaluated later. Bug 49840
11253 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11255 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11256 to kb.Nlast, and not the kb.nFirst to isolate the switch
11259 Extract the underlying type, so enumerations of long/ulong are
11260 treated like long/ulong.
11262 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11264 * expression.cs (New): Overload the meaning of RequestedType to
11265 track the possible creation of the NewDelegate type, since
11266 DoResolve is invoked more than once for new constructors on field
11269 See bugs: #48800 and #37014
11271 * cs-parser.jay (declare_local_constants): Take an arraylist
11272 instead of a single constant.
11274 (local_constant_declaration): It should take a
11275 constant_declarators, not a constant_declarator. Fixes 49487
11277 * convert.cs: Fix error report.
11279 2003-10-13 Jackson Harper <jackson@ximian.com>
11281 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11284 2003-10-09 Martin Baulig <martin@ximian.com>
11286 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11288 (MethodCore.DoDefineParameters): Removed the TypeContainer
11289 argument; use the DeclSpace which was passed to the .ctor instead.
11290 (MethodCore.CheckParameter): Take a DeclSpace instead of a
11291 TypeContainer; we only need a DeclSpace here.
11293 2003-10-09 Martin Baulig <martin@ximian.com>
11295 * class.cs (MethodData): Added additional `DeclSpace ds' argument
11297 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11298 EmitContext's .ctor.
11300 2003-10-09 Martin Baulig <martin@ximian.com>
11302 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11303 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11304 AsAccessible(), moved them as well.
11306 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11308 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11310 * cs-parser.jay : Renamed yyName to yyNames related to jay.
11312 2003-10-07 Miguel de Icaza <miguel@ximian.com>
11314 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11315 generation for >=, as spotted by Paolo, bug 48679.
11316 Patch from David Waite.
11318 * cs-tokenizer.cs: Add handling for #pragma.
11320 * cs-parser.jay: Allow for both yield and yield return in the
11321 syntax. The anti-cobolization of C# fight will go on!
11323 * class.cs (TypeBuilder.DefineType): Catch error condition here
11324 (Parent.DefineType erroring out and returning null).
11326 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11327 coping with enumerations variables, we were mistakenly processing
11328 them as a regular value type instead of built-in types. Fixes the
11331 * typemanager.cs (IsBuiltinOrEnum): New method.
11333 2003-09-30 Miguel de Icaza <miguel@ximian.com>
11335 * cs-parser.jay: Upgrade: yield now needs the return clause.
11337 2003-09-19 Martin Baulig <martin@ximian.com>
11339 * decl.cs (MemberCache.SetupCacheForInterface): Take a
11340 `MemberCache parent' argument. Normally, an interface doesn't
11341 have a parent type except System.Object, but we use this in gmcs
11342 for generic type parameters.
11344 2003-09-18 Martin Baulig <martin@ximian.com>
11346 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11347 on `type.IsInterface'; don't check whether the type has a parent
11348 to determine whether it's an interface.
11350 2003-09-15 Martin Baulig <martin@ximian.com>
11352 * class.cs (TypeContainer.DefineType): Added an error flag to
11353 avoid reporting duplicate CS0146's ("class definition is
11356 * driver.cs (Driver.MainDriver): Abort if
11357 RootContext.ResolveTree() reported any errors.
11359 2003-09-07 Martin Baulig <martin@ximian.com>
11361 * report.cs (Error, Warning): Added overloaded versions which take
11362 a `params object[] args' and call String.Format().
11364 2003-09-07 Martin Baulig <martin@ximian.com>
11366 * decl.cs (DeclSpace..ctor): Don't call
11367 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11368 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
11369 (DeclSpace.RecordDecl): New method.
11371 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11373 2003-09-02 Ravi Pratap <ravi@ximian.com>
11375 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11376 value attributes to be applied to ParameterBuilders.
11378 * class.cs (MethodCore.LabelParameters): Make static and more
11379 generic so that it can be used from other places - like interface
11380 methods, for instance.
11382 * interface.cs (Interface.Emit): Call LabelParameters before
11383 emitting attributes on the InterfaceMethod.
11385 2003-08-26 Martin Baulig <martin@ximian.com>
11387 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11388 resolving aliases; fixes #47927.
11390 2003-08-26 Martin Baulig <martin@ximian.com>
11392 * statement.cs (Using.DoResolve): This is internally emitting a
11393 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11394 do not always return. Fixes #47681.
11396 2003-08-26 Martin Baulig <martin@ximian.com>
11398 * decl.cs (MemberCore): Moved WarningNotHiding(),
11399 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11401 (AdditionResult): Make this nested in DeclSpace.
11402 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11403 argument; call NamespaceEntry.Define() unless we're nested in a
11406 * namespace.cs (Namespace.DefineName): New public function. This
11407 is called from DeclSpace's .ctor to add
11408 (Namespace.Lookup): Include DeclSpaces in the lookup.
11410 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11412 * const.cs (Const): Derive from MemberBase, not MemberCore.
11414 2003-08-25 Martin Baulig <martin@ximian.com>
11416 * convert.cs (Convert.ExplicitReferenceConversion): When
11417 converting from an interface type to a class, unbox if the target
11418 type is a struct type. Fixes #47822.
11420 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11422 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11425 2003-08-22 Martin Baulig <martin@ximian.com>
11427 * class.cs (TypeManager.DefineType): When defining a nested type,
11428 call DefineType() on our parent; fixes #47801.
11430 2003-08-22 Martin Baulig <martin@ximian.com>
11432 * class.cs (MethodData.Define): While checking if a method is an
11433 interface implementation, improve the test a bit more to fix #47654.
11435 2003-08-22 Martin Baulig <martin@ximian.com>
11437 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11438 correctly; fixes #47722.
11440 2003-08-22 Martin Baulig <martin@ximian.com>
11442 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11443 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11445 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11447 2003-08-22 Martin Baulig <martin@ximian.com>
11449 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11450 can only be assigned in static constructors. Fixes #47161.
11452 2003-08-22 Martin Baulig <martin@ximian.com>
11454 Rewrote and improved the flow analysis code.
11456 * flowbranching.cs (FlowBranching): Make this class abstract.
11457 (FlowBranching.CreateBranching): New static function to create a
11458 new flow branching.
11459 (FlowBranchingBlock, FlowBranchingException): New classes.
11460 (FlowBranching.UsageVector.Type): New public readonly field.
11461 (FlowBranching.UsageVector.Breaks): Removed the setter.
11462 (FlowBranching.UsageVector.Returns): Removed the setter.
11463 (FlowBranching.UsageVector): Added Break(), Return(),
11464 NeverReachable() and Throw() methods to modify the reachability.
11465 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11466 done by FlowBranching.Merge().
11467 (FlowBranching.UsageVector.MergeChild): New method; merges the
11468 merge result into the current vector.
11469 (FlowBranching.Merge): New abstract method to merge a branching.
11471 2003-08-12 Martin Baulig <martin@ximian.com>
11473 * expression.cs (Indirection.CacheTemporaries): Create the
11474 LocalTemporary with the pointer type, not its element type.
11476 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11478 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11479 token was a keyword or not.
11481 Add `error' options where an IDENTIFIER was expected; Provide
11482 CheckToken and CheckIdentifierToken convenience error reporting
11485 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11487 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11488 NameSpaceEntry NameSpaceEntry.
11490 (LookupInterfaceOrClass): Avoid creating a full qualified name
11491 from namespace and name: avoid doing lookups when we know the
11492 namespace is non-existant. Use new Tree.LookupByNamespace which
11493 looks up DeclSpaces based on their namespace, name pair.
11495 * driver.cs: Provide a new `parser verbose' to display the
11496 exception thrown during parsing. This is turned off by default
11497 now, so the output of a failure from mcs is more graceful.
11499 * namespace.cs: Track all the namespaces defined in a hashtable
11502 (IsNamespace): New method
11504 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11506 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11507 we know that we need to concatenate (full typename can never be
11512 * statement.cs: Use a bitfield; Do not initialize to null things
11513 which are done by the constructor by default.
11515 * cs-parser.jay: bug fix, parameter was 4, not 3.
11517 * expression.cs: Just use the property;
11519 * statement.cs: No need for GetVariableInfo method.
11521 2003-08-08 Martin Baulig <martin@ximian.com>
11523 * flowanalysis.cs (FlowReturns): This is now nested in the
11524 `FlowBranching' class.
11525 (MyBitVector): Moved this here from statement.cs.
11526 (FlowBranching.SiblingType): New enum type.
11527 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11529 2003-08-07 Martin Baulig <martin@ximian.com>
11531 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11532 `FlowBranching' class and called `BranchingType'.
11534 2003-08-07 Martin Baulig <martin@ximian.com>
11536 * flowanalysis.cs: Moved all the control flow analysis code into
11539 2003-08-07 Martin Baulig <martin@ximian.com>
11541 * assign.cs (Assign.DoResolve): `target' must either be an
11542 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11545 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11547 * expression.cs (BinaryMethod): This kind of expression is created by the
11548 Binary class if it determines that the operator has to be handled
11551 (BinaryDelegate): This kind of expression is created if we are
11552 dealing with a + or - operator on delegates.
11554 (Binary): remove method, argumetns, and DelegateOperator: when
11555 dealing with methods,
11557 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11559 * statement.cs (Block): use bitfields for the three extra booleans
11560 we had in use. Remove unused topblock parameter.
11562 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11564 * assign.cs: Drop extra unneeded tests.
11566 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11568 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11570 * statement.cs (Foreach): Use VariableStorage instead of
11573 * codegen.cs (VariableStorage): New class used by clients that
11574 require a variable stored: locals or fields for variables that
11575 need to live across yield.
11577 Maybe provide a convenience api for EmitThis+EmitLoad?
11579 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11582 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11584 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11585 RemapParameterLValue): New methods that are used to turn a
11586 precomputed FieldInfo into an expression like this:
11590 The idea is to use this instead of making LocalVariableReference
11591 have more than one meaning.
11593 * cs-parser.jay: Add error production to BASE.
11595 * ecore.cs: Deal with TypeManager.GetField returning null, which
11596 is now a valid return value.
11598 (FieldExprNoAddress): New expression for Fields whose address can
11601 * expression.cs (LocalVariableReference): During the resolve
11602 phases, create new expressions if we are in a remapping context.
11603 Remove code that dealt with remapping here.
11605 (ParameterReference): same.
11607 (ProxyInstance): New expression, like the `This' expression, but
11608 it is born fully resolved. We know what we are doing, so remove
11609 the errors that are targeted to user-provided uses of `this'.
11611 * statement.cs (Foreach): our variable is now stored as an
11612 Expression; During resolution, follow the protocol, dont just
11613 assume it will return this.
11615 2003-08-06 Martin Baulig <martin@ximian.com>
11617 * support.cs (SeekableStreamReader.cs): New public class.
11619 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11620 SeekableStreamReader instead of the normal StreamReader.
11622 2003-08-04 Martin Baulig <martin@ximian.com>
11624 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11625 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11626 deambiguate casts and delegate invocations.
11627 (parenthesized_expression): Use the new tokens to ensure this is
11628 not a cast of method invocation.
11630 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11631 when reading a `)' and Deambiguate_CloseParens () was previously
11634 * expression.cs (ParenthesizedExpression): New class. This is
11635 just used for the CS0075 test.
11636 (Binary.DoResolve): Check for CS0075.
11638 2003-07-29 Ravi Pratap <ravi@ximian.com>
11640 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11641 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11642 reference comparison.
11644 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11645 examine the ReturnType for equality - this is necessary in the
11646 cases of implicit and explicit operators whose signature also
11647 includes the return type.
11649 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11651 * namespace.cs: Cache the result of the namespace computation,
11652 instead of computing it every time.
11654 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11656 * decl.cs: Use a global arraylist that we reuse over invocations
11657 to avoid excesive memory consumption. Reduces memory usage on an
11658 mcs compile by one meg (45 average).
11660 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11661 private, work around that.
11663 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11665 * literal.cs (IntLiteral): Define Zero and One static literals.
11667 * cs-parser.jay (integer_literal): use static literals to reduce
11668 memory usage for the most used literals (0, 1 and -1). 211kb
11669 reduced in memory usage.
11671 Replace all calls to `new ArrayList' with `new
11672 ArrayList(4)' which is a good average number for most allocations,
11673 and also requires only 16 bytes of memory for its buffer by
11676 This reduced MCS memory usage in seven megabytes for the RSS after
11679 2003-07-28 Ravi Pratap <ravi@ximian.com>
11681 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11682 handle params methods the correct way by forming only one
11683 applicable set with params and normal methods in them. Earlier we
11684 were looking at params methods only if we found no normal methods
11685 which was not the correct thing to do.
11687 (Invocation.BetterFunction): Take separate arguments indicating
11688 when candidate and the best method are params methods in their
11691 This fixes bugs #43367 and #46199.
11693 * attribute.cs: Documentation updates.
11695 (CheckAttribute): Rename to CheckAttributeTarget.
11696 (GetValidPlaces): Rename to GetValidTargets.
11698 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11699 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11703 2003-07-28 Martin Baulig <martin@ximian.com>
11705 * class.cs (TypeContainer.DefineMembers): Use the base type's full
11706 name when looking up the base class of a nested class. Fixes #46977.
11708 2003-07-26 Martin Baulig <martin@ximian.com>
11710 * expression.cs (Indexers.Indexer): New nested struct; contains
11711 getter, setter and the indexer's type.
11712 (Indexers.Properties): This is now an ArrayList of
11713 Indexers.Indexer's.
11714 (IndexerAccess.DoResolveLValue): Correctly set the type if the
11715 indexer doesn't have any getters.
11717 * assign.cs (Assign.DoResolve): Also do the implicit conversions
11718 for embedded property and indexer assignments.
11720 2003-07-26 Martin Baulig <martin@ximian.com>
11722 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11723 preprocessor directive is not the first non-whitespace character
11726 2003-07-26 Martin Baulig <martin@ximian.com>
11728 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11729 namespace parsing, follow the spec more closely.
11731 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11732 NamespaceEntry.Lookup().
11734 2003-07-25 Martin Baulig <martin@ximian.com>
11736 * MethodCore.cs (OverridesSomething): New public field; it's set
11737 from TypeContainer.DefineMembers if this method overrides
11738 something (which doesn't need to be a method). Fix #39462.
11740 2003-07-25 Ravi Pratap <ravi@ximian.com>
11742 * typemanager.cs (GetMembers): Ensure that the list of members is
11743 reversed. This keeps things in sync.
11745 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11746 find an AttributeUsage attribute.
11748 * expression.cs (Invocation.OverloadResolve): Perform the check
11749 which disallows Invoke to be directly called on a Delegate.
11751 (Error_InvokeOnDelegate): Report error cs1533.
11753 2003-07-25 Martin Baulig <martin@ximian.com>
11755 * expression.cs (Indexers.GetIndexersForType): Only look in the
11756 interface hierarchy if the requested type is already an
11757 interface. Fixes #46788 while keeping #46502 fixed.
11759 2003-07-25 Martin Baulig <martin@ximian.com>
11761 * class.cs (TypeContainer.DefineMembers): Check whether all
11762 readonly fields have been assigned and report warning CS0649 if
11765 * statement.cs (LocalInfo.IsFixed): Always return true if this is
11768 2003-07-24 Ravi Pratap <ravi@ximian.com>
11770 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11771 returned from GetMethods to make things consistent with the
11772 assumptions MCS makes about ordering of methods.
11774 This should comprehensively fix bug #45127 and it does :-)
11776 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11777 ordering is actually reverse.
11779 * Clean up some debug messages I left lying around.
11781 * interface.cs (Populate*): Get rid of code which emits attributes
11782 since the stage in which we emit attributes is the 'Emit' stage,
11783 not the define stage.
11785 (Emit): Move attribute emission for interface members here.
11787 2003-07-22 Ravi Pratap <ravi@ximian.com>
11789 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11790 closely: we eliminate methods in base types when we have an
11791 applicable method in a top-level type.
11793 Please see section 14.5.5.1 for an exact description of what goes
11796 This fixes bug #45127 and a host of other related to corlib compilation.
11798 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11799 array is the method corresponding to the top-level type (this is
11800 because of the changes made to icall.c) so we change this
11803 (MethodGroupExpr.Name): This too.
11805 * typemanager.cs (GetElementType): New method which does the right
11806 thing when compiling corlib.
11808 * everywhere: Make use of the above in the relevant places.
11810 2003-07-22 Martin Baulig <martin@ximian.com>
11812 * cs-parser.jay (invocation_expression): Moved
11813 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11814 `cast_expression', but create a InvocationOrCast which later
11815 resolves to either an Invocation or a Cast.
11817 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11818 method; call this before EmitStatement() to make sure that this
11819 expression can be used as a statement.
11821 * expression.cs (InvocationOrCast): New class; resolves to either
11822 an Invocation or a Cast.
11824 * statement.cs (StatementExpression): Call ResolveStatement() on
11825 the ExpressionStatement before emitting it.
11827 2003-07-21 Martin Baulig <martin@ximian.com>
11829 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11830 `ref' and `out' attributes match; fixes #46220.
11831 (MemberAccess.ResolveMemberAccess): You can't reference a type
11832 through an expression; fixes #33180.
11833 (Indexers.GetIndexersForType): Don't return the indexers from
11834 interfaces the class implements; fixes #46502.
11836 2003-07-21 Martin Baulig <martin@ximian.com>
11838 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11839 CS0661 checks; fixes bug #30442.
11841 2003-07-21 Martin Baulig <martin@ximian.com>
11843 * decl.cs (AdditionResult): Added `Error'.
11845 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11847 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11848 makes cs0031.cs actually work.
11850 2003-07-20 Martin Baulig <martin@ximian.com>
11852 * namespace.cs: Fixed that bug which caused a crash when compiling
11853 the debugger's GUI.
11855 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11857 * typemanager.cs (LookupTypeReflection): Never expose types which
11858 are NotPublic, NestedPrivate, NestedAssembly, or
11859 NestedFamANDAssem. We used to return these, and later do a check
11860 that would report a meaningful error, but the problem is that we
11861 would not get the real match, if there was a name override.
11863 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11865 * namespace.cs (Namespace, Name): Do not compute the namespace
11866 name dynamically, compute it in the constructor. This reduced
11867 memory usage by 1697 KB.
11869 * driver.cs: Use --pause to pause at the end.
11871 2003-07-17 Peter Williams <peter@newton.cx>
11873 * Makefile: Change the name of the test target so that it doesn't
11874 conflict with the recursive test target.
11876 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11878 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11879 AddressOf): Do not use EmitThis, that was wrong, use the actual
11882 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11884 * class.cs (MethodData.Define): While checking if a method is an
11885 interface implementation, improve the test: If we are not public
11886 (use new test here: use the computed MethodAttributes directly,
11887 instead of the parsed modifier flags) check if the `implementing'
11888 method comes from an interface or not.
11890 * pending.cs (VerifyPendingMethods): Slightly better error
11893 * makefile: add test target that does the mcs bootstrap.
11895 2003-07-16 Ravi Pratap <ravi@ximian.com>
11897 * interface.cs (Define): Do nothing here since there are no
11898 members to populate etc. Move the attribute emission out of here
11899 since this was just totally the wrong place to put it. Attribute
11900 application happens during the 'Emit' phase, not in the 'Define'
11903 (Emit): Add this method and move the attribute emission here
11905 * rootcontext.cs (EmitCode): Call the Emit method on interface
11908 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11910 * expression.cs (OverloadResolve): Report error only if Location
11911 is not 'Null' which means that there was a probe going on.
11913 2003-07-14 Martin Baulig <martin@ximian.com>
11915 * expression.cs (ConditionalLogicalOperator): New public class to
11916 implement user defined conditional logical operators.
11917 This is section 14.11.2 in the spec and bug #40505.
11919 2003-07-14 Martin Baulig <martin@ximian.com>
11921 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11923 2003-07-14 Martin Baulig <martin@ximian.com>
11925 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11927 * ecore.cs (IVariable.VerifyFixed): New interface method.
11929 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11930 operator, check whether the variable is actually fixed. Fixes bug
11931 #36055. Set a variable definitely assigned when taking its
11932 address as required by the spec.
11934 * statement.cs (LocalInfo.IsFixed): New field.
11935 (LocalInfo.MakePinned): Set `IsFixed' to true.
11937 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11939 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11940 for .ctors, ensure that we only ask for members declared in the
11941 attribute type (BindingFlags.DeclaredOnly).
11945 * expression.cs (Error_WrongNumArguments): Report error 1501
11946 correctly the way CSC does.
11948 2003-07-13 Martin Baulig <martin@ximian.com>
11950 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11951 lookup on the fully qualified name, to make things like "X.X" work
11952 where "X.X" is a fully qualified type name, but we also have a
11953 namespace "X" in the using list. Fixes #41975.
11955 2003-07-13 Martin Baulig <martin@ximian.com>
11957 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11958 function. If we're a CompoundAssign, we need to create an embedded
11959 CompoundAssign, not an embedded Assign.
11960 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11963 2003-07-13 Martin Baulig <martin@ximian.com>
11965 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11966 work to fix bug #46088.
11968 2003-07-13 Ravi Pratap <ravi@ximian.com>
11970 * class.cs (Operator.Emit): Do not emit attributes here - it is
11971 taken care of by the Method class that we delegate too. This takes
11972 care of bug #45876.
11974 2003-07-10 Martin Baulig <martin@ximian.com>
11976 * expression.cs (TypeOfVoid): New class.
11977 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11979 2003-07-10 Martin Baulig <martin@ximian.com>
11981 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11984 2003-07-10 Martin Baulig <martin@ximian.com>
11986 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11987 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11989 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11991 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11993 2003-07-10 Martin Baulig <martin@ximian.com>
11995 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11996 of decimal. Fixes #42850.
11998 NOTE: I also fixed the created byte blob, but this doesn't work on
11999 the MS runtime and csc never produces any byte blobs for decimal
12002 2003-07-10 Martin Baulig <martin@ximian.com>
12004 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12005 structs; fixes #32068.
12006 (Block.AddChildVariableNames): Fixed #44302.
12008 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12010 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12012 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12014 * attribute.cs: And this test is onger needed.
12016 2003-07-08 Martin Baulig <martin@ximian.com>
12018 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12019 inaccessible types. Fixes #36313.
12021 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12023 * namespace.cs (NamespaceEntry): Create implicit entries for all
12024 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12025 implicit entries for N1.N2 and N1.
12027 2003-07-08 Martin Baulig <martin@ximian.com>
12029 Rewrote the handling of namespaces to fix a lot of the issues
12030 wrt. `using' aliases etc.
12032 * namespace.cs (Namespace): Splitted this class into a
12033 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12035 * typemanager.cs (TypeManager.IsNamespace): Removed.
12036 (TypeManager.ComputeNamespaces): Only compute namespaces from
12037 loaded assemblies here, not the namespaces from the assembly we're
12038 currently compiling.
12040 2003-07-08 Martin Baulig <martin@ximian.com>
12042 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12044 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12046 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12049 I thought about the memory savings here, but LookupTypeReflection
12050 is used under already very constrained scenarios. Compiling
12051 corlib or mcs only exposes one hit, so it would not really reduce
12052 any memory consumption.
12054 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12056 * typemanager.cs: fixes bug #45889 by only adding public types from
12057 other assemblies to the list of known types.
12059 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12061 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12062 on the type we resolved.
12064 2003-07-05 Martin Baulig <martin@ximian.com>
12066 * pending.cs (PendingImplementation.ParentImplements): Don't
12067 create the proxy if the parent is abstract.
12069 * class.cs (TypeContainer.DefineIndexers): Process explicit
12070 interface implementations first. Fixes #37714.
12072 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12074 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12075 defined recursively; but since we modify the input parameters
12076 (left is set to `this' temporarily), we reset this value if the
12077 left_is_explicit is false, which gives the original semantics to
12080 * literal.cs (NullPointer): new class used to represent a null
12081 literal in a pointer context.
12083 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12084 type is a pointer, use a NullPointer object instead of a
12085 NullLiteral. Closes 43687
12087 (ExplicitConversion): Convert pointer values using
12088 the conv opcode to the proper type.
12090 * ecore.cs (New): change ValueTypeVariable property into a method,
12091 that returns whether the valuetype is suitable for being used.
12093 * expression.cs (Binary.DoNumericPromotions): Only return if we
12094 the int constant was a valid uint, and we can return both left and
12095 right as uints. If not, we continue processing, to trigger the
12096 type conversion. This fixes 39018.
12098 * statement.cs (Block.EmitMeta): During constant resolution, set
12099 the CurrentBlock property on the emitcontext, so that we resolve
12100 constants propertly.
12102 2003-07-02 Martin Baulig <martin@ximian.com>
12104 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12105 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12107 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12108 than emitting it here.
12110 * statement.cs: Fixed some more flow analysis bugs.
12112 2003-07-02 Martin Baulig <martin@ximian.com>
12114 * class.cs (MethodData.Define): When implementing interface
12115 methods, set Final unless we're Virtual.
12117 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12118 check work for interface methods.
12120 2003-07-01 Martin Baulig <martin@ximian.com>
12122 * ecore.cs (EmitContext.This): Replaced this property with a
12123 GetThis() method which takes a Location argument. This ensures
12124 that we get the correct error location for a CS0188.
12126 2003-07-01 Miguel de Icaza <miguel@ximian.com>
12128 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12129 ImplicitStandardConversion.
12131 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12133 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
12135 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12138 2003-06-30 Miguel de Icaza <miguel@ximian.com>
12140 * class.cs (Constructor.Define): Turn off initlocals for unsafe
12143 (MethodData.Define): Turn off initlocals for unsafe methods.
12145 2003-06-29 Miguel de Icaza <miguel@ximian.com>
12147 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12148 complete; Fixes #37521.
12150 * delegate.cs: Use Modifiers.TypeAttr to compute the
12151 TypeAttributes, instead of rolling our own. This makes the flags
12152 correct for the delegates.
12154 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12156 * class.cs (Constructor.Define): Set the private flag for static
12157 constructors as well.
12159 * cs-parser.jay (statement_expression): Set the return value to
12160 null, to avoid a crash when we catch an error.
12162 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12164 * cs-parser.jay: Applied patch from Jackson that adds support for
12165 extern and unsafe modifiers to destructor declarations.
12167 * expression.cs: Report error 21 if the user is trying to index a
12170 * driver.cs: Add an error message, suggested by the bug report.
12172 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12173 if we do not have a ": this ()" constructor initializer. Fixes 45149
12175 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12177 * namespace.cs: Add some information to reduce FAQs.
12179 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12181 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12182 underlying enumeration types. Fixes #43915.
12184 * expression.cs: Treat ushort/short as legal values to be used in
12185 bitwise operations.
12187 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12189 * delegate.cs: transfer custom attributes for paramenters from
12190 the delegate declaration to Invoke and BeginInvoke.
12192 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12194 * attribute.cs: handle custom marshalers and emit marshal info
12197 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12199 * makefile.gnu: Added anonymous.cs to the compiler sources.
12201 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12203 * iterators.cs: Change the name of the proxy class to include two
12206 * cs-parser.jay: Update grammar to include anonymous methods.
12208 * anonymous.cs: new file.
12210 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12212 * class.cs (Field.Define): Add missing test for pointers and
12215 2003-05-27 Ravi Pratap <ravi@ximian.com>
12217 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12218 we use the stobj opcode.
12220 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12221 since it wasn't the correct fix.
12223 It still is puzzling that we are required to use stobj for IntPtr
12224 which seems to be a ValueType.
12226 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12228 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12229 during regular simple name resolution. Now, the trick is that
12230 instead of returning for processing the simplename, we do a
12231 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12232 contextual lookup type). If a match is found, return that, if
12233 not, return for further composition.
12235 This fixes long-standing 30485.
12237 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12238 using the address to initialize an object, do an Stobj instead of
12239 using the regular Stelem.
12241 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12242 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12243 Because if we are a BaseIndexerAccess that value will be true.
12246 * statement.cs (GotoCase.Resolve): Return after reporting an
12247 error, do not attempt to continue.
12249 * expression.cs (PointerArithmetic.Emit): If our operand is a
12250 long, convert our constants to match the operand before
12251 multiplying. Convert to I type before adding. Fixes 43670.
12253 2003-05-14 Ravi Pratap <ravi@ximian.com>
12255 * enum.cs (ImplicitConversionExists) : Rename to
12256 ImplicitEnumConversionExists to remove ambiguity.
12258 * ecore.cs (NullCast): New type of cast expression class which
12259 basically is very similar to EmptyCast with the difference being
12260 it still is a constant since it is used only to cast a null to
12262 (eg. (string) null)
12264 * convert.cs (ImplicitReferenceConversion): When casting a null
12265 literal, we return a NullCast.
12267 * literal.cs (NullLiteralTyped): Remove - I don't see why this
12268 should be around anymore.
12270 The renaming (reported was slightly wrong). Corrections:
12272 ConvertImplicitStandard -> ImplicitConversionStandard
12273 ConvertExplicitStandard -> ExplicitConversionStandard
12275 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12276 before passing them in !
12278 * convert.cs (ImplicitConversionStandard): When comparing for
12279 equal expr and target types, ensure that expr is not a
12282 In general, we must not be checking (expr_type ==
12283 target_type) in the top level conversion methods
12284 (ImplicitConversion, ExplicitConversion etc). This checking is
12285 done in the methods that they delegate to.
12287 2003-05-20 Miguel de Icaza <miguel@ximian.com>
12289 * convert.cs: Move Error_CannotConvertType,
12290 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12291 ImplicitNumericConversion, ImplicitConversionExists,
12292 ImplicitUserConversionExists, StandardConversionExists,
12293 FindMostEncompassedType, FindMostSpecificSource,
12294 FindMostSpecificTarget, ImplicitUserConversion,
12295 ExplicitUserConversion, GetConversionOperators,
12296 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12297 TryImplicitIntConversion, Error_CannotConvertImplicit,
12298 ConvertImplicitRequired, ConvertNumericExplicit,
12299 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12300 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12303 Perform the following renames:
12305 StandardConversionExists -> ImplicitStandardConversionExists
12306 ConvertImplicit -> ImplicitConversion
12307 ConvertImplicitStandard -> ImplicitStandardConversion
12308 TryImplicitIntConversion -> ImplicitIntConversion
12309 ConvertImplicitRequired -> ImplicitConversionRequired
12310 ConvertNumericExplicit -> ExplicitNumericConversion
12311 ConvertReferenceExplicit -> ExplicitReferenceConversion
12312 ConvertExplicit -> ExplicitConversion
12313 ConvertExplicitStandard -> ExplicitStandardConversion
12315 2003-05-19 Martin Baulig <martin@ximian.com>
12317 * statement.cs (TypeInfo.StructInfo): Made this type protected.
12318 (TypeInfo): Added support for structs having structs as fields.
12320 * ecore.cs (FieldExpr): Implement IVariable.
12321 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12322 VariableInfo for the field.
12324 2003-05-18 Martin Baulig <martin@ximian.com>
12326 * expression.cs (This.DoResolve): Report a CS0027 if we're
12327 emitting a field initializer.
12329 2003-05-18 Martin Baulig <martin@ximian.com>
12331 * expression.cs (This.ResolveBase): New public function.
12332 (This.DoResolve): Check for CS0188.
12334 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12337 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12338 `instance_expression' to null if we don't have any non-static
12341 2003-05-18 Martin Baulig <martin@ximian.com>
12343 Reworked the way how local variables and parameters are handled by
12344 the flow analysis code.
12346 * statement.cs (TypeInfo, VariableMap): New public classes.
12347 (VariableInfo): New public class. This is now responsible for
12348 checking whether a variable has been assigned. It is used for
12349 parameters and local variables.
12350 (Block.EmitMeta): Take the InternalParameters as argument; compute
12351 the layout of the flow vectors here.
12352 (Block.LocalMap, Block.ParameterMap): New public properties.
12353 (FlowBranching): The .ctor doesn't get the InternalParameters
12354 anymore since Block.EmitMeta() now computes the layout of the flow
12356 (MyStructInfo): This class is now known as `StructInfo' and nested
12357 in `TypeInfo'; we don't access this directly anymore.
12359 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12360 property and removed IsAssigned(), IsFieldAssigned(),
12361 SetAssigned() and SetFieldAssigned(); we now call them on the
12362 VariableInfo so we don't need to duplicate this code everywhere.
12364 * expression.cs (ParameterReference): Added `Block block' argument
12366 (LocalVariableReference, ParameterReference, This): The new
12367 VariableInfo class is now responsible for all the definite
12370 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12371 IsParameterAssigned, SetParameterAssigned): Removed.
12373 2003-05-18 Martin Baulig <martin@ximian.com>
12375 * typemanager.cs (InitCoreTypes): Try calling
12376 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12377 the 3-args-version. Corlib now also needs our `void_type'.
12378 (GetMethod): Added overloaded version which takes an optional
12379 `bool report_errors' to allow lookups of optional methods.
12381 2003-05-12 Martin Baulig <martin@ximian.com>
12383 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12384 only used for locals and not for parameters.
12386 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12388 * support.cs (InternalParameters.ParameterType): Return the
12389 ExternalType of the parameter.
12391 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12394 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12396 * class.cs (MethodData.Define): Do not set the `newslot' on
12397 interface members, if they are also flagged as "override".
12399 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12400 better code for ++i and i++. This only works for static fields
12401 and local variables.
12403 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12404 want to pull the DeclSpace out of the builder_to_declspace instead
12405 of the TypeBuilder (like in TypeContainer.FindMembers).
12407 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12408 instead of LookupTypeContainer. Fixes the crash on .NET for
12409 looking up interface members.
12411 * const.cs: Create our own emit context during the Definition
12412 stage, so that constants are evaluated in the proper context, when
12413 a recursive definition happens.
12415 2003-05-11 Martin Baulig <martin@ximian.com>
12417 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12418 new block for a switch section.
12419 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12420 the adding/lookup in the switch block. Fixes #39828.
12422 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12424 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12425 functionality: I needed to convert the data after I had performed
12426 the add/sub operation into the operands type size.
12428 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12429 pass the type for the box operation, otherwise the resulting
12430 object would have been of type object.
12432 (BoxedCast): Add constructor to specify the type to box as.
12434 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12436 * iterators.cs: I was reusing the `count' variable inadvertently,
12437 take steps to not allow this to happen.
12439 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12441 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12442 by creating an array at the point where the params starts and
12443 putting all those arguments there, then adjusting the size of the
12446 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12448 * expression.cs (New.AddressOf): Implement interface
12449 IMemoryLocation. This is used when the `new' operator is used in
12450 the context of an invocation to a method on a value type.
12452 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12455 * namespace.cs: Also check the using aliases here.
12457 * driver.cs: Move the test for using validity after the types have
12458 been entered, so we do a single pass that also includes the using
12461 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12462 in the regular case. CreateSiblingForFinally is doing extra
12465 * attribute.cs (GetAttributeArgumentExpression): Store the result
12466 on an out value, and use the return value to indicate failure
12467 instead of using null (which is a valid return for Constant.GetValue).
12469 * statement.cs: Perform the analysis flow for the increment
12470 portion after the statement, because this will be the real flow of
12471 execution. Fixes #42385
12473 * codegen.cs (EmitContext.EmitArgument,
12474 EmitContext.EmitStoreArgument): New helper functions when the
12475 RemapToProxy flag is set.
12477 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12480 Add support for remapping parameters.
12482 * iterators.cs: Propagate parameter values; Store parameter
12483 values in the proxy classes.
12485 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12487 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12488 need a proxy reference; I do not know what I was thinking
12490 * cs-parser.jay (constructor_initializer): catch another error,
12491 and display nice message.
12493 (field_declaration): catch void field declaration
12494 to flag a better error.
12496 * class.cs (MemberBase.CheckBase): Report an error instead of a
12497 warning if a new protected member is declared in a struct.
12498 (Field.Define): catch the error of readonly/volatile.
12500 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12502 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12503 volatile variable is taken
12505 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12507 * statement.cs (Fixed.Resolve): Report an error if we are not in
12510 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12512 * typemanager.cs: reuse the code that handles type clashes for
12513 delegates and enumerations.
12515 * class.cs (Report28): Always report.
12517 * expression.cs (EncodeAsAttribute): Allow nulls here.
12519 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12521 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12522 the functionality for testing whether an expression is valid for
12523 an attribute here. Also handle the case of arrays of elements
12526 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12527 encoding a linear array into an array of objects that are suitable
12528 to be passed to an CustomAttributeBuilder.
12530 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12532 * ecore.cs: (FieldExpr): Handle field remapping here.
12534 * iteratators.cs: Pass the instance variable (if the method is an
12535 instance method) to the constructors, so we can access the field
12536 variables on the class.
12538 TODO: Test this with structs. I think the THIS variable on
12539 structs might have to be a pointer, and not a refenrece
12541 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12543 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12544 local variables to fields in a proxy class.
12546 * iterators.cs (PopulateProxy): Rename our internal fields to
12548 Create a <THIS> field if we are an instance method, so we can
12549 reference our parent container variables.
12550 (MapVariable): Called back from the EmitContext code to enter a
12551 new variable to field mapping into the proxy class (we just create
12555 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12556 for using the remapped locals to fields.
12558 I placed the code here, because that gives the same semantics to
12559 local variables, and only changes the Emit code.
12561 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12562 statements inside iterators.
12563 (VariableInfo): Add a FieldBuilder for the cases when we are
12564 remapping local variables to fields in a proxy class
12566 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12567 current_block != null.
12569 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12570 not cope with strings, as it has been moved to the
12571 TableSwitchEmit. Fixed bug in switch generation.
12573 * expression.cs (New.DoResolve): Provide more context for the user
12574 when reporting an error.
12576 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12579 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12580 check the permissions for it. Note than in a type-resolution
12581 context the check was already present in DeclSpace.ResolveType,
12582 but was missing from the MemberAccess.
12584 (ArrayCreation.CheckIndices): warn if the user has
12585 more nested levels of expressions, but there are no more
12586 dimensions specified. Avoids crash on bug 41906.
12588 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12590 * statement.cs (Block): replace Implicit bool, for a generic
12592 New flag: `Unchecked'. This is used during the EmitMeta phase
12593 (which is out-of-line with the regular Resolve/Emit process for a
12594 statement, as this is done ahead of time, but still gets a chance
12595 to call constant resolve).
12597 (Block.Flags): new enum for adding a new flag.
12599 (Block.EmitMeta): track the state of unchecked.
12601 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12602 to enable constant resolution to work there as well.
12604 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12606 * typemanager.cs (ienumerable_type): Also look up
12607 System.Collections.IEnumerable.
12609 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12611 TODO: Test more than one conditional per method.
12613 * class.cs (Indexer.Define): Report the location where the user is
12614 referencing the unsupported feature.
12616 (MethodData): Overload the use of `conditionals' to
12617 minimize the creation of needless ArrayLists. This saves roughly
12618 212kb on my machine.
12620 (Method): Implement the new IIteratorContainer interface.
12621 (Method.SetYields): Implement the method by setting the ModFlags
12622 to contain METHOD_YIELDS.
12624 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12625 which just got set to null.
12627 * iterators.cs: New file.
12629 (Yield, YieldBreak): New statements.
12631 * statement.cs (Return.Resolve): Flag an error if we are used in
12632 an iterator method.
12634 * codegen.cs (InIterator): New flag set if the code is being
12635 compiled in an iterator method.
12637 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12638 internal modifier, and we just use it to avoid adding extra
12639 fields, as this is seldom used.
12641 * cs-parser.jay: Add yield_statement (yield and yield break).
12643 * driver.cs: New flag -v2 to turn on version 2 features.
12645 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12646 hashtable when v2 is enabled.
12648 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12650 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12651 there is already a namespace defined with this name.
12653 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12654 people upgraded their corlibs.
12656 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12657 always use fully qualified types, no need to use the compiler
12660 (TypeManager.IsNamespace): Use binarysearch.
12662 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12663 AddDelegate): I did not quite use the new IsValid API properly: I
12664 have to pass the short-name and the fullname. I was passing only
12665 the basename instead of the fullname sometimes.
12667 (TypeContainer.DefineType): call NamespaceClash.
12669 * interface.cs (Interface.DefineType): use NamespaceClash before
12672 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12675 * enum.cs: (Enum.DefineType): use NamespaceClash before
12678 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12679 speed increase. First, use the negative_hits cache when we get a
12680 negative. Second, add the type with its full original name
12681 instead of the new . and + encoded name (reflection uses + to
12682 separate type from a nested type). Use LookupTypeReflection
12683 directly which bypasses the type->name hashtable (that we already
12684 know does not contain the type.
12686 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12687 location/container type.
12689 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12691 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12693 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12695 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12696 method is being referenced in the method group from a static
12697 context, and report error 120 if so.
12699 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12702 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12703 is created, we create the A namespace).
12705 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12708 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12710 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12711 invocation to ModuleBuilder.GetType with the same values will
12712 return a new type instance, so we need to cache its return
12715 * expression.cs (Binary.ResolveOperator): Only allow the compare
12716 operators on enums if they are of the same type.
12718 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12719 types of ValueType on their own case. Before we were giving them
12720 the same treatment as objects.
12722 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12723 fullname. Short name is used to compare against container name.
12724 Fullname is used to check against defined namespace names.
12726 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12727 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12729 (Method.CheckBase): Call parent.
12730 (MemberBase.CheckBase): Check for protected members on sealed
12732 (PropertyBase.CheckBase): Call parent.
12733 (Field.Define): Call parent.
12735 * report.cs: Negative error codes are now mapped to 8000 - code,
12736 so that the display is render more nicely.
12738 * typemanager.cs: Do not use try/catch, instead report a regular
12741 (GetPointerType, GetReferenceType): These methods provide
12742 mechanisms to obtain the T* and T& from a T. We had the code
12743 previously scattered around the code base, and it also used
12744 TypeManager.LookupType that would go through plenty of caches.
12745 This one goes directly to the type source.
12747 In some places we did the Type.GetType followed by
12748 ModuleBuilder.GetType, but not in others, so this unifies the
12749 processing as well.
12751 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12752 statements now that we have namespace information.
12754 * typemanager.cs (IsNamespace): New method, returns whether the
12755 string presented is a namespace or not.
12757 (ComputeNamespaces): New public entry point, computes the list of
12758 available namespaces, using the GetNamespaces API call in Mono, or
12759 the slower version in MS.NET.
12761 Now before we start the semantic analysis phase, we have a
12762 complete list of namespaces including everything that the user has
12765 Deleted old code to cache namespaces in .nsc files.
12767 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12769 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12770 class/struct location definition Location for the implicit
12771 constructor location.
12773 (Operator.Define): Use the location of the operator for the
12774 implicit Method definition.
12776 (Constructor.Emit): use the constructor location for the implicit
12777 base initializer constructor.
12779 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12780 and the Expression class now contains two new methods:
12782 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12783 isolate type lookup from the rest of the resolution process.
12785 Since we use Expressions to hold type definitions due to the way
12786 we parse the input we have historically overloaded Resolve to
12787 perform the Type lookups if a special flag is passed. Now this is
12788 eliminated and two methods take their place.
12790 The differences in the two methods between xStep and xTerminal is
12791 that xStep is involved in our current lookup system that uses
12792 SimpleNames to compose a name, while xTerminal is used just to
12793 catch the case where the simplename lookup failed.
12795 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12797 * expression.cs (ResolveMemberAccess): Remove redundant code.
12798 TypeExpr expressions are always born fully resolved.
12800 * interface.cs (PopulateMethod): Do not lookup the types twice.
12801 We were doing it once during SemanticAnalysis and once during
12804 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12805 in local variable type definitions, were being returned as a
12806 SimpleName (we decomposed everything into a string), that is
12807 because primary_expression was being used instead of a type in the
12808 grammar (reduce/reduce conflicts).
12810 The part that was wrong is that we converted the expression into a
12811 string (an oversimplification in one hand, compounded with primary
12812 expressions doing string concatenation).
12818 Would return "A.B.C[]" as a SimpleName. This stopped things like
12819 using clauses from working on this particular context. And a type
12820 was being matched directly against "A.B.C[]".
12822 We now use the correct approach, and allow for ComposedCast to be
12823 part of the unary expression. So the "A.B.C []" become a composed
12824 cast of "A.B.C" (as a nested group of MemberAccess with a
12825 SimpleName at the end) plus the rank composition "[]".
12829 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12831 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12832 for the access level checking.
12834 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12835 `TypeContainer container', because I kept getting confused when I
12836 was debugging this code.
12838 * expression.cs (Indexers): Instead of tracking getters/setters,
12839 we now track them in parallel. We create one arraylist less, but
12840 most importantly it is possible now for the LValue code to find a
12841 matching get for a set.
12843 (IndexerAccess.DoResolveLValue): Update the code.
12844 GetIndexersForType has been modified already to extract all the
12845 indexers from a type. The code assumed it did not.
12847 Also make the code set the correct return type for the indexer.
12848 This was fixed a long time ago for properties, but was missing for
12849 indexers. It used to be void_type.
12851 (Binary.Emit): Test first for doubles instead of
12852 floats, as they are more common.
12854 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12855 when dealing with floats and the <=, >= operators. This fixes bug
12858 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12859 to load the array value by emitting a load on the foreach variable
12860 type. This was incorrect.
12862 We now emit the code to load an element using the the array
12863 variable type, and then we emit the conversion operator.
12867 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12869 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12871 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12873 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12874 test for protection before we test for signatures.
12876 (MethodSignature.ToString): implement.
12878 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12879 to the case where we reduced into a LongConstant.
12881 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12882 depend on whether the information is acurrate, because the
12883 Microsoft runtime will always claim that the array type is public,
12884 regardless of the real state.
12886 If the type is a pointer, another problem happens: the type is
12887 reported as non-public in Microsoft.
12889 In both cases we have to call CheckAccessLevel recursively with
12890 the underlying type as the argument to be tested.
12892 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12894 * assign.cs (Assign.Emit): If we are dealing with a compound
12895 assignment expression, we should use the code path that stores the
12896 intermediate result in a temporary value. This fixes #40903.
12898 *expression.cs (Indirection.ToString): Provide ToString method for
12901 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12903 * class.cs: Null out fields holding references to Block objects so
12904 they can be garbage collected.
12906 * expression.cs (OverloadResolve): Remove unused local.
12908 2003-04-07 Martin Baulig <martin@ximian.com>
12910 * codegen.cs (EmitContext.CurrentFile): New public field.
12911 (EmitContext.Mark): Use the CurrentFile to check whether the
12912 location is in the correct file.
12913 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12915 2003-04-07 Martin Baulig <martin@ximian.com>
12917 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12919 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12920 location. [FIXME: The location argument which gets passed to this
12921 method is sometimes wrong!]
12923 2003-04-07 Nick Drochak <ndrochak@gol.com>
12925 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12927 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12929 * expression.cs (Indirection.EmitAssign): We were using the
12930 temporary, but returning immediately instead of continuing the
12933 2003-04-06 Martin Baulig <martin@ximian.com>
12935 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12936 if it's a nested child, but also deriving from the outer class.
12939 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12940 nested child, but also deriving from the outer class. See
12942 (FilterWithClosure): We may access private members of the outer
12943 class if we're a nested child and deriving from the outer class.
12944 (RealMemberLookup): Only set `closure_private_ok' if the
12945 `original_bf' contained BindingFlags.NonPublic.
12947 2003-04-05 Martin Baulig <martin@ximian.com>
12949 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12951 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12953 * class.cs (Event.Define): Do not allow abstract events to have
12956 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12958 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12959 block in event declarations.
12961 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12962 value type, get its address.
12964 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12965 leaving a class on the stack instead of a boolean value (int
12966 0/1). Change the code so we compare against null, and then the
12967 result against zero.
12969 * class.cs (TypeContainer.GetClassBases): We were checking for the
12970 parent class being sealed too late.
12972 * expression.cs (Binary.Emit): For <= and >= when dealing with
12973 floating point values, use cgt.un and clt.un instead of cgt and
12976 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12978 * statement.cs: Apply the same optimization as MS: skip the
12979 GetEnumerator returning an IEnumerator, and use the one returning a
12980 CharEnumerator instead. This allows us to avoid the try-finally block
12983 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12985 * cs-parser.jay: Attributes cannot be applied to
12986 namespaces. Fixes #40473
12988 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12991 (Add*): check if the name is valid using the full name for constants,
12992 fields, properties and events.
12994 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12996 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12997 char constants to be part of the enumeration.
12999 * expression.cs (Conditional.DoResolve): Add support for operator
13000 true. Implements the missing functionality from 14.12
13002 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13003 operator true/false as required by the spec.
13005 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13006 implicit conversion to boolean.
13008 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13009 also one where the type implements `operator true'.
13011 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13012 get an expression that will invoke operator true based on an
13015 (GetConversionOperators): Removed the hack that called op_True
13018 (Expression.ResolveBoolean): Move this from Statement.
13020 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13022 * ecore.cs (FieldExpr): do not allow initialization of initonly
13023 fields on derived classes
13025 2003-03-13 Martin Baulig <martin@ximian.com>
13027 * statement.cs (Block.Emit): Call ig.BeginScope() and
13028 ig.EndScope() when compiling with debugging info; call
13029 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13031 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13033 * expression.cs (Indexers): Do not construct immediately, allow
13034 for new members to be appended as we go. Fixes 38143
13036 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13038 * expression.cs: save/restore context when resolving an unchecked
13041 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13043 * cfold.cs: Catch division by zero in modulus operator during
13046 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13048 * interface.cs (Interface.DefineMembers): Avoid defining members
13051 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13053 * driver.cs: handle the +/- options for -noconfig
13055 * statement.cs (Unckeched.Resolve): Also track the state of
13056 unchecked in the Resolve phase.
13058 2003-02-27 Martin Baulig <martin@ximian.com>
13060 * ecore.cs (Expression.MemberLookup): Don't create a
13061 MethodGroupExpr for something which is not a method. Fixes #38291.
13063 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13065 * class.cs (MemberBase.CheckParameters): Also check that the type
13066 is unmanaged if it is a pointer.
13068 * expression.cs (SizeOf.Resolve): Add location information.
13070 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13071 a managed type is declared.
13073 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13074 parameter modifiers as well. Fixes bug 38606
13076 * class.cs: Very sad. Am backing out the speed up changes
13077 introduced by the ArrayList -> Array in the TypeContainer, as they
13078 were not actually that much faster, and introduced a bug (no error
13079 reports on duplicated methods).
13081 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13082 source first, this will guarantee that we have a valid expression
13083 before calling in lower levels functions that will require a
13084 resolved object. Then use this original_source in the
13085 target.ResolveLValue instead of the original source that was
13088 Another change. Use target.Resolve instead of LValueResolve.
13089 Although we are resolving for LValues, we will let the Assign code
13090 take care of that (it will be called again from Resolve). This
13091 basically allows code like this:
13093 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13094 class Y { void A (X x) { x [0] += o; }
13096 The problem was that the indexer was trying to resolve for
13097 set_Item (idx, object o) and never finding one. The real set_Item
13098 was set_Item (idx, X). By delaying the process we get the right
13103 2003-02-23 Martin Baulig <martin@ximian.com>
13105 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13106 while calling DoEmit ().
13108 * codegen.cs (EmitContext.Mark): Don't mark locations in other
13109 source files; if you use the #line directive inside a method, the
13110 compiler stops emitting line numbers for the debugger until it
13111 reaches the end of the method or another #line directive which
13112 restores the original file.
13114 2003-02-23 Martin Baulig <martin@ximian.com>
13116 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13118 2003-02-23 Martin Baulig <martin@ximian.com>
13120 * statement.cs (Block.AddChildVariableNames): We need to call this
13121 recursively, not just for our immediate children.
13123 2003-02-23 Martin Baulig <martin@ximian.com>
13125 * class.cs (Event.Define): Always make the field private, like csc does.
13127 * typemanager.cs (TypeManager.RealMemberLookup): Make events
13128 actually work, fixes bug #37521.
13130 2003-02-23 Miguel de Icaza <miguel@ximian.com>
13132 * delegate.cs: When creating the various temporary "Parameters"
13133 classes, make sure that we call the ComputeAndDefineParameterTypes
13134 on those new parameters (just like we do with the formal ones), to
13135 allow them to be resolved in the context of the DeclSpace.
13137 This fixes the bug that Dick observed in Bugzilla #38530.
13139 2003-02-22 Miguel de Icaza <miguel@ximian.com>
13141 * expression.cs (ResolveMemberAccess): When resolving a constant,
13142 do not attempt to pull a constant if the value was not able to
13143 generate a valid constant.
13145 * const.cs (LookupConstantValue): Do not report more errors than required.
13147 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13149 * expression.cs: fixes bug #38328.
13151 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13153 * class.cs: Changed all the various members that can be part of a
13154 class from being an ArrayList to be an Array of the right type.
13155 During the DefineType type_list, interface_list, delegate_list and
13156 enum_list are turned into types, interfaces, delegates and enums
13159 And during the member population, indexer_list, event_list,
13160 constant_list, field_list, instance_constructor_list, method_list,
13161 operator_list and property_list are turned into their real arrays.
13163 Although we could probably perform this operation earlier, for
13164 good error reporting we need to keep the lists and remove the
13165 lists for longer than required.
13167 This optimization was triggered by Paolo profiling the compiler
13168 speed on the output of `gen-sample-program.pl' perl script.
13170 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13171 not crash in methods like MemberLookupFailed that use this field.
13173 This problem arises when the compiler fails to resolve a type
13174 during interface type definition for example.
13176 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13178 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13179 inherit from System.Object, so we have to stop at null, not only
13180 when reaching System.Object.
13182 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13184 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13185 DeclaredOnly because the parent indexer might have had a different
13186 name, but did not loop until the top of the hierarchy was reached.
13188 The problem this one fixes is 35492: when a class implemented an
13189 indexer from an interface, we were getting the interface method
13190 (which was abstract) and we were flagging an error (can not invoke
13193 This also keeps bug 33089 functioning, and test-148 functioning.
13195 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13196 out if a method is special is to see if it is declared in a
13197 property or event, or whether it is one of the predefined operator
13198 names. This should fix correctly #36804.
13200 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13202 The goal here is to remove the dependency on EmptyCast.Peel ().
13203 Killing it completely.
13205 The problem is that currently in a number of places where
13206 constants are expected, we have to "probe" for an EmptyCast, and
13207 Peel, which is not the correct thing to do, as this will be
13208 repetitive and will likely lead to errors.
13210 The idea is to remove any EmptyCasts that are used in casts that
13211 can be reduced to constants, so we only have to cope with
13214 This bug hunt was triggered by Bug 37363 and the desire to remove
13215 the duplicate pattern where we were "peeling" emptycasts to check
13216 whether they were constants. Now constants will always be
13219 * ecore.cs: Use an enumconstant here instead of wrapping with
13222 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13223 throwing me off. By handling this we can get rid of a few hacks.
13225 * statement.cs (Switch): Removed Peel() code.
13227 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13229 * class.cs: Location information for error 508
13231 * expression.cs (New.DoResolve): Add a guard against double
13232 resolution of an expression.
13234 The New DoResolve might be called twice when initializing field
13235 expressions (see EmitFieldInitializers, the call to
13236 GetInitializerExpression will perform a resolve on the expression,
13237 and later the assign will trigger another resolution
13239 This leads to bugs (#37014)
13241 * delegate.cs: The signature for EndInvoke should contain any ref
13242 or out parameters as well. We were not doing this in the past.
13244 * class.cs (Field.Define): Do not overwrite the type definition
13245 inside the `volatile' group. Turns out that volatile enumerations
13246 were changing the type here to perform a validity test, which
13249 2003-02-12 Miguel de Icaza <miguel@ximian.com>
13251 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13252 and structs, we do not want to load the instance variable
13254 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13255 enum_type has to be handled like an object reference (implicit
13256 conversions exists from this to object), but the regular IsClass
13257 and IsValueType tests will never return true for this one.
13259 Also we use TypeManager.IsValueType instead of type.IsValueType,
13260 just for consistency with the rest of the code (this is only
13261 needed if we ever use the construct exposed by test-180.cs inside
13262 corlib, which we dont today).
13264 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
13266 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13269 2003-02-09 Martin Baulig <martin@ximian.com>
13271 * namespace.cs (Namespace..ctor): Added SourceFile argument.
13272 (Namespace.DefineNamespaces): New static public method; this is
13273 called when we're compiling with debugging to add all namespaces
13274 to the symbol file.
13276 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13277 pass it to the Namespace's .ctor.
13279 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13280 and MethodBase arguments; pass the namespace ID to the symwriter;
13281 pass the MethodBase instead of the token to the symwriter.
13282 (SymbolWriter.DefineNamespace): New method to add a namespace to
13285 2003-02-09 Martin Baulig <martin@ximian.com>
13287 * symbolwriter.cs: New file. This is a wrapper around
13288 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
13289 methods here in near future.
13291 2003-02-09 Martin Baulig <martin@ximian.com>
13293 * codegen.cs (EmitContext.Mark): Just pass the arguments to
13294 ILGenerator.MarkSequencePoint() which are actually used by the
13297 2003-02-09 Martin Baulig <martin@ximian.com>
13299 * location.cs (SourceFile): New public sealed class. This
13300 contains the name and an index which is used in the location's token.
13301 (Location): Reserve an appropriate number of bits in the token for
13302 the source file instead of walking over that list, this gives us a
13303 really huge performance improvement when compiling with debugging.
13305 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13306 `SourceFile' argument instead of a string.
13307 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13308 but don't parse/tokenize here, we need to generate the list of all
13309 source files before we do that.
13310 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13313 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13314 instead of a string.
13316 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13319 2003-02-09 Martin Baulig <martin@ximian.com>
13321 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13322 filename on `#line default'.
13324 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13326 * statement.cs: don't clear the pinned var when the fixed statement
13327 returns from the method (fixes bug#37752).
13329 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13331 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13334 2003-02-07 Martin Baulig <martin@ximian.com>
13336 * driver.cs: Removed the `--debug-args' command line argument.
13338 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13339 automatically by the AsssemblyBuilder.
13340 (CodeGen.InitializeSymbolWriter): We don't need to call any
13341 initialization function on the symbol writer anymore. This method
13342 doesn't take any arguments.
13344 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13346 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13347 from referenced assemblies as well.
13349 2003-02-02 Martin Baulig <martin@ximian.com>
13351 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13353 2003-02-02 Martin Baulig <martin@ximian.com>
13355 * class.cs (Constructor.Emit): Open the symbol writer before
13356 emitting the constructor initializer.
13357 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13358 single-stepping through constructor initializers.
13360 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13362 * class.cs: Handle error 549: do not allow virtual methods in
13365 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13367 * decl.cs: Check access levels when resolving types
13369 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13371 * statement.cs: Add parameters and locals set in catch blocks that might
13372 return to set vector
13374 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13376 * class.cs (Operator): Set the SpecialName flags for operators.
13378 * expression.cs (Invocation.DoResolve): Only block calls to
13379 accessors and operators on SpecialName methods.
13381 (Cast.TryReduce): Handle conversions from char constants.
13384 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13386 * statement.cs: small memory and time optimization in FlowBranching.
13388 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13390 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13391 problem that the last fix but in the other sid (Set).
13393 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13394 access when there is no indexer in the hierarchy.
13396 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13398 * class.cs: Combine some if statements.
13400 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13402 * driver.cs: fixed bug #37187.
13404 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13406 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13407 any indexer, it's needed to build a list with all the indexers in the
13408 hierarchy (AllGetters), else we have problems. Fixes #35653.
13410 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13412 * class.cs (MethodData.Define): It is wrong for an interface
13413 implementation to be static in both cases: explicit and implicit.
13414 We were only handling this in one case.
13416 Improve the if situation there to not have negations.
13418 * class.cs (Field.Define): Turns out that we do not need to check
13419 the unsafe bit on field definition, only on usage. Remove the test.
13421 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13423 * driver.cs: use assembly.Location instead of Codebase (the latest
13424 patch made mcs fail when using MS assemblies).
13426 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13428 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13429 get the path to *corlib.dll.
13431 2003-01-21 Nick Drochak <ndrochak@gol.com>
13435 * typemanager.cs: Remove compiler warnings
13437 2003-01-20 Duncan Mak <duncan@ximian.com>
13439 * AssemblyInfo.cs: Bump the version number to 0.19.
13441 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13443 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13445 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13447 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13449 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13451 * cs-parser.jay: Small fix: we were not comparing the constructor
13452 name correctly. Thanks to Zoltan for the initial pointer.
13454 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13456 * cs-tokenizer.cs: Set file name when specified with #line
13458 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13460 * cs-parser.jay: Only perform the constructor checks here if we
13461 are named like the class; This will help provider a better
13462 error. The constructor path is taken when a type definition is
13463 not found, but most likely the user forgot to add the type, so
13464 report that rather than the constructor error.
13466 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13468 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13471 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13473 * cs-parser.jay: Add cleanup call.
13475 2003-01-13 Duncan Mak <duncan@ximian.com>
13477 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13478 consistent with other methods.
13480 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13482 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13484 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13486 * attribute.cs: only set GuidAttr to true when we have a
13489 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13493 * typemanager.cs: fixes to allow mcs compile corlib with the new
13494 Type.IsSubclassOf fix.
13496 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13498 * expression.cs (LocalVariableReference.DoResolve): Classify a
13499 constant as a value, not as a variable. Also, set the type for
13502 * cs-parser.jay (fixed_statement): take a type instead of a
13503 pointer_type, so we can produce a better error message later.
13505 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13508 (For.DoEmit): Make inifinite loops have a
13509 non-conditional branch back.
13511 (Fixed.DoEmit): First populate the pinned variables, then emit the
13512 statement, then clear the variables. Before I was emitting the
13513 code once for each fixed piece.
13516 2003-01-08 Martin Baulig <martin@ximian.com>
13518 * statement.cs (FlowBranching.MergeChild): A break in a
13519 SWITCH_SECTION does not leave a loop. Fixes #36155.
13521 2003-01-08 Martin Baulig <martin@ximian.com>
13523 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13524 lives in the same number space than `param_map'. Fixes #36154.
13526 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13528 * cs-parser.jay (constructor_declaration): Set the
13529 Constructor.ModFlags before probing for it. This makes the
13530 compiler report 514, 515 and 132 (the code was there, but got
13533 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13534 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13535 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13537 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13539 * enum.cs: create the enum static fields using the enum type.
13541 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13543 * class.cs: don't try to create the ParamBuilder for the return
13544 type if it's not needed (and handle it breaking for the ms runtime
13547 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13549 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13551 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13553 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13554 the command. This showed up while compiling the JANET source
13555 code, which used \r as its only newline separator.
13557 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13559 * class.cs (Method.Define): If we are an operator (because it
13560 reuses our code), then set the SpecialName and HideBySig. #36128
13562 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13564 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13565 exception, report error 120 `object reference required'.
13567 * driver.cs: Add --pause option, used during to measure the size
13568 of the process as it goes with --timestamp.
13570 * expression.cs (Invocation.DoResolve): Do not allow methods with
13571 SpecialName to be invoked.
13573 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13575 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13576 number before adding it.
13578 2002-12-21 Ravi Pratap <ravi@ximian.com>
13580 * ecore.cs (StandardImplicitConversion): When in an unsafe
13581 context, we allow conversion between void * to any other pointer
13582 type. This fixes bug #35973.
13584 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13586 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13587 is not thrown when extensionless outputs are used
13589 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13591 * rootcontext.cs: fixed compilation of corlib.
13593 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13595 * attribute.cs (Attributes.Contains): Add new method.
13597 * class.cs (MethodCore.LabelParameters): if the parameter is an
13598 `out' parameter, check that no attribute `[In]' has been passed.
13600 * enum.cs: Handle the `value__' name in an enumeration.
13602 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13604 * decl.cs: Added special case to allow overrides on "protected
13607 2002-12-18 Ravi Pratap <ravi@ximian.com>
13609 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13610 since it makes much more sense.
13612 (Attributes.ctor): Don't require a Location parameter.
13614 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13616 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13617 since we already have that information per attribute.
13619 * everywhere : make appropriate changes.
13621 * class.cs (LabelParameters): Write the code which actually
13622 applies attributes to the return type. We can't do this on the MS
13623 .NET runtime so we flag a warning in the case an exception is
13626 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13628 * const.cs: Handle implicit null conversions here too.
13630 2002-12-17 Ravi Pratap <ravi@ximian.com>
13632 * class.cs (MethodCore.LabelParameters): Remove the extra
13633 Type [] parameter since it is completely unnecessary. Instead
13634 pass in the method's attributes so that we can extract
13635 the "return" attribute.
13637 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13639 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13640 of ignoring it and letting the compile continue.
13642 * typemanager.cs (ChangeType): use an extra argument to return an
13643 error condition instead of throwing an exception.
13645 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13647 * expression.cs (Unary.TryReduce): mimic the code for the regular
13648 code path. Perform an implicit cast in the cases where we can
13649 implicitly convert to one of the integral types, and then reduce
13650 based on that constant. This fixes bug #35483.
13652 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13654 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13656 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13658 * namespace.cs: fixed bug #35489.
13660 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13662 * class.cs: Remove some dead code.
13664 * cs-parser.jay: Estimate the number of methods needed
13665 (RootContext.MethodCount);
13667 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13668 numbers instead of StringBuilders.
13670 * support.cs (PtrHashtable): Add constructor with initial size;
13671 We can now reduce reallocations of the method table.
13673 2002-12-10 Ravi Pratap <ravi@ximian.com>
13675 * attribute.cs (ApplyAttributes): Keep track of the emitted
13676 attributes on a per-target basis. This fixes bug #35413.
13678 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13680 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13681 default to the Windows 1252 encoding.
13683 (UnixParseOption): Support version, thanks to Alp for the missing
13686 * AssemblyInfo.cs: Add nice assembly information.
13688 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13691 * cs-parser.jay: Allow a trailing comma before the close bracked
13692 in the attribute_section production.
13694 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13695 address of the instance was being taken, I will take this out,
13696 because we take the address of the object immediately here.
13698 2002-12-09 Ravi Pratap <ravi@ximian.com>
13700 * typemanager.cs (AreMultipleAllowed): Take care of the most
13701 obvious case where attribute type is not in the current assembly -
13704 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13706 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13707 definitions, instead of doing that afterwards.
13709 Also we use a nice little hack, depending on the constructor, we
13710 know if we are a "composed" name or a simple name. Hence, we
13711 avoid the IndexOf test, and we avoid
13713 * codegen.cs: Add code to assist in a bug reporter to track down
13714 the source of a compiler crash.
13716 2002-12-07 Ravi Pratap <ravi@ximian.com>
13718 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13719 types have been emitted for a given element and flag an error
13720 if something which does not have AllowMultiple set is used more
13723 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13724 attribute types and their corresponding AllowMultiple properties
13726 (AreMultipleAllowed): Check the property for a given type.
13728 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13729 property in the case we have a TypeContainer.
13731 (Attributes.AddAttribute): Detect duplicates and just skip on
13732 adding them. This trivial fix catches a pretty gross error in our
13733 attribute emission - global attributes were being emitted twice!
13735 Bugzilla bug #33187 is now fixed.
13737 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13739 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13740 instead of pp_and).
13742 * expression.cs (Binary.ResolveOperator): I can only use the
13743 Concat (string, string, string) and Concat (string, string,
13744 string, string) if the child is actually a concatenation of
13747 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13749 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13750 context where we need a 2-character lookahead.
13752 * pending.cs (PendingImplementation): Rework so we can keep track
13753 of interface types all the time, and flag those which were
13754 implemented by parents as optional.
13756 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13758 * expression.cs (Binary.ResolveOperator): Use
13759 String.Concat(string,string,string) or
13760 String.Concat(string,string,string,string) when possible.
13762 * typemanager: More helper methods.
13765 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13767 * pending.cs: remove the bogus return from GetMissingInterfaces()
13768 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13770 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13772 * namespace.cs: avoid duplicated 'using xxx' being added to
13773 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13774 when we get more than one 'using' statement for the same namespace.
13775 Report a CS0105 warning for it.
13777 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13779 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13780 of calling getChar/putback, uses internal knowledge of it.
13782 (xtoken): Reorder tokenizer so most common patterns are checked
13783 first. This reduces the compilation time in another 5% (from 8.11s
13784 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13786 The parsing time is 22% of the compilation in mcs, and from that
13787 64% is spent on the tokenization process.
13789 I tried using a binary search for keywords, but this is slower
13790 than the hashtable. Another option would be to do a couple of
13793 * Not use a StringBuilder, instead use an array of chars,
13794 with a set value. Notice that this way we could catch
13795 the 645 error without having to do it *afterwards*.
13797 * We could write a hand-parser to avoid the hashtable
13798 compares altogether.
13800 The identifier consumption process takes 37% of the tokenization
13801 time. Another 15% is spent on is_number. 56% of the time spent
13802 on is_number is spent on Int64.Parse:
13804 * We could probably choose based on the string length to
13805 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13808 Another 3% is spend on wrapping `xtoken' in the `token' function.
13810 Handle 0xa0 as whitespace (#34752)
13812 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13814 * typemanager.cs (IsCLRType): New routine to tell whether a type
13815 is one of the builtin types.
13817 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13818 typecode in more places instead of doing pointer comparissions.
13819 We could leverage some knowledge about the way the typecodes are
13822 New code to cache namespaces in assemblies, it is currently not
13823 invoked, to be used soon.
13825 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13827 * expression.cs (Binary.ResolveOperator): specially handle
13828 strings, and do not perform user-defined operator overloading for
13831 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13833 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13834 internalcall as it is a pretty simple operation; Avoid whenever
13835 possible to call Char.IsLetter.
13837 (consume_identifier): Cut by half the number of
13838 hashtable calls by merging the is_keyword and GetKeyword behavior.
13840 Do not short-circuit, because if we do, we
13841 report errors (ie, #if false && true would produce an invalid
13845 2002-11-24 Martin Baulig <martin@ximian.com>
13847 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13848 check constant ranges and report a CS0221. Fixes #33186.
13850 2002-11-24 Martin Baulig <martin@ximian.com>
13852 * cs-parser.jay: Make this work for uninitialized variable
13853 declarations in the `for' initializer. Fixes #32416.
13855 2002-11-24 Martin Baulig <martin@ximian.com>
13857 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13858 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13860 2002-11-24 Martin Baulig <martin@ximian.com>
13862 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13863 argument; if true, we also check for user-defined conversions.
13864 This is only needed if both arguments are of a user-defined type.
13865 Fixes #30443, added test-175.cs.
13866 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13868 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13870 2002-11-24 Martin Baulig <martin@ximian.com>
13872 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13873 function to get the store opcode.
13874 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13875 only emit the Ldelema if the store opcode is Stobj. You must run
13876 both test-34 and test-167 to test this. Fixes #34529.
13878 2002-11-23 Martin Baulig <martin@ximian.com>
13880 * ecore.cs (Expression.MemberLookup): Added additional
13881 `qualifier_type' argument which is used when we're being called
13882 from MemberAccess.DoResolve() and null if we're called from a
13884 (Expression.MemberLookupFailed): New method to report errors; this
13885 does the CS1540 check and reports the correct error message.
13887 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13888 argument for the CS1540 check and redone the way how we're dealing
13889 with private members. See the comment in the source code for details.
13890 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13891 `closure_start_type' to `closure_qualifier_type' and check whether
13892 it's not null. It was not this filter being broken, it was just
13893 being called with the wrong arguments.
13895 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13896 and pass it the correct `qualifier_type'; this also does the error
13899 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13901 * expression.cs (Invocation.EmitParams): If the we are dealing
13902 with a non-built-in value type, load its address as well.
13904 (ArrayCreation): Use a a pretty constant instead
13905 of the hardcoded value 2. Use 6 instead of 2 for the number of
13906 static initializers.
13908 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13909 because they are not really value types, just glorified integers.
13911 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13913 * ecore.cs: Remove redundant code for enumerations, make them use
13914 the same code path as everything else, fixes the casting issue
13915 with enumerations in Windows.Forms.
13917 * attribute.cs: Do only cast to string if it is a string, the
13918 validation happens later.
13920 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13921 people upgrade their corlibs.
13923 * ecore.cs: Oops, enumerations were not following the entire code path
13925 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13927 * typemanager.cs (FilterWithClosure): Commented out the test for
13928 1540 in typemanager.cs, as it has problems when accessing
13929 protected methods from a parent class (see test-174.cs).
13931 * attribute.cs (Attribute.ValidateGuid): new method.
13932 (Attribute.Resolve): Use above.
13934 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13936 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13938 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13939 handling for enumerations, as we only needed the TypeContainer
13940 functionality to begin with (this is required for the fix below to
13941 work for enums that reference constants in a container class for
13944 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13946 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13947 a valid TypeBuilder to perform lookups on.o
13949 * class.cs (InheritableMemberSignatureCompare): Use true in the
13950 call to GetGetMethod and GetSetMethod, because we are comparing
13951 the signature, and we need to get the methods *even* if they are
13954 (PropertyBase.CheckBase): ditto.
13956 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13957 GotoCase.Resolve): Use Peel on EmpytCasts.
13959 * ecore.cs (EmptyCast): drop child, add Peel method.
13961 2002-11-17 Martin Baulig <martin@ximian.com>
13963 * ecore.cs (EmptyCast.Child): New public property.
13965 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13966 label resolved to an EmptyCast. Fixes #34162.
13967 (GotoCase.Resolve): Likewise.
13968 (Block.EmitMeta): Likewise.
13970 2002-11-17 Martin Baulig <martin@ximian.com>
13972 * expression.cs (Invocation.BetterConversion): Prefer int over
13973 uint; short over ushort; long over ulong for integer literals.
13974 Use ImplicitConversionExists instead of StandardConversionExists
13975 since we also need to check for user-defined implicit conversions.
13976 Fixes #34165. Added test-173.cs.
13978 2002-11-16 Martin Baulig <martin@ximian.com>
13980 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13981 with the `true' and `false' literals. Fixes #33151.
13983 2002-11-16 Martin Baulig <martin@ximian.com>
13985 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13986 October 22nd; don't do the cs1540 check for static members.
13988 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13989 now using our own filter here and doing the cs1540 check again.
13991 2002-11-16 Martin Baulig <martin@ximian.com>
13993 * support.cs (InternalParameters): Don't crash if we don't have
13994 any fixed parameters. Fixes #33532.
13996 2002-11-16 Martin Baulig <martin@ximian.com>
13998 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13999 when looking up static methods to make this work on Windows.
14002 2002-11-16 Martin Baulig <martin@ximian.com>
14004 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14005 a setter rather than using PropertyInfo.CanWrite.
14007 2002-11-15 Nick Drochak <ndrochak@gol.com>
14009 * class.cs: Allow acces to block member by subclasses. Fixes build
14012 2002-11-14 Martin Baulig <martin@ximian.com>
14014 * class.cs (Constructor.Emit): Added the extern/block check.
14017 2002-11-14 Martin Baulig <martin@ximian.com>
14019 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14020 iteration while looking for indexers, this is needed because the
14021 indexer may have a different name in our base classes. Fixed the
14022 error reporting (no indexers at all, not get accessor, no
14023 overloaded match). Fixes bug #33089.
14024 (IndexerAccess.DoResolveLValue): Likewise.
14026 2002-11-14 Martin Baulig <martin@ximian.com>
14028 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14029 indexers. Fixes the first part of bug #33089.
14030 (MethodSignature.InheritableMemberSignatureCompare): Added support
14033 2002-11-13 Ravi Pratap <ravi@ximian.com>
14035 * attribute.cs (Attribute.Resolve): Catch the
14036 NullReferenceException and report it since it isn't supposed to
14039 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14041 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14042 LogicalOr and LogicalAnd that can benefit from recursively
14043 handling EmitBranchable. The code now should be nice for Paolo.
14045 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14047 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14048 the Type lookups, as we perform quite a number of lookups on
14049 non-Types. This can be removed once we can deterministically tell
14050 whether we have a type or a namespace in advance.
14052 But this might require special hacks from our corlib.
14056 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14057 and double which avoids a conversion from an integer to a double.
14059 * expression.cs: tiny optimization, avoid calling IsConstant,
14060 because it effectively performs the lookup twice.
14062 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14064 But a bogus return here to keep the semantics of the old code
14065 until the Mono runtime is fixed.
14067 * pending.cs (GetMissingInterfaces): New method used to remove all
14068 the interfaces that are already implemented by our parent
14069 classes from the list of pending methods.
14071 * interface.cs: Add checks for calls after ResolveTypeExpr.
14073 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14075 * class.cs (Class.Emit): Report warning 67: event not used if the
14076 warning level is beyond 3.
14078 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14079 being a NullLiteral.
14081 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14084 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14085 path that might fail if a type can not be resolved.
14087 * expression.cs (Binary.Emit): Emit unsigned versions of the
14090 * driver.cs: use error 5.
14092 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14094 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14096 2002-11-01 Miguel de Icaza <miguel@ximian.com>
14098 * cs-parser.jay (switch_section): A beautiful patch from Martin
14099 Baulig that fixed 33094.
14101 2002-10-31 Miguel de Icaza <miguel@ximian.com>
14103 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14104 Check whether the base is abstract and report an error if so.
14106 * expression.cs (IndexerAccess.DoResolveLValue,
14107 IndexerAccess.DoResolve): ditto.
14109 (Invocation.DoResolve): ditto.
14111 (Invocation.FullMethodDesc): Improve the report string.
14113 * statement.cs (Block): Eliminate IsVariableDefined as it is
14114 basically just a wrapper for GetVariableInfo.
14116 * ecore.cs (SimpleName): Use new
14118 * support.cs (ReflectionParamter.ParameterType): We unwrap the
14119 type, as we return the actual parameter ref/unref state on a
14122 2002-10-30 Miguel de Icaza <miguel@ximian.com>
14124 * support.cs: Return proper flags REF/OUT fixing the previous
14127 * expression.cs: Reverted last patch, that was wrong. Is_ref is
14128 not used to mean `ref' but `ref or out' in ParameterReference
14130 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14131 full type signature instead of calling TypeManger.CSharpName
14134 * support.cs (InternalParameters.ParameterDesc): Do not compare
14135 directly to the modflags, because REF/OUT will actually be bitsets
14138 * delegate.cs (VerifyMethod): Check also the modifiers.
14140 * cs-tokenizer.cs: Fix bug where floating point values with an
14141 exponent where a sign was missing was ignored.
14143 * driver.cs: Allow multiple assemblies to be specified in a single
14146 2002-10-28 Miguel de Icaza <miguel@ximian.com>
14148 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
14149 because identifiers after a parenthesis would end up in this kind
14150 of production, and we needed to desamiguate it for having casts
14153 (UserDefinedType *) xxx
14155 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14157 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14158 we should set on the Bindingflags.NonPublic, but not turn on
14159 private_ok. private_ok controls whether a Private member is
14160 returned (this is chekced on the filter routine), while the
14161 BindingFlags.NonPublic just controls whether private/protected
14162 will be allowed. This fixes the problem part of the problem of
14163 private properties being allowed to be used in derived classes.
14165 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14166 so we can call the children DoResolveLValue method (this will
14167 properly signal errors on lvalue assignments to base properties)
14169 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14170 getter are null, and we have a property info, we know that this
14171 happened because the lookup failed, so we report an error 122 for
14172 protection level violation.
14174 We also silently return if setter and getter are null in the
14175 resolve functions, this condition only happens if we have flagged
14176 the error before. This is the other half of the problem.
14178 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14179 not have accessibility information, that is why we were returning
14180 true in the filter function in typemanager.cs.
14182 To properly report 122 (property is inaccessible because of its
14183 protection level) correctly, we report this error in ResolveAccess
14184 by failing if both the setter and the getter are lacking (ie, the
14187 DoResolve and DoLResolve have been modified to check for both
14188 setter/getter being null and returning silently, the reason being
14189 that I did not want to put the knowledge about this error in upper
14192 int old = Report.Errors;
14193 x = new PropertyExpr (...);
14194 if (old != Report.Errors)
14199 So the property expr is returned, but it is invalid, so the error
14200 will be flagged during the resolve process.
14202 * class.cs: Remove InheritablePropertySignatureCompare from the
14203 class, as we no longer depend on the property signature to compute
14204 whether it is possible to implement a method or not.
14206 The reason is that calling PropertyInfo.GetGetMethod will return
14207 null (in .NET, in Mono it works, and we should change this), in
14208 cases where the Get Method does not exist in that particular
14213 class X { public virtual int A { get { return 1; } } }
14215 class Z : Y { public override int A { get { return 2; } } }
14217 Would fail in Z because the parent (Y) would not have the property
14218 defined. So we avoid this completely now (because the alternative
14219 fix was ugly and slow), and we now depend exclusively on the
14222 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14223 reference method, instead of using the property.
14225 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14226 routines are gone now.
14228 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14229 names, they were incorrectly named.
14231 * cs-tokenizer.cs: Return are more gentle token on failure.
14233 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14234 had an out-of-sync index variable, which caused it to remove from
14235 the list of pending methods the wrong method sometimes.
14237 2002-10-22 Miguel de Icaza <miguel@ximian.com>
14239 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14240 CanWrite, because those refer to this particular instance of the
14241 property, and do not take into account the fact that we can
14242 override single members of a property.
14244 Constructor requires an EmitContext. The resolution process does
14245 not happen here, but we need to compute the accessors before,
14246 because the resolution does not always happen for properties.
14248 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14249 subclass, before we did not update this flag, but we did update
14252 (GetAccessors): Drop this routine, as it did not work in the
14253 presence of partially overwritten set/get methods.
14255 Notice that this broke the cs1540 detection, but that will require
14258 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14262 * driver.cs: issue a warning instead of an error if we don't support
14263 debugging for the platform. Also ignore a couple of errors that may
14264 arise when trying to write the symbols. Undo my previous patch.
14266 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14268 * driver.cs: ignore /debug switch except for Unix platforms.
14270 2002-10-23 Nick Drochak <ndrochak@gol.com>
14272 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14274 2002-10-21 Miguel de Icaza <miguel@ximian.com>
14276 * driver.cs: Do not make mcs-debug conditional, so we do not break
14277 builds that use it.
14279 * statement.cs (UsageVector.MergeChildren): I would like Martin to
14280 review this patch. But basically after all the children variables
14281 have been merged, the value of "Breaks" was not being set to
14282 new_breaks for Switch blocks. I think that it should be set after
14283 it has executed. Currently I set this to the value of new_breaks,
14284 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14285 conservative, but I do not understand this code very well.
14287 I did not break anything in the build, so that is good ;-)
14289 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14291 2002-10-20 Mark Crichton <crichton@gimp.org>
14293 * cfold.cs: Fixed compile blocker. Really fixed it this time.
14295 2002-10-20 Nick Drochak <ndrochak@gol.com>
14297 * cfold.cs: Fixed compile blocker.
14299 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14301 * driver.cs: I was chekcing the key, not the file.
14303 2002-10-19 Ravi Pratap <ravi@ximian.com>
14305 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14306 message that we were generating - we just need to silently return
14309 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14311 * class.cs (Event.Define): Change my previous commit, as this
14312 breaks the debugger. This is a temporary hack, as it seems like
14313 the compiler is generating events incorrectly to begin with.
14315 * expression.cs (Binary.ResolveOperator): Added support for
14316 "U operator - (E x, E y)"
14318 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14321 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14322 init-only variables, but this path did not take into account that
14323 there might be also instance readonly variables. Correct this
14326 This fixes bug 32253
14328 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14331 * driver.cs: Change the extension for modules to `netmodule'
14333 * cs-parser.jay: Improved slightly the location tracking for
14334 the debugger symbols.
14336 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14337 modifiers that were specified instead of the hardcoded value
14338 (FamAndAssem). This was basically ignoring the static modifier,
14339 and others. Fixes 32429.
14341 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14342 fixed a bug in the process (32476)
14344 * expression.cs (ArrayAccess.EmitAssign): Patch from
14345 hwang_rob@yahoo.ca that fixes bug 31834.3
14347 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14349 * driver.cs: Make the module extension .netmodule.
14351 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14353 * driver.cs: Report an error if the resource file is not found
14354 instead of crashing.
14356 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14357 false, like Emit does.
14359 2002-10-16 Nick Drochak <ndrochak@gol.com>
14361 * typemanager.cs: Remove unused private member. Also reported mcs
14362 bug to report this as a warning like csc.
14364 2002-10-15 Martin Baulig <martin@gnome.org>
14366 * statement.cs (Statement.Emit): Made this a virtual method; emits
14367 the line number info and calls DoEmit().
14368 (Statement.DoEmit): New protected abstract method, formerly knows
14369 as Statement.Emit().
14371 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14373 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14375 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14376 have fixed a remaining problem: not every AddXXXX was adding a
14377 fully qualified name.
14379 Now everyone registers a fully qualified name in the DeclSpace as
14380 being defined instead of the partial name.
14382 Downsides: we are slower than we need to be due to the excess
14383 copies and the names being registered this way.
14385 The reason for this is that we currently depend (on the corlib
14386 bootstrap for instance) that types are fully qualified, because
14387 we dump all the types in the namespace, and we should really have
14388 types inserted into the proper namespace, so we can only store the
14389 basenames in the defined_names array.
14391 2002-10-10 Martin Baulig <martin@gnome.org>
14393 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14394 from bug #31834, see the bug report for a testcase which is
14397 2002-10-10 Martin Baulig <martin@gnome.org>
14399 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14400 flow analysis code for this.
14402 * statement.cs (Do, While, For): Tell the flow analysis code about
14404 (FlowBranching.UsageVector): Added support for infinite loops.
14405 (Block.Resolve): Moved the dead code elimination here and use flow
14408 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14410 * class.cs (Field.Define): Catch cycles on struct type
14413 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14414 fields if the fields are static. We only need to check instance
14417 * expression.cs (As.DoResolve): Test for reference type.
14419 * statement.cs (Using.ResolveExpression): Use
14420 ConvertImplicitRequired, not ConvertImplicit which reports an
14422 (Using.ResolveLocalVariableDecls): ditto.
14424 * expression.cs (Binary.ResolveOperator): Report errors in a few
14425 places where we had to.
14427 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14429 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14431 * expression.cs: Use StoreFromPtr instead of extracting the type
14432 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14434 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14435 an enumeration value to a System.Enum, but System.Enum is not a
14436 value type, but an class type, so we need to box.
14438 (Expression.ConvertExplicit): One codepath could return
14439 errors but not flag them. Fix this. Fixes #31853
14441 * parameter.cs (Resolve): Do not allow void as a parameter type.
14443 2002-10-06 Martin Baulig <martin@gnome.org>
14445 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14446 if it's a class type and not a struct. Fixes #31815.
14448 2002-10-06 Martin Baulig <martin@gnome.org>
14450 * statement.cs: Reworked the flow analysis code a bit to make it
14451 usable for dead code elimination.
14453 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14455 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14457 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14459 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14460 to fix the test 165, will investigate deeper.
14462 2002-10-04 Martin Baulig <martin@gnome.org>
14464 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14465 finally blocks actually work.
14466 (Try.Resolve): We don't need to create a sibling for `finally' if
14467 there is no finally block.
14469 2002-10-04 Martin Baulig <martin@gnome.org>
14471 * class.cs (Constructor.Define): The default accessibility for a
14472 non-default constructor is private, not public.
14474 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14476 * class.cs (Constructor): Make AllowedModifiers public, add
14479 * cs-parser.jay: Perform the modifiers test here, as the
14480 constructor for the Constructor class usually receives a zero
14481 because of the way we create it (first we create, later we
14482 customize, and we were never checking the modifiers).
14484 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14485 is a version of LookupTypeReflection that includes the type-name
14486 cache. This can be used as a fast path for functions that know
14487 the fully qualified name and are only calling into *.GetType() to
14488 obtain a composed type.
14490 This is also used by TypeManager.LookupType during its type
14493 (LookupType): We now also track the real type name, as sometimes
14494 we can get a quey for the real type name from things like
14495 ComposedCast. This fixes bug 31422.
14497 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14498 complete type fullname, it does not have to go through the type
14499 resolution system to obtain the composed version of the type (for
14500 obtaining arrays or pointers).
14502 (Conditional.Emit): Use the EmitBoolExpression to
14503 generate nicer code, as requested by Paolo.
14505 (ArrayCreation.CheckIndices): Use the patch from
14506 hwang_rob@yahoo.ca to validate the array initializers.
14508 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14510 * class.cs (ConstructorInitializer.Emit): simplify code by using
14511 Invocation.EmitCall, and at the same time, fix the bugs in calling
14512 parent constructors that took variable arguments.
14514 * ecore.cs (Expression.ConvertNumericExplicit,
14515 Expression.ImplicitNumericConversion): Remove the code that
14516 manually wrapped decimal (InternalTypeConstructor call is now gone
14519 * expression.cs (Cast.TryReduce): Also handle decimal types when
14520 trying to perform a constant fold on the type.
14522 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14524 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14525 that only turned off an error report, and did nothing else.
14527 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14529 * driver.cs: Handle and ignore /fullpaths
14531 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14533 * expression.cs (Binary.ResolveOperator): Catch the case where
14534 DoNumericPromotions returns true,
14536 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14538 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14540 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14543 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14545 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14546 conversion exists, but it is also required that the conversion be
14547 performed. This manifested in "(Type64Enum) 2".
14549 * class.cs (TypeManager.AddMethod): The fix is not to change
14550 AddEnum, because that one was using a fully qualified name (every
14551 DeclSpace derivative does), but to change the AddMethod routine
14552 that was using an un-namespaced name. This now correctly reports
14553 the duplicated name.
14555 Revert patch until I can properly fix it. The issue
14556 is that we have a shared Type space across all namespaces
14557 currently, which is wrong.
14559 Options include making the Namespace a DeclSpace, and merge
14560 current_namespace/current_container in the parser.
14562 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14564 * cs-parser.jay: Improve error reporting when we get a different
14565 kind of expression in local_variable_type and
14566 local_variable_pointer_type.
14568 Propagate this to avoid missleading errors being reported.
14570 * ecore.cs (ImplicitReferenceConversion): treat
14571 TypeManager.value_type as a target just like object_type. As
14576 Is valid, and needs to result in the int 1 being boxed before it
14577 is assigned to the value type v.
14579 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14580 to validate the enumeration name.
14582 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14583 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14584 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14586 * ecore.cs (TryImplicitIntConversion): When doing an
14587 implicit-enumeration-conversion, check if the type is 64-bits and
14588 perform a conversion before passing to EnumConstant.
14590 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14592 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14593 report ambiguous type references. Unlike the MS version, we
14594 report what the ambiguity is. Innovation at work ;-)
14596 (DeclSpace.FindType): Require a location argument to
14597 display when we display an ambiguous error.
14599 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14601 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14603 * expression.cs (EmitDynamicInitializers): Apply patch from
14604 hwang_rob@yahoo.ca that fixes the order in which we emit our
14607 2002-09-21 Martin Baulig <martin@gnome.org>
14609 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14610 delegate takes no arguments.
14612 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14614 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14617 * expression.cs: Extract the underlying type.
14619 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14621 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14623 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14625 * class.cs (TypeContainer.DefineType): We can not use the nice
14626 PackingSize with the size set to 1 DefineType method, because it
14627 will not allow us to define the interfaces that the struct
14630 This completes the fixing of bug 27287
14632 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14633 means also structs. This fixes part of the problem.
14634 (Expresion.ImplicitReferenceConversionExists): ditto.
14636 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14637 error if there were no errors reported during the type lookup
14638 process, to avoid duplicates or redundant errors. Without this
14639 you would get an ambiguous errors plus a type not found. We have
14640 beaten the user enough with the first error.
14642 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14645 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14646 during the resolution process, stop the lookup, this avoids
14647 repeated error reports (same error twice).
14649 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14651 * typemanager.cs (LookupType): Redo the type lookup code to match
14652 the needs of System.Reflection.
14654 The issue is that System.Reflection requires references to nested
14655 types to begin with a "+" sign instead of a dot. So toplevel
14656 types look like: "NameSpace.TopLevelClass", and nested ones look
14657 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14660 2002-09-19 Martin Baulig <martin@gnome.org>
14662 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14663 says that a method always returns or always throws an exception,
14664 don't report the CS0161.
14666 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14667 set `Returns = new_returns'.
14669 2002-09-19 Martin Baulig <martin@gnome.org>
14671 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14672 to an enum constant, check for a CS0176.
14674 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14676 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14677 for operators that must be in pairs and report errors.
14679 * ecore.cs (SimpleName.DoResolveType): During the initial type
14680 resolution process, when we define types recursively, we must
14681 check first for types in our current scope before we perform
14682 lookups in the enclosing scopes.
14684 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14686 (Invocation.VerifyArgumentsCompat): Call
14687 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14688 I thought we were supposed to always call this, but there are a
14689 few places in the code where we dont do it.
14691 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14693 * driver.cs: Add support in -linkres and -resource to specify the
14694 name of the identifier.
14696 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14698 * ecore.cs (StandardConversionExists): Sync with the conversion
14699 code: allow anything-* to void* conversions.
14701 (FindMostSpecificSource): Use an Expression argument
14702 instead of a Type, because we might be handed over a Literal which
14703 gets a few more implicit conversions that plain types do not. So
14704 this information was being lost.
14706 Also, we drop the temporary type-holder expression when not
14709 2002-09-17 Martin Baulig <martin@gnome.org>
14711 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14712 this is an explicit interface implementation.
14714 2002-09-17 Martin Baulig <martin@gnome.org>
14716 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14717 different `IndexerName' attributes.
14719 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14720 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14721 virtual CommonResolve().
14723 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14725 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14726 and convert that to the UnderlyingType.
14728 * statement.cs (Foreach.Resolve): Indexers are just like variables
14729 or PropertyAccesses.
14731 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14732 inside quoted strings, we were not doing this before.
14734 2002-09-16 Martin Baulig <martin@gnome.org>
14736 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14737 resolve it. This is needed for the definite assignment check of the
14738 instance expression, fixes bug #29846.
14739 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14741 2002-09-16 Nick Drochak <ndrochak@gol.com>
14743 * parameter.cs: Fix compile error. Cannot reference static member
14744 from an instance object. Is this an mcs bug?
14746 2002-09-14 Martin Baulig <martin@gnome.org>
14748 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14749 multiple times. Fixes bug #30295, added test-166.cs.
14751 2002-09-14 Martin Baulig <martin@gnome.org>
14753 * statement.cs (Block.Emit): Don't emit unreachable code.
14754 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14755 `break' statements.
14756 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14758 2002-09-14 Martin Baulig <martin@gnome.org>
14760 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14763 2002-09-14 Martin Baulig <martin@gnome.org>
14765 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14766 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14767 be false on the ms runtime.
14769 2002-09-13 Martin Baulig <martin@gnome.org>
14771 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14772 the CS0038 error message.
14774 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14776 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14777 constant inside, return it.
14779 2002-09-12 Martin Baulig <martin@gnome.org>
14781 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14782 implicit conversion can be done between enum types.
14784 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14785 check whether an implicit conversion to the current enum's UnderlyingType
14786 exists and report an error if not.
14788 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14789 without debugging support.
14791 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14792 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14794 2002-09-12 Martin Baulig <martin@gnome.org>
14796 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14798 * ecore.cs (IMemberExpr.DeclaringType): New property.
14799 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14800 nonstatic member of an outer type (CS0038).
14802 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14804 * driver.cs: Activate the using-error detector at warning level
14805 4 (at least for MS-compatible APIs).
14807 * namespace.cs (VerifyUsing): Small buglett fix.
14809 * pending.cs (PendingImplementation): pass the container pointer.
14811 * interface.cs (GetMethods): Allow for recursive definition. Long
14812 term, I would like to move every type to support recursive
14813 definitions, not the current ordering mechanism that we have right
14816 The situation is this: Attributes are handled before interfaces,
14817 so we can apply attributes to interfaces. But some attributes
14818 implement interfaces, we will now handle the simple cases
14819 (recursive definitions will just get an error).
14821 * parameter.cs: Only invalidate types at the end if we fail to
14824 2002-09-09 Martin Baulig <martin@gnome.org>
14826 * ecore.cs (PropertyExpr.Emit): Also check for
14827 TypeManager.system_int_array_get_length so this'll also work when
14828 compiling corlib. Fixes #30003.
14830 2002-09-09 Martin Baulig <martin@gnome.org>
14832 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14833 and throw an exception if we can't get the type's size. Fixed #30040,
14836 2002-09-09 Martin Baulig <martin@gnome.org>
14838 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14840 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14841 context. Fixes bug #30027.
14843 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14844 virtual functions. Fixes bug #30043, added test-164.cs.
14846 2002-09-08 Ravi Pratap <ravi@ximian.com>
14848 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14850 2002-09-08 Nick Drochak <ndrochak@gol.com>
14852 * driver.cs: Use an object to get the windows codepage since it's not a
14855 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14857 * statement.cs (For.Emit): for infinite loops (test == null)
14858 return whether there is a break inside, not always "true".
14860 * namespace.cs (UsingEntry): New struct to hold the name of the
14861 using definition, the location where it is defined, and whether it
14862 has been used in a successful type lookup.
14864 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14869 2002-09-06 Ravi Pratap <ravi@ximian.com>
14871 * attribute.cs : Fix incorrect code which relied on catching
14872 a NullReferenceException to detect a null being passed in
14873 where an object was expected.
14875 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14877 * statement.cs (Try): flag the catch variable as assigned
14879 * expression.cs (Cast): Simplified by using ResolveType instead of
14880 manually resolving.
14882 * statement.cs (Catch): Fix bug by using ResolveType.
14884 2002-09-06 Ravi Pratap <ravi@ximian.com>
14886 * expression.cs (BetterConversion): Special case for when we have
14887 a NullLiteral as the argument and we have to choose between string
14888 and object types - we choose string the way csc does.
14890 * attribute.cs (Attribute.Resolve): Catch the
14891 NullReferenceException and report error #182 since the Mono
14892 runtime no more has the bug and having this exception raised means
14893 we tried to select a constructor which takes an object and is
14896 2002-09-05 Ravi Pratap <ravi@ximian.com>
14898 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14899 message (1502, 1503) when we can't locate a method after overload
14900 resolution. This is much more informative and closes the bug
14903 * interface.cs (PopulateMethod): Return if there are no argument
14904 types. Fixes a NullReferenceException bug.
14906 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14907 expressions too. Previously we were checking only in one place for
14908 positional arguments leaving out named arguments.
14910 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14911 type to the enum type is not allowed. Remove code corresponding to
14914 (ConvertNumericExplicit): Allow explicit conversions from
14915 the underlying type to enum type. This precisely follows the spec
14916 and closes a bug filed by Gonzalo.
14918 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14921 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14923 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14925 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14926 it was important that we stored the right value after the
14927 reduction in `converted'.
14929 2002-09-04 Martin Baulig <martin@gnome.org>
14931 * location.cs (Location.SymbolDocument): Use full pathnames for the
14934 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14936 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14937 of the expression resolve mechanism, because that will catch the
14938 SimpleName error failures.
14940 (Conditional): If we can not resolve the
14941 expression, return, do not crash.
14943 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14946 (location): display token name instead of its number.
14948 2002-08-28 Martin Baulig <martin@gnome.org>
14950 * expression.cs (Binary.ResolveOperator): Don't silently return
14951 but return an error if an operator cannot be applied between two
14954 2002-08-28 Martin Baulig <martin@gnome.org>
14956 * class.cs (Constructor.Define): Set the permission attributes
14957 correctly instead of making all constructors public.
14959 2002-08-28 Martin Baulig <martin@gnome.org>
14961 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14962 for private members before reporting a CS0103; if we find anything,
14965 2002-08-28 Martin Baulig <martin@gnome.org>
14967 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14968 to check whether `closure_start_type == closure_invocation_type',
14969 we also need to check whether `m.DeclaringType == closure_invocation_type'
14970 before bypassing the permission checks. We might be accessing
14971 protected/private members from the base class.
14972 (TypeManager.RealMemberLookup): Only set private_ok if private
14973 members were requested via BindingFlags.NonPublic.
14975 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14977 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14978 MethodGroupExpr.IsExplicitImpl if appropriate.
14979 (Invocation.DoResolve): Don't report the CS0120 for explicit
14980 interface implementations.
14982 2002-08-27 Martin Baulig <martin@gnome.org>
14984 * expression.cs (Invocation.DoResolve): If this is a static
14985 method and we don't have an InstanceExpression, we must report
14988 2002-08-25 Martin Baulig <martin@gnome.org>
14990 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14991 `==' between a valuetype and an object.
14993 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14995 * ecore.cs (TypeExpr): Provide a ToString method.
14997 2002-08-24 Martin Baulig <martin@gnome.org>
14999 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15000 now called proggie.dbg and it's a binary file.
15002 2002-08-23 Martin Baulig <martin@gnome.org>
15004 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15006 2002-08-23 Martin Baulig <martin@gnome.org>
15008 * struct.cs (MyStructInfo.ctor): Make this work with empty
15009 structs; it's not allowed to use foreach() on null.
15011 2002-08-23 Martin Baulig <martin@gnome.org>
15013 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15014 writer the full pathname of the generated assembly.
15016 2002-08-23 Martin Baulig <martin@gnome.org>
15018 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15019 A `finally' block never returns or breaks; improved handling of
15022 2002-08-23 Martin Baulig <martin@gnome.org>
15024 * statement.cs (Throw.Resolve): Allow `throw null'.
15026 2002-08-23 Martin Baulig <martin@gnome.org>
15028 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15029 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15030 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15031 MemberLookup would return a wrong event if this is an explicit
15032 interface implementation and the class has an event with the same
15035 2002-08-23 Martin Baulig <martin@gnome.org>
15037 * statement.cs (Block.AddChildVariableNames): New public method.
15038 (Block.AddChildVariableName): Likewise.
15039 (Block.IsVariableNameUsedInChildBlock): Likewise.
15040 (Block.AddVariable): Check whether a variable name has already
15041 been used in a child block.
15043 * cs-parser.jay (declare_local_variables): Mark all variable names
15044 from the current block as being used in a child block in the
15047 2002-08-23 Martin Baulig <martin@gnome.org>
15049 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15050 find the symbol writer.
15052 * driver.cs: csc also allows the arguments to /define being
15053 separated by commas, not only by semicolons.
15055 2002-08-23 Martin Baulig <martin@gnome.org>
15057 * interface.cs (Interface.GetMembers): Added static check for events.
15059 2002-08-15 Martin Baulig <martin@gnome.org>
15061 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15062 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15064 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15065 why the MethodData.EmitDestructor() change was necessary.
15067 2002-08-20 Martin Baulig <martin@gnome.org>
15069 * class.cs (TypeContainer.FindMembers): Added static check for events.
15071 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15073 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15074 use Type.GetEvents(), not Type.FindMembers().
15076 2002-08-20 Martin Baulig <martin@gnome.org>
15078 * decl.cs (MemberCache): Added a special method cache which will
15079 be used for method-only searched. This ensures that a method
15080 search will return a MethodInfo with the correct ReflectedType for
15083 2002-08-20 Martin Baulig <martin@gnome.org>
15085 * decl.cs (DeclSpace.FindMembers): Made this public.
15087 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15089 * delegate.cs: fixed build on windows.
15090 [FIXME: Filed as bug #29150: MCS must report these errors.]
15092 2002-08-19 Ravi Pratap <ravi@ximian.com>
15094 * ecore.cs (StandardConversionExists): Return a false
15095 if we are trying to convert the void type to anything else
15096 since that is not allowed.
15098 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15099 we flag error 70 in the event an event is trying to be accessed
15100 directly from outside the declaring type.
15102 2002-08-20 Martin Baulig <martin@gnome.org>
15104 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15105 MemberCache from typemanager.cs to decl.cs.
15107 2002-08-19 Martin Baulig <martin@gnome.org>
15109 * class.cs (TypeContainer): Implement IMemberContainer.
15110 (TypeContainer.DefineMembers): Create the MemberCache.
15111 (TypeContainer.FindMembers): Do better BindingFlags checking; only
15112 return public members if BindingFlags.Public was given, check
15113 whether members are static.
15115 2002-08-16 Martin Baulig <martin@gnome.org>
15117 * decl.cs (DeclSpace.Define): Splitted this in Define and
15118 DefineMembers. DefineMembers is called first and initializes the
15121 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
15122 DefineMembers() on all our DeclSpaces.
15124 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15125 but call DefineMembers() on all nested interfaces. We call their
15126 Define() in our new Define() function.
15128 * interface.cs (Interface): Implement IMemberContainer.
15129 (Interface.Define): Moved all code except the attribute stuf to
15131 (Interface.DefineMembers): Initialize the member cache.
15133 * typemanager.cs (IMemberFinder): Removed this interface, we don't
15134 need this anymore since we can use MemberCache.FindMembers directly.
15136 2002-08-19 Martin Baulig <martin@gnome.org>
15138 * typemanager.cs (MemberCache): When creating the cache for an
15139 interface type, add all inherited members.
15140 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15141 to `out bool used_cache' and documented it.
15142 (TypeManager.MemberLookup): If we already used the cache in the first
15143 iteration, we don't need to do the interfaces check.
15145 2002-08-19 Martin Baulig <martin@gnome.org>
15147 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
15148 here from IMemberFinder and don't implement this interface anymore.
15149 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15151 * typemanager.cs (IMemberFinder): This interface is now only used by
15152 classes which actually support the member cache.
15153 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15154 since we only put DeclSpaces into this Hashtable.
15155 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15156 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15158 2002-08-16 Martin Baulig <martin@gnome.org>
15160 * typemanager.cs (ICachingMemberFinder): Removed.
15161 (IMemberFinder.MemberCache): New property.
15162 (TypeManager.FindMembers): Merged this with RealFindMembers().
15163 This function will never be called from TypeManager.MemberLookup()
15164 so we can't use the cache here, just the IMemberFinder.
15165 (TypeManager.MemberLookup_FindMembers): Check whether the
15166 IMemberFinder has a MemberCache and call the cache's FindMembers
15168 (MemberCache): Rewrote larger parts of this yet another time and
15169 cleaned it up a bit.
15171 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15173 * driver.cs (LoadArgs): Support quoting.
15175 (Usage): Show the CSC-like command line arguments.
15177 Improved a few error messages.
15179 2002-08-15 Martin Baulig <martin@gnome.org>
15181 * typemanager.cs (IMemberContainer.Type): New property.
15182 (IMemberContainer.IsInterface): New property.
15184 The following changes are conditional to BROKEN_RUNTIME, which is
15185 defined at the top of the file.
15187 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15188 class'es members, but add all members from TypeHandle.ObjectType
15189 if we're an interface.
15190 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15191 is the current type.
15192 (MemberCache.CacheEntry.Container): Removed this field.
15193 (TypeHandle.GetMembers): Include inherited members.
15195 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15197 * typemanager.cs: fixed compilation and added a comment on a field that
15200 2002-08-15 Martin Baulig <martin@gnome.org>
15202 * class.cs (ConstructorInitializer.Resolve): In the
15203 Expression.MemberLookup call, use the queried_type as
15206 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15207 declared' attribute, it's always true.
15208 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15209 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15210 temporary wrapper for FindMembers which tells MemberLookup whether
15211 members from the base classes are included in the return value.
15212 This will go away soon.
15213 (TypeManager.MemberLookup): Use this temporary hack here; once the
15214 new MemberCache is completed, we don't need to do the DeclaredOnly
15215 looping here anymore since the MemberCache will take care of this.
15216 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15217 (MemberCache): When creating the MemberCache for a class, get
15218 members from the current class and all its base classes.
15219 (MemberCache.CacheEntry.Container): New field. This is a
15220 temporary hack until the Mono runtime is fixed to distinguish
15221 between ReflectedType and DeclaringType. It allows us to use MCS
15222 with both the MS runtime and the unfixed Mono runtime without
15223 problems and without accecting performance.
15224 (MemberCache.SearchMembers): The DeclaredOnly looping from
15225 TypeManager.MemberLookup is now done here.
15227 2002-08-14 Martin Baulig <martin@gnome.org>
15229 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15230 Type.GetFields on dynamic types but get the fields from the
15231 corresponding TypeContainer.
15232 (MyStructInfo.GetStructInfo): Added check for enum types.
15234 * typemanager.cs (MemberList.IsSynchronized): Implemented.
15235 (MemberList.SyncRoot): Implemented.
15236 (TypeManager.FilterWithClosure): No need to check permissions if
15237 closure_start_type == closure_invocation_type, don't crash if
15238 closure_invocation_type is null.
15240 2002-08-13 Martin Baulig <martin@gnome.org>
15242 Rewrote TypeContainer.FindMembers to use a member cache. This
15243 gives us a speed increase of about 35% for the self-hosting MCS
15244 build and of about 15-20% for the class libs (both on GNU/Linux).
15246 * report.cs (Timer): New class to get enhanced profiling. This
15247 whole class is "TIMER" conditional since it remarkably slows down
15250 * class.cs (MemberList): New class. This is an IList wrapper
15251 which we're now using instead of passing MemberInfo[]'s around to
15252 avoid copying this array unnecessarily.
15253 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15254 (ICachingMemberFinder, IMemberContainer): New interface.
15255 (TypeManager.FilterWithClosure): If `criteria' is null, the name
15256 has already been checked, otherwise use it for the name comparision.
15257 (TypeManager.FindMembers): Renamed to RealMemberFinder and
15258 provided wrapper which tries to use ICachingMemberFinder.FindMembers
15259 if possible. Returns a MemberList, not a MemberInfo [].
15260 (TypeHandle): New class, implements IMemberContainer. We create
15261 one instance of this class per type, it contains a MemberCache
15262 which is used to do the member lookups.
15263 (MemberCache): New class. Each instance of this class contains
15264 all members of a type and a name-based hash table.
15265 (MemberCache.FindMembers): This is our new member lookup
15266 function. First, it looks up all members of the requested name in
15267 the hash table. Then, it walks this list and sorts out all
15268 applicable members and returns them.
15270 2002-08-13 Martin Baulig <martin@gnome.org>
15272 In addition to a nice code cleanup, this gives us a performance
15273 increase of about 1.4% on GNU/Linux - not much, but it's already
15274 half a second for the self-hosting MCS compilation.
15276 * typemanager.cs (IMemberFinder): New interface. It is used by
15277 TypeManager.FindMembers to call FindMembers on a TypeContainer,
15278 Enum, Delegate or Interface.
15279 (TypeManager.finder_to_member_finder): New PtrHashtable.
15280 (TypeManager.finder_to_container): Removed.
15281 (TypeManager.finder_to_delegate): Removed.
15282 (TypeManager.finder_to_interface): Removed.
15283 (TypeManager.finder_to_enum): Removed.
15285 * interface.cs (Interface): Implement IMemberFinder.
15287 * delegate.cs (Delegate): Implement IMemberFinder.
15289 * enum.cs (Enum): Implement IMemberFinder.
15291 * class.cs (TypeContainer): Implement IMemberFinder.
15293 2002-08-12 Martin Baulig <martin@gnome.org>
15295 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15297 2002-08-12 Martin Baulig <martin@gnome.org>
15299 * ecore.cs (ITypeExpression): New interface for expressions which
15301 (TypeExpression): Renamed to TypeLookupExpression.
15302 (Expression.DoResolve): If we're doing a types-only lookup, the
15303 expression must implement the ITypeExpression interface and we
15304 call DoResolveType() on it.
15305 (SimpleName): Implement the new ITypeExpression interface.
15306 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15307 hack, the situation that we're only looking up types can't happen
15308 anymore when this method is called. Moved the type lookup code to
15309 DoResolveType() and call it.
15310 (SimpleName.DoResolveType): This ITypeExpression interface method
15311 is now doing the types-only lookup.
15312 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15313 (ResolveFlags): Added MaskExprClass.
15315 * expression.cs (MemberAccess): Implement the ITypeExpression
15317 (MemberAccess.DoResolve): Added support for a types-only lookup
15318 when we're called via ITypeExpression.DoResolveType().
15319 (ComposedCast): Implement the ITypeExpression interface.
15321 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15322 Expression.Resolve() with ResolveFlags.Type instead.
15324 2002-08-12 Martin Baulig <martin@gnome.org>
15326 * interface.cs (Interface.Define): Apply attributes.
15328 * attribute.cs (Attribute.ApplyAttributes): Added support for
15329 interface attributes.
15331 2002-08-11 Martin Baulig <martin@gnome.org>
15333 * statement.cs (Block.Emit): Only check the "this" variable if we
15334 do not always throw an exception.
15336 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15337 whether the property has a set accessor.
15339 2002-08-11 Martin Baulig <martin@gnome.org>
15341 Added control flow analysis support for structs.
15343 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15344 with control flow analysis turned off.
15345 (IVariable): New interface.
15346 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15347 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15348 (FieldExpr.DoResolve): Resolve the instance expression with flow
15349 analysis turned off and do the definite assignment check after the
15350 resolving when we know what the expression will resolve to.
15352 * expression.cs (LocalVariableReference, ParameterReference):
15353 Implement the new IVariable interface, only call the flow analysis
15354 code if ec.DoFlowAnalysis is true.
15355 (This): Added constructor which takes a Block argument. Implement
15356 the new IVariable interface.
15357 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15358 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15359 This does the definite assignment checks for struct members.
15361 * class.cs (Constructor.Emit): If this is a non-static `struct'
15362 constructor which doesn't have any initializer, call
15363 Block.AddThisVariable() to tell the flow analysis code that all
15364 struct elements must be initialized before control returns from
15367 * statement.cs (MyStructInfo): New public class.
15368 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15369 argument to this indexer. If non-zero, check an individual struct
15370 member, not the whole struct.
15371 (FlowBranching.CheckOutParameters): Check struct members.
15372 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15373 overloaded versions of these methods which take an additional
15374 `int field_idx' argument to check struct members.
15375 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15376 overloaded versions of these methods which take an additional
15377 `string field_name' argument to check struct member.s
15378 (VariableInfo): Implement the IVariable interface.
15379 (VariableInfo.StructInfo): New public property. Returns the
15380 MyStructInfo instance of the variable if it's a struct or null.
15381 (Block.AddThisVariable): New public method. This is called from
15382 Constructor.Emit() for non-static `struct' constructor which do
15383 not have any initializer. It creates a special variable for the
15384 "this" instance variable which will be checked by the flow
15385 analysis code to ensure that all of the struct's fields are
15386 initialized before control returns from the constructor.
15387 (UsageVector): Added support for struct members. If a
15388 variable/parameter is a struct with N members, we reserve a slot
15389 in the usage vector for each member. A struct is considered fully
15390 initialized if either the struct itself (slot 0) or all its
15391 members are initialized.
15393 2002-08-08 Martin Baulig <martin@gnome.org>
15395 * driver.cs (Driver.MainDriver): Only report an error CS5001
15396 if there were no compilation errors.
15398 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15399 `UnsafeContext' property to determine whether the parent is in
15400 unsafe context rather than checking the parent's ModFlags:
15401 classes nested in an unsafe class are unsafe as well.
15403 2002-08-08 Martin Baulig <martin@gnome.org>
15405 * statement.cs (UsageVector.MergeChildren): Distinguish between
15406 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15407 we return. Added test17() and test18() to test-154.cs.
15409 2002-08-08 Martin Baulig <martin@gnome.org>
15411 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15412 Family access, make sure the invoking type isn't a subclass of the
15413 queried type (that'd be a CS1540).
15415 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15416 this method which takes an additional `Type invocation_type'.
15418 * expression.cs (BaseAccess.DoResolve): Use the base type as
15419 invocation and query type.
15420 (MemberAccess.DoResolve): If the lookup failed and we're about to
15421 report a CS0122, try a lookup with the ec.ContainerType - if this
15422 succeeds, we must report a CS1540.
15424 2002-08-08 Martin Baulig <martin@gnome.org>
15426 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15427 (MethodGroupExpr): Implement the IMemberExpr interface.
15429 * expression (MemberAccess.ResolveMemberAccess): No need to have
15430 any special code for MethodGroupExprs anymore, they're now
15433 2002-08-08 Martin Baulig <martin@gnome.org>
15435 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15436 Family, FamANDAssem and FamORAssem permissions.
15437 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15439 2002-08-08 Martin Baulig <martin@gnome.org>
15441 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15442 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15445 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15447 * driver.cs: implemented /resource option to embed managed resources.
15449 2002-08-07 Martin Baulig <martin@gnome.org>
15451 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15452 (FieldBase.HasFieldInitializer): New public property.
15453 (FieldBase.GetInitializerExpression): New public method. Resolves and
15454 returns the field initializer and makes sure it is only resolved once.
15455 (TypeContainer.EmitFieldInitializers): Call
15456 FieldBase.GetInitializerExpression to get the initializer, this ensures
15457 that it isn't resolved multiple times.
15459 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15460 the resolving process (SimpleName/MemberLookup) that we're currently
15461 emitting a field initializer (which must not access any instance members,
15462 this is an error CS0236).
15464 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15465 argument, if the `IsFieldInitializer' flag is set, we must report and
15466 error CS0236 and not an error CS0120.
15468 2002-08-07 Martin Baulig <martin@gnome.org>
15470 * ecore.cs (IMemberExpr): New public interface.
15471 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15472 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15473 if the expression is an IMemberExpr.
15475 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15476 to be null, implicitly default to `this' if we're non-static in
15477 this case. Simplified the code a lot by using the new IMemberExpr
15478 interface. Also fixed bug #28176 here.
15480 2002-08-06 Martin Baulig <martin@gnome.org>
15482 * cs-parser.jay (SimpleLookup): Removed. We need to create
15483 ParameterReferences during semantic analysis so that we can do a
15484 type-only search when resolving Cast, TypeOf and SizeOf.
15485 (block): Pass the `current_local_parameters' to the Block's
15488 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15489 argument to the constructor.
15490 (ConstructorInitializer.Resolve): Create a temporary implicit
15491 block with the parameters.
15493 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15494 references here if we aren't doing a type-only search.
15496 * statement.cs (Block): Added constructor which takes a
15497 `Parameters parameters' argument.
15498 (Block.Parameters): New public property.
15500 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15501 to `Parameters' and made it public readonly.
15503 2002-08-06 Martin Baulig <martin@gnome.org>
15505 * ecore.cs (Expression.Warning): Made this public as well.
15507 * report.cs (Report.Debug): Print the contents of collections.
15509 2002-08-06 Martin Baulig <martin@gnome.org>
15511 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15512 used to tell Resolve() which kinds of expressions it may return.
15513 (Expression.Resolve): Added overloaded version of this method which
15514 takes a `ResolveFlags flags' argument. This can be used to tell
15515 Resolve() which kinds of expressions it may return. Reports a
15517 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15518 ResolveFlags.SimpleName.
15519 (Expression.Error118): Added overloaded version of this method which
15520 takes a `ResolveFlags flags' argument. It uses the flags to determine
15521 which kinds of expressions are allowed.
15523 * expression.cs (Argument.ResolveMethodGroup): New public method.
15524 Resolves an argument, but allows a MethodGroup to be returned.
15525 This is used when invoking a delegate.
15527 * TODO: Updated a bit.
15529 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15531 Fixed compilation with csc.
15533 * ecore.cs: Expression.Error made public. Is this correct? Should
15534 Warning be made public too?
15536 * expression.cs: use ea.Location instead of ea.loc.
15537 [FIXME: Filed as bug #28607: MCS must report these errors.]
15539 2002-08-06 Martin Baulig <martin@gnome.org>
15541 * ecore.cs (Expression.loc): Moved the location here instead of
15542 duplicating it in all derived classes.
15543 (Expression.Location): New public property.
15544 (Expression.Error, Expression.Warning): Made them non-static and
15545 removed the location argument.
15546 (Expression.Warning): Added overloaded version which takes an
15547 `int level' argument.
15548 (Expression.Error118): Make this non-static and removed the
15549 expression and location arguments.
15550 (TypeExpr): Added location argument to the constructor.
15552 * expression.cs (StaticCallExpr): Added location argument to
15554 (Indirection, PointerArithmetic): Likewise.
15555 (CheckedExpr, UnCheckedExpr): Likewise.
15556 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15557 (StringPtr): Likewise.
15560 2002-08-05 Martin Baulig <martin@gnome.org>
15562 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15564 * assign.cs (Assign.DoResolve): Check whether the source
15565 expression is a value or variable.
15567 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15568 while resolving the corresponding blocks.
15570 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15571 an error, don't silently return null.
15573 * statement.cs (Block.AddVariable): Do the error reporting here
15574 and distinguish between CS0128 and CS0136.
15575 (Block.DoResolve): Report all unused labels (warning CS0164).
15576 (LabeledStatement): Pass the location to the constructor.
15577 (LabeledStatement.HasBeenReferenced): New property.
15578 (LabeledStatement.Resolve): Set it to true here.
15580 * statement.cs (Return.Emit): Return success even after reporting
15581 a type mismatch error (CS0126 or CS0127), this is what csc does and
15582 it avoids confusing the users with any consecutive errors.
15584 2002-08-05 Martin Baulig <martin@gnome.org>
15586 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15588 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15590 * expression.cs (MemberAccess.DoResolve): Silently return if an
15591 error has already been reported.
15593 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15594 error has already been reported.
15596 2002-08-05 Martin Baulig <martin@gnome.org>
15598 * statement.cs (UsageVector): Only initialize the `parameters'
15599 vector if we actually have any "out" parameters.
15601 2002-08-05 Martin Baulig <martin@gnome.org>
15603 * expression.cs (Binary.ResolveOperator): When combining delegates,
15604 they must have the same type.
15606 2002-08-05 Martin Baulig <martin@gnome.org>
15608 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15609 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15610 work with the ms runtime and we also don't need it: if we're a
15611 PropertyBuilder and not in the `indexer_arguments' hash, then we
15612 are a property and not an indexer.
15614 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15615 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15616 since the latter one doesn't work with the ms runtime.
15618 2002-08-03 Martin Baulig <martin@gnome.org>
15620 Fixed bugs #27998 and #22735.
15622 * class.cs (Method.IsOperator): New public field.
15623 (Method.CheckBase): Report CS0111 if there's already a method
15624 with the same parameters in the current class. Report CS0508 when
15625 attempting to change the return type of an inherited method.
15626 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15627 and it's not marked abstract or extern.
15628 (PropertyBase): New abstract base class for Property and Indexer.
15629 (PropertyBase.CheckBase): Moved here from Property and made it work
15631 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15632 the same so we can reuse it there.
15633 (Property, Indexer): Derive from PropertyBase.
15634 (MethodSignature.inheritable_property_signature_filter): New delegate
15635 to find properties and indexers.
15637 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15638 argument and improved error reporting.
15640 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15641 EmptyReadOnlyParameters and made it a property.
15643 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15644 version of this method which takes a `PropertyInfo indexer'.
15645 (TypeManager.RegisterIndexer): New method.
15647 * class.cs: Added myself as author of this file :-)
15649 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15651 * class.cs: fixed compilation on windoze.
15653 2002-08-03 Martin Baulig <martin@gnome.org>
15655 * interface.cs (Interface.GetInterfaceBases): Check whether all
15656 base interfaces are at least as accessible than the current one.
15658 * class.cs (TypeContainer.GetClassBases): Check whether base types
15659 are at least as accessible than the current type.
15660 (TypeContainer.AsAccessible): Implemented and made non-static.
15661 (MemberBase.CheckParameters): Report errors if the accessibility
15664 * delegate.cs (Delegate.Delegate): The default visibility is
15665 internal for top-level types and private for nested types.
15666 (Delegate.Define): Report errors if the accessibility checks fail.
15668 * enum.cs (Enum.Enum): The default visibility is internal for
15669 top-level types and private for nested types.
15670 (Enum.DefineType): Compute the correct visibility.
15672 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15673 function which takes a `bool is_toplevel' instead of a TypeContainer.
15675 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15678 2002-08-02 Martin Baulig <martin@gnome.org>
15680 * expression.cs (LocalVariableReferenc): Added constructor which
15681 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15682 (LocalVariableReference.IsReadOnly): New property.
15683 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15684 variable is readonly, use our own readonly flag to do this; you can
15685 use the new constructor to get a writable reference to a read-only
15688 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15689 reference to the local variable.
15691 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15693 * rootcontext.cs (ResolveCore): Also include System.Exception
15695 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15696 we reach an EmptyStatement.
15698 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15701 * expression.cs (Binary.ResolveOperator): Check error result in
15704 use brtrue/brfalse directly and avoid compares to null.
15706 2002-08-02 Martin Baulig <martin@gnome.org>
15708 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15709 Fixes bug #28407, added test-155.cs.
15711 2002-08-01 Martin Baulig <martin@gnome.org>
15713 * class.cs (Event.EmitDefaultMethod): Make this work with static
15714 events. Fixes #28311, added verify-3.cs.
15716 2002-08-01 Martin Baulig <martin@gnome.org>
15718 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15719 `is_disposable' fields.
15720 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15721 `hm.is_disposable' if we're using the collection pattern.
15722 (Foreach.EmitCollectionForeach): Use the correct type for the
15723 enumerator's local variable, only emit the try/finally block if
15724 necessary (fixes #27713).
15726 2002-08-01 Martin Baulig <martin@gnome.org>
15728 * ecore.cs (Expression.report118): Renamed to Error118 and made
15731 * statement.cs (Throw.Resolve): Check whether the expression is of
15732 the correct type (CS0118) and whether the type derives from
15733 System.Exception (CS0155).
15734 (Catch.Resolve): New method. Do the type lookup here and check
15735 whether it derives from System.Exception (CS0155).
15736 (Catch.CatchType, Catch.IsGeneral): New public properties.
15738 * typemanager.cs (TypeManager.exception_type): Added.
15740 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15742 * driver.cs: Updated About function.
15744 2002-07-31 Martin Baulig <martin@gnome.org>
15746 Implemented Control Flow Analysis.
15748 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15749 (EmitContext.CurrentBranching): Added.
15750 (EmitContext.StartFlowBranching): Added.
15751 (EmitContext.EndFlowBranching): Added.
15752 (EmitContext.KillFlowBranching): Added.
15753 (EmitContext.IsVariableAssigned): Added.
15754 (EmitContext.SetVariableAssigned): Added.
15755 (EmitContext.IsParameterAssigned): Added.
15756 (EmitContext.SetParameterAssigned): Added.
15757 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15758 Added control flow analysis stuff here.
15760 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15761 resolve the expression as lvalue.
15762 (LocalVariableReference.DoResolve): Check whether the variable has
15763 already been assigned.
15764 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15765 the parameter as assigned here.
15766 (ParameterReference.DoResolve): Check whether the parameter has already
15768 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15769 expression as lvalue.
15771 * statement.cs (FlowBranching): New class for the flow analysis code.
15772 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15773 (LabeledStatement.IsDefined): New public property.
15774 (LabeledStatement.AddUsageVector): New public method to tell flow
15775 analyis that the label may be reached via a forward jump.
15776 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15778 (VariableInfo.Number): New public field. This is used by flow analysis
15779 to number all locals of a block.
15780 (Block.CountVariables): New public property. This is the number of
15781 local variables in this block (including the locals from all parent
15783 (Block.EmitMeta): Number all the variables.
15785 * statement.cs: Added flow analysis support to all classes.
15787 2002-07-31 Martin Baulig <martin@gnome.org>
15789 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15790 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15791 then use this argument.
15793 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15795 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15796 use this to specify /define options.
15798 2002-07-29 Martin Baulig <martin@gnome.org>
15800 * statement.cs (Fixed): Moved all code that does variable lookups
15801 and resolvings from Emit to Resolve.
15803 * statement.cs (For): Moved all code that does variable lookups
15804 and resolvings from Emit to Resolve.
15806 * statement.cs (Using): Moved all code that does variable lookups
15807 and resolvings from Emit to Resolve.
15809 2002-07-29 Martin Baulig <martin@gnome.org>
15811 * attribute.cs (Attribute.Resolve): Explicitly catch a
15812 System.NullReferenceException when creating the
15813 CustromAttributeBuilder and report a different warning message.
15815 2002-07-29 Martin Baulig <martin@gnome.org>
15817 * support.cs (ParameterData.ParameterName): Added method to
15818 get the name of a parameter.
15820 * typemanager.cs (TypeManager.IsValueType): New public method.
15822 2002-07-29 Martin Baulig <martin@gnome.org>
15824 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15825 is a flag which specifies that it's either ref or out.
15826 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15827 the out parameter to `out Parameter.Modifier mod', also set the
15828 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15830 * support.cs (InternalParameters.ParameterModifier): Distinguish
15831 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15832 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15834 * expression.cs (Argument.GetParameterModifier): Distinguish
15835 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15836 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15838 2002-07-29 Martin Baulig <martin@gnome.org>
15840 * expression.cs (ParameterReference.ParameterReference): Added
15841 `Location loc' argument to the constructor.
15843 * cs-parser.jay: Pass location to ParameterReference.
15845 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15847 * statement.cs (Try): Initialize the location.
15849 * cs-parser.jay: pass location to Try.
15851 * expression.cs (Unary.Reduce): Change the prototype to return
15852 whether a constant fold could be performed or not. The result is
15853 returned in an out parameters. In the case of Indirection and
15854 AddressOf, we want to perform the full tests.
15856 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15858 * statement.cs (Statement.Emit): Flag dead code.
15860 2002-07-27 Andrew Birkett <andy@nobugs.org>
15862 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15864 2002-07-27 Martin Baulig <martin@gnome.org>
15866 * class.cs (MethodData.Define): Put back call to
15867 TypeManager.AddMethod(), accidentally commented this out.
15869 * report.cs (Debug): New public method to print debugging information,
15870 this is `[Conditional ("DEBUG")]'.
15872 2002-07-26 Martin Baulig <martin@gnome.org>
15874 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15875 (switch_statement): Push the current_block to the switch_stack and
15876 pop it again when we're done with the switch.
15877 (switch_section): The new block is a child of the current_block.
15878 Fixes bug #24007, added test-152.cs.
15880 2002-07-27 Martin Baulig <martin@gnome.org>
15882 * expression.cs (Invocation.EmitArguments): When calling a varargs
15883 function with only its fixed arguments, we need to pass an empty
15886 2002-07-27 Martin Baulig <martin@gnome.org>
15888 Mono 0.13 has been released.
15890 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15892 * driver.cs: Rename --resource to --linkres, because that is what
15893 we do currently, we dont support --resource yet.
15895 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15897 2002-07-25 Martin Baulig <martin@gnome.org>
15899 * class.cs (MethodData): New public class. This is a `method builder'
15900 class for a method or one accessor of a Property/Indexer/Event.
15901 (MethodData.GetMethodFlags): Moved here from MemberBase.
15902 (MethodData.ApplyAttributes): Likewise.
15903 (MethodData.ApplyObsoleteAttribute): Likewise.
15904 (MethodData.ApplyConditionalAttribute): Likewise.
15905 (MethodData.ApplyDllImportAttribute): Likewise.
15906 (MethodData.CheckAbstractAndExternal): Likewise.
15907 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15908 (MethodData.Emit): Formerly known as Method.Emit().
15909 (MemberBase): Moved everything which was specific to a single
15910 accessor/method to MethodData.
15911 (Method): Create a new MethodData and call Define() and Emit() on it.
15912 (Property, Indexer, Event): Create a new MethodData objects for each
15913 accessor and call Define() and Emit() on them.
15915 2002-07-25 Martin Baulig <martin@gnome.org>
15917 Made MethodCore derive from MemberBase to reuse the code from there.
15918 MemberBase now also checks for attributes.
15920 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15921 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15923 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15924 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15925 (MemberBase.ApplyAttributes): New virtual method; applies the
15926 attributes to a method or accessor.
15927 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15928 (MemberBase.ApplyConditionalAttribute): Likewise.
15929 (MemberBase.ApplyDllImportAttribute): Likewise.
15930 (MemberBase.CheckAbstractAndExternal): Likewise.
15931 (MethodCore.ParameterTypes): This is now a property instead of a
15932 method, it's initialized from DoDefineParameters().
15933 (MethodCore.ParameterInfo): Removed the set accessor.
15934 (MethodCore.DoDefineParameters): New protected virtual method to
15935 initialize ParameterTypes and ParameterInfo.
15936 (Method.GetReturnType): We can now simply return the MemberType.
15937 (Method.GetMethodFlags): Override the MemberBase version and add
15938 the conditional flags.
15939 (Method.CheckBase): Moved some code from Define() here, call
15940 DoDefineParameters() here.
15941 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15942 here to avoid some larger code duplication.
15943 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15944 ensure that abstract and external accessors don't declare a body.
15946 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15947 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15948 lookup in the attribute's parent classes, so we need to abort as soon
15949 as we found the first match.
15950 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15951 the attribute has no arguments.
15953 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15956 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15958 * cs-parser.jay: reverted previous patch.
15960 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15962 * cs-parser.jay: fixed bug #22119.
15964 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15966 * attribute.cs: fixed compilation. The error was:
15967 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15968 be assigned to before control leaves the current method."
15969 [FIXME: Filed as bug #28186: MCS must report this error.]
15971 2002-07-25 Martin Baulig <martin@gnome.org>
15973 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15974 method to pull the condition name ouf of a Conditional attribute.
15975 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15976 the obsolete message and error flag out of an Obsolete attribute.
15978 * class.cs (Method.GetMethodFlags): New public method to get the
15979 TypeManager.MethodFlags for this method.
15980 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15982 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15983 if we're overriding a virtual function, set the new private variable
15984 `parent_method'; call the new TypeManager.AddMethod().
15986 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15987 the MethodBuilder and the Method in a PtrHashtable.
15988 (TypeManager.builder_to_method): Added for this purpose.
15989 (TypeManager.MethodFlags): Added IsObsoleteError.
15990 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15991 Obsolete and Conditional arguments in MethodBuilders. If we discover
15992 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15993 the message from the attribute.
15995 2002-07-24 Martin Baulig <martin@gnome.org>
15997 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15998 preprocessor directives, ensure that the argument to #define/#undef is
15999 exactly one identifier and that it's actually an identifier.
16001 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16004 2002-07-24 Martin Baulig <martin@gnome.org>
16006 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16007 initialize it to TypeManager.object_type in the constructor.
16008 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16009 of the `hm.get_current' method if we're using the collection pattern.
16010 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16011 for the explicit conversion to make it work when we're using the collection
16012 pattern and the `Current' property has a different return type than `object'.
16015 2002-07-24 Martin Baulig <martin@gnome.org>
16017 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16018 does not match, but don't report any errors. This method is called in
16019 order for all methods in a MethodGroupExpr until a matching method is
16020 found, so we don't want to bail out if the first method doesn't match.
16021 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16022 matches, report the 123. Fixes #28070.
16024 2002-07-24 Martin Baulig <martin@gnome.org>
16026 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16027 TypeManager.TypeToCoreType() to the top of the method so the
16028 following equality checks will work. Fixes #28107.
16030 2002-07-24 Martin Baulig <martin@gnome.org>
16032 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16033 operand is of type uint, and the other operand is of type sbyte,
16034 short or int, the operands are converted to type long." -
16035 Actually do what this comment already told us. Fixes bug #28106,
16038 2002-07-24 Martin Baulig <martin@gnome.org>
16040 * class.cs (MethodBase): New abstract class. This is now a base
16041 class for Property, Indexer and Event to avoid some code duplication
16042 in their Define() and DefineMethods() methods.
16043 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16044 generic methods for Define() and DefineMethods().
16045 (FieldBase): Derive from MemberBase, not MemberCore.
16046 (Property): Derive from MemberBase, not MemberCore.
16047 (Property.DefineMethod): Moved all the code from this method to the
16048 new MethodBase.DefineAccessor(), just call it with appropriate
16050 (Property.Define): Call the new Property.DoDefine(), this does some
16051 sanity checks and we don't need to duplicate the code everywhere.
16052 (Event): Derive from MemberBase, not MemberCore.
16053 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16054 accessors, this will also make them work with interface events.
16055 (Indexer): Derive from MemberBase, not MemberCore.
16056 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16057 (Indexer.Define): Use the new MethodBase functions.
16059 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16060 argument to the constructor.
16061 (Interface.FindMembers): Added support for interface events.
16062 (Interface.PopluateEvent): Implemented.
16064 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16066 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16068 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16069 but this is required to check for a method name being the same as
16070 the containing class.
16074 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16076 * interface.cs: initialize variable.
16078 2002-07-23 Martin Baulig <martin@gnome.org>
16080 Implemented the IndexerName attribute in interfaces.
16082 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16083 name if this is an explicit interface implementation.
16084 (Indexer.InterfaceIndexerName): New public variable. If we're
16085 implementing an interface indexer, this is the IndexerName in that
16086 interface. Otherwise, it's the IndexerName.
16087 (Indexer.DefineMethod): If we're implementing interface indexer,
16088 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16089 and Pending.ImplementIndexer methods.
16090 (Indexer.Define): Also define the PropertyBuilder if we're
16091 implementing an interface indexer and this is neither an explicit
16092 interface implementation nor do the IndexerName match the one in
16095 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16096 If a method is defined here, then we always need to create a proxy
16097 for it. This is used when implementing interface indexers.
16098 (Pending.IsInterfaceIndexer): New public method.
16099 (Pending.ImplementIndexer): New public method.
16100 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16101 This is used when implementing interface indexers to define a proxy
16103 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16104 define a proxy if necessary.
16106 * interface.cs (Interface.IndexerName): New public variable.
16107 (Interface.PopulateIndexer): Set the IndexerName.
16108 (Interface.DefineIndexers): New private method. Populate all the
16109 indexers and make sure their IndexerNames match.
16111 * typemanager.cs (IndexerPropertyName): Added support for interface
16114 2002-07-22 Martin Baulig <martin@gnome.org>
16116 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16117 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16118 ret if HasReturnLabel.
16119 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16122 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16123 and set the ec.LoopBeginTryCatchLevel.
16124 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16125 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16126 the current ec.TryCatchLevel, the branch goes out of an exception
16127 block. In this case, we need to use Leave and not Br.
16129 2002-07-22 Martin Baulig <martin@gnome.org>
16131 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16132 block unless the block does not always return or it is contained in
16133 another try { ... } catch { ... } block. Fixes bug #26506.
16134 Added verify-1.cs to the test suite.
16136 2002-07-22 Martin Baulig <martin@gnome.org>
16138 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16139 then we do not always return. Fixes bug #24985.
16141 2002-07-22 Martin Baulig <martin@gnome.org>
16143 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16144 lookup on a per-class level; ie. walk up the class hierarchy until we
16145 found at least one applicable method, then choose the best among them.
16146 Fixes bug #24463 and test-29.cs.
16148 2002-07-22 Martin Baulig <martin@gnome.org>
16150 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16151 return types of the methods. The return type is not part of the
16152 signature and we must not check it to make the `new' modifier work.
16153 Fixes bug #27999, also added test-147.cs.
16154 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16156 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16157 on the method's return type.
16159 2002-07-21 Martin Baulig <martin@gnome.org>
16161 * assign.cs: Make this work if the rightmost source is a constant and
16162 we need to do an implicit type conversion. Also adding a few more tests
16163 to test-38.cs which should have caught this.
16165 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16166 target in the makefile for this. The makefile.gnu is primarily intended
16167 for end-users who don't want to debug the compiler.
16169 2002-07-21 Martin Baulig <martin@gnome.org>
16171 * assign.cs: Improved the Assign class so it can now handle embedded
16172 assignments (X = Y = Z = something). As a side-effect this'll now also
16173 consume less local variables. test-38.cs now passes with MCS, added
16174 a few new test cases to that test.
16176 2002-07-20 Martin Baulig <martin@gnome.org>
16178 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16179 instructions. Fixes bug #27977, also added test-146.cs.
16181 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16183 * cs-tokenizer.cs: fixed getHex ().
16185 2002-07-19 Martin Baulig <martin@gnome.org>
16187 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16188 not Type.GetType() to lookup the array type. This is needed when
16189 we're constructing an array of a user-defined type.
16190 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16191 single-dimensional arrays, but also for single-dimensial arrays of
16194 2002-07-19 Martin Baulig <martin@gnome.org>
16196 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16197 this function is called, it's not allowed to share LocalBuilders
16198 among ILGenerators.
16200 2002-07-19 Martin Baulig <martin@gnome.org>
16202 * expression.cs (Argument.Resolve): Report an error 118 when trying
16203 to pass a type as argument.
16205 2002-07-18 Martin Baulig <martin@gnome.org>
16207 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16208 Conv_R_Un for the signed `long' type.
16210 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16212 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16213 `expr' for the temporary result, as that will fail if we do
16214 multiple resolves on the same expression.
16216 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16218 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16219 ec.TypeContainer for looking up aliases.
16221 * class.cs (TypeContainer): Remove LookupAlias from here.
16223 * decl.cs (DeclSpace); Move here.
16225 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16227 * class.cs (FindMembers): Only call filter if the constructor
16228 bulider is not null.
16230 Also handle delegates in `NestedTypes' now. Now we will perform
16231 type lookups using the standard resolution process. This also
16234 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16235 This uses Expressions (the limited kind that can be parsed by the
16236 tree) instead of strings.
16238 * expression.cs (ComposedCast.ToString): Implement, used to flag
16239 errors since now we have to render expressions.
16241 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
16244 * ecore.cs (SimpleName.ToString): ditto.
16246 * cs-parser.jay: Instead of using strings to assemble types, use
16247 Expressions to assemble the type (using SimpleName, ComposedCast,
16248 MemberAccess). This should fix the type lookups in declarations,
16249 because we were using a different code path for this.
16251 * statement.cs (Block.Resolve): Continue processing statements
16252 even when there is an error.
16254 2002-07-17 Miguel de Icaza <miguel@ximian.com>
16256 * class.cs (Event.Define): Also remove the `remove' method from
16257 the list of pending items.
16259 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16260 generate more compact code.
16262 2002-07-17 Martin Baulig <martin@gnome.org>
16264 * const.cs (Const.LookupConstantValue): Add support for constant
16265 `unchecked' and `checked' expressions.
16266 Also adding test case test-140.cs for this.
16268 2002-07-17 Martin Baulig <martin@gnome.org>
16270 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16271 check whether mi.ReturnType implements the IEnumerator interface; the
16272 `==' and the IsAssignableFrom() will fail in this situation.
16274 2002-07-16 Ravi Pratap <ravi@ximian.com>
16276 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
16279 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16281 * expression.cs: fixed bug #27811.
16283 2002-07-14 Miguel de Icaza <miguel@ximian.com>
16285 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16286 Molaro: when we are a ref, the value already contains a pointer
16287 value, do not take the address of it.
16289 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16290 * removed mb-parser.jay and mb-tokenizer.cs
16292 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16294 * expression.cs: check against the building corlib void type.
16296 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16298 * ecore.cs: fix for valuetype static readonly fields: when
16299 initializing them, we need their address, not the address of a copy.
16301 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16303 * typemanager.cs: register also enum_type in corlib.
16305 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16307 * class.cs: allow calling this (but not base) initializers in structs.
16309 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16311 * ecore.cs: make sure we compare against the building base types
16314 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16316 * typemanager.cs: fix TypeToCoreType() to handle void and object
16317 (corlib gets no more typerefs after this change).
16319 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16321 * expression.cs (ArrayCreation.EmitArrayArguments): use
16322 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16324 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16325 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16326 array indexes, the runtime actually forbids them.
16328 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16329 for array arguments here.
16331 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16332 instead of the default for ValueTypes.
16334 (New.DoEmit): Use IsValueType instead of
16335 IsSubclassOf (value_type)
16336 (New.DoResolve): ditto.
16337 (Invocation.EmitCall): ditto.
16339 * assign.cs (Assign): ditto.
16341 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16342 Statements *are* currently doing part of their resolution during
16345 Expressions do always resolve during resolve, but statements are
16346 only required to propagate resolution to their children.
16348 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16350 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16352 (LoadAssembly): Do not add the dll if it is already specified
16354 (MainDriver): Add the System directory to the link path at the end,
16355 after all the other -L arguments.
16357 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16358 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16359 ldelem.u1) and using the opposite for sbytes.
16361 This fixes Digger, and we can finally run it.
16363 * driver.cs (UnixParseOption): Move the option parsing here.
16364 (CSCParseOption): Implement CSC-like parsing of options.
16366 We now support both modes of operation, the old Unix way, and the
16367 new CSC-like way. This should help those who wanted to make cross
16368 platform makefiles.
16370 The only thing broken is that /r:, /reference: and /lib: are not
16371 implemented, because I want to make those have the same semantics
16372 as the CSC compiler has, and kill once and for all the confussion
16373 around this. Will be doing this tomorrow.
16375 * statement.cs (Unsafe.Resolve): The state is checked during
16376 resolve, not emit, so we have to set the flags for IsUnsfe here.
16378 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16380 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16381 not catch the Error_ObjectRefRequired in SimpleName (as it is
16382 possible to have a class/instance variable name that later gets
16383 deambiguated), we have to check this here.
16385 2002-07-10 Ravi Pratap <ravi@ximian.com>
16387 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16388 make static and put into Expression.
16390 (Event.Define): Register the private field of the event with the
16391 TypeManager so that GetFieldFromEvent can get at it.
16393 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16394 keep track of the private field associated with an event which
16397 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16400 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16402 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16404 * expression.cs (Binary.EmitBranchable): this routine emits the
16405 Binary expression in a branchable context. This basically means:
16406 we need to branch somewhere, not just get the value on the stack.
16408 This works together with Statement.EmitBoolExpression.
16410 * statement.cs (Statement.EmitBoolExpression): Use
16413 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16415 * statement.cs (For): Reduce the number of jumps in loops.
16417 (For): Implement loop inversion for the For statement.
16419 (Break): We can be breaking out of a Try/Catch controlled section
16420 (foreach might have an implicit try/catch clause), so we need to
16421 use Leave instead of Br.
16423 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16424 now). If the instace expression supports IMemoryLocation, we use
16425 the AddressOf method from the IMemoryLocation to extract the
16426 address instead of emitting the instance.
16428 This showed up with `This', as we were emitting the instance
16429 always (Emit) instead of the Address of This. Particularly
16430 interesting when This is a value type, as we dont want the Emit
16431 effect (which was to load the object).
16433 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16435 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16437 * statement.cs (Checked): Set the CheckedState during the resolve
16438 process too, as the ConvCast operations track the checked state on
16439 the resolve process, and not emit.
16441 * cs-parser.jay (namespace_member_declaration): Flag that we have
16442 found a declaration when we do. This is used to flag error 1529
16444 * driver.cs: Report ok when we display the help only.
16446 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16448 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16450 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16452 * cs-tokenizer.cs (define): We also have to track locally the
16453 defines. AllDefines is just used for the Conditional Attribute,
16454 but we also need the local defines for the current source code.
16456 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16458 * statement.cs (While, For, Do): These loops can exit through a
16459 Break statement, use this information to tell whether the
16460 statement is the last piece of code.
16462 (Break): Flag that we break.
16464 * codegen.cs (EmitContexts): New `Breaks' state variable.
16466 2002-07-03 Martin Baulig <martin@gnome.org>
16468 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16469 modifiers in method declarations in structs. Otherwise, you won't
16470 be able to override things like Object.Equals().
16472 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16474 * class.cs (Method, Property, Indexer): Do not allow the public
16475 modifier to be used in explicit interface implementations.
16477 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16478 override modifiers in method declarations in structs
16480 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16482 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16483 integer or real overflow, report an error
16485 2002-07-02 Martin Baulig <martin@gnome.org>
16487 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16488 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16489 to tell the runtime about our newly created System.Object and
16490 System.ValueType types.
16492 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16494 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16495 struct instead of Ldarg/Starg.
16497 2002-07-02 Martin Baulig <martin@gnome.org>
16499 * expression.cs (Indirection.Indirection): Call
16500 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16502 2002-07-02 Martin Baulig <martin@gnome.org>
16504 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16505 ValueType, call TypeManager.TypeToCoreType() on it.
16506 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16507 the OpCodes.Newarr argument.
16509 2002-07-02 Martin Baulig <martin@gnome.org>
16511 * expression.cs (Invocation.EmitCall): When compiling corlib,
16512 replace all calls to the system's System.Array type to calls to
16513 the newly created one.
16515 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16516 System.Array methods.
16517 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16518 from the system's System.Array type which must be replaced.
16520 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16522 * typemanager.cs: load unverifiable_code_ctor so we can build
16523 corlib using the correct type. Avoid using GetTypeCode() with
16525 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16526 TypeManager.object_type to allow building corlib.
16528 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16530 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16532 2002-07-01 Martin Baulig <martin@gnome.org>
16534 * class.cs: Make the last change actually work, we need to check
16535 whether `ifaces != null' to avoid a crash.
16537 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16539 * class.cs: when we build structs without fields that implement
16540 interfaces, we need to add the interfaces separately, since there is
16541 no API to both set the size and add the interfaces at type creation
16544 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16546 * expression.cs: the dimension arguments to the array constructors
16547 need to be converted if they are a long.
16549 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16551 * class.cs: don't emit ldarg.0 if there is no parent constructor
16552 (fixes showstopper for corlib).
16554 2002-06-29 Martin Baulig <martin@gnome.org>
16556 MCS now compiles corlib on GNU/Linux :-)
16558 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16559 ie. check for MethodImplOptions.InternalCall.
16561 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16562 and TypeManager.attribute_type are null, so we must explicitly check
16563 whether parent is not null to find out whether it's an attribute type.
16564 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16565 and SetBuilder, not only if the property is neither abstract nor external.
16566 This is necessary to set the MethodImplOptions on the accessor methods.
16567 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16568 SetBuilder, see Property.Emit().
16570 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16571 populate "System.Object", "System.ValueType" and "System.Attribute" since
16572 they've already been populated from BootCorlib_PopulateCoreTypes().
16574 2002-06-29 Martin Baulig <martin@gnome.org>
16576 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16577 is the NullLiteral, we also need to make sure that target_type is not
16580 2002-06-29 Martin Baulig <martin@gnome.org>
16582 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16583 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16584 before calling BootstrapCorlib_ResolveDelegate ().
16586 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16588 * statement.cs: fixed build-breaker. All tests passed ok.
16590 2002-06-27 Martin Baulig <martin@gnome.org>
16592 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16593 for System.Decimal when compiling corlib.
16595 2002-06-27 Martin Baulig <martin@gnome.org>
16597 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16598 switch blocks which contain nothing but a default clause.
16600 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16602 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16604 2002-06-27 Martin Baulig <martin@gnome.org>
16606 * ecore.cs (PropertyExpr.PropertyExpr): Call
16607 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16609 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16610 is already a TypeBuilder.
16612 2002-06-27 Martin Baulig <martin@gnome.org>
16614 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16615 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16616 the "from an array-type to System.Array" case. This makes it work
16617 when compiling corlib.
16619 2002-06-27 Martin Baulig <martin@gnome.org>
16621 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16622 non-static PropertyExpr, set its InstanceExpression. This makes
16623 the `ICollection.Count' property work in System/Array.cs.
16625 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16627 * driver.cs: Made error handling more consistent. Errors now
16628 tracked by Report class, so many methods which used to return int
16629 now return void. Main() now prints success/failure and
16630 errors/warnings message.
16632 Renamed '--probe' compiler argument to '--expect-error'. Removed
16633 the magic number return values (123 and 124). Now, if the
16634 expected error occurs, the compiler exits with success (exit value
16635 0). If the compilation completes without seeing that particular
16636 error, the compiler exits with failure (exit value 1). The
16637 makefile in mcs/errors has been changed to handle the new behaviour.
16639 * report.cs: Made 'expected error' number a property and renamed
16640 it from 'Probe' to 'ExpectedError'.
16642 * genericparser.cs: Removed error handling support, since it is
16643 now all done by Report class.
16645 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16646 class, so parse() no longer returns an int.
16648 * namespace.cs: Use Report.Error instead of GenericParser.error
16650 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16652 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16653 TypeContainer.AddOperator): At the front of the list put the
16654 explicit implementations, so they get resolved/defined first.
16656 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16658 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16659 interface type is implemented by this TypeContainer. Used during
16660 explicit interface implementation.
16662 (Property.Define, Indexer.Define, Method.Define): Validate that
16663 the given interface in the explicit implementation is one of the
16664 base classes for the containing type.
16666 Also if we are explicitly implementing an interface, but there is
16667 no match in the pending implementation table, report an error.
16669 (Property.Define): Only define the property if we are
16670 not explicitly implementing a property from an interface. Use the
16671 correct name also for those properties (the same CSC uses,
16672 although that is really not needed).
16674 (Property.Emit): Do not emit attributes for explicitly implemented
16675 properties, as there is no TypeBuilder.
16677 (Indexer.Emit): ditto.
16679 Hiding then means that we do not really *implement* a pending
16680 implementation, which makes code fail.
16682 2002-06-22 Martin Baulig <martin@gnome.org>
16684 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16685 the return value of Object.GetType(). [FIXME: we need to do this whenever
16686 we get a type back from the reflection library].
16688 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16690 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16692 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16694 * attribute.cs: Return null if we can not look up the type.
16696 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16697 the interface types found.
16699 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16700 interface types found.
16702 * typemanager.cs (GetInterfaces): Make this routine returns alll
16703 the interfaces and work around the lame differences between
16704 System.Type and System.Reflection.Emit.TypeBuilder in the results
16705 result for GetInterfaces.
16707 (ExpandInterfaces): Given an array of interface types, expand and
16708 eliminate repeated ocurrences of an interface. This expands in
16709 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16712 2002-06-21 Martin Baulig <martin@gnome.org>
16714 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16717 2002-06-21 Martin Baulig <martin@gnome.org>
16719 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16720 and called with one of the core types, return the corresponding typebuilder for
16723 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16726 2002-06-21 Martin Baulig <martin@gnome.org>
16728 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16729 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16730 (Expression.ConvertReferenceExplicit): Likewise.
16732 * expression.cs (ElementAccess.DoResolve): Likewise.
16733 (ElementAccess.DoResolveLValue): Likewise.
16735 2002-06-10 Martin Baulig <martin@gnome.org>
16737 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16738 add the "value" parameter to the parameter list.
16740 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16743 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16745 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16746 the argument to an int, uint, long or ulong, per the spec. Also
16747 catch negative constants in array creation.
16749 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16751 * class.cs: do not allow the same interface to appear twice in
16752 the definition list.
16754 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16756 * ecore.cs: don't use ldlen with System.Array.
16758 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16760 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16762 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16764 * modifiers.cs: produce correct field attributes for protected
16765 internal. Easy fix so miguel can work on ther harder stuff:-)
16767 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16769 * pending.cs: New file. Move the code from class.cs here.
16770 Support clearning the pending flag for all methods (when not doing
16771 explicit interface implementation).
16773 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16775 * rootcontext.cs: added a couple more types needed to bootstrap.
16777 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16779 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16780 constructor in the type, instead of any constructor in the type
16781 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16782 a bug in the Mono runtime when applying the params attribute).
16784 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16785 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16787 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16789 * expression.cs (Unary.ResolveOperator): Use TypeManager
16790 to resolve the type.
16792 2002-06-13 Ravi Pratap <ravi@ximian.com>
16794 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16797 * enum.cs (AddEnumMember): Add support to store the attributes associated
16798 with each member too.
16800 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16801 field builders too - this takes care of the enum member case.
16803 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16805 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16806 address-of operator on both value types and pointers.
16808 2002-06-10 Martin Baulig <martin@gnome.org>
16810 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16811 PropertyBuilder to the `property_builders' list.
16813 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16814 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16815 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16816 find any indexers which are inherited from an interface.
16818 2002-06-09 Martin Baulig <martin@gnome.org>
16820 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16821 the same type as the constant if necessary. There's also a test-130.cs
16824 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16826 * typemanager.cs (TypeManager.ChangeType): Previously known as
16827 Enum.ChangeEnumType().
16829 2002-06-09 Martin Baulig <martin@gnome.org>
16831 * expression.cs (Cast.TryReduce): Added support for consts.
16833 2002-06-08 Ravi Pratap <ravi@ximian.com>
16835 * class.cs (Accessor): Hold attributes information so we can pass
16838 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16839 Modify to pass in attributes attached to the methods.
16841 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16843 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16844 to handle the Accessor kind :-)
16846 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16848 2002-06-08 Martin Baulig <martin@gnome.org>
16850 * expression.cs (Unary.TryReduceNegative): Added support for
16853 2002-06-08 Martin Baulig <martin@gnome.org>
16855 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16856 name can't be found in the `defined_names' - the caller will do a
16857 MemberLookup in this case and thus find methods in System.Enum
16858 such as Enum.IsDefined().
16860 2002-06-08 Martin Baulig <martin@gnome.org>
16862 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16863 Convert.ChangeType() which works with TypeBuilder created types.
16864 (Enum.LookupEnumValue, Enum.Define): Use it here.
16866 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16867 `TypeBuilder.BaseType != null' check.
16868 (TypeContainer.FindMembers): Only lookup parent members if we
16869 actually have a parent.
16870 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16871 (ConstructorInitializer.Resolve): Likewise.
16873 * interface.cs (Interface.FindMembers): Added
16874 `TypeBuilder.BaseType != null' check.
16876 * rootcontext.cs (RootContext.ResolveCore): Added
16877 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16878 classes_second_stage.
16880 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16881 debug_type and trace_type when compiling with --nostdlib.
16883 2002-06-07 Martin Baulig <martin@gnome.org>
16885 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16886 (AddField): Set it to true when adding a non-static field.
16887 (DefineType): Use `have_nonstatic_fields' to find out whether we
16888 have non-static fields, not `Fields != null'.
16890 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16892 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16893 dereferencing a null on the static-field code path)
16895 2002-05-30 Martin Baulig <martin@gnome.org>
16897 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16898 to take command line arguments. Use reflection to call the new
16899 custom `Initialize' function on the symbol writer and pass it the
16900 command line arguments.
16902 * driver.cs (--debug-args): New command line argument to pass command
16903 line arguments to the symbol writer.
16905 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16907 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16908 the target type for indexers and properties. Thanks to Joe for
16911 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16913 * typemanager.cs (MethodFlags): returns the method flags
16914 (Obsolete/ShouldIgnore) that control warning emission and whether
16915 the invocation should be made, or ignored.
16917 * expression.cs (Invocation.Emit): Remove previous hack, we should
16918 not do this on matching a base type, we should do this based on an attribute
16920 Only emit calls to System.Diagnostics.Debug and
16921 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16922 on the command line.
16924 * rootcontext.cs: Global settings for tracing and debugging.
16926 * cs-tokenizer.cs (define): New utility function to track
16927 defines. Set the global settings for TRACE and DEBUG if found.
16929 2002-05-25 Ravi Pratap <ravi@ximian.com>
16931 * interface.cs (Populate*): Pass in the TypeContainer as well as
16932 the DeclSpace as parameters so that we can create EmitContexts and
16933 then use that to apply attributes etc.
16935 (PopulateMethod, PopulateEvent, PopulateProperty)
16936 (PopulateIndexer): Apply attributes everywhere.
16938 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16941 (ApplyAttributes): Update accordingly.
16943 We now apply interface attributes for all members too.
16945 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16947 * class.cs (Indexer.Define); Correctly check if we are explicit
16948 implementation (instead of checking the Name for a ".", we
16949 directly look up if the InterfaceType was specified).
16951 Delay the creation of the PropertyBuilder.
16953 Only create the PropertyBuilder if we are not an explicit
16954 interface implementation. This means that explicit interface
16955 implementation members do not participate in regular function
16956 lookups, and hence fixes another major ambiguity problem in
16957 overload resolution (that was the visible effect).
16959 (DefineMethod): Return whether we are doing an interface
16962 * typemanager.cs: Temporary hack until we get attributes in
16963 interfaces (Ravi is working on that) and we get IndexerName
16964 support in interfaces.
16966 * interface.cs: Register the indexers as properties.
16968 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16969 warning, I have verified that this is a bug in the .NET runtime
16970 (JavaScript suffers of the same problem).
16972 * typemanager.cs (MemberLookup): When looking up members for
16973 interfaces, the parent of an interface is the implicit
16974 System.Object (so we succeed in searches of Object methods in an
16975 interface method invocation. Example: IEnumerable x; x.ToString
16978 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16980 * class.cs (Event): Events should also register if they do
16981 implement the methods that an interface requires.
16983 * typemanager.cs (MemberLookup); use the new GetInterfaces
16986 (GetInterfaces): The code used to lookup interfaces for a type is
16987 used in more than one place, factor it here.
16989 * driver.cs: Track the errors at the bottom of the file, we kept
16992 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16993 instance if the method we are calling is static!
16995 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16997 * attribute.cs (ApplyAttributes): Make this function filter out
16998 the IndexerName attribute (as that attribute in reality is never
16999 applied) and return the string constant for the IndexerName
17002 * class.cs (TypeContainer.Emit): Validate that all the indexers
17003 have the same IndexerName attribute, and if so, set the
17004 DefaultName attribute on the class.
17006 * typemanager.cs: The return value might contain other stuff (not
17007 only methods). For instance, consider a method with an "Item"
17008 property and an Item method.
17010 * class.cs: If there is a problem with the parameter types,
17013 2002-05-24 Ravi Pratap <ravi@ximian.com>
17015 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17016 looks at user defined conversion after making a call to
17017 StandardConversionExists - we need this for overload resolution.
17019 * expression.cs : Update accordingly the various method calls.
17021 This fixes 2 bugs filed against implicit user defined conversions
17023 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17025 * statement.cs: Track the result of the assignment.
17027 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17029 * expression.cs (MemberAccess): Improved error reporting for
17030 inaccessible members.
17032 2002-05-22 Martin Baulig <martin@gnome.org>
17034 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17035 itself with debugging support.
17037 2002-05-22 Martin Baulig <martin@gnome.org>
17039 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17040 Removed, this isn't needed anymore.
17042 2002-05-20 Martin Baulig <martin@gnome.org>
17044 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17045 be underlying type for an enum.
17047 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17049 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17050 that splits out the loading of just the core types.
17052 * rootcontext.cs (ResolveCore): Split the struct resolution in
17053 two, so we can load the enumeration underlying types before any
17056 * expression.cs (Is): Bandaid until we fix properly Switch (see
17057 bug #24985 for details).
17059 * typemanager.cs (ImplementsInterface): The hashtable will contain
17060 a null if there are no interfaces implemented.
17062 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17064 * cs-parser.jay (indexer_declarator): It is fine to have array
17067 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17069 * typemanager.cs: (RegisterBuilder): New function used to register
17070 TypeBuilders that implement interfaces. Since
17071 TypeBuilder.GetInterfaces (as usual) does not work with lame
17073 (AddUserType): register interfaces.
17075 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17076 dealing with TypeBuilder. Also, arrays are showing up as
17077 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17078 methods can not be invoked on them!
17080 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17081 (ImplicitReferenceConversionExists): Split out from
17082 StandardConversionExists.
17084 * expression.cs (As): We were only implementing one of the three
17085 cases for the as operator. We now implement them all.
17086 (Is): Implement the various other cases for Is as well.
17088 * typemanager.cs (CACHE): New define used to control if we want or
17089 not the FindMembers cache. Seems to have a negative impact on
17090 performance currently
17092 (MemberLookup): Nested types have full acess to
17093 enclosing type members
17095 Remove code that coped with instance/static returns for events, we
17096 now catch this in RealFindMembers.
17098 (RealFindMembers): only perform static lookup if the instance
17099 lookup did not return a type or an event.
17101 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17103 * assign.cs (CompoundAssign): We pass more semantic information
17104 now to Compound Assignments than we did before: now we have all
17105 the information at hand, and now we resolve the target *before* we
17106 do the expression expansion, which allows the "CacheValue" method
17107 to have the effect we intended (before, a [x] += 1 would generate
17108 two differen ArrayAccess expressions from the ElementAccess,
17109 during the resolution process).
17111 (CompoundAssign.DoResolve): Resolve target and original_source here.
17113 2002-05-16 Miguel de Icaza <miguel@ximian.com>
17115 * expression.cs (ArrayAccess): dropped debugging information.
17117 * typemanager.cs: Small bug fix: I was always returning i_members,
17118 instead of one of i_members or s_members (depending on which had
17121 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
17122 method is invoked before any code generation takes place, and it
17123 is a mechanism to inform that the expression will be invoked more
17124 than once, and that the method should use temporary values to
17125 avoid having side effects
17127 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17129 * ecore.cs (Expression.CacheTemporaries): Provide empty default
17132 * expression.cs (Indirection, ArrayAccess): Add support for
17133 CacheTemporaries in these two bad boys.
17135 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17136 ldobj or ldind_ref.
17137 (StoreFromPtr): Handle stobj as well.
17139 * expression.cs (UnaryMutator): Share more code.
17141 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17142 down: I was not tracking the Filter function as well, which
17143 was affecting the results of the cache.
17145 2002-05-15 Miguel de Icaza <miguel@ximian.com>
17147 * attribute.cs: Remove the hack to handle the CharSet property on
17150 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17152 * attribute.cs (DoResolve): More uglyness, we now only try to
17153 resolve the attribute partially, to extract the CharSet
17154 information (only if we are a StructLayout attribute). Otherwise
17156 (GetExtraTypeInfo): Add some code to conditionally kill in the
17157 future this. I am more and more convinced that the .NET
17158 framework has special code to handle the attribute setting on
17161 * expression.cs (IsParamsMethodApplicable): Revert my previous
17162 foreach change here, it was wrong.
17164 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17166 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17167 (pp_expr): do not abort on unknown input, just return.
17168 (eval): abort if there are pending chars.
17170 * attribute.cs (Attribute.Resolve): Positional parameters are
17171 optional. Deal with that case.
17173 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17174 the Ansi/Unicode/Auto information for the type.
17176 (TypeContainer.DefineType): instantiate the EmitContext here, as
17177 we will be using it during the type definition (to resolve
17178 attributes) and during the emit phase.
17180 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17181 to pull type information out of the attributes
17183 (Attribute.Resolve): track the constructor builder, and allow for
17184 multiple invocations (structs and classes will use this).
17186 * ecore.cs (MemberLookupFinal): new version with all the
17187 parameters customizable.
17189 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17190 constructors. Return if the result value is null (as the error
17191 would have been flagged already by MemberLookupFinal)
17193 Do not allow instances of abstract classes or interfaces to be
17196 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17197 We have to compare the assembly property here when dealing with
17198 FamANDAssem and Assembly access modifiers, because we might be
17199 creating an assembly from *modules* (that means that we are not
17200 getting TypeBuilders for types defined in other modules that are
17201 part of this assembly).
17203 (Method.Emit): If the method is marked abstract and has a body,
17206 (TypeContainer.DefineMembers): If both the defined member and the
17207 parent name match are methods, then do not emit any warnings: let
17208 the Method.Define routine take care of flagging warnings. But if
17209 there is a mismatch (method overrides something else, or method is
17210 overriwritten by something, then emit warning).
17212 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17213 set to null, this means `do not check for the return type on the
17216 (Method.Define): set the return type for the method signature to
17217 null, so that we get methods with the same name and parameters and
17218 different return types. This is used to flag warning 114 (you are
17219 hiding a method, and you probably want to use the new/override
17222 * typemanager.cs (MemberLookup): Implemented proper access
17223 control, closing a long standing set of bug reports. The problem
17224 was that the Framework only has two bits: Public and NonPublic,
17225 and NonPublic includes private and protected methods, but we need
17226 to enforce the FamANDAssem, FamOrAssem and Family.
17228 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17230 * statement.cs (GotoCase): Return true: Ammounts to giving up
17231 knowledge on whether we return or not, and letting the other case
17232 be responsible for it.
17234 2002-05-10 Miguel de Icaza <miguel@ximian.com>
17236 * driver.cs: Do not load directories for each file processed, only
17237 do it if there is a pattern.
17239 * ecore.cs: Report readonly assigns here as well, as we might have
17240 been resolved only by MemberAccess.
17242 (SimpleName.SimpleNameResolve): Also be useful for LValue
17243 resolution. We need this to propagate assign to local readonly variables
17245 * typemanager.cs: Use a ptrhashtable for the criteria, because we
17246 do not want to reuse potential criteria memory.
17248 * class.cs (MyEventBuilder): Set reflected_type;
17250 * ecore.cs (Constantify): Added support for constifying bools.
17252 (RootContext.LookupType): Added a cache for values looked up in
17253 the declaration space.
17255 * typemanager.cs (FindMembers): Now is a front-end to
17256 RealFindMembers, and provides a two-level hashtable-based cache to
17259 15% performance improvement: from 22.5 to 19.2 seconds.
17261 * expression.cs (IsParamsMethodApplicable): use foreach.
17262 (Invocation.DoResolve): ditto.
17263 (New.DoResolve): ditto.
17264 (ArrayCreation.DoResolve): ditto.
17266 * ecore.cs (FindMostEncompassingType): use foreach.
17268 * delegate.cs (NewDelegate.DoResolve): Use foreach
17270 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17271 (RemoveMethods): use foreach.
17273 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17274 nested foreach statements instead of for, and also break out of
17275 the inner loop once a match is found.
17277 (Invocation.OverloadResolve): Use foreach, simplify the code.
17279 2002-05-08 Miguel de Icaza <miguel@ximian.com>
17281 * cfold.cs (BinaryFold): During an enumeration evaluation context,
17282 we actually unwrap the expression to allow for extra information
17285 * expression.cs: Use Shr_Un on unsigned operations.
17287 2002-05-08 Ravi Pratap <ravi@ximian.com>
17289 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
17290 applicable operators was not being considered correctly. This closes
17291 the bug Miguel reported.
17293 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17295 * attribute.cs: check that the type derives from System.Attribute
17296 and report the correct error in that case (moved the duplicate code to
17297 its own method, too).
17299 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17301 * attribute.cs: lookup attribute type name as the spec says: first the
17302 bare attribute name and then name + "Attribute" (nant compiles with
17303 mcs after this fix).
17305 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17307 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17308 Because of the way we parse things, we should try to see if a
17309 UIntConstant can fit in an integer.
17311 2002-05-07 Ravi Pratap <ravi@ximian.com>
17313 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17314 when we are in an explicit context.
17316 (ConvertReferenceExplicit): When converting from Iface type S to Class
17317 T make sure the rules are implemented as an OR.
17319 * parameter.cs (ParameterType): Make it a property for now although the
17320 purpose really isn't anything immediate.
17322 * expression.cs (Is*Applicable): Do better checking on the parameter type
17323 of a ref/out parameter. The ones from the system assemblies are already
17324 marked with the correct type so we don't need to do any correction.
17326 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17327 the object type is standard too so include that.
17329 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17331 * ecore.cs (StandardConversionExists): Augment with missing code:
17332 deal with IntConstant, LongConstants and Enumerations.
17334 * assign.cs: Report the error, instead of failing silently
17336 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17337 typecontainer that they are declared, because the
17338 typecontainer/namespace will have the list of using clauses that
17339 need to be applied.
17341 Assembly Attributes were escaping the normal registration
17344 (EmitCode): Apply attributes within an EmitContext that represents
17345 the container they were declared on.
17347 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17349 2002-05-06 Ravi Pratap <ravi@ximian.com>
17351 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17352 Revamp completely - make much cleaner as we now operate only
17355 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17356 to implement the logic detailed in the spec more correctly.
17358 (UserDefinedConversion): Update accordingly.
17360 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17362 * statement.cs: Return flow analysis information up.
17364 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17367 (token): Do not consume an extra character before calling
17370 2002-05-06 Piers Haken <piersh@friskit.com>
17372 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17374 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17376 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17377 EmitContext during the instance constructor initializer
17378 resolution, to stop access to instance variables.
17380 This is mandated by the spec, last paragraph of the `constructor
17381 initializers' section.
17383 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17385 * cs-parser.jay, class.cs (Accessor): new class used to represent
17386 an accessor (get or set). In the past we used `null' to represent
17387 a missing accessor. But this is ambiguous because there was no
17388 way to tell in abstract indexers/properties if one of them was
17391 Now there is a way of addressing that.
17393 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17394 instead of FindMembers.
17396 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17397 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17399 * attribute.cs: Treat indexers and properties as the same in terms
17400 of applying attributes
17402 * ecore.cs (FindMostEncompassedType): Use statically initialized
17403 EmptyExpressions()s like we do elsewhere to avoid creating useless
17404 objects (and we take this out of the tight loop).
17406 (GetConversionOperators): Move the code to extract the actual
17407 operators to a separate routine to clean things up.
17409 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17411 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17412 events are always registered FieldBuilders.
17414 * class.cs (FieldBase): New class shared by Fields
17416 * delegate.cs: If we are a toplevel delegate, use our full name.
17417 If we are a nested delegate, then only use our tail name.
17419 2002-05-02 Ravi Pratap <ravi@ximian.com>
17421 * expression.cs (IsApplicable): Ensure that we add the "&" to
17422 ref/out types before comparing it with the type of the argument.
17424 (IsParamsMethodApplicable): Ditto.
17426 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17429 * delegate.cs : Handle the case when we have more than one applicable
17430 method. Flag an error only when we finish checking all.
17432 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17434 * expression.cs: Add support for boolean static initializers.
17436 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17438 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17440 * parameter.cs (ComputeParameterTypes,
17441 ComputeAndDefineParameterTypes): Better error handling: now we
17442 clear the `types' cache if we fail during any of the type lookups.
17443 We also return the status code correctly to our caller
17445 * delegate.cs: If we fail to define a delegate, abort the extra
17448 * expression.cs (Binary.ResolveOperator): for
17449 operator==(object,object) and operator !=(object, object) we also
17450 have to verify that there is an implicit conversion from one to
17453 (ArrayAccess.DoResolve): Array Access can operate on
17456 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17458 * assign.cs (CompoundAssign): A new class used as a "flag" that
17459 the assignment actually is happening as part of a compound
17460 assignment operator.
17462 During compound assignment, a few new rules exist to enable things
17469 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17470 to the type of x) if y is implicitly convertible to the type of x,
17471 and the operator is a builtin operator and the return type of the
17472 operator is explicitly convertible to the type of x.
17474 * rootcontext.cs: Reset warning level to 2. 4 catches various
17475 "interesting" features in mcs, we must clean this up at some
17476 point, but currently am trying to kill other bugs ;-)
17478 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17479 in container classes as well.
17481 * expression.cs (Binary.ResolveOperator): Handle string case
17482 before anything else (as operator overloading does emit an error
17483 before doing anything else).
17485 This code could go away when we move to a table driven model, but
17486 i could not come up with a good plan last night.
17488 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17490 * typemanager.cs (CSharpName): reimplementation using regex.
17491 * class.cs: added null check for fields in Emit
17492 * rootcontext.cs: set warninglevel to 4
17494 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17496 * typemanager.cs (CSharpName): reimplemented with Lupus
17499 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17501 * statement.cs (If): correclty implement Resolve, because we were
17502 not catching sem errors in there. The same process is needed
17504 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17507 (Statement.Warning_DeadCodeFound): Factorize code.
17508 (While): Report dead code here too.
17510 (Statement): Added Resolve virtual method to allow
17511 for resolution split from the emit code.
17513 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17515 * statement.cs (EmitBoolExpression): No longer try to resolve the
17517 (MakeBoolean): New utility function that resolve, implicitly
17518 converts to boolean and tags the expression.
17521 (If, Do): Implement dead code elimination.
17522 (While): Implement loop inversion
17524 (Do, While, For, If): Resolve the expression prior to calling our
17527 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17530 - added method Report28 (warning: program has more than one entry point)
17531 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17532 - modified method Method.Define, the part at the end of the method
17534 * rootcontext.cs: added static public Location EntryPointLocation;
17536 * ../errors/cs0028.cs : Add test case for the above warning.
17539 - modified method CSharpName to allow arrays of primitive type to
17540 be printed nicely (e.g. instead of System.Int32[][] it now prints
17542 - added method CSharpSignature: returns the signature of a method
17543 in string format to be used in reporting errors, warnings, etc.
17545 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17548 2002-04-26 Ravi Pratap <ravi@ximian.com>
17550 * delegate.cs (Define): Fix extremely silly bug where I was
17551 setting the type of the 'object' parameter of the BeginInvoke
17552 method to System.IAsyncResult instead of System.Object ;-)
17554 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17556 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17559 (Constructor.Emit): return if we fail to initialize the
17560 constructor. Another door closed!
17562 * expression.cs (New.DoResolve): Improve error message (from -6 to
17563 1501). Use DeclaredOnly lookup to find the exact constructor.
17565 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17566 loop. This is useful.
17568 * cs-parser.jay: Adjust the default parameters so that destructors
17569 have the proper signature.
17571 2002-04-26 Martin Baulig <martin@gnome.org>
17573 * driver.cs (LoadAssembly): If `assembly' contains any characters
17574 which are only valid in path names and not in assembly names
17575 (currently slash, backslash and point), use Assembly.LoadFrom ()
17576 instead of Assembly.Load () on the `assembly' (before iteration
17577 over the link_paths).
17579 2002-04-26 Martin Baulig <martin@gnome.org>
17581 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17583 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17585 * class.cs (Property): use the new typemanager.MemberLookup
17587 (TypeContainer.MemberLookup): Implement using the
17588 TypeManager.MemberLookup now.
17590 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17591 and return MemberInfos, so that these can be used without an
17592 EmitContext (what we had before).
17594 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17596 * expression.cs: Fix the case where the argument to params if the
17597 type of the params. I omitted handling this before. Fixed
17599 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17601 * driver.cs: Call BootCorlib_PopulateCoreType
17603 * class.cs (Property.CheckBase): Check for properties only, not
17606 * interface.cs: Temporary hack: try/catch around the
17607 CustomAttributeBuilder, because I am getting an exception that I
17610 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17611 types whose definitions are required to be there (attributes are
17612 defined before standard types).
17614 Compute definitions as we boot the various types, as they are used
17615 immediately (value_type class will need object_type, but if we do
17616 not initialize object_type, we will pass a null, which will let
17617 the runtime pick the System.Object from the existing corlib, which
17618 is not what we want).
17620 2002-04-22 Patrik Torstensson <totte@labs2.com>
17622 * cs-tokenizer.cs: fixed a number of trim() issues.
17624 2002-04-22 Ravi Pratap <ravi@ximian.com>
17626 * expression.cs (Argument.Type): Ensure that we return the correct
17627 type when we have out or ref parameters [in which case we
17630 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17632 * class.cs (Property, Indexer): Allow extern modifier in there.
17634 * typemanager.cs (InitBaseTypes): Initializes object_type and
17635 value_type, since those will be used early on during the bootstrap
17636 process to compile corlib.
17638 (InitCoreTypes): Move code from here to InitBaseTypes.
17640 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17642 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17643 single-dimension arrays as using the ldlen opcode.
17645 Daniel Lewis discovered this optimization.
17647 * typemanager.cs: Add signature for System.Array::get_Length
17649 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17651 * statement.cs: report the error when the foreach does not apply to an
17652 array nor a collection.
17654 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17656 * expression.cs: Add implicit conversions to the operator ~.
17658 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17660 * typemanager.cs: Locate the decimal constructor.
17662 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17664 * attribute.cs: use the new property of TypeOf.
17665 * expression.cs: added 'get' property around typearg.
17667 These changes fix a build breaker reported by NickD. Is this the
17668 correct way to fix? If not, please, revert my changes and make it
17671 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17673 * attribute.cs: Add support for typeof in attribute invocations.
17674 I am not sure that this is right though.
17676 2002-04-14 Duncan Mak <duncan@ximian.com>
17678 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17679 Binary.Operator.Division case.
17681 2002-04-13 Ravi Pratap <ravi@ximian.com>
17683 * class.cs (DefineType): Ensure that we do a proper check on
17684 attribute types and also register it with the TypeManager.
17686 (TypeContainer.Targets): The default for attribute types is
17687 AttributeTargets.All.
17689 * attribute.cs (ApplyAttributes): Registering the attribute type
17690 is done elsewhere, not when we discover we have a Usage attribute.
17692 2002-04-12 Ravi Pratap <ravi@ximian.com>
17694 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17695 and get rid of is_delegate parameter.
17697 * everywhere : update.
17699 2002-04-12 Ravi Pratap <ravi@ximian.com>
17701 * cs-parser.jay (compilation_unit): Revamp completely to use
17702 some new ideas that I got from Rhys' grammar to solve the problems
17703 with assembly level attributes.
17705 (outer_declaration): New grammar production.
17707 (attribute_sections): Add.
17709 (opt_attributes): Base on attribute_sections
17711 (namespace_declaration): Allow opt_attributes to tackle the case
17712 when we have assembly level attributes - we are clever in this
17715 * attribute.cs (ApplyAttributes): Do not worry about assembly
17716 attributes in the non-global context.
17718 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17719 instead of SetGlobalAttributes.
17721 * class.cs, rootcontext.cs : Ensure we define and generate
17722 attribute types before anything else.
17724 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17725 and flag the new error -20 for the case when the attribute type
17726 does not have valid targets specified. csc does not catch this.
17728 * ../errors/errors.txt : update for error # -20
17730 2002-04-11 Ravi Pratap <ravi@ximian.com>
17732 * support.cs (InternalParameters.ParameterModifier): Do some null
17733 checking and return sane values.
17735 * class.cs (Method.Define): If we are a PInvoke method, ensure
17736 that we are static and extern. Report error # 601
17738 * ../errors/cs0601.cs : Add test case for the above error.
17740 2002-04-07 Ravi Pratap <ravi@ximian.com>
17742 * rootcontext.cs (attribute_types): We need to keep type of
17743 all attribute types separately and emit code for them first.
17745 (RegisterAttribute) : Implement.
17747 * class.cs (DefineType): Check if the current Type is a custom
17748 attribute type and register it accordingly.
17750 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17751 adding the first attribute twice and rename to
17753 (SetGlobalAttributes): this.
17755 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17758 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17759 if we are processing global arguments. Hmm, I am unsure of this.
17761 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17763 * expression.cs: added static array of strings to avoid calling
17764 Enum.ToString () for Operator in Binary. Significant recover of
17767 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17769 * class.cs (FindMembers): Allow the Builders of the various
17770 members to be null. If they are skip them. This only happens
17771 during the PInvoke declaration.
17773 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17775 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17776 failure, so we do not keep going afterwards.
17778 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17779 wanted to pass `false' as the `is_delegate' argument. If this is
17780 the case, why not use delegate_type == null to mean `is_delegate =
17781 false' and anything else as is_delegate = true.
17783 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17785 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17786 code for the section, not the beginning of the tests.
17788 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17790 * cfold.cs: Handle operator + (Enum x, Underlying x)
17792 * expression.cs (Binary): same. Warn about errors where we have
17793 Enum/Enum in operator + as well.
17795 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17798 - added support for switch(bool)
17799 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17800 - add TableSwitchEmit() to handle table-based switch statements
17802 2002-04-05 Ravi Pratap <ravi@ximian.com>
17804 * expression.cs (Invocation.OverloadResolve): Factor out code which
17805 does parameter compatibility checking with arguments so that we can
17806 re-use the code even from Delegate.VerifyApplicability
17808 (VerifyArgumentsCompat): Move above code here.
17810 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17811 and instead make a call to the above method.
17813 2002-03-31 Ravi Pratap <ravi@ximian.com>
17815 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17816 We use it to keep track of classes which are attribute types.
17818 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17820 * delegate.cs (Delegate.Define): Correctly define the types in the
17821 presence of fixed and array parameters.
17823 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17826 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17827 include NonPublic after the first iteration.
17829 * class.cs (Indexer.CheckBase): Only check if both parents are
17832 * cs-parser.jay (accessor_body): If empty, set to null.
17834 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17835 same code path here to resolve constants names that we did have in
17836 MemberAccess.DoResolve. There is too much code duplicated here.
17838 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17840 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17842 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17845 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17846 tokens, numbers and strings.
17848 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17851 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17852 asyncronous parameters and the regular parameters.
17854 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17855 specify the target directory.
17857 * expression.cs: (This.DoResolve): Simplify
17858 (As.Emit): Optimize, do not generate IsInst if the expression is
17859 always of the given type.
17861 (Is.DoResolve): Bug fix, we were reporting both always/never for
17864 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17865 creating too many unnecessary arrays.
17867 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17869 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17870 fields instead of rolling our own initializer. Takes care of all
17871 implicit conversions, and drops unnecessary static checks/argument.
17873 2002-03-31 Dick Porter <dick@ximian.com>
17875 * driver.cs: use the GetDirectories() return values properly, and
17876 use "/" as path separator.
17878 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17880 * expression.cs (Unary): Optimize - - expr into expr.
17881 (Binary): Optimize a + (-b) into a -b.
17883 * codegen.cs (CodeGen): Made all methods static.
17885 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17889 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17890 TypeBuilder property.
17892 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17895 * tree.cs: Removed the various RecordXXXX, and replaced with a
17896 single RecordDecl. Removed all the accessor methods, and just
17897 left a single access point Type
17899 * enum.cs: Rename DefineEnum to DefineType.
17901 * decl.cs: New abstract method `DefineType' used to unify the
17902 Defines for Enumerations, Interfaces, TypeContainers and
17905 (FindType): Moved LookupInterfaceOrClass here. Moved the
17906 LookupBaseClasses method that used to live in class.cs and
17907 interface.cs here, and renamed to FindType.
17909 * delegate.cs: Implement DefineType. Take advantage of the
17910 refactored pattern for locating the parent builder without taking
17911 the parent_builder argument (which we know does not work if we are
17912 nested, and triggering a toplevel definition).
17914 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17916 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17917 accessibility of a member has changed during override and report
17920 * class.cs (Method.Define, Property.Define): Only complain on
17921 overrides if the method is private, any other accessibility is
17922 fine (and since we just checked the permission is the same, we are
17925 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17926 and elif are processed always. The other pre-processing
17927 directives are only processed if we are "taking" the path
17929 2002-03-29 Martin Baulig <martin@gnome.org>
17931 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17932 current location is not Null.
17934 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17935 a separate method so we can profile it.
17937 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17938 `span.Seconds' are just seconds, but no minutes or hours.
17939 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17941 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17943 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17944 Remove the gratuitous set of Final:
17946 // If an interface implementation, then we can set Final.
17947 if (((flags & MethodAttributes.Abstract) == 0) &&
17948 implementing.DeclaringType.IsInterface)
17949 flags |= MethodAttributes.Final;
17951 I do not know what I was smoking when I used that.
17954 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17955 step into fixing the name resolution issues for delegates and
17956 unifying the toplevel name resolution.
17958 2002-03-28 Martin Baulig <martin@gnome.org>
17960 * class.cs (Method.Emit): If we have a symbol writer, call its
17961 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17962 tell it about the current method.
17964 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17965 writer that we're going to emit the first byte of IL code for a new
17966 statement (a new source line).
17967 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17968 EmitContext.Mark() before emitting any code.
17970 * location.cs (SymbolDocument): Return null when we're Null.
17972 * statement.cs (Statement): Moved the `Location loc' variable here.
17973 (Statement.EmitBoolExpression): If we have a symbol writer, call
17974 ec.Mark() before emitting any code to tell it that we're at the
17975 beginning of a new statement.
17976 (StatementExpression): Added `Location' argument to the constructor.
17977 (Block): Added public readonly variable `StartLocation' and public
17978 variable `EndLocation'. The latter is to be set using SetEndLocation().
17979 (Block): Added constructor which takes a start and end location.
17980 (Block.SetEndLocation): New method. This sets the end location.
17981 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17982 local variables we create.
17983 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17984 each statement and do also mark the begin and end of the block.
17986 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17987 tell it the current lexer.Location, use Location.Null for the end of the
17989 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17990 current block, set its end location using SetEndLocation().
17991 (statement_expression): StatementExpression constructor now takes the
17992 lexer.Location as additional argument.
17993 (for_statement, declare_local_variables): Likewise.
17994 (declare_local_variables): When creating a new implicit block, use the
17995 new Block constructor and pass it the lexer.Location.
17997 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17999 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18000 members also on the parent interfaces recursively.
18002 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18004 * report.cs: Use new formats, since Gonzalo finished the missing
18007 * expression.cs (Binary.ResolveOperator): added missing operator|
18008 operator& and operator^ for bool/bool.
18010 * cs-parser.jay: CheckDef now takes a Location argument that is
18011 used to report errors more precisly (instead of reporting the end
18012 of a definition, we try to track something which is a lot closer
18013 to the source of the problem).
18015 * cs-tokenizer.cs: Track global token use, so we can properly flag
18016 the use of #define/#undef after the first token has been seen.
18018 Also, rename the reportXXXX to Error_DescriptiveName
18020 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18021 TypeContainer, so that Enum and Interface can use this too.
18023 * class.cs (TypeContainer.LookupInterfaceOrClass,
18024 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18025 `builder' argument. Typically this was used to pass the parent
18026 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18029 The problem is that a nested class could trigger the definition of
18030 a toplevel class, and the builder would be obviously wrong in that
18033 So we drop this argument, and we compute dynamically the
18034 TypeBuilder/ModuleBuilder (the correct information was available
18035 to us anyways from DeclSpace.Parent)
18037 * interface.cs (Interface.DefineInterface): Drop builder
18038 parameter cleanup like class.cs
18040 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18043 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18046 (Try.Emit): Propagate the returns value from the statement.
18048 (Return.Emit): Even if we are leavning
18050 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18052 * modifiers.cs: Fix the computation of MethodAttributes flags.
18054 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18056 * driver.cs: allow compilation of files that start with '/'.
18057 Add a default case when checking the argument of --target.
18059 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18061 * interface.cs: Implement the same search algorithm for types in
18062 the interface code.
18064 * delegate.cs: Do not allow multiple definition.
18066 * Recovered ChangeLog that got accidentally amputated
18068 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18070 * rootcontext.cs: Load manually enum to allow core classes to
18071 contain enumerations.
18073 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18074 Update to new static methods in TypeManager.
18076 * typemanager.cs (GetMethod, GetConstructor): Use our
18077 implementation of FindMembers to find the members, since during
18078 corlib compilation, the types are TypeBuilders and GetMethod and
18079 GetConstructor do not work.
18081 Make all methods in TypeManager static.
18083 (InitCodeHelpers): Split the functionality from
18084 the InitCodeTypes function.
18086 * driver.cs: Call InitCodeHelpers after we have populated the
18089 * cs-parser.jay (delegate_declaration): we did not used to compute
18090 the delegate name correctly for void delegates.
18092 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18094 * rootcontext.cs (RootContext): Init the interface_resolve_order
18095 and type_container_resolve_order always.
18097 (ResolveCore, BootstrapCorlib_ResolveClass,
18098 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18099 compiler when compiling with --nostdlib
18101 * class.cs (TypeContainer.DefineType): Check that our parent is
18102 not null. This test is most important when we are bootstraping
18105 * codegen.cs: Split out the symbol writing code.
18107 2002-03-25 Martin Baulig <martin@gnome.org>
18109 * driver.cs (-g): Made -g an alias for --debug.
18111 2002-03-24 Martin Baulig <martin@gnome.org>
18113 * codegen.cs (SymbolWriter): New public variable. Returns the
18114 current symbol writer.
18115 (CodeGen): Added `bool want_debugging_support' argument to the
18116 constructor. If true, tell the ModuleBuild that we want debugging
18117 support and ask it for the ISymbolWriter.
18118 (Save): If we have a symbol writer, call it's Close() method after
18119 saving the assembly.
18121 * driver.c (--debug): New command line argument to create a
18122 debugger information file.
18124 * location.cs (SymbolDocument): New public property. Returns an
18125 ISymbolDocumentWriter object for the current source file or null
18126 if we don't have a symbol writer.
18128 2002-03-21 Miguel de Icaza <miguel@ximian.com>
18130 * driver.cs (LoadAssembly): Correctly return when all the paths
18131 have been tried and not before.
18133 * statement.cs (Switch.Emit): return the actual coverage for this
18134 statement (returns/not-returns)
18136 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18137 switch of the statement if we are the last switch section. That
18138 kills two problems: try/catch problems (we used to emit an empty
18139 nop at the end) and switch statements where all branches would
18142 2002-03-19 Miguel de Icaza <miguel@ximian.com>
18144 * driver.cs: Add default assemblies (the equivalent to the
18145 Microsoft CSC.RSP file)
18147 * cs-tokenizer.cs: When updating `cols and setting it to zero,
18148 also update tokens_seen and set it to false.
18150 * driver.cs: Implement --recurse for Mike.
18152 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18153 correctly splitting out the paths.
18155 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18157 * interface.cs (Interface.PopulateProperty): Instead of using
18158 `parent' as the declaration space for the set parameters, use
18161 * support.cs (InternalParameters): InternalParameters constructor
18162 takes a DeclSpace instead of a TypeContainer.
18164 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18165 types are being initialized, load the address of it before calling
18168 (New): Provide a mechanism to disable the generation of local
18169 value type temporaries when the caller will be providing us with
18170 an address to store it.
18172 (ArrayCreation.EmitDynamicInitializers): Use it.
18174 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18176 * expression.cs (Invocation.EmitArguments): Only probe for array
18177 property if there is more than one argument. Sorry about that.
18179 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18180 empty param arrays.
18182 * class.cs (Method.LabelParameters): Fix incorrect code path that
18183 prevented the `ParamArrayAttribute' from being applied to the
18186 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18188 * support.cs (ReflectionParameters): Correctly compute whether the
18189 last argument is a params array. Fixes the problem with
18192 * typemanager.cs: Make the assemblies array always be non-null
18193 (empty, but non-null)
18195 * tree.cs (RecordDecl): New function that abstracts the recording
18196 of names. This reports error 101, and provides a pointer to the
18197 previous declaration. Fixes a crash in the compiler.
18199 * cs-parser.jay (constructor_declaration): Update to new grammar,
18200 and provide a constructor_body that can be empty.
18202 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18204 * driver.cs: Add support for --resources.
18206 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18207 Make all types for the various array helper methods be integer.
18209 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18210 CheckState to ConvCast.
18212 (ConvCast): Now it takes a `checked' state argument, to avoid
18213 depending on the emit context for the conversion, and just using
18214 the resolve time setting.
18216 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18217 instead of Invocation.EmitArguments. We do not emit the original
18218 arguments, instead we emit those which have been converted to
18219 unsigned int expressions.
18221 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18223 * codegen.cs: ditto.
18225 * expression.cs (LocalVariableReference): Drop the use of the
18226 Store function that depended on the variable index.
18228 * statement.cs (VariableInfo): Drop the `Idx' property from this
18229 class, as this is not taking into account the indexes for
18230 temporaries tat we generate during the execution, getting the
18233 * class.cs: First emit class initializers, then call the parent
18236 * expression.cs (Binary): Fix opcode emision.
18237 (UnaryMutator.EmitCode): Support checked code generation
18239 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18240 matches for events for both the Static and Instance scans,
18241 pointing to the same element. Fix that.
18243 2002-03-14 Miguel de Icaza <miguel@ximian.com>
18245 * rootcontext.cs (ResolveTree): Always set the
18246 interface_resolve_order, because nested interfaces will be calling
18249 * class.cs (GetInterfaceOrClass): Track the same resolution
18250 process used by TypeManager.LookupType. This fixes the nested
18251 type lookups in class declarations (separate path from
18254 (TypeContainer.DefineType): Also define nested interfaces.
18255 (TypeContainer.RegisterOrder): New public function used to
18256 register the order in which child interfaces need to be closed.
18258 Nested interfaces need to be closed after their parents have been
18261 * interface.cs (InterfaceAttr): Put all the logic for computing
18262 the interface attribute here.
18264 (DefineInterface): Register our interface order with the
18265 RootContext or with the TypeContainer depending on the case.
18267 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18269 * cs-parser.jay: rework foreach statement to work with the new
18270 changes to the policy on SimpleNames.
18272 * report.cs: support Stacktrace on warnings as well.
18274 * makefile: drop --unsafe and /unsafe from the compile.
18276 2002-03-13 Ravi Pratap <ravi@ximian.com>
18278 * ecore.cs (StandardConversionExists): Modify to take an Expression
18279 as the first parameter. Ensure we do null -> reference type conversion
18282 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18283 temporary Expression objects.
18285 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18287 * interface.cs: workaround bug in method overloading resolution
18288 (there is already a bugzilla bug for it).
18290 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18292 We could also solve this problem by having a separate path for
18293 performing type lookups, instead of DoResolve, we could have a
18294 ResolveType entry point, and only participating pieces of the
18295 production (simplename, deref, array) would implement this.
18297 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18298 signal SimpleName to only resolve type names and not attempt to
18299 resolve anything else.
18301 * expression.cs (Cast): Set the flag.
18303 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18305 * class.cs: Only report 108 if there is no `new' modifier.
18307 * cs-parser.jay: rework foreach statement to work with the new
18308 changes to the policy on SimpleNames.
18310 * report.cs: support Stacktrace on warnings as well.
18312 * makefile: drop --unsafe and /unsafe from the compile.
18314 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18316 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18317 lookups here, instead of doing that at parse time. This means
18318 that our grammar will not introduce `LocalVariableReferences' as
18319 expressions at this point. That solves the problem of code like
18323 static void Main ()
18327 This is only half the fix. The full fix requires parameters to
18328 also be handled in this way.
18330 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18331 makes the use more obvious of the DeclSpace. The
18332 ec.TypeContainer.TypeBuilder is now only used to pull the
18333 TypeBuilder for it.
18335 My theory is that I can get rid of the TypeBuilder completely from
18336 the EmitContext, and have typecasts where it is used (from
18337 DeclSpace to where it matters).
18339 The only pending problem is that the code that implements Aliases
18340 is on TypeContainer, and probably should go in DeclSpace.
18342 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18343 lookups here, instead of doing that at parse time. This means
18344 that our grammar will not introduce `LocalVariableReferences' as
18345 expressions at this point. That solves the problem of code like
18349 static void Main ()
18353 This is only half the fix. The full fix requires parameters to
18354 also be handled in this way.
18356 * class.cs (Property.DefineMethod): When implementing an interface
18357 method, set newslot, when implementing an abstract method, do not
18358 set the flag (before we tried never setting it, or always setting
18359 it, which is the difference).
18360 (Indexer.DefineMethod): same.
18361 (Method.DefineMethod): same.
18363 * ecore.cs: Only set the status used flag if we get back a Field.
18365 * attribute.cs: Temporary hack, so Paolo can keep working.
18367 2002-03-08 Ravi Pratap <ravi@ximian.com>
18369 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18370 the unmanaged type in the case we have a MarshalAs attribute.
18372 (Resolve): Handle the case when we are parsing the special MarshalAs
18373 attribute [we need to store the unmanaged type to use later]
18375 * typemanager.cs (marshal_as_attr_type): Built in type for the
18376 MarshalAs Attribute.
18378 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18379 on parameters and accordingly set the marshalling info.
18381 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18383 * class.cs: Optimizing slightly by removing redundant code after
18384 we switched to the `NoTypes' return value.
18385 (Property.DefineMethod): use NoTypes here too.
18387 This fixes the bug I introduced in my last batch of changes.
18389 2002-03-05 Ravi Pratap <ravi@ximian.com>
18391 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18393 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18394 Enums since those are types too.
18396 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18398 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18399 thanks to a call during the lookup process.
18401 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18403 * statement.cs (Foreach): Lots of work to accomodate a particular
18404 kind of foreach statement that I had not kept in mind. It is
18405 possible to have foreachs on classes that provide a GetEnumerator
18406 method that return objects that implement the "pattern" for using
18407 a foreach, there is no need to support GetEnumerator
18410 This is needed to compile nant.
18412 * decl.cs: Only report 114 if the member is not `Finalize' and if
18413 the warning level is at least 2.
18415 * class.cs: Moved the compare function from Method to
18418 (MethodSignature.InheritableMemberSignatureCompare): Add new
18419 filter function that is used to extract inheritable methods from a
18422 (Method.Define): Use the new `inheritable_method_signature_filter'
18425 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18428 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18430 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18432 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18434 * expression.cs: Pass location information to
18435 ConvertImplicitStandard.
18437 * class.cs: Added debugging code to track return values from
18440 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18442 * expression.cs (Is.DoResolve): If either side of the `is' is an
18443 interface, do not flag the warning.
18445 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18448 * report.cs: Allow for --fatal to be used with --probe.
18450 * typemanager.cs (NoTypes): Move the definition for the empty Type
18453 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18455 (TypeContainer.DefineProxy): New function used to proxy to parent
18456 implementations when implementing interfaces.
18457 (TypeContainer.ParentImplements): used to lookup if our parent
18458 implements a public function that is required by an interface.
18459 (TypeContainer.VerifyPendingMethods): Hook this up.
18461 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18462 `modules' and `assemblies' arraylists into arrays. We only grow
18463 these are the very early start up of the program, so this improves
18464 the speedof LookupType (nicely measured).
18466 * expression.cs (MakeByteBlob): Replaced unsafe code with
18467 BitConverter, as suggested by Paolo.
18469 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18470 folding of string concatenation, but if either side is a string,
18471 and the other is not, then return null, and let the runtime use
18472 the concatenation on the string plus the object (using
18473 `Object.ToString').
18475 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18477 Constant Folding has been implemented now.
18479 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18480 the error instead on types that are not supported in one's
18483 * constant.cs (Constant and all children): New set of functions to
18484 perform implict and explicit conversions.
18486 * ecore.cs (EnumConstant): Implement the new functions to perform
18487 conversion by proxying to the child expression.
18489 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18490 own separate setting that can not be turned off from the command
18491 line using --unchecked or --checked and is only controlled using
18492 the checked/unchecked statements and expressions. This setting is
18493 used by the constant folder to flag errors.
18495 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18496 ConstantCheckState as well.
18498 During Resolve, they also have to flag the state, because the
18499 constant folder runs completely in the Resolve phase.
18501 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18504 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18506 * cfold.cs: New file, this file contains the constant folder.
18508 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18509 argument to track whether we are using the resulting address to
18510 load or store a value and provide better error messages.
18512 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18513 new AddressOf arguments.
18515 * statement.cs (Foreach.EmitCollectionForeach): Update
18517 * expression.cs (Argument.Emit): Call AddressOf with proper
18518 arguments to track usage.
18520 (New.DoEmit): Call AddressOf with new arguments.
18522 (Unary.Emit): Adjust AddressOf call.
18524 2002-03-01 Ravi Pratap <ravi@ximian.com>
18526 * cs-parser.jay (member_access): Change the case for pre-defined types
18527 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18530 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18533 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18534 essentially like methods and apply attributes like MethodImplOptions to them too.
18536 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18539 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18540 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18543 * Update code everywhere accordingly.
18545 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18547 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18549 2002-02-28 Ravi Pratap <ravi@ximian.com>
18551 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18552 try performing lookups against those instead of jumping straight into using
18553 the 'using' clauses.
18555 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18557 (LookupType): Perform lookups in implicit parents too.
18559 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18560 sequence as RootContext.LookupType.
18562 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18563 the various cases of namespace lookups into this method.
18565 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18567 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18568 in positional arguments)
18570 * class.cs (Operator): Update the AllowedModifiers to contain
18573 * cs-parser.jay: Update operator declaration to allow for the
18574 operator body to be empty.
18576 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18579 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18581 * class.cs (Method.Emit): Label parameters.
18583 * driver.cs: Return 1 or 0 as the program exit code.
18585 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18587 * expression.cs: Special case the `null' object when trying to
18588 auto-compute the type, as anything can be explicitly converted to
18591 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18592 spotting this Paolo.
18594 (Expression.ImplicitNumericConversion): Perform comparissions of
18595 the type using the underlying type in the case of an enumeration
18596 rather than using the enumeration type for the compare.
18598 Cope with the underlying == type case, which is not possible to
18601 (Expression.ConvertNumericExplicit): Perform comparissions of
18602 the type using the underlying type in the case of an enumeration
18603 rather than using the enumeration type for the compare.
18605 * driver.cs: If the user does not supply an extension, assume .exe
18607 * cs-parser.jay (if_statement): Rewrote so that we can track the
18608 location for the if statement.
18610 * expression.cs (Binary.ConstantFold): Only concat strings when
18611 the operation is "+", not everything ;-)
18613 * statement.cs (Statement.EmitBoolExpression): Take a location
18615 (If, While, Do): Track location.
18617 * expression.cs (Binary.ResolveOperator): In the object + string
18618 case, I was missing a call to ConvertImplicit
18620 2002-02-25 Ravi Pratap <ravi@ximian.com>
18622 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18623 Location arguments. Ensure we use RootContext.LookupType to do our work
18624 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18626 * interface.cs (PopulateMethod): Handle the type of the parameter being
18629 * expression.cs (Invocation.BetterFunction): Handle the case when we
18630 have a params method with no fixed arguments and a call is made with no
18633 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18635 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18636 the verbatim-string-literal
18638 * support.cs (InternalParameters.ParameterModifier): handle null
18640 (InternalParameters.ParameterType): ditto.
18642 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18643 duplicating the name of the variable parameter.
18644 (GetParameterByName): Fix bug where we were not looking up array
18645 paramters if they were the only present (thanks Paolo!).
18646 (GetParameterInfo): We only have an empty set of types if both
18647 fixed and array are set to null.
18648 (GetParameterInfo-idx): Handle FixedParameter == null
18650 * cs-parser.jay: Handle the case where there is no catch
18651 statements (missing null test).
18653 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18655 * driver.cs (MainDriver): Be conservative on our command line
18658 Catch DirectoryNotFoundException when calling GetFiles.
18660 (SplitPathAndPattern): Used to split the input specification into
18661 a path and a pattern that we can feed to Directory.GetFiles.
18663 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18665 * statement.cs (Fixed): Implement the last case of the Fixed
18666 statement (string handling).
18668 * expression.cs (StringPtr): New class used to return a char * to
18669 a string; Used by the Fixed statement.
18671 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18673 * expression.cs (Binary.ResolveOperator): Remove redundant
18674 MemberLookup pn parent type.
18675 Optimize union call, we do not need a union if the types are the same.
18676 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18679 Specialize the use of MemberLookup everywhere, instead of using
18680 the default settings.
18682 (StackAlloc): Implement stackalloc keyword.
18684 * cs-parser.jay: Add rule to parse stackalloc.
18686 * driver.cs: Handle /h, /help, /?
18688 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18689 before we supported unsafe code.
18691 * makefile: add --unsafe to the self compilation of mcs.
18693 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18695 * expression.cs (PointerArithmetic): New class that is used to
18696 perform pointer arithmetic.
18697 (Binary.Resolve): Handle pointer arithmetic
18698 Handle pointer comparission.
18699 (ArrayPtr): Utility expression class that is used to take the
18700 address of an array.
18702 (ElementAccess): Implement array access for pointers
18704 * statement.cs (Fixed): Implement fixed statement for arrays, we
18705 are missing one more case before we are done.
18707 * expression.cs (Indirection): Implement EmitAssign and set the
18708 ExprClass to Variable. This allows pointer dereferences to be
18709 treated as variables, and to have values assigned to them.
18711 * ecore.cs (Expression.StoreFromPtr): New utility function to
18712 store values dereferencing.
18714 2002-02-20 Ravi Pratap <ravi@ximian.com>
18716 * expression.cs (Binary.ResolveOperator): Ensure that we are
18717 not trying to operate on a void type - this fixes the reported
18720 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18721 the parent implementation is sealed.
18723 * ../errors/cs0239.cs : Add.
18725 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18727 * typemanager.cs (unverifiable_code_type): Corresponds to
18728 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18729 which have unsafe code in them.
18731 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18734 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18736 * cs-tokenizer.cs: Add support for @"litreal strings"
18738 Make tokenizer accept pre-processor directives
18739 on any column (remove the old C-like limitation).
18741 * rootcontext.cs (EmitCode): Emit any global attributes.
18742 (AddGlobalAttributes): Used to keep track of assembly attributes.
18744 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18746 * cs-parser.jay: Add support for global attributes.
18748 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18750 * expression.cs (Indirection): New helper class. Unary will
18751 create Indirection classes to be able to implement the
18752 IMemoryLocation interface on it.
18754 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18756 * cs-parser.jay (fixed_statement): reference the right statement.
18758 * statement.cs (Fixed.Emit): Finish implementing the fixed
18759 statement for the &x case.
18761 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18763 * class.cs (Property.Define, Method.Define): Remove newslot when
18766 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18767 wrong. NewSlot should only be used if the `new' keyword is present.
18769 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18770 locating our system dir. Sorry about this.
18772 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18774 * driver.cs (GetSystemDir): Compute correctly the location of our
18775 system assemblies. I was using the compiler directory instead of
18776 the library directory.
18778 2002-02-13 Ravi Pratap <ravi@ximian.com>
18780 * expression.cs (BetterFunction): Put back in what Miguel commented out
18781 since it is the correct fix. The problem is elsewhere ;-)
18783 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18784 parameters of the parms method are themselves compatible or not !
18786 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18787 to check that a class implements an interface before saying that an implicit
18788 conversion was allowed. Use ImplementsInterface to do the checking.
18790 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18792 * class.cs (Method.Define): Track whether we are an explicit
18793 implementation or not. And only call DefineMethodOverride if we
18794 are an explicit implementation.
18796 (Property.DefineMethod): Ditto.
18798 2002-02-11 Ravi Pratap <ravi@ximian.com>
18800 * expression.cs (BetterFunction): Catch hideous bug which was
18801 preventing us from detecting ambiguous calls due to implicit casts i.e
18804 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18806 * support.cs (Pair): Remove un-needed method. I figured why I was
18807 getting the error in cs-parser.jay, the variable in a foreach loop
18808 is readonly, and the compiler does not really treat this as a variable.
18810 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18811 instead of EQUALS in grammar.
18813 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18815 * expression.cs (Unary.DoResolve): Check whether the argument is
18818 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18820 * support.cs: Api for Pair to set a value. Despite the fact that
18821 the variables are public the MS C# compiler refuses to compile
18822 code that accesses the field if the variable is part of a foreach
18825 * statement.cs (Fixed): Begin implementation of the fixed
18828 (Block.AddVariable): Return the VariableInfo on success and null
18829 on failure instead of true/false.
18831 * cs-parser.jay (foreach): Catch errors on variables already
18832 defined (we were ignoring this value before) and properly unwind
18833 the block hierarchy
18835 (fixed_statement): grammar for the fixed statement.
18837 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18839 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18840 pointer types to be incretemented.
18842 (SizeOf): Implement.
18844 * cs-parser.jay (pointer_member_access): Implement
18845 expr->IDENTIFIER production.
18847 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18848 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18851 (Unary): Implement indirection.
18853 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18854 use in non-unsafe context).
18856 (SimpleName.DoResolve): Check for pointers in field access on safe
18859 (Expression.LoadFromPtr): Factor the load-indirect code in this
18860 function. This was duplicated in UnboxCast and ParameterReference
18862 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18864 * expression.cs (ComposedCast): report an error if a pointer cast
18865 is used in a safe region.
18867 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18868 pointer type casts in unsafe context.
18870 * codegen.cs (EmitContext): Set up IsUnsafe.
18872 * cs-parser.jay (non_expression_type): Add productions for pointer
18875 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18876 code. We should not use force into static mode if the method is
18877 not virtual. Fixes bug in MIS
18879 * statement.cs (Do.Emit, While.Emit, For.Emit,
18880 Statement.EmitBoolExpression): Add support to Do and While to
18881 propagate infinite loop as `I do return' semantics.
18883 Improve the For case to also test for boolean constants.
18885 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18886 to the list of attributes we can add.
18888 Remove `EmitContext' argument.
18890 * class.cs (Method.Define): Apply parameter attributes.
18891 (Constructor.Define): Apply parameter attributes.
18892 (MethodCore.LabelParameters): Move here the core of labeling
18895 * support.cs (ReflectionParameters.ParameterModifier,
18896 InternalParameters.ParameterModifier): Use IsByRef on the type and
18897 only return the OUT bit for these parameters instead of in/out/ref
18900 This is because I miss-understood things. The ParameterInfo.IsIn
18901 and IsOut represent whether the parameter has the [In] and [Out]
18904 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18906 * ecore.cs (FieldExpr.Emit): Release temporaries.
18908 * assign.cs (LocalTemporary.Release): new function.
18910 * codegen.cs (EmitContext.GetTemporaryStorage,
18911 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18912 temporary storage. Now we can "put back" localbuilders when we
18915 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18917 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18918 need to make a copy of the variable to generate verifiable code.
18920 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18922 * driver.cs: Compute dynamically the system directory.
18924 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18925 Slower, but more generally useful. Used by the abstract
18926 registering implementation.
18928 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18929 the rules for the special rule on Type/instances. First check if
18930 we have the same name, and if so, try that special static path
18931 rather than the instance path.
18933 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18935 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18938 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18939 Enum, ValueType, Delegate or Array for non-corlib compiles.
18941 * cs-tokenizer.cs: Catch long identifiers (645)
18943 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18946 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18947 fix, we were returning too early, so we were not registering
18948 pending methods from abstract classes.
18950 Do not register pending methods if the class is abstract.
18952 * expression.cs (Conditional.DoResolve): Report circular implicit
18953 conversions when we neecd to compute it for conditional
18956 (Is.DoResolve): If the expression is always of the provided type,
18957 flag warning 183. If the expression can not ever be of the
18958 provided type flag warning 184.
18960 * class.cs: Catch 169 as well.
18962 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18965 2002-01-18 Nick Drochak <ndrochak@gol.com>
18967 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18969 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18971 * interface.cs: (PopulateMethod): Check for pointers being defined
18972 only if the unsafe context is active.
18973 (PopulateProperty): ditto.
18974 (PopulateIndexer): ditto.
18976 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18977 specified. If pointers are present, make sure that they are
18978 present in an unsafe context.
18979 (Constructor, Constructor.Define): ditto.
18980 (Field, Field.Define): ditto.
18981 (Property, Property.Define): ditto.
18982 (Event, Event.Define): ditto.
18984 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18985 hashtable if there are classes or structs defined.
18987 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18988 code, as the constant resolution moved.
18990 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18991 the metadata, so we can flag error 133.
18993 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18994 pointer is being declared in an unsafe context.
18996 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18998 * modifiers.cs (Modifiers.Check): Require a Location argument.
18999 Report error 227 for Unsafe use.
19001 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19003 * statement.cs (For.Emit): If the test is null, then report that
19004 we do `return', as we wont reach anything afterwards.
19006 (Switch.SwitchGoverningType): Track the expression that matched
19009 * driver.cs: Allow negative numbers as an error code to flag.
19011 * cs-parser.jay: Handle 1551.
19013 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19015 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19017 * cs-parser.jay: Report 1518 (type declaration can only contain
19018 class, struct, interface, enum or delegate)
19020 (switch_label): Report 1523 (keywords `case' or `default' must
19023 (opt_switch_sections): Report 1522 (empty switch)
19025 * driver.cs: Report 1515 (response file specified multiple times)
19026 Report 1516 (Source file specified multiple times).
19028 * expression.cs (Argument.Resolve): Signal 1510
19030 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19031 access not allowed in static code)
19033 2002-01-11 Ravi Pratap <ravi@ximian.com>
19035 * typemanager.cs (IsPointerType): Utility method which we are going
19038 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19039 the object type, so we take care of that.
19041 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19043 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19044 added to non-params parameters :-)
19046 * typemanager.cs (CSharpName): Include 'void' type too.
19048 (void_ptr_type): Include in the set of core types.
19050 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19053 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19056 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19057 completely forgotten about it.
19059 2002-01-10 Ravi Pratap <ravi@ximian.com>
19061 * cs-parser.jay (pointer_type): Add. This begins our implementation
19062 of parsing rules for unsafe code.
19064 (unsafe_statement): Implement.
19066 (embedded_statement): Modify to include the above.
19068 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19070 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19071 if the current context is an unsafe one.
19073 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19074 are handled differently, we need separate rules for them.
19076 (local_variable_declaration): Update to use local_variable_pointer_type
19077 to allow variable declarations of unmanaged pointer types.
19079 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19080 in unsafe contexts.
19082 * ../errors/cs0214.cs : Add.
19084 2002-01-16 Nick Drochak <ndrochak@gol.com>
19086 * makefile: remove 'response' file when cleaning.
19088 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19090 * cs-parser.jay: Report 1524.
19092 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19094 * typemanager.cs (RegisterMethod): drop checking if we have
19095 registered this from here
19097 2002-01-12 Miguel de Icaza <miguel@ximian.com>
19099 * class.cs (Method.EmitDestructor): Implement calling our base
19102 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19103 value of InFinally.
19105 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19106 this routine and will wrap the call in a try/catch block. Deal
19109 2002-01-11 Miguel de Icaza <miguel@ximian.com>
19111 * ecore.cs (Expression.MemberLookup): instead of taking a
19112 parameter `same_type' that was used to tell whether we could
19113 access private members we compute our containing type from the
19116 (FieldExpr): Added partial support for volatile fields. This does
19117 not work for volatile fields exposed from assemblies, as I can not
19118 figure out how to extract the modreq from it.
19120 Updated all the source files to use this.
19122 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19123 because it is referenced by MemberLookup very often.
19125 2002-01-09 Ravi Pratap <ravi@ximian.com>
19127 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19128 TypeBuilder.GetCustomAttributes to retrieve what we need.
19130 Get rid of redundant default_member_attr_type as this is the same as
19131 default_member_type which already exists.
19133 * interface.cs, attribute.cs : Update accordingly.
19135 2002-01-08 Miguel de Icaza <miguel@ximian.com>
19137 * typemanager.cs: Enable IndexerPropertyName again. It does not
19138 work for TYpeBuilders though. Ravi, can you please fix this?
19140 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19142 * expression.cs (Argument.Emit): Handle the case of ref objects
19143 being passed to ref functions;
19145 (ParameterReference.EmitLoad): Loads the content of the pointer
19146 without dereferencing.
19148 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19150 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19152 2002-01-08 Ravi Pratap <ravi@ximian.com>
19154 * class.cs (Indexer.DefineMethod): Incorporate the interface
19155 type in the name of the method if we are doing explicit interface
19158 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19160 (BetterConversion): Fix extremely trivial bug where we were referring to
19161 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19164 * ../errors/bug16.cs : Add although we have fixed it.
19166 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19168 * expression.cs (BaseIndexer): Begin implementation.
19170 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19172 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19173 production directly to remove a shift/reduce, and implement
19174 explicit interface implementation.
19176 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19177 after a floating point suffix.
19179 * expression.cs (DoNumericPromotions): Improved the conversion for
19180 uint/uint. If we have a constant, we avoid doing a typecast to a
19183 * class.cs (Indexer): Implement explicit interface implementation
19186 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19188 * class.cs: make the default instance constructor public and hidebysig.
19190 2001-01-03 Ravi Pratap <ravi@ximian.com>
19192 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19193 so we can call it from elsewhere.
19195 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19196 we emit it internally if the class has a defined indexer; otherwise the user
19197 emits it by decorating the class definition with the DefaultMemberAttribute.
19199 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19200 attribute is not used on a type which defines an indexer.
19202 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19203 character when we skip whitespace.
19205 * ../errors/cs0646.cs : Add.
19207 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19209 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19212 * makefile: Add practical target `mcs3.exe' which builds the third
19213 generation compiler.
19215 * expression.cs (New): Fix structures constructor calling.
19217 * class.cs (Property, Method, Indexer): Emit Final flag on the
19218 method if we are an interface implementation and we are not
19221 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19222 whether this property is referencing a `base' method.
19224 * expression.cs (Invocation.EmitCall): take an extra argument:
19225 is_base, this is used to determine whether the `call' or
19226 `callvirt' opcode should be used.
19229 * delegate.cs: update EmitCall.
19231 * class.cs (Method.Define): Set NewSlot for the cases where we are
19232 not implementing an interface method.
19234 (Property.Define): ditto.
19236 2002-01-02 Miguel de Icaza <miguel@ximian.com>
19238 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19239 'r'. Allows mcs to parse itself fully.
19241 2002-01-02 Ravi Pratap <ravi@ximian.com>
19243 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19244 of the number of initializers that require the InitializeArray method.
19246 (CheckIndices): Store the Expression in all cases - not the plain value. Also
19247 update the above field where necessary.
19249 (MakeByteBlob): Update accordingly.
19251 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
19254 (EmitDynamicInitializers): Update in accordance with the new optimization.
19256 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19257 same OpCode applies.
19259 * cs-parser.jay : Fix some glaring errors I introduced.
19261 2002-01-01 Ravi Pratap <ravi@ximian.com>
19263 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19264 so that we can check for name clashes there too.
19266 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19267 for interface indexers.
19269 * interfaces.cs (Define): Emit the default member attribute.
19271 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19272 variable was being referred to while setting the value ;-)
19274 2002-01-01 Miguel de Icaza <miguel@ximian.com>
19276 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19277 byte-by-byte information when we know the data is zero.
19279 Make the block always a multiple of 4, because
19280 DefineInitializedData has a bug.
19282 * assign.cs: Fix, we should assign from the temporary, not from
19285 * expression.cs (MakeByteBlob): Fix my incorrect code.
19287 2001-12-31 Miguel de Icaza <miguel@ximian.com>
19289 * typemanager.cs (EnumToUnderlying): This function is used to get
19290 the underlying type from an enumeration, because it does not
19293 * constant.cs: Use the I4_S form for values between -128 and 127.
19295 * statement.cs (Block.LookupLabel): Looks up a label.
19296 (Block): Drop support for labeled blocks.
19298 (LabeledStatement): New kind of statement that represents a label
19301 (Goto): Finally implement this bad boy.
19303 * cs-parser.jay: Update to reflect new mechanism to implement
19306 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19308 * codegen.cs (EmitContext.This): a codegen property that keeps the
19309 a single instance of this instead of creating many different this
19312 * delegate.cs (Delegate.DoResolve): Update to use the property;
19314 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19316 * expression.cs (BaseAccess.DoResolve): Ditto.
19318 2001-12-29 Ravi Pratap <ravi@ximian.com>
19320 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19321 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19323 (InitCoreTypes): Update accordingly.
19325 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19326 so we can quickly store the state.
19328 (ApplyAttributes): Set the correct implementation flags
19329 for InternalCall methods.
19331 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19333 * expression.cs (EmitCall): if a method is not virtual, then do
19334 not use callvirt on it.
19336 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19337 user defined stuff) requires the use of stobj, which takes an
19338 address on the stack instead of an array and an index. So emit
19339 the Ldelema operation for it.
19341 (EmitStoreOpcode): Use stobj for valuetypes.
19343 (UnaryMutator.EmitCode): Use the right 1 value depending on
19344 whether we are dealing with int64/uint64, float or doubles.
19346 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19347 constructors that I implemented last night.
19349 (Constructor.IsDefault): Fix to work properly for static
19352 * cs-parser.jay (CheckDef): report method signature errors.
19353 Update error number 103 to be 132.
19355 * decl.cs: New AdditionResult enumeration value: MethodExists.
19356 Although we do this check for methods later on in the semantic
19357 analysis, catching repeated default constructors is so easy that
19358 we catch these here.
19360 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19363 (ParameterReference.EmitAssign, Emit): handle
19366 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19367 (ArrayAccess.EmitStoreOpcode): ditto.
19369 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19371 * expression.cs (MakeByteBlob): Complete all the missing types
19372 (uint, short, ushort, byte, sbyte)
19374 * class.cs: Only init instance field initializers on instance
19377 Rename `constructors' to instance_constructors.
19379 (TypeContainer.AddConstructor): Only add constructors to the list
19380 if it is not static.
19382 Make sure that we handle default_static_constructor independently
19383 everywhere where we handle instance_constructors
19385 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19387 * class.cs: Do not lookup or create a base initializer for a
19388 static constructor.
19390 (ConstructorInitializer.Resolve): use the proper type to lookup
19393 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19395 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19398 * decl.cs: CloseType is now an virtual method, the default
19399 implementation just closes this type.
19401 2001-12-28 Ravi Pratap <ravi@ximian.com>
19403 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19404 to PreserveSig by default. Also emit HideBySig on such methods.
19406 Basically, set the defaults to standard values.
19408 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19409 argument, if candidate is better, it can't be worse than the best !
19411 (Invocation): Re-write bits to differentiate between methods being
19412 applicable in their expanded form and their normal form - for params
19415 Get rid of use_standard everywhere as only standard conversions are allowed
19416 in overload resolution.
19418 More spec conformance.
19420 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19422 * driver.cs: Add --timestamp, to see where the compiler spends
19425 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19426 `this' in static code.
19428 (SimpleName.DoResolve): Implement in terms of a helper function
19429 that allows static-references to be passed upstream to
19432 (Expression.ResolveWithSimpleName): Resolve specially simple
19433 names when called by MemberAccess to implement the special
19436 (Expression.ImplicitReferenceConversion): Handle conversions from
19437 Null to reference types before others, as Null's type is
19440 * expression.cs (Invocation.EmitCall): Handle the special case of
19441 calling methods declared on a reference type from a ValueType
19442 (Base classes System.Object and System.Enum)
19444 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19445 the left hand side is a TypeExpr, not on every enumeration.
19447 (Binary.Resolve): If types are reference types, then do a cast to
19448 object on operators != and == of both arguments.
19450 * typemanager.cs (FindMembers): Extract instance and static
19451 members if requested.
19453 * interface.cs (PopulateProperty): Use void_type instead of null
19454 as the return type for the setter method.
19456 (PopulateIndexer): ditto.
19458 2001-12-27 Ravi Pratap <ravi@ximian.com>
19460 * support.cs (ReflectionParameters): Fix minor bug where we
19461 were examining the wrong parameter for the ParamArray attribute.
19463 Cope with requests for the type of the parameter at position
19464 greater than the params parameter's. We now return the element
19465 type of the params array as that makes more sense.
19467 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19468 accordingly as we no longer have to extract the element type
19471 (Invocation.OverloadResolve): Update.
19473 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19475 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19476 against IEnumerator, test whether the return value is a descendant
19477 of the IEnumerator interface.
19479 * class.cs (Indexer.Define): Use an auxiliary method to implement
19480 the other bits of the method definition. Begin support for
19481 explicit interface implementation.
19483 (Property.DefineMethod): Use TypeManager.void_type instead of null
19484 for an empty return value.
19486 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19488 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19489 dealing with a FieldExpr which is composed of a FieldBuilder, in
19490 the code path we did extract the constant, but we should have
19491 obtained the underlying value to be able to cast it (otherwise we
19492 end up in an infinite loop, this is what Ravi was running into).
19494 (ArrayCreation.UpdateIndices): Arrays might be empty.
19496 (MemberAccess.ResolveMemberAccess): Add support for section
19497 14.5.4.1 that deals with the special case of E.I when E is a type
19498 and something else, that I can be a reference to a static member.
19500 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19501 handle a particular array type to create byte blobs, it is just
19502 something we dont generate byteblobs for.
19504 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19507 * location.cs (Push): remove the key from the hashtable that we
19508 are about to add. This happens for empty files.
19510 * driver.cs: Dispose files after we have parsed them.
19512 (tokenize): new function that only runs the tokenizer on its
19513 input, for speed testing.
19515 2001-12-26 Ravi Pratap <ravi@ximian.com>
19517 * class.cs (Event.Define): Define the private field only if there
19518 are no accessors defined.
19520 * expression.cs (ResolveMemberAccess): If there is no associated
19521 field with the event, that means we have an event defined with its
19522 own accessors and we should flag error cs0070 since transforming
19523 ourselves into a field is not valid in that case.
19525 * ecore.cs (SimpleName.DoResolve): Same as above.
19527 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19528 and charset to sane values.
19530 2001-12-25 Ravi Pratap <ravi@ximian.com>
19532 * assign.cs (DoResolve): Perform check on events only if they
19533 are being accessed outside the declaring type.
19535 * cs-parser.jay (event_declarations): Update rules to correctly
19536 set the type of the implicit parameter etc.
19538 (add_accessor, remove_accessor): Set current local parameters.
19540 * expression.cs (Binary): For delegate addition and subtraction,
19541 cast the return value from the method into the appropriate delegate
19544 2001-12-24 Ravi Pratap <ravi@ximian.com>
19546 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19547 of these as the workaround is unnecessary.
19549 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19550 delegate data - none of that is needed at all.
19552 Re-write bits to extract the instance expression and the delegate method
19555 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19558 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19559 of attaching attributes instead of duplicating code everywhere.
19561 * everywhere : Update code to do attribute emission using the above method.
19563 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19565 * expression.cs (IsParamsMethodApplicable): if there are not
19566 parameters, return immediately.
19568 * ecore.cs: The 0 literal can be implicity converted to an enum
19571 (SimpleName.DoResolve): First lookup the type, then lookup the
19574 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19575 want to get its address. If the InstanceExpression is not
19576 addressable, store the result in a temporary variable, then get
19579 * codegen.cs: Only display 219 errors on warning level or above.
19581 * expression.cs (ArrayAccess): Make it implement the
19582 IMemoryLocation interface.
19584 (Binary.DoResolve): handle the operator == (object a, object b)
19585 and operator != (object a, object b) without incurring into a
19586 BoxedCast (because 5 != o should never be performed).
19588 Handle binary enumerator operators.
19590 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19591 value type, otherwise use Ldelem_ref.
19593 Use precomputed names;
19595 (AddressOf): Implement address of
19597 * cs-parser.jay (labeled_statement): Fix recursive block
19598 addition by reworking the production.
19600 * expression.cs (New.DoEmit): New has a special case:
19602 If we are dealing with a ValueType, we have a few
19603 situations to deal with:
19605 * The target of New is a ValueType variable, that is
19606 easy, we just pass this as the variable reference
19608 * The target of New is being passed as an argument,
19609 to a boxing operation or a function that takes a
19612 In this case, we need to create a temporary variable
19613 that is the argument of New.
19616 2001-12-23 Ravi Pratap <ravi@ximian.com>
19618 * rootcontext.cs (LookupType): Check that current_type is not null before
19619 going about looking at nested types.
19621 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19622 not implement the IAssignMethod interface any more.
19624 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19625 where we tranform them into FieldExprs if they are being resolved from within
19626 the declaring type.
19628 * ecore.cs (SimpleName.DoResolve): Do the same here.
19630 * assign.cs (DoResolve, Emit): Clean up code considerably.
19632 * ../errors/bug10.cs : Add.
19634 * ../errors/cs0070.cs : Add.
19636 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19638 * assign.cs : Get rid of EventIsLocal everywhere.
19640 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19642 * ecore.cs (ConvertIntLiteral): finished the implementation.
19644 * statement.cs (SwitchLabel): Convert the value we are using as a
19645 key before looking up the table.
19647 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19649 * codegen.cs (EmitTopBlock): Require a Location argument now.
19651 * cs-parser.jay (constructor_declarator): We need to setup
19652 current_local_parameters before we parse the
19653 opt_constructor_initializer, to allow the variables to be bound
19654 to the constructor arguments.
19656 * rootcontext.cs (LookupType): First lookup nested classes in our
19657 class and our parents before we go looking outside our class.
19659 * expression.cs (ConstantFold): Extract/debox the values at the
19662 * rootcontext.cs (EmitCode): Resolve the constants first before we
19663 resolve the types. This is not really needed, but it helps debugging.
19665 * statement.cs: report location.
19667 * cs-parser.jay: pass location to throw statement.
19669 * driver.cs: Small bug fix.
19671 * report.cs: Updated format to be 4-zero filled digits.
19673 2001-12-22 Ravi Pratap <ravi@ximian.com>
19675 * expression.cs (CheckIndices): Fix minor bug where the wrong
19676 variable was being referred to ;-)
19678 (DoEmit): Do not call EmitStaticInitializers when the
19679 underlying type is System.Object.
19681 2001-12-21 Ravi Pratap <ravi@ximian.com>
19683 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19684 and do the usual workaround for SRE.
19686 * class.cs (MyEventBuilder.EventType): New member to get at the type
19687 of the event, quickly.
19689 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19691 * assign.cs (Assign.DoResolve): Handle the case when the target
19692 is an EventExpr and perform the necessary checks.
19694 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19697 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19699 (EventExpr): Set the type in the constructor itself since we
19700 are meant to be born fully resolved.
19702 (EventExpr.Define): Revert code I wrote earlier.
19704 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19705 instance expression is null. The instance expression is a This in that case
19706 or a null, depending on whether it is a static method or not.
19708 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19709 refers to more than one method.
19711 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19712 and accordingly flag errors.
19714 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19716 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19718 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19720 * location.cs (ToString): Provide useful rutine.
19722 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19724 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19725 objects, return the actual integral boxed.
19727 * statement.cs (SwitchLabel): define an ILLabel for each
19730 (Switch.CheckSwitch): If the value is a Literal, extract
19731 the underlying literal.
19733 Also in the unused hashtable we had, add the SwitchLabel so we can
19734 quickly look this value up.
19736 * constant.cs: Implement a bunch of new constants. Rewrite
19737 Literal based on this. Made changes everywhere to adapt to this.
19739 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19740 dereferencing array only once, and also copes with enumrations.
19742 bytes are two bytes wide, not one.
19744 (Cast): Perform constant conversions.
19746 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19747 wrappers to the literals here.
19749 * expression.cs (DoNumericPromotions): long literals can converted
19750 to ulong implicity (this is taken care of elsewhere, but I was
19751 missing this spot).
19753 * ecore.cs (Expression.Literalize): Make the return type Literal,
19754 to improve type checking.
19756 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19758 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19760 * literal.cs: Revert code from ravi that checked the bounds. The
19761 bounds are sane by the definition of the type itself.
19763 * typemanager.cs: Fix implementation of ImplementsInterface. We
19764 need to actually look up in our parent hierarchy for interfaces
19767 * const.cs: Use the underlying type for enumerations
19769 * delegate.cs: Compute the basename for the delegate creation,
19770 that should fix the delegate test case, and restore the correct
19771 Type Lookup semantics in rootcontext
19773 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19774 referencing a nested type with the Reflection API is using the "+"
19777 * cs-parser.jay: Do not require EOF token at the end.
19779 2001-12-20 Ravi Pratap <ravi@ximian.com>
19781 * rootcontext.cs (LookupType): Concatenate type names with
19782 a '.' instead of a '+' The test suite passes again.
19784 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19785 field of the enumeration.
19787 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19788 the case when the member is an EventExpr.
19790 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19791 static has an associated instance expression.
19793 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19795 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19797 * class.cs (Event.Define): Register event and perform appropriate checks
19800 We define the Add and Remove methods even if the use provides none because
19801 in that case, we provide default implementations ourselves.
19803 Define a private field of the type of the event. This is done by the CSC compiler
19804 and we should be doing it too ;-)
19806 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19807 More methods we use in code we generate.
19809 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19812 (InitCoreTypes): Update accordingly for the above.
19814 * class.cs (Event.Emit): Generate code for default accessors that we provide
19816 (EmitDefaultMethod): Do the job in the above.
19818 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19821 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19823 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19824 builders even if we were missing one.
19826 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19827 pass the Basename as our class name instead of the Name. The
19828 basename will be correctly composed for us.
19830 * parameter.cs (Paramters): Now takes a Location argument.
19832 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19833 make all the code call directly LookupType in RootContext and take
19834 this chance to pass the Location information everywhere.
19836 * Everywhere: pass Location information.
19838 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19840 * class.cs (Constructor.Define): Updated way of detecting the
19841 length of the parameters.
19843 (TypeContainer.DefineType): Use basename as the type name for
19846 (TypeContainer.Define): Do not recursively define types here, as
19847 definition is taken care in order by the RootContext.
19849 * tree.cs: Keep track of namespaces in a per-file basis.
19851 * parameter.cs (Parameter.ComputeSignature): Update to use
19854 (Parameters.GetSignature): ditto.
19856 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19857 instead of a TypeContainer.
19859 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19860 resolve names. Because we need to be resolve in our context, not
19863 * driver.cs: Implement response files.
19865 * class.cs (TypeContainer.DefineType): If we are defined, do not
19866 redefine ourselves.
19868 (Event.Emit): Emit the code for add/remove handlers.
19869 (Event.Define): Save the MethodBuilders for add/remove.
19871 * typemanager.cs: Use pair here too.
19873 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19874 DictionaryEntry requires the first argument to be non-null.
19876 (enum_declaration): Compute full name for registering the
19879 (delegate_declaration): Instead of using
19880 formal_parameter_list, use opt_formal_parameter_list as the list
19883 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19884 (EventParsing): New property that controls whether `add' and
19885 `remove' are returned as tokens or identifiers (for events);
19887 2001-12-19 Ravi Pratap <ravi@ximian.com>
19889 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19890 use MyEventBuilder only and let it wrap the real builder for us.
19892 (MyEventBuilder): Revamp constructor etc.
19894 Implement all operations that we perform on EventBuilder in precisely the same
19897 (FindMembers): Update to use the EventBuilder member.
19899 (Event.Emit): Update accordingly.
19901 2001-12-18 Ravi Pratap <ravi@ximian.com>
19903 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19904 by calling the appropriate methods.
19906 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19909 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19911 2001-12-17 Ravi Pratap <ravi@ximian.com>
19913 * delegate.cs (Delegate.Populate): Check that the return type
19914 and various parameters types are indeed accessible.
19916 * class.cs (Constructor.Define): Same here.
19918 (Field.Define): Ditto.
19920 (Event.Define): Ditto.
19922 (Operator.Define): Check that the underlying Method defined itself
19923 correctly - so it's MethodBuilder should not be null.
19925 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19926 expression happens to be null.
19928 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19929 members but as of now we don't seem to be able to do anything really useful with it.
19931 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19932 not the EventBuilder.
19934 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19936 * cs-tokenizer.cs: Add support for defines.
19937 Add support for #if, #elif, #else, #endif
19939 (eval_var): evaluates a variable.
19940 (eval): stubbed for evaluating functions.
19942 * cs-parser.jay: Pass the defines information
19944 * driver.cs: Add --define command line option.
19946 * decl.cs: Move MemberCore here.
19948 Make it the base class for DeclSpace. This allows us to catch and
19949 report 108 and 109 for everything now.
19951 * class.cs (TypeContainer.Define): Extract all the members
19952 before populating and emit the warning 108 (new keyword required
19953 to override) instead of having each member implement this.
19955 (MemberCore.Define): New abstract method, we will be using this in
19956 the warning reporting engine in Populate.
19958 (Operator.Define): Adjust to new MemberCore protocol.
19960 * const.cs (Const): This does not derive from Expression, it is a
19961 temporary object we use to create fields, it is a MemberCore.
19963 * class.cs (Method.Define): Allow the entry point to be in a
19966 * driver.cs: Rewrite the argument handler to clean it up a bit.
19968 * rootcontext.cs: Made it just an auxiliary namespace feature by
19969 making everything static.
19971 * driver.cs: Adapt code to use RootContext type name instead of
19974 * delegate.cs: Remove RootContext argument.
19976 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19979 * class.cs (Event.Define): The lookup can fail.
19981 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19983 * expression.cs: Resolve the this instance before invoking the code.
19985 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19987 * cs-parser.jay: Add a production in element_access that allows
19988 the thing to become a "type" reference. This way we can parse
19989 things like "(string [])" as a type.
19991 Note that this still does not handle the more complex rules of
19995 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19997 * ecore.cs: (CopyNewMethods): new utility function used to
19998 assemble the list of methods from running FindMembers.
20000 (MemberLookup): Rework FindMembers so that
20002 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20004 * class.cs (TypeContainer): Remove Delegates who fail to be
20007 * delegate.cs (Populate): Verify that we dont get null return
20008 values. TODO: Check for AsAccessible.
20010 * cs-parser.jay: Use basename to emit error 574 (destructor should
20011 have the same name as container class), not the full name.
20013 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20014 possible representation.
20016 Also implements integer type suffixes U and L.
20018 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20020 * expression.cs (ArrayCreation.DoResolve): We need to do the
20021 argument resolution *always*.
20023 * decl.cs: Make this hold the namespace. Hold the root context as
20025 (LookupType): Move here.
20027 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20029 * location.cs (Row, Name): Fixed the code, it was always returning
20030 references to the first file.
20032 * interface.cs: Register properties defined through interfaces.
20034 * driver.cs: Add support for globbing on the command line
20036 * class.cs (Field): Make it derive from MemberCore as well.
20039 2001-12-15 Ravi Pratap <ravi@ximian.com>
20041 * class.cs (Event::Define): Check that the type of the event is a delegate
20042 type else flag error #66.
20044 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20047 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20048 values of EntryPoint, CharSet etc etc.
20050 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20052 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20053 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20054 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20055 which needs this to do its work.
20057 * ../errors/cs0066.cs : Add.
20059 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20061 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20064 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20065 clears out the parameters field.
20066 (MemberSignatureCompare): Cleanup
20068 (MemberCore): New base class used to share code between MethodCore
20071 (RegisterRequiredImplementations) BindingFlags.Public requires
20072 either BindingFlags.Instace or Static. Use instance here.
20074 (Property): Refactored code to cope better with the full spec.
20076 * parameter.cs (GetParameterInfo): Return an empty array instead
20079 * class.cs (Property): Abstract or extern properties have no bodies.
20081 * parameter.cs (GetParameterInfo): return a zero-sized array.
20083 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20084 method modifier validation to the typecontainer so we can reuse
20085 this on properties.
20087 (MethodCore.ParameterTypes): return an empty sized array of types.
20089 (Property.Define): Test property modifier validity.
20091 Add tests for sealed/override too.
20093 (Method.Emit): abstract or extern methods have no bodies.
20095 2001-12-14 Ravi Pratap <ravi@ximian.com>
20097 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20100 (Method::Define, ::Emit): Modify accordingly.
20102 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20104 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20106 * makefile: Pass in /unsafe.
20108 2001-12-13 Miguel de Icaza <miguel@ximian.com>
20110 * class.cs (MakeKey): Kill routine.
20112 * class.cs (TypeContainer.Define): Correctly define explicit
20113 method implementations (they require the full interface name plus
20116 * typemanager.cs: Deply the PtrHashtable here and stop using the
20117 lame keys. Things work so much better.
20119 This of course broke everyone who depended on `RegisterMethod' to
20120 do the `test for existance' test. This has to be done elsewhere.
20122 * support.cs (PtrHashtable): A hashtable that avoid comparing with
20123 the object stupid Equals method (because, that like fails all over
20124 the place). We still do not use it.
20126 * class.cs (TypeContainer.SetRequiredInterface,
20127 TypeContainer.RequireMethods): Killed these two routines and moved
20128 all the functionality to RegisterRequiredImplementations.
20130 (TypeContainer.RegisterRequiredImplementations): This routine now
20131 registers all the implementations required in an array for the
20132 interfaces and abstract methods. We use an array of structures
20133 which can be computed ahead of time to reduce memory usage and we
20134 also assume that lookups are cheap as most classes will not
20135 implement too many interfaces.
20137 We also avoid creating too many MethodSignatures.
20139 (TypeContainer.IsInterfaceMethod): Update and optionally does not
20140 clear the "pending" bit if we find that there are problems with
20143 (TypeContainer.VerifyPendingMethods): Update to report errors of
20144 methods that look like implementations but are not.
20146 (TypeContainer.Define): Add support for explicit interface method
20149 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20151 * typemanager.cs: Keep track of the parameters here instead of
20152 being a feature of the TypeContainer.
20154 * class.cs: Drop the registration of parameters here, as
20155 InterfaceMethods are also interface declarations.
20157 * delegate.cs: Register methods with the TypeManager not only with
20158 the TypeContainer. This code was buggy.
20160 * interface.cs: Full registation here.
20162 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20164 * expression.cs: Remove reducer for binary expressions, it can not
20167 * const.cs: Put here the code that used to go into constant.cs
20169 * constant.cs: Put here the code for constants, this is a new base
20170 class for Literals.
20172 * literal.cs: Make Literal derive from Constant.
20174 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20176 * statement.cs (Return.Emit): Report error 157 if the user
20177 attempts to return from a finally block.
20179 (Return.Emit): Instead of emitting a return, jump to the end of
20182 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20183 LocalBuilder to store the result of the function. ReturnLabel is
20184 the target where we jump.
20187 2001-12-09 Radek Doulik <rodo@ximian.com>
20189 * cs-parser.jay: remember alias in current namespace
20191 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20194 * class.cs (LookupAlias): lookup alias in my_namespace
20196 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20198 (LookupAlias): lookup alias in this and if needed in parent
20201 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20205 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20206 making things static. I need this to avoid passing the
20207 TypeContainer when calling ParameterType.
20209 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20210 that did string manipulation to compute the type and then call
20211 GetType. Use Parameter.ParameterType instead.
20213 * cs-tokenizer.cs: Consume the suffix for floating values.
20215 * expression.cs (ParameterReference): figure out whether this is a
20216 reference parameter or not. Kill an extra variable by computing
20217 the arg_idx during emission.
20219 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20220 function that returns whether a parameter is an out/ref value or not.
20222 (Parameter.ParameterType): The type of the parameter (base,
20223 without ref/out applied).
20225 (Parameter.Resolve): Perform resolution here.
20226 (Parameter.ExternalType): The full type (with ref/out applied).
20228 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20229 support for expressions on the using statement.
20231 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20233 * statement.cs (Using.EmitLocalVariableDecls): Split the
20234 localvariable handling of the using statement.
20236 (Block.EmitMeta): Keep track of variable count across blocks. We
20237 were reusing slots on separate branches of blocks.
20239 (Try.Emit): Emit the general code block, we were not emitting it.
20241 Check the type of the declaration to be an IDisposable or
20242 something that can be implicity converted to it.
20244 Emit conversions if required.
20246 * ecore.cs (EmptyExpression): New utility class.
20247 (Expression.ImplicitConversionExists): New utility function.
20249 2001-12-06 Miguel de Icaza <miguel@ximian.com>
20251 * statement.cs (Using): Implement.
20253 * expression.cs (LocalVariableReference): Support read only variables.
20255 * statement.cs: Remove the explicit emit for the Leave opcode.
20256 (VariableInfo): Add a readonly field.
20258 2001-12-05 Miguel de Icaza <miguel@ximian.com>
20260 * ecore.cs (ConvCast): new class used to encapsulate the various
20261 explicit integer conversions that works in both checked and
20262 unchecked contexts.
20264 (Expression.ConvertNumericExplicit): Use new ConvCast class to
20265 properly generate the overflow opcodes.
20267 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20269 * statement.cs: The correct type for the EmptyExpression is the
20270 element_type, not the variable type. Ravi pointed this out.
20272 2001-12-04 Ravi Pratap <ravi@ximian.com>
20274 * class.cs (Method::Define): Handle PInvoke methods specially
20275 by using DefinePInvokeMethod instead of the usual one.
20277 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20278 above to do the task of extracting information and defining the method.
20280 2001-12-04 Ravi Pratap <ravi@ximian.com>
20282 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20283 of the condition for string type.
20285 (Emit): Move that here.
20287 (ArrayCreation::CheckIndices): Keep string literals in their expression
20290 (EmitDynamicInitializers): Handle strings appropriately.
20292 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20294 * codegen.cs (EmitContext): Replace multiple variables with a
20295 single pointer to the current Switch statement.
20297 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20300 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20304 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20307 (Foreach.Emit): Foreach on arrays was not setting
20308 up the loop variables (for break/continue).
20310 (GotoCase): Semi-implented.
20312 2001-12-03 Ravi Pratap <ravi@ximian.com>
20314 * attribute.cs (CheckAttribute): Handle system attributes by using
20315 Attribute.GetAttributes to examine information we need.
20317 (GetValidPlaces): Same here.
20319 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20321 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20323 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20325 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20327 (Method::Emit): Handle the case when we are a PInvoke method.
20329 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20331 * expression.cs: Use ResolveWithSimpleName on compound names.
20333 2001-12-02 Ravi Pratap <ravi@ximian.com>
20335 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20336 before trying to reduce it.
20338 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20340 * constant.cs (LookupConstantValue): Implement.
20342 (EmitConstant): Use the above in emitting the constant.
20344 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20345 that are user-defined by doing a LookupConstantValue on them.
20347 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20350 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20352 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20354 (BaseAccess.DoResolve): Implement.
20356 (MemberAccess.DoResolve): Split this routine into a
20357 ResolveMemberAccess routine that can be used independently
20359 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20361 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20362 As that share bits of the implementation. Is returns a boolean,
20363 while As returns the Type that is being probed.
20365 2001-12-01 Ravi Pratap <ravi@ximian.com>
20367 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20368 instead of a Literal - much easier.
20370 (EnumInTransit): Remove - utterly useless :-)
20372 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20374 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20376 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20377 chain when we have no associated expression.
20379 2001-11-30 Ravi Pratap <ravi@ximian.com>
20381 * constant.cs (Define): Use Location while reporting the errror.
20383 Also emit a warning when 'new' is used and there is no inherited
20386 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20389 (LookupEnumValue): Implement to lookup an enum member's value and define it
20392 (Populate): Re-write accordingly to use the above routine.
20394 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20396 * expression.cs (This): Fix prototype for DoResolveLValue to
20397 override the base class DoResolveLValue.
20399 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20402 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20403 (we need to load the address of the field here). This fixes
20406 (FieldExpr.DoResolveLValue): Call the DoResolve
20407 function to initialize the Instance expression.
20409 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20410 correctly the GetEnumerator operation on a value type.
20412 * cs-parser.jay: Add more simple parsing error catches.
20414 * statement.cs (Switch): Add support for string switches.
20415 Handle null specially.
20417 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20419 2001-11-28 Ravi Pratap <ravi@ximian.com>
20421 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20423 (declare_local_constant): New helper function.
20425 * statement.cs (AddConstant): Keep a separate record of constants
20427 (IsConstant): Implement to determine if a variable is a constant.
20429 (GetConstantExpression): Implement.
20431 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20433 * statement.cs (IsVariableDefined): Re-write.
20435 2001-11-27 Ravi Pratap <ravi@ximian.com>
20437 * class.cs (TypeContainer::FindMembers): Look for constants
20438 in the case when we are looking for MemberTypes.Field
20440 * expression.cs (MemberAccess::DoResolve): Check that in the
20441 case we are a FieldExpr and a Literal, we are not being accessed
20442 by an instance reference.
20444 * cs-parser.jay (local_constant_declaration): Implement.
20446 (declaration_statement): Implement for constant declarations.
20448 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20450 * statement.cs (Switch): Catch double defaults.
20452 (Switch): More work on the switch() statement
20453 implementation. It works for integral values now, need to finish
20457 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20459 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20460 integer literals into other integer literals. To be used by
20463 2001-11-24 Ravi Pratap <ravi@ximian.com>
20465 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20468 (EmitDynamicInitializers): Cope with the above since we extract data
20469 directly from ArrayData now.
20471 (ExpectInitializers): Keep track of whether initializers are mandatory
20474 (Bounds): Make it a hashtable to prevent the same dimension being
20475 recorded for every element in that dimension.
20477 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20480 Also fix bug which was causing the indices to be emitted in the reverse
20483 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20485 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20486 unfinished. They do not work, because the underlying code is
20489 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20491 * cs-parser.jay: Remove bogus fixme.
20493 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20494 on Switch statement.
20496 2001-11-23 Ravi Pratap <ravi@ximian.com>
20498 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20501 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20502 parameter. Apparently, any expression is allowed.
20504 (ValidateInitializers): Update accordingly.
20506 (CheckIndices): Fix some tricky bugs thanks to recursion.
20508 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20509 I was being completely brain-dead.
20511 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20512 and re-write acordingly.
20514 (DelegateInvocation): Re-write accordingly.
20516 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20518 (MakeByteBlob): Handle types more correctly.
20520 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20521 initialization from expressions but it is incomplete because I am a complete
20524 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20526 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20527 on If. Basically, we have to return `true' (ie, we do return to
20528 our caller) only if both branches of the if return.
20530 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20531 short-circuit operators, handle them as short circuit operators.
20533 (Cast.DoResolve): Resolve type.
20534 (Cast.Cast): Take an expression as the target type.
20536 * cs-parser.jay (cast_expression): Remove old hack that only
20537 allowed a limited set of types to be handled. Now we take a
20538 unary_expression and we resolve to a type during semantic
20541 Use the grammar productions from Rhys to handle casts (this is
20542 not complete like Rhys syntax yet, we fail to handle that corner
20543 case that C# has regarding (-x), but we will get there.
20545 2001-11-22 Ravi Pratap <ravi@ximian.com>
20547 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20548 field which is an array type.
20550 * cs-parser.jay (declare_local_variables): Support array initialization too.
20552 * typemanager.cs (MakeKey): Implement.
20554 (everywhere): Use the above appropriately.
20556 * cs-parser.jay (for_statement): Update for array initialization while
20557 declaring variables.
20559 * ecore.cs : The error message was correct, it's the variable's names that
20560 were misleading ;-) Make the code more readable.
20562 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20563 the correct type etc.
20565 (ConvertExplicit): Handle Enum types by examining the underlying type.
20567 2001-11-21 Ravi Pratap <ravi@ximian.com>
20569 * parameter.cs (GetCallingConvention): Always return
20570 CallingConventions.Standard for now.
20572 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20574 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20575 and `r' after calling DoNumericPromotions.
20577 * ecore.cs: Fix error message (the types were in the wrong order).
20579 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20580 BindingFlags.Instance as well
20582 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20583 implicit int literal conversion in an empty cast so that we
20584 propagate the right type upstream.
20586 (UnboxCast): new class used to unbox value types.
20587 (Expression.ConvertExplicit): Add explicit type conversions done
20590 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20591 the target type before applying the implicit LongLiterals to ULong
20594 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20596 * cs-parser.jay (for_statement): Reworked the way For works: now
20597 we declare manually any variables that are introduced in
20598 for_initializer to solve the problem of having out-of-band code
20599 emition (that is what got for broken).
20601 (declaration_statement): Perform the actual variable declaration
20602 that used to be done in local_variable_declaration here.
20604 (local_variable_declaration): Do not declare anything, just pass
20605 the information on a DictionaryEntry
20607 2001-11-20 Ravi Pratap <ravi@ximian.com>
20609 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20610 re-write of the logic to now make it recursive.
20612 (UpdateIndices): Re-write accordingly.
20614 Store element data in a separate ArrayData list in the above methods.
20616 (MakeByteBlob): Implement to dump the array data into a byte array.
20618 2001-11-19 Ravi Pratap <ravi@ximian.com>
20620 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20623 * constant.cs (Define): Implement.
20625 (EmitConstant): Re-write fully.
20627 Pass in location info.
20629 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20632 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20633 DictionaryEntry since we need location info too.
20635 (constant_declaration): Update accordingly.
20637 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20638 code into another method : UpdateIndices.
20640 2001-11-18 Ravi Pratap <ravi@ximian.com>
20642 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20643 some type checking etc.
20645 2001-11-17 Ravi Pratap <ravi@ximian.com>
20647 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20648 bits to provide dimension info if the user skips doing that.
20650 Update second constructor to store the rank correctly.
20652 2001-11-16 Ravi Pratap <ravi@ximian.com>
20654 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20655 and try to implement.
20657 * ../errors/cs0150.cs : Add.
20659 * ../errors/cs0178.cs : Add.
20661 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20663 * statement.cs: Implement foreach on multi-dimensional arrays.
20665 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20666 name of the params argument.
20668 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20669 initializing the array.
20671 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20672 we can use this elsewhere.
20674 * statement.cs: Finish implementation of foreach for single
20677 * cs-parser.jay: Use an out-of-band stack to pass information
20678 around, I wonder why I need this.
20680 foreach_block: Make the new foreach_block the current_block.
20682 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20683 function used to return a static Parameters structure. Used for
20684 empty parameters, as those are created very frequently.
20686 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20688 2001-11-15 Ravi Pratap <ravi@ximian.com>
20690 * interface.cs : Default modifier is private, not public. The
20691 make verify test passes again.
20693 2001-11-15 Ravi Pratap <ravi@ximian.com>
20695 * support.cs (ReflectionParameters): Fix logic to determine
20696 whether the last parameter is a params one. Test 9 passes again.
20698 * delegate.cs (Populate): Register the builders we define with
20699 RegisterParameterForBuilder. Test 19 passes again.
20701 * cs-parser.jay (property_declaration): Reference $6 instead
20702 of $$ to get at the location.
20704 (indexer_declaration): Similar stuff.
20706 (attribute): Ditto.
20708 * class.cs (Property): Register parameters for the Get and Set methods
20709 if they exist. Test 23 passes again.
20711 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20712 call to EmitArguments as we are sure there aren't any params arguments.
20713 Test 32 passes again.
20715 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20716 IndexOutOfRangeException.
20718 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20719 Test 33 now passes again.
20721 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20723 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20724 broke a bunch of things. Will have to come up with a better way
20725 of tracking locations.
20727 * statement.cs: Implemented foreach for single dimension arrays.
20729 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20731 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20732 an error. This removes the lookup from the critical path.
20734 * cs-parser.jay: Removed use of temporary_loc, which is completely
20737 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20739 * support.cs (ReflectionParameters.ParameterModifier): Report
20740 whether the argument is a PARAMS argument or not.
20742 * class.cs: Set the attribute `ParamArrayAttribute' on the
20743 parameter argument.
20745 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20746 and cons_param_array_attribute (ConstructorInfo for
20747 ParamArrayAttribute).,
20749 * codegen.cs: Emit the return using the `Return' statement, that
20750 way we can report the error correctly for missing return values.
20752 * class.cs (Method.Emit): Clean up.
20754 * expression.cs (Argument.Resolve): Take another argument: the
20755 location where this argument is used. Notice that this is not
20756 part of the "Argument" class as to reduce the size of the
20757 structure (we know the approximate location anyways).
20759 Test if the argument is a variable-reference, if not, then
20760 complain with a 206.
20762 (Argument.Emit): Emit addresses of variables.
20764 (Argument.FullDesc): Simplify.
20766 (Invocation.DoResolve): Update for Argument.Resolve.
20768 (ElementAccess.DoResolve): ditto.
20770 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20771 method should be virtual, as this method is always virtual.
20773 (NewDelegate.DoResolve): Update for Argument.Resolve.
20775 * class.cs (ConstructorInitializer.DoResolve): ditto.
20777 * attribute.cs (Attribute.Resolve): ditto.
20779 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20781 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20783 * expression.cs (ParameterReference): Drop IStackStorage and implement
20784 IAssignMethod instead.
20786 (LocalVariableReference): ditto.
20788 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20789 IAssignMethod instead.
20791 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20793 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20794 enumerations that are used in heavily used structures derive from
20795 byte in a laughable and pathetic attempt to reduce memory usage.
20796 This is the kind of pre-optimzations that you should not do at
20797 home without adult supervision.
20799 * expression.cs (UnaryMutator): New class, used to handle ++ and
20800 -- separatedly from the other unary operators. Cleans up the
20801 code, and kills the ExpressionStatement dependency in Unary.
20803 (Unary): Removed `method' and `Arguments' from this class, making
20804 it smaller, and moving it all to SimpleCall, so I can reuse this
20805 code in other locations and avoid creating a lot of transient data
20806 strucutres when not required.
20808 * cs-parser.jay: Adjust for new changes.
20810 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20812 * enum.cs (Enum.Populate): If there is a failure during
20815 * cs-parser.jay (opt_enum_base): we used to catch type errors
20816 here, but this is really incorrect. The type error should be
20817 catched during semantic analysis.
20819 2001-12-11 Ravi Pratap <ravi@ximian.com>
20821 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20822 current_local_parameters as expected since I, in my stupidity, had forgotten
20825 * attribute.cs (GetValidPlaces): Fix stupid bug.
20827 * class.cs (Method::Emit): Perform check on applicability of attributes.
20829 (Constructor::Emit): Ditto.
20831 (Field::Emit): Ditto.
20833 (Field.Location): Store location information.
20835 (Property, Event, Indexer, Operator): Ditto.
20837 * cs-parser.jay (field_declaration): Pass in location for each field.
20839 * ../errors/cs0592.cs : Add.
20841 2001-11-12 Ravi Pratap <ravi@ximian.com>
20843 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20845 (InitCoreTypes): Update accordingly.
20847 (RegisterAttrType, LookupAttr): Implement.
20849 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20850 info about the same.
20852 (Resolve): Update to populate the above as necessary.
20854 (Error592): Helper.
20856 (GetValidPlaces): Helper to the above.
20858 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20860 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20862 2001-11-12 Ravi Pratap <ravi@ximian.com>
20864 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20866 * ../errors/cs0617.cs : Add.
20868 2001-11-11 Ravi Pratap <ravi@ximian.com>
20870 * enum.cs (Emit): Rename to Populate to be more consistent with what
20871 we expect it to do and when exactly it is called.
20873 * class.cs, rootcontext.cs : Update accordingly.
20875 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20876 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20878 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20880 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20881 of a fieldinfo using the above, when dealing with a FieldBuilder.
20883 2001-11-10 Ravi Pratap <ravi@ximian.com>
20885 * ../errors/cs0031.cs : Add.
20887 * ../errors/cs1008.cs : Add.
20889 * ../errrors/cs0543.cs : Add.
20891 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20894 (FindMembers): Implement.
20896 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20897 enums and delegates too.
20899 (enum_types): Rename to builder_to_enum.
20901 (delegate_types): Rename to builder_to_delegate.
20903 * delegate.cs (FindMembers): Implement.
20905 2001-11-09 Ravi Pratap <ravi@ximian.com>
20907 * typemanager.cs (IsEnumType): Implement.
20909 * enum.cs (Emit): Re-write parts to account for the underlying type
20910 better and perform checking etc.
20912 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20913 of the underlying type.
20915 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20918 * enum.cs (error31): Helper to report error #31.
20920 * cs-parser.jay (enum_declaration): Store location of each member too.
20922 * enum.cs (member_to_location): New hashtable.
20924 (AddEnumMember): Update location hashtable.
20926 (Emit): Use the location of each member while reporting errors.
20928 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20930 * cs-parser.jay: A for_initializer if is a
20931 local_variable_declaration really ammount to have an implicit
20932 block with the variable declaration and no initializer for for.
20934 * statement.cs (For.Emit): Cope with null initializers.
20936 This fixes the infinite loop on for initializers.
20938 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20940 * enum.cs: More cleanup.
20942 * ecore.cs: Remove dead code.
20944 * class.cs (Property.Emit): More simplification.
20945 (Event.Emit): ditto.
20947 Reworked to have less levels of indentation.
20949 2001-11-08 Ravi Pratap <ravi@ximian.com>
20951 * class.cs (Property): Emit attributes.
20961 * enum.cs (Emit): Ditto.
20963 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20966 * class.cs (Field, Event, etc.): Move attribute generation into the
20967 Emit method everywhere.
20969 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20970 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20971 as we had no way of defining nested enums !
20973 * rootcontext.cs : Adjust code accordingly.
20975 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20977 2001-11-07 Ravi Pratap <ravi@ximian.com>
20979 * expression.cs (EvalConstantExpression): Move into ecore.cs
20981 * enum.cs (Enum): Rename some members and make them public and readonly
20982 according to our convention.
20984 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20987 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20989 (Enum::Emit): Write a simple version for now which doesn't try to compute
20990 expressions. I shall modify this to be more robust in just a while.
20992 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20994 (TypeContainer::CloseType): Create the Enum types too.
20996 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20998 * expression.cs (EvalConstantExpression): Get rid of completely.
21000 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21001 user-defined values and other cases.
21003 (IsValidEnumLiteral): Helper function.
21005 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21006 out there in the case we had a literal FieldExpr.
21008 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21010 (Literalize): Revamp a bit to take two arguments.
21012 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21014 2001-11-06 Ravi Pratap <ravi@ximian.com>
21016 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21018 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21020 (Resolve): Use the above to ensure we have proper initializers.
21022 2001-11-05 Ravi Pratap <ravi@ximian.com>
21024 * expression.cs (Expression::EvalConstantExpression): New method to
21025 evaluate constant expressions.
21027 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21029 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21031 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21034 (Binary.ResolveOperator): Handle operator != (object a, object b)
21035 and operator == (object a, object b);
21037 (Binary.DoNumericPromotions): Indicate whether the numeric
21038 promotion was possible.
21040 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21043 Made the ArrayAccess implement interface IAssignMethod instead of
21044 IStackStore as the order in which arguments are passed reflects
21047 * assign.cs: Instead of using expr.ExprClass to select the way of
21048 assinging, probe for the IStackStore/IAssignMethod interfaces.
21050 * typemanager.cs: Load InitializeArray definition.
21052 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21053 static data that can be used to initialize arrays.
21055 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21057 * expression.cs: Handle operator== and operator!= for booleans.
21059 (Conditioal.Reduce): Implement reducer for the ?: operator.
21061 (Conditional.Resolve): Implement dead code elimination.
21063 (Binary.Resolve): Catch string literals and return a new
21064 concatenated string.
21066 (Unary.Reduce): Implement reduction of unary expressions.
21068 * ecore.cs: Split out the expression core handling here.
21070 (Expression.Reduce): New method used to perform constant folding
21071 and CSE. This is needed to support constant-expressions.
21073 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21074 targets, and optimize for !x.
21076 2001-11-04 Ravi Pratap <ravi@ximian.com>
21078 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21079 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21080 set custom atttributes.
21082 * literal.cs (Literal::GetValue): New abstract method to return the actual
21083 value of the literal, cast as an object.
21085 (*Literal): Implement GetValue method.
21087 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21088 expressions to the arraylist but objects of type Argument.
21090 * class.cs (TypeContainer::Emit): Emit our attributes too.
21092 (Method::Emit, Constructor::Emit): Ditto.
21094 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21095 to be ignoring earlier.
21097 2001-11-03 Ravi Pratap <ravi@ximian.com>
21099 * attribute.cs (AttributeSection::Define): Implement to do the business
21100 of constructing a CustomAttributeBuilder.
21102 (Attribute): New trivial class. Increases readability of code.
21104 * cs-parser.jay : Update accordingly.
21106 (positional_argument_list, named_argument_list, named_argument): New rules
21108 (attribute_arguments): Use the above so that we are more correct.
21110 2001-11-02 Ravi Pratap <ravi@ximian.com>
21112 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21113 to perform all checks for a method with a params parameter.
21115 (Invocation::OverloadResolve): Update to use the above method and therefore
21116 cope correctly with params method invocations.
21118 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
21121 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21122 constructors in our parent too because we can't afford to miss out on
21125 * attribute.cs (AttributeSection): New name for the class Attribute
21127 Other trivial changes to improve readability.
21129 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21130 use the new class names.
21132 2001-11-01 Ravi Pratap <ravi@ximian.com>
21134 * class.cs (Method::Define): Complete definition for params types too
21136 (Indexer::Define): Ditto.
21138 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21139 Cope everywhere with a request for info about the array parameter.
21141 2001-11-01 Ravi Pratap <ravi@ximian.com>
21143 * tree.cs (RecordNamespace): Fix up to check for the correct key.
21145 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
21146 local_variable_type to extract the string corresponding to the type.
21148 (local_variable_type): Fixup the action to use the new helper method.
21150 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21153 * expression.cs : Clean out code which uses the above.
21155 2001-10-31 Ravi Pratap <ravi@ximian.com>
21157 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21158 and bale out if necessary by returning a false.
21160 (RegisterProperty): Ditto.
21162 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21163 and print out appropriate error messages.
21165 * interface.cs (everywhere): Ditto.
21167 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21168 location to constructor.
21170 * class.cs (Property, Event, Indexer): Update accordingly.
21172 * ../errors/cs111.cs : Added.
21174 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21175 of a method, as laid down by the spec.
21177 (Invocation::OverloadResolve): Use the above method.
21179 2001-10-31 Ravi Pratap <ravi@ximian.com>
21181 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21182 now take a TypeContainer and a Parameters object.
21184 (ParameterData): Modify return type of ParameterModifier method to be
21185 Parameter.Modifier and not a string.
21187 (ReflectionParameters, InternalParameters): Update accordingly.
21189 * expression.cs (Argument::GetParameterModifier): Same here.
21191 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21192 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21193 symbol in it at all so maybe this is only for now.
21195 2001-10-30 Ravi Pratap <ravi@ximian.com>
21197 * support.cs (InternalParameters): Constructor now takes an extra argument
21198 which is the actual Parameters class.
21200 (ParameterDesc): Update to provide info on ref/out modifiers.
21202 * class.cs (everywhere): Update call to InternalParameters to pass in
21203 the second argument too.
21205 * support.cs (ParameterData): Add ParameterModifier, which is a method
21206 to return the modifier info [ref/out etc]
21208 (InternalParameters, ReflectionParameters): Implement the above.
21210 * expression.cs (Argument::ParameterModifier): Similar function to return
21211 info about the argument's modifiers.
21213 (Invocation::OverloadResolve): Update to take into account matching modifiers
21216 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21217 a new SetFormalParameters object which we pass to InternalParameters.
21219 2001-10-30 Ravi Pratap <ravi@ximian.com>
21221 * expression.cs (NewArray): Merge into the ArrayCreation class.
21223 2001-10-29 Ravi Pratap <ravi@ximian.com>
21225 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21226 NewUserdefinedArray into one as there wasn't much of a use in having
21229 * expression.cs (Argument): Change field's name to ArgType from Type.
21231 (Type): New readonly property which returns the proper type, taking into
21232 account ref/out modifiers.
21234 (everywhere): Adjust code accordingly for the above.
21236 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21237 whether we are emitting for a ref or out parameter.
21239 * expression.cs (Argument::Emit): Use the above field to set the state.
21241 (LocalVariableReference::Emit): Update to honour the flag and emit the
21244 * parameter.cs (Attributes): Set the correct flags for ref parameters.
21246 * expression.cs (Argument::FullDesc): New function to provide a full desc.
21248 * support.cs (ParameterData): Add method ParameterDesc to the interface.
21250 (ReflectionParameters, InternalParameters): Implement the above method.
21252 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21255 (Invocation::FullMethodDesc): Ditto.
21257 2001-10-29 Miguel de Icaza <miguel@ximian.com>
21259 * cs-parser.jay: Add extra production for the second form of array
21262 * expression.cs (ArrayCreation): Update to reflect the above
21265 * Small changes to prepare for Array initialization.
21267 2001-10-28 Miguel de Icaza <miguel@ximian.com>
21269 * typemanager.cs (ImplementsInterface): interface might be null;
21270 Deal with this problem;
21272 Also, we do store negative hits on the cache (null values), so use
21273 this instead of calling t.GetInterfaces on the type everytime.
21275 2001-10-28 Ravi Pratap <ravi@ximian.com>
21277 * typemanager.cs (IsBuiltinType): New method to help determine the same.
21279 * expression.cs (New::DoResolve): Get rid of array creation code and instead
21280 split functionality out into different classes.
21282 (New::FormArrayType): Move into NewBuiltinArray.
21284 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21287 (NewBuiltinArray): New class to handle creation of built-in arrays.
21289 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21290 account creation of one-dimensional arrays.
21292 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21294 (NewUserdefinedArray::DoResolve): Implement.
21296 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21298 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21299 we maintain inside the TypeManager. This is necessary to perform lookups on the
21302 (LookupType): Update to perform GetType on the module builders too.
21304 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21306 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21308 2001-10-23 Ravi Pratap <ravi@ximian.com>
21310 * expression.cs (New::DoResolve): Implement guts of array creation.
21312 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21314 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21316 * expression.cs: Fix bug I introduced lsat night that broke
21319 (Expression.Resolve): Report a 246 error (can not resolve name)
21320 if we find a SimpleName in the stream.
21322 (Expression.ResolveLValue): Ditto.
21324 (Expression.ResolveWithSimpleName): This function is a variant of
21325 ResolveName, this one allows SimpleNames to be returned without a
21326 warning. The only consumer of SimpleNames is MemberAccess
21328 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21330 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21331 might arrive here. I have my doubts that this is correct.
21333 * statement.cs (Lock): Implement lock statement.
21335 * cs-parser.jay: Small fixes to support `lock' and `using'
21337 * cs-tokenizer.cs: Remove extra space
21339 * driver.cs: New flag --checked, allows to turn on integer math
21342 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21343 Threading.Monitor.Exit
21345 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21347 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21348 Expression Class to be IndexerAccess.
21350 Notice that Indexer::DoResolve sets the eclass to Value.
21352 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21354 * class.cs (TypeContainer::Emit): Emit code for indexers.
21356 * assign.cs (IAssignMethod): New interface implemented by Indexers
21357 and Properties for handling assignment.
21359 (Assign::Emit): Simplify and reuse code.
21361 * expression.cs (IndexerAccess, PropertyExpr): Implement
21362 IAssignMethod, clean up old code.
21364 2001-10-22 Ravi Pratap <ravi@ximian.com>
21366 * typemanager.cs (ImplementsInterface): New method to determine if a type
21367 implements a given interface. Provides a nice cache too.
21369 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21372 (ConvertReferenceExplicit): Ditto.
21374 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21375 various methods, with correct names etc.
21377 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21378 Operator.UnaryNegation.
21380 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21381 we have a unary plus or minus operator.
21383 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21386 * everywhere : update accordingly.
21388 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21391 * class.cs (Method::Define): For the case where we are implementing a method
21392 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21393 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21395 2001-10-21 Ravi Pratap <ravi@ximian.com>
21397 * interface.cs (FindMembers): Implement to work around S.R.E
21400 * typemanager.cs (IsInterfaceType): Implement.
21402 (FindMembers): Update to handle interface types too.
21404 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21405 use IsAssignableFrom as that is not correct - it doesn't work.
21407 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21408 and accordingly override EmitStatement.
21410 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21411 using the correct logic :-)
21413 2001-10-19 Ravi Pratap <ravi@ximian.com>
21415 * ../errors/cs-11.cs : Add to demonstrate error -11
21417 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21419 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21420 then pass this as a hint to ResolveLValue.
21422 * expression.cs (FieldExpr): Add Location information
21424 (FieldExpr::LValueResolve): Report assignment to readonly
21427 (Expression::ExprClassFromMemberInfo): Pass location information.
21429 (Expression::ResolveLValue): Add new method that resolves an
21432 (Expression::DoResolveLValue): Default invocation calls
21435 (Indexers): New class used to keep track of indexers in a given
21438 (IStackStore): Renamed from LValue, as it did not really describe
21439 what this did. Also ResolveLValue is gone from this interface and
21440 now is part of Expression.
21442 (ElementAccess): Depending on the element access type
21444 * typemanager.cs: Add `indexer_name_type' as a Core type
21445 (System.Runtime.CompilerServices.IndexerNameAttribute)
21447 * statement.cs (Goto): Take a location.
21449 2001-10-18 Ravi Pratap <ravi@ximian.com>
21451 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21452 if two delegates are compatible.
21454 (NewDelegate::DoResolve): Update to take care of the case when
21455 we instantiate a delegate from another delegate.
21457 * typemanager.cs (FindMembers): Don't even try to look up members
21458 of Delegate types for now.
21460 2001-10-18 Ravi Pratap <ravi@ximian.com>
21462 * delegate.cs (NewDelegate): New class to take care of delegate
21465 * expression.cs (New): Split the delegate related code out into
21466 the NewDelegate class.
21468 * delegate.cs (DelegateInvocation): New class to handle delegate
21471 * expression.cs (Invocation): Split out delegate related code into
21472 the DelegateInvocation class.
21474 2001-10-17 Ravi Pratap <ravi@ximian.com>
21476 * expression.cs (New::DoResolve): Implement delegate creation fully
21477 and according to the spec.
21479 (New::DoEmit): Update to handle delegates differently.
21481 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21482 because of which we were printing out arguments in reverse order !
21484 * delegate.cs (VerifyMethod): Implement to check if the given method
21485 matches the delegate.
21487 (FullDelegateDesc): Implement.
21489 (VerifyApplicability): Implement.
21491 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21492 delegate invocations too.
21494 (Invocation::Emit): Ditto.
21496 * ../errors/cs1593.cs : Added.
21498 * ../errors/cs1594.cs : Added.
21500 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21502 2001-10-16 Ravi Pratap <ravi@ximian.com>
21504 * typemanager.cs (intptr_type): Core type for System.IntPtr
21506 (InitCoreTypes): Update for the same.
21508 (iasyncresult_type, asynccallback_type): Ditto.
21510 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21513 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21516 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21517 the builders for the 4 members of a delegate type :-)
21519 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21522 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21524 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21526 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21528 * statement.cs (Break::Emit): Implement.
21529 (Continue::Emit): Implement.
21531 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21532 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21533 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21534 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21537 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21538 properties that track the label for the current loop (begin of the
21539 loop and end of the loop).
21541 2001-10-15 Ravi Pratap <ravi@ximian.com>
21543 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21544 use of emitting anything at all.
21546 * class.cs, rootcontext.cs : Get rid of calls to the same.
21548 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21550 (Populate): Define the constructor correctly and set the implementation
21553 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21556 (AddDelegateType): Implement.
21558 (IsDelegateType): Implement helper method.
21560 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21562 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21563 and accordingly handle it.
21565 * delegate.cs (Populate): Take TypeContainer argument.
21566 Implement bits to define the Invoke method. However, I still haven't figured out
21567 how to take care of the native int bit :-(
21569 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21570 Qualify the name of the delegate, not its return type !
21572 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21575 (StandardConversionExists): Checking for array types turns out to be recursive.
21577 (ConvertReferenceExplicit): Implement array conversion.
21579 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21581 2001-10-12 Ravi Pratap <ravi@ximian.com>
21583 * cs-parser.jay (delegate_declaration): Store the fully qualified
21584 name as it is a type declaration.
21586 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21589 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21590 as TypeContainer::DefineType.
21592 (Populate): Method in which all the definition of the various methods (Invoke)
21595 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21598 (CloseDelegate): Finally creates the delegate.
21600 * class.cs (TypeContainer::DefineType): Update to define delegates.
21601 (Populate, Emit and CloseType): Do the same thing here too.
21603 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21604 delegates in all these operations.
21606 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21608 * expression.cs: LocalTemporary: a new expression used to
21609 reference a temporary that has been created.
21611 * assign.cs: Handle PropertyAccess back here, so that we can
21612 provide the proper semantic access to properties.
21614 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21615 a few more explicit conversions.
21617 * modifiers.cs: `NEW' modifier maps to HideBySig.
21619 * expression.cs (PropertyExpr): Make this into an
21620 ExpressionStatement, and support the EmitStatement code path.
21622 Perform get/set error checking, clean up the interface.
21624 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21625 them into toplevel access objects.
21627 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21629 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21632 * typemanager.cs: Keep track here of our PropertyBuilders again to
21633 work around lameness in SRE.
21635 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21637 * expression.cs (LValue::LValueResolve): New method in the
21638 interface, used to perform a second resolution pass for LValues.
21640 (This::DoResolve): Catch the use of this in static methods.
21642 (This::LValueResolve): Implement.
21644 (This::Store): Remove warning, assigning to `this' in structures
21647 (Invocation::Emit): Deal with invocation of
21648 methods on value types. We need to pass the address to structure
21649 methods rather than the object itself. (The equivalent code to
21650 emit "this" for structures leaves the entire structure on the
21651 stack instead of a pointer to it).
21653 (ParameterReference::DoResolve): Compute the real index for the
21654 argument based on whether the method takes or not a `this' pointer
21655 (ie, the method is static).
21657 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21658 value types returned from functions when we need to invoke a
21659 method on the sturcture.
21662 2001-10-11 Ravi Pratap <ravi@ximian.com>
21664 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21665 defining the type in the Modulebuilder or Typebuilder. This is to take
21666 care of nested types which need to be defined on the TypeBuilder using
21667 DefineNestedMethod.
21669 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21670 methods in RootContext, only ported to be part of TypeContainer.
21672 (TypeContainer::GetInterfaceOrClass): Ditto.
21674 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21676 * interface.cs (Interface::DefineInterface): New method. Does exactly
21677 what RootContext.CreateInterface did earlier, only it takes care of nested types
21680 (Interface::GetInterfaces): Move from RootContext here and port.
21682 (Interface::GetInterfaceByName): Same here.
21684 * rootcontext.cs (ResolveTree): Re-write.
21686 (PopulateTypes): Re-write.
21688 * class.cs (TypeContainer::Populate): Populate nested types too.
21689 (TypeContainer::Emit): Emit nested members too.
21691 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21692 instead just use the name argument passed in as it is already fully
21695 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21696 to TypeContainer mapping to see if a type is user-defined.
21698 * class.cs (TypeContainer::CloseType): Implement.
21700 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21701 the default constructor.
21703 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21706 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21708 * interface.cs (CloseType): Create the type here.
21710 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21713 Remove all the methods which are now in TypeContainer.
21715 2001-10-10 Ravi Pratap <ravi@ximian.com>
21717 * delegate.cs (Define): Re-write bits to define the delegate
21720 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21722 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21724 * expression.cs (ImplicitReferenceConversion): handle null as well
21725 as a source to convert to any reference type.
21727 * statement.cs (Return): Perform any implicit conversions to
21728 expected return type.
21730 Validate use of return statement.
21732 * codegen.cs (EmitContext): Pass the expected return type here.
21734 * class.cs (Method, Constructor, Property): Pass expected return
21735 type to EmitContext.
21737 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21739 * expression.cs: Make DoResolve take an EmitContext instead of a
21742 Replaced `l' and `location' for `loc', for consistency.
21744 (Error, Warning): Remove unneeded Tc argument.
21746 * assign.cs, literal.cs, constant.cs: Update to new calling
21749 * codegen.cs: EmitContext now contains a flag indicating whether
21750 code is being generated in a static method or not.
21752 * cs-parser.jay: DecomposeQI, new function that replaces the old
21753 QualifiedIdentifier. Now we always decompose the assembled
21754 strings from qualified_identifier productions into a group of
21757 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21759 * rootcontext.cs: Deal with field-less struct types correctly now
21760 by passing the size option to Define Type.
21762 * class.cs: Removed hack that created one static field.
21764 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21766 * statement.cs: Moved most of the code generation here.
21768 2001-10-09 Ravi Pratap <ravi@ximian.com>
21770 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21773 (ElementAccess): Remove useless bits for now - keep checks as the spec
21776 2001-10-08 Ravi Pratap <ravi@ximian.com>
21778 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21779 and start performing checks according to the spec.
21781 2001-10-07 Ravi Pratap <ravi@ximian.com>
21783 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21784 rank_specifiers instead.
21786 (rank_specifiers): Change the order in which the rank specifiers are stored
21788 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21790 * expression.cs (ElementAccess): Implement the LValue interface too.
21792 2001-10-06 Ravi Pratap <ravi@ximian.com>
21794 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21795 except that user defined conversions are not included.
21797 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21798 perform the conversion of the return type, if necessary.
21800 (New::DoResolve): Check whether we are creating an array or an object
21801 and accordingly do the needful.
21803 (New::Emit): Same here.
21805 (New::DoResolve): Implement guts of array creation.
21807 (New::FormLookupType): Helper function.
21809 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21811 * codegen.cs: Removed most of the code generation here, and move the
21812 corresponding code generation bits to the statement classes.
21814 Added support for try/catch/finalize and throw.
21816 * cs-parser.jay: Added support for try/catch/finalize.
21818 * class.cs: Catch static methods having the flags override,
21819 virtual or abstract.
21821 * expression.cs (UserCast): This user cast was not really doing
21822 what it was supposed to do. Which is to be born in fully resolved
21823 state. Parts of the resolution were being performed at Emit time!
21827 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21829 * expression.cs: Implicity convert the result from UserCast.
21831 2001-10-05 Ravi Pratap <ravi@ximian.com>
21833 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21834 prevented it from working correctly.
21836 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21837 merely ConvertImplicit.
21839 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21841 * typemanager.cs: Make the LookupTypeContainer function static,
21842 and not per-instance.
21844 * class.cs: Make static FindMembers (the one that takes a Type
21847 * codegen.cs: Add EmitForeach here.
21849 * cs-parser.jay: Make foreach a toplevel object instead of the
21850 inline expansion, as we need to perform semantic analysis on it.
21852 2001-10-05 Ravi Pratap <ravi@ximian.com>
21854 * expression.cs (Expression::ImplicitUserConversion): Rename to
21855 UserDefinedConversion.
21857 (Expression::UserDefinedConversion): Take an extra argument specifying
21858 whether we look for explicit user conversions too.
21860 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21862 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21864 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21865 with the appropriate arguments.
21867 * cs-parser.jay (cast_expression): Record location too.
21869 * expression.cs (Cast): Record location info.
21871 (Expression::ConvertExplicit): Take location argument.
21873 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21874 to determine if we are doing explicit conversions.
21876 (UserCast::Emit): Update accordingly.
21878 (Expression::ConvertExplicit): Report an error if everything fails.
21880 * ../errors/cs0030.cs : Add.
21882 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21884 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21885 virtual and newslot bits.
21887 * class.cs (TypeContainer::RegisterRequiredImplementations):
21888 Record methods we need.
21890 (TypeContainer::MakeKey): Helper function to make keys for
21891 MethodBases, since the Methodbase key is useless.
21893 (TypeContainer::Populate): Call RegisterRequiredImplementations
21894 before defining the methods.
21896 Create a mapping for method_builders_to_methods ahead of time
21897 instead of inside a tight loop.
21899 (::RequireMethods): Accept an object as the data to set into the
21900 hashtable so we can report interface vs abstract method mismatch.
21902 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21904 * report.cs: Make all of it static.
21906 * rootcontext.cs: Drop object_type and value_type computations, as
21907 we have those in the TypeManager anyways.
21909 Drop report instance variable too, now it is a global.
21911 * driver.cs: Use try/catch on command line handling.
21913 Add --probe option to debug the error reporting system with a test
21916 * report.cs: Add support for exiting program when a probe
21917 condition is reached.
21919 2001-10-03 Ravi Pratap <ravi@ximian.com>
21921 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21922 we do a forcible conversion regardless of type, to check if
21923 ForceConversion returns a null.
21925 (Binary::error19): Use location to report error.
21927 (Unary::error23): Use location here too.
21929 * ../errors/cs0019.cs : Check in.
21931 * ../errors/cs0023.cs : Check in.
21933 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21934 case of a non-null MethodInfo object with a length of 0 !
21936 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21937 an applicable member - according to the spec :-)
21938 Also fix logic to find members in base types.
21940 (Unary::ResolveOperator): Same here.
21942 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21943 as I was getting thoroughly confused between this and error19 :-)
21945 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21946 (::FindMostEncompassedType): Implement.
21947 (::FindMostEncompassingType): Implement.
21948 (::StandardConversionExists): Implement.
21950 (UserImplicitCast): Re-vamp. We now need info about most specific
21951 source and target types so that we can do the necessary conversions.
21953 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21954 mathematical union with no duplicates.
21956 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21958 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21959 in order from base classes to child classes, so that we can in
21960 child classes look up in our parent for method names and
21961 attributes (required for handling abstract, virtual, new, override
21962 constructs: we need to instrospect our base class, and if we dont
21963 populate the classes in order, the introspection might be
21964 incorrect. For example, a method could query its parent before
21965 the parent has any methods and would determine that the parent has
21966 no abstract methods (while it could have had them)).
21968 (RootContext::CreateType): Record the order in which we define the
21971 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21973 * class.cs (TypeContainer::Populate): Also method definitions can
21974 fail now, keep track of this.
21976 (TypeContainer::FindMembers): Implement support for
21977 DeclaredOnly/noDeclaredOnly flag.
21979 (Constructor::Emit) Return the ConstructorBuilder.
21981 (Method::Emit) Return the MethodBuilder.
21982 Check for abstract or virtual methods to be public.
21984 * rootcontext.cs (RootContext::CreateType): Register all the
21985 abstract methods required for the class to be complete and the
21986 interface methods that must be implemented.
21988 * cs-parser.jay: Report error 501 (method requires body if it is
21989 not marked abstract or extern).
21991 * expression.cs (TypeOf::Emit): Implement.
21993 * typemanager.cs: runtime_handle_type, new global type.
21995 * class.cs (Property::Emit): Generate code for properties.
21997 2001-10-02 Ravi Pratap <ravi@ximian.com>
21999 * expression.cs (Unary::ResolveOperator): Find operators on base type
22000 too - we now conform exactly to the spec.
22002 (Binary::ResolveOperator): Same here.
22004 * class.cs (Operator::Define): Fix minor quirk in the tests.
22006 * ../errors/cs0215.cs : Added.
22008 * ../errors/cs0556.cs : Added.
22010 * ../errors/cs0555.cs : Added.
22012 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22014 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22015 single integer which is really efficient
22017 2001-10-01 Ravi Pratap <ravi@ximian.com>
22019 * expression.cs (Expression::ImplicitUserConversion): Use location
22020 even in the case when we are examining True operators.
22022 * class.cs (Operator::Define): Perform extensive checks to conform
22023 with the rules for operator overloading in the spec.
22025 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22026 some of the other conversions mentioned in the spec.
22028 * typemanager.cs (array_type): New static member for the System.Array built-in
22031 (cloneable_interface): For System.ICloneable interface.
22033 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22034 we start resolving the tree and populating types.
22036 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22038 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22040 * expression.cs (Expression::ExprClassFromMemberInfo,
22041 Expression::Literalize): Create literal expressions from
22042 FieldInfos which are literals.
22044 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22045 type casts, because they were wrong. The test suite in tests
22048 (ImplicitNumericConversion): ushort to ulong requires a widening
22051 Int32 constant to long requires widening cast as well.
22053 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22054 for integers because the type on the stack is not i4.
22056 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22058 * expression.cs (report118): require location argument.
22060 * parameter.cs: Do not dereference potential null value.
22062 * class.cs: Catch methods that lack the `new' keyword when
22063 overriding a name. Report warnings when `new' is used without
22064 anything being there to override.
22066 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22068 * class.cs: Only add constructor to hashtable if it is non-null
22069 (as now constructors can fail on define).
22071 (TypeManager, Class, Struct): Take location arguments.
22073 Catch field instance initialization in structs as errors.
22075 accepting_filter: a new filter for FindMembers that is static so
22076 that we dont create an instance per invocation.
22078 (Constructor::Define): Catch errors where a struct constructor is
22081 * cs-parser.jay: Pass location information for various new
22084 * delegate.cs (Delegate): take a location argument.
22086 * driver.cs: Do not call EmitCode if there were problesm in the
22087 Definition of the types, as many Builders wont be there.
22089 * decl.cs (Decl::Decl): Require a location argument.
22091 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22092 into integers, and find the most appropiate integer for it.
22094 * literal.cs: Implement ULongLiteral.
22096 * rootcontext.cs: Provide better information about the location of
22097 failure when CreateType fails.
22099 2001-09-29 Miguel de Icaza <miguel@ximian.com>
22101 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22104 * expression.cs (Binary::CheckShiftArguments): Add missing type
22106 (Binary::ResolveOperator): Add type to the logical and and logical
22107 or, Bitwise And/Or and Exclusive Or code paths, it was missing
22110 (Binary::DoNumericPromotions): In the case where either argument
22111 is ulong (and most signed types combined with ulong cause an
22112 error) perform implicit integer constant conversions as well.
22114 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22116 * expression.cs (UserImplicitCast): Method should always be
22118 (Invocation::BetterConversion): Simplified test for IntLiteral.
22120 (Expression::ImplicitNumericConversion): Split this routine out.
22121 Put the code that performs implicit constant integer conversions
22124 (Expression::Resolve): Become a wrapper around DoResolve so we can
22125 check eclass and type being set after resolve.
22127 (Invocation::Badness): Remove this dead function
22129 (Binary::ResolveOperator): Do not compute the expensive argumnets
22130 unless we have a union for it.
22132 (Probe::Emit): Is needs to do an isinst and then
22133 compare against null.
22135 (::CanConvert): Added Location argument. If the Location argument
22136 is null (Location.Null), then we do not report errors. This is
22137 used by the `probe' mechanism of the Explicit conversion. We do
22138 not want to generate an error for something that the user
22139 explicitly requested to be casted. But the pipeline for an
22140 explicit cast first tests for potential implicit casts.
22142 So for now, if the Location is null, it means `Probe only' to
22143 avoid adding another argument. Might have to revise this
22146 (ClassCast): New class used to type cast objects into arbitrary
22147 classes (used in Explicit Reference Conversions).
22149 Implement `as' as well.
22151 Reverted all the patches from Ravi below: they were broken:
22153 * The use of `level' as a mechanism to stop recursive
22154 invocations is wrong. That was there just to catch the
22155 bug with a strack trace but not as a way of addressing
22158 To fix the problem we have to *understand* what is going
22159 on and the interactions and come up with a plan, not
22160 just get things going.
22162 * The use of the type conversion cache that I proposed
22163 last night had an open topic: How does this work across
22164 protection domains. A user defined conversion might not
22165 be public in the location where we are applying the
22166 conversion, a different conversion might be selected
22167 (ie, private A->B (better) but public B->A (worse),
22168 inside A, A->B applies, but outside it, B->A will
22171 * On top of that (ie, even if the above is solved),
22172 conversions in a cache need to be abstract. Ie, `To
22173 convert from an Int to a Short use an OpcodeCast', not
22174 `To convert from an Int to a Short use the OpcodeCast on
22175 the variable 5' (which is what this patch was doing).
22177 2001-09-28 Ravi Pratap <ravi@ximian.com>
22179 * expression.cs (Invocation::ConversionExists): Re-write to use
22180 the conversion cache
22182 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22183 cache all conversions done, not just user-defined ones.
22185 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22186 to determine if a conversion exists instead of acutually trying to
22187 perform the conversion. It's faster too.
22189 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22190 and only then attempt the implicit conversion.
22192 2001-09-28 Ravi Pratap <ravi@ximian.com>
22194 * expression.cs (ConvertImplicit): Use a cache for conversions
22195 already found. Check level of recursion and bail out if necessary.
22197 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22199 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22200 Export standard methods that we expect for string operations.
22202 * statement.cs (Block::UsageWarning): Track usage of variables and
22203 report the errors for not used variables.
22205 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22208 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22210 * codegen.cs: remove unnneded code
22212 * expression.cs: Removed BuiltinTypeAccess class
22214 Fix the order in which implicit conversions are
22217 The previous fixed dropped support for boxed conversions (adding a
22218 test to the test suite now)
22220 (UserImplicitCast::CanConvert): Remove test for source being null,
22221 that code is broken. We should not feed a null to begin with, if
22222 we do, then we should track the bug where the problem originates
22223 and not try to cover it up here.
22225 Return a resolved expression of type UserImplicitCast on success
22226 rather than true/false. Ravi: this is what I was talking about,
22227 the pattern is to use a static method as a "constructor" for
22230 Also, do not create arguments until the very last minute,
22231 otherwise we always create the arguments even for lookups that
22232 will never be performed.
22234 (UserImplicitCast::Resolve): Eliminate, objects of type
22235 UserImplicitCast are born in a fully resolved state.
22237 * typemanager.cs (InitCoreTypes): Init also value_type
22238 (System.ValueType).
22240 * expression.cs (Cast::Resolve): First resolve the child expression.
22242 (LValue): Add new method AddressOf to be used by
22245 Change the argument of Store to take an EmitContext instead of an
22246 ILGenerator, because things like FieldExpr need to be able to call
22247 their children expression to generate the instance code.
22249 (Expression::Error, Expression::Warning): Sugar functions for
22252 (Expression::MemberLookup): Accept a TypeContainer instead of a
22253 Report as the first argument.
22255 (Expression::ResolvePrimary): Killed. I still want to improve
22256 this as currently the code is just not right.
22258 (Expression::ResolveMemberAccess): Simplify, but it is still
22261 (Unary::Resolve): Catch errors in AddressOf operators.
22263 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22264 index to a byte for the short-version, or the compiler will choose
22265 the wrong Emit call, which generates the wrong data.
22267 (ParameterReference::Emit, ::Store): same.
22269 (FieldExpr::AddressOf): Implement.
22271 * typemanager.cs: TypeManager: made public variable instead of
22274 * driver.cs: document --fatal.
22276 * report.cs (ErrorMessage, WarningMessage): new names for the old
22277 Error and Warning classes.
22279 * cs-parser.jay (member_access): Turn built-in access to types
22280 into a normal simplename
22282 2001-09-27 Ravi Pratap <ravi@ximian.com>
22284 * expression.cs (Invocation::BetterConversion): Fix to cope
22285 with q being null, since this was introducing a bug.
22287 * expression.cs (ConvertImplicit): Do built-in conversions first.
22289 2001-09-27 Ravi Pratap <ravi@ximian.com>
22291 * expression.cs (UserImplicitCast::Resolve): Fix bug.
22293 2001-09-27 Ravi Pratap <ravi@ximian.com>
22295 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22296 I had introduced long ago (what's new ?).
22298 * expression.cs (UserImplicitCast::CanConvert): Static method to do
22299 the work of all the checking.
22300 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22301 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22303 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22304 that is the right way.
22306 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22307 overloading resolution. Use everywhere instead of cutting and pasting code.
22309 (Binary::ResolveOperator): Use MakeUnionSet.
22311 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22312 we have to convert to bool types. Not complete yet.
22314 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22316 * typemanager.cs (TypeManager::CSharpName): support ushort.
22318 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22319 to provide an expression that performsn an implicit constant int
22320 conversion (section 6.1.6).
22321 (Expression::ConvertImplicitRequired): Reworked to include
22322 implicit constant expression conversions.
22324 (Expression::ConvertNumericExplicit): Finished.
22326 (Invocation::Emit): If InstanceExpression is null, then it means
22327 that we perform a call on this.
22329 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22331 * expression.cs (Unary::Emit): Remove some dead code.
22332 (Probe): Implement Resolve and Emit for `is'.
22333 (Expression::ConvertImplicitRequired): Attempt to do constant
22334 expression conversions here. Maybe should be moved to
22335 ConvertImplicit, but I am not sure.
22336 (Expression::ImplicitLongConstantConversionPossible,
22337 Expression::ImplicitIntConstantConversionPossible): New functions
22338 that tell whether is it possible to apply an implicit constant
22339 expression conversion.
22341 (ConvertNumericExplicit): Started work on explicit numeric
22344 * cs-parser.jay: Update operator constants.
22346 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22347 (Parameters::GetSignature): Hook up VerifyArgs here.
22348 (Parameters::VerifyArgs): Verifies that no two arguments have the
22351 * class.cs (Operator): Update the operator names to reflect the
22352 ones that the spec expects (as we are just stringizing the
22355 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22356 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22357 previous usage did only work for our methods.
22358 (Expression::ConvertImplicit): Handle decimal implicit numeric
22359 conversions as well.
22360 (Expression::InternalTypeConstructor): Used to invoke constructors
22361 on internal types for default promotions.
22363 (Unary::Emit): Implement special handling for the pre/post
22364 increment/decrement for overloaded operators, as they need to have
22365 the same semantics as the other operators.
22367 (Binary::ResolveOperator): ditto.
22368 (Invocation::ConversionExists): ditto.
22369 (UserImplicitCast::Resolve): ditto.
22371 2001-09-26 Ravi Pratap <ravi@ximian.com>
22373 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22374 operator, return after emitting body. Regression tests pass again !
22376 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22377 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22378 (Invocation::OverloadResolve): Ditto.
22379 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22381 * everywhere : update calls to the above methods accordingly.
22383 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22385 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22387 * expression.cs (ExpressionStatement): New base class used for
22388 expressions that can appear in statements, so that we can provide
22389 an alternate path to generate expression that do not leave a value
22392 (Expression::Emit, and all the derivatives): We no longer return
22393 whether a value is left on the stack or not. Every expression
22394 after being emitted leaves a single value on the stack.
22396 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22397 facilties of ExpressionStatement if possible.
22399 * cs-parser.jay: Update statement_expression.
22401 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22403 * driver.cs: Change the wording of message
22405 2001-09-25 Ravi Pratap <ravi@ximian.com>
22407 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22408 the type of the expression to the return type of the method if
22409 we have an overloaded operator match ! The regression tests pass again !
22410 (Unary::ResolveOperator): Ditto.
22412 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22413 to find "op_Implicit", not "implicit" ;-)
22414 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22415 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22417 * everywhere : Correct calls to the above accordingly.
22419 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22420 (ConvertImplicit): Do user-defined conversion if it exists.
22422 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22424 * assign.cs: track location.
22425 (Resolve): Use implicit conversions on assignment.
22427 * literal.cs: Oops. Not good, Emit of short access values should
22428 pass (Bytes) or the wrong argument will be selected.
22430 * expression.cs (Unary::Emit): Emit code for -expr.
22432 (Unary::ResolveOperator): Handle `Substract' for non-constants
22433 (substract from zero from the non-constants).
22434 Deal with Doubles as well.
22436 (Expression::ConvertImplicitRequired): New routine that reports an
22437 error if no implicit conversion exists.
22439 (Invocation::OverloadResolve): Store the converted implicit
22440 expressions if we make them
22442 2001-09-24 Ravi Pratap <ravi@ximian.com>
22444 * class.cs (ConstructorInitializer): Take a Location argument.
22445 (ConstructorBaseInitializer): Same here.
22446 (ConstructorThisInitializer): Same here.
22448 * cs-parser.jay : Update all calls accordingly.
22450 * expression.cs (Unary, Binary, New): Take location argument.
22451 Update accordingly everywhere.
22453 * cs-parser.jay : Update all calls to the above to take a location
22456 * class.cs : Ditto.
22458 2001-09-24 Ravi Pratap <ravi@ximian.com>
22460 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22461 (Invocation::BetterConversion): Same here
22462 (Invocation::ConversionExists): Ditto.
22464 (Invocation::ConversionExists): Implement.
22466 2001-09-22 Ravi Pratap <ravi@ximian.com>
22468 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22469 Also take an additional TypeContainer argument.
22471 * All over : Pass in TypeContainer as argument to OverloadResolve.
22473 * typemanager.cs (CSharpName): Update to check for the string type and return
22476 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22479 2001-09-21 Ravi Pratap <ravi@ximian.com>
22481 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22482 (Invocation::BetterFunction): Implement.
22483 (Invocation::BetterConversion): Implement.
22484 (Invocation::ConversionExists): Skeleton, no implementation yet.
22486 Okay, things work fine !
22488 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22490 * typemanager.cs: declare and load enum_type, delegate_type and
22493 * expression.cs (Expression::Emit): Now emit returns a value that
22494 tells whether a value is left on the stack or not. This strategy
22495 might be reveted tomorrow with a mechanism that would address
22496 multiple assignments.
22497 (Expression::report118): Utility routine to report mismatches on
22500 (Unary::Report23): Report impossible type/operator combination
22503 (Unary::IsIncrementableNumber): Whether the type can be
22504 incremented or decremented with add.
22505 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22507 (Unary::ResolveOperator): Implement ++, !, ~,
22509 (Invocation::Emit): Deal with new Emit convetion.
22511 * All Expression derivatives: Updated their Emit method to return
22512 whether they leave values on the stack or not.
22514 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22515 stack for expressions that are statements.
22517 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22519 * expression.cs (LValue): New interface. Must be implemented by
22521 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22524 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22525 interface for generating code, simplifies the code.
22527 2001-09-20 Ravi Pratap <ravi@ximian.com>
22529 * expression.cs (everywhere): Comment out return statements in ::Resolve
22530 methods to avoid the warnings.
22532 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22534 * driver.cs (parse): Report error 2001 if we can not open the
22537 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22540 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22543 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22544 otherwise nested blocks end up with the same index.
22546 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22548 * expression.cs: Instead of having FIXMEs in the Resolve
22549 functions, throw exceptions so it is obvious that we are facing a
22552 * cs-parser.jay (invocation_expression): Pass Location information.
22554 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22555 Use a basename for those routines because .NET does not like paths
22558 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22561 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22563 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22564 are loading the correct data types (throws an exception if not).
22565 (TypeManager::InitCoreTypes): Use CoreLookupType
22567 * expression.cs (Unary::ResolveOperator): return the child
22568 expression for expressions which are just +expr.
22569 (Unary::ResolveOperator): Return negative literals for -LITERAL
22570 expressions (otherwise they are Unary {Literal}).
22571 (Invocation::Badness): Take into account `Implicit constant
22572 expression conversions'.
22574 * literal.cs (LongLiteral): Implement long literal class.
22575 (IntLiteral): export the `Value' of the intliteral.
22577 2001-09-19 Ravi Pratap <ravi@ximian.com>
22579 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22581 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22582 instead of 'Operator'
22584 * expression.cs (Binary::ResolveOperator): Update accordingly.
22585 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22588 * cs-parser.jay (unary_expression): Update to use the new names.
22590 * gen-treedump.cs (GetUnary): Same here.
22592 * expression.cs (Unary::Resolve): Implement.
22593 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22594 operators are found instead of making noise ;-)
22595 (Unary::ResolveOperator): New method to do precisely the same thing which
22596 Binary::ResolveOperator does for Binary expressions.
22597 (Unary.method, .Arguments): Add.
22598 (Unary::OperName): Implement.
22599 (Unary::ForceConversion): Copy and Paste !
22601 * class.cs (Operator::Define): Fix a small bug for the case when we have
22604 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22605 for the inbuilt operators. Only overloading works for now ;-)
22607 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22609 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22610 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22612 * expression.cs (This::Emit): Implement.
22613 (This::Resolve): Implement.
22614 (TypeOf:Resolve): Implement.
22615 (Expression::ResolveSimpleName): Add an implicit this to instance
22617 (MemberAccess::Resolve): Deal with Parameters and Fields.
22618 Bind instance variable to Field expressions.
22619 (FieldExpr::Instance): New field used to track the expression that
22620 represents the object instance.
22621 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22623 (FieldExpr::Emit): Implement.
22625 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22626 the last instruction contains a return opcode to avoid generating
22627 the last `ret' instruction (this generates correct code, and it is
22628 nice to pass the peverify output).
22630 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22631 initializer for static and instance variables.
22632 (Constructor::Emit): Allow initializer to be null in the case of
22633 static constructors. Only emit initializer for instance
22636 (TypeContainer::FindMembers): Return a null array if there are no
22639 Also fix the code for the MemberTypes.Method branch, as it was not
22640 scanning that for operators (or tried to access null variables before).
22642 * assign.cs (Assign::Emit): Handle instance and static fields.
22646 * driver.cs: Stop compilation if there are parse errors.
22648 * cs-parser.jay (constructor_declaration): Provide default base
22649 initializer for non-static constructors.
22650 (constructor_declarator): Do not provide a default base
22651 initializers if none was specified.
22652 Catch the fact that constructors should not have parameters.
22654 * class.cs: Do not emit parent class initializers for static
22655 constructors, that should be flagged as an error.
22657 2001-09-18 Ravi Pratap <ravi@ximian.com>
22659 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22660 Move back code into TypeContainer::Populate.
22662 2001-09-18 Ravi Pratap <ravi@ximian.com>
22664 * class.cs (TypeContainer::AddConstructor): Fix the check to
22665 compare against Name, not Basename.
22666 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22668 * cs-parser.jay : Update accordingly.
22670 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22671 for methods, don't forget to look into the operators too.
22672 (RegisterMethodBuilder): Helper method to take care of this for
22673 methods, constructors and operators.
22674 (Operator::Define): Completely revamp.
22675 (Operator.OperatorMethod, MethodName): New fields.
22676 (TypeContainer::Populate): Move the registering of builders into
22677 RegisterMethodBuilder.
22678 (Operator::Emit): Re-write.
22680 * expression.cs (Binary::Emit): Comment out code path to emit method
22681 invocation stuff for the case when we have a user defined operator. I am
22682 just not able to get it right !
22684 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22686 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22689 (Expression::MemberLookup): Provide a version that allows to
22690 specify the MemberTypes and BindingFlags.
22692 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22693 so it was not fetching variable information from outer blocks.
22695 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22696 Beforefieldinit as it was buggy.
22698 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22699 that Ravi put here.
22701 * class.cs (Constructor::Emit): Only emit if block is not null.
22702 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22703 deal with this by semantically definining it as if the user had
22706 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22707 constructors as we now "emit" them at a higher level.
22709 (TypeContainer::DefineDefaultConstructor): Used to define the
22710 default constructors if none was provided.
22712 (ConstructorInitializer): Add methods Resolve and Emit.
22714 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22716 2001-09-17 Ravi Pratap <ravi@ximian.com>
22718 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22719 the default constructor builder with our hashtable for methodbuilders
22722 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22723 and argument_count is 0 in which case we have a match.
22724 (Binary::ResolveOperator): More null checking and miscellaneous coding
22727 2001-09-17 Ravi Pratap <ravi@ximian.com>
22729 * rootcontext.cs (IsNameSpace): Compare against null.
22731 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22733 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22734 and Unary::Operator.
22736 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22739 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22740 we have overloaded operators.
22741 (Binary::ResolveOperator): Implement the part which does the operator overload
22744 * class.cs (Operator::Emit): Implement.
22745 (TypeContainer::Emit): Emit the operators we have too.
22747 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22748 the case when we have a user-defined operator.
22750 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22752 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22754 2001-09-16 Ravi Pratap <ravi@ximian.com>
22756 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22757 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22758 (Constructor::Emit): Implement.
22759 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22760 if we have no work to do.
22761 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22764 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22765 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22767 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22770 2001-09-15 Ravi Pratap <ravi@ximian.com>
22772 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22774 (Tree::RecordNamespace): Method to do what the name says ;-)
22775 (Tree::Namespaces): Property to get at the namespaces hashtable.
22777 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22780 * rootcontext.cs (IsNamespace): Fixed it :-)
22782 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22784 * class.cs (TypeContainer::FindMembers): Add support for
22786 (MethodCore): New class that encapsulates both the shared aspects
22787 of a Constructor and a Method.
22788 (Method, Constructor): Factored pieces into MethodCore.
22790 * driver.cs: Added --fatal which makes errors throw exceptions.
22791 Load System assembly as well as part of the standard library.
22793 * report.cs: Allow throwing exceptions on errors for debugging.
22795 * modifiers.cs: Do not use `parent', instead use the real type
22796 container to evaluate permission settings.
22798 * class.cs: Put Ravi's patch back in. He is right, and we will
22799 have to cope with the
22801 2001-09-14 Ravi Pratap <ravi@ximian.com>
22803 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22804 FamORAssem, not FamANDAssem.
22806 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22808 * driver.cs: Added --parse option that only parses its input files
22811 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22812 incorrect. IsTopLevel is not used to tell whether an object is
22813 root_types or not (that can be achieved by testing this ==
22814 root_types). But to see if this is a top-level *class* (not
22815 necessarly our "toplevel" container).
22817 2001-09-14 Ravi Pratap <ravi@ximian.com>
22819 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22820 parent instead of a direct call to GetType.
22822 2001-09-14 Ravi Pratap <ravi@ximian.com>
22824 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22825 Modifiers.TypeAttr. This should just be a call to that method.
22827 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22828 object so that we can determine if we are top-level or not.
22830 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22833 * enum.cs (Enum::Define): Ditto.
22835 * modifiers.cs (FieldAttr): Re-write.
22837 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22838 (TypeContainer::HaveStaticConstructor): New property to provide access
22839 to precisely that info.
22841 * modifiers.cs (MethodAttr): Re-write.
22842 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22844 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22845 of top-level types as claimed.
22847 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22849 * expression.cs (MemberLookup): Fruitless attempt to lookup
22850 constructors. Maybe I need to emit default constructors? That
22851 might be it (currently .NET emits this for me automatically).
22852 (Invocation::OverloadResolve): Cope with Arguments == null.
22853 (Invocation::EmitArguments): new function, shared by the new
22854 constructor and us.
22855 (Invocation::Emit): Handle static and instance methods. Emit
22856 proper call instruction for virtual or non-virtual invocations.
22857 (New::Emit): Implement.
22858 (New::Resolve): Implement.
22859 (MemberAccess:Resolve): Implement.
22860 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22861 to track instances.
22862 (FieldExpr::Resolve): Set type.
22864 * support.cs: Handle empty arguments.
22866 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22867 SimpleLookup): Auxiliary routines to help parse a qualifier
22870 Update qualifier_identifier rule.
22872 * codegen.cs: Removed debugging messages.
22874 * class.cs: Make this a global thing, this acts just as a "key" to
22875 objects that we might have around.
22877 (Populate): Only initialize method_builders_to_methods once.
22879 * expression.cs (PropertyExpr): Initialize type from the
22882 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22883 Resolve pattern. Attempt to implicitly convert value to boolean.
22886 * expression.cs: Set the type for the int32/int32 argument case.
22887 (Binary::ResolveOperator): Set the return type to boolean for
22888 comparission operators
22890 * typemanager.cs: Remove debugging print code.
22892 (Invocation::Resolve): resolve type.
22894 * class.cs: Allocate a MemberInfo of the correct size, as the code
22895 elsewhere depends on the test to reflect the correct contents.
22897 (Method::) Keep track of parameters, due to System.Reflection holes
22899 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22902 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22903 of the exact size and return that.
22905 (Class::LookupMethodByBuilder): New function that maps
22906 MethodBuilders to its methods. Required to locate the information
22907 on methods because System.Reflection bit us again.
22909 * support.cs: New file, contains an interface ParameterData and
22910 two implementations: ReflectionParameters and InternalParameters
22911 used to access Parameter information. We will need to grow this
22914 * expression.cs (Invocation::GetParameterData): implement a cache
22915 and a wrapper around the ParameterData creation for methods.
22916 (Invocation::OverloadResolve): Use new code.
22918 2001-09-13 Ravi Pratap <ravi@ximian.com>
22920 * class.cs (TypeContainer::EmitField): Remove and move into
22921 (Field::Define): here and modify accordingly.
22922 (Field.FieldBuilder): New member.
22923 (TypeContainer::Populate): Update accordingly.
22924 (TypeContainer::FindMembers): Implement.
22926 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22928 * statement.cs: (VariableInfo::VariableType): New field to be
22929 initialized with the full type once it is resolved.
22931 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22933 * parameter.cs (GetParameterInfo): Use a type cache to compute
22934 things only once, and to reuse this information
22936 * expression.cs (LocalVariableReference::Emit): Implement.
22937 (OpcodeCast::Emit): fix.
22939 (ParameterReference::Resolve): Implement.
22940 (ParameterReference::Emit): Implement.
22942 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22943 that are expressions need to stay as Expressions.
22945 * typemanager.cs (CSharpName): Returns the C# name of a type if
22948 * expression.cs (Expression::ConvertImplicit): New function that
22949 implements implicit type conversions.
22951 (Expression::ImplicitReferenceConversion): Implements implicit
22952 reference conversions.
22954 (EmptyCast): New type for transparent casts.
22956 (OpcodeCast): New type for casts of types that are performed with
22957 a sequence of bytecodes.
22959 (BoxedCast): New type used for casting value types into reference
22960 types. Emits a box opcode.
22962 (Binary::DoNumericPromotions): Implements numeric promotions of
22963 and computation of the Binary::Type.
22965 (Binary::EmitBranchable): Optimization.
22967 (Binary::Emit): Implement code emission for expressions.
22969 * typemanager.cs (TypeManager): Added two new core types: sbyte
22972 2001-09-12 Ravi Pratap <ravi@ximian.com>
22974 * class.cs (TypeContainer::FindMembers): Method which does exactly
22975 what Type.FindMembers does, only we don't have to use reflection. No
22976 implementation yet.
22978 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22979 typecontainer objects as we need to get at them.
22980 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22982 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22983 typecontainer object.
22985 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22986 of just a Report object.
22988 2001-09-11 Ravi Pratap <ravi@ximian.com>
22990 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22992 (TypeContainer::Populate): Now define the delegates of the type too.
22993 (TypeContainer.Delegates): Property to access the list of delegates defined
22996 * delegates.cs (Delegate::Define): Implement partially.
22998 * modifiers.cs (TypeAttr): Handle more flags.
23000 2001-09-11 Ravi Pratap <ravi@ximian.com>
23002 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23004 (Operator::Define): Re-write logic to get types by using the LookupType method
23005 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23006 (Indexer::Define): Ditto.
23007 (Event::Define): Ditto.
23008 (Property::Define): Ditto.
23010 2001-09-10 Ravi Pratap <ravi@ximian.com>
23012 * class.cs (TypeContainer::Populate): Now define operators too.
23013 (TypeContainer.Operators): New property to access the list of operators
23015 (Operator.OperatorMethodBuilder): New member to hold the method builder
23016 for the operator we are defining.
23017 (Operator::Define): Implement.
23019 2001-09-10 Ravi Pratap <ravi@ximian.com>
23021 * class.cs (Event::Define): Make the prefixes of the accessor methods
23022 addOn_ and removeOn_
23024 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23025 of the location being passed in too. Ideally, this should go later since all
23026 error reporting should be done through the Report object.
23028 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23029 (Populate): Iterate thru the indexers we have and define them too.
23030 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23031 for the get and set accessors.
23032 (Indexer::Define): Implement.
23034 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23036 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23037 my previous implementation, did not work.
23039 * typemanager.cs: Add a couple of missing types (the longs).
23041 * literal.cs: Use TypeManager.bool_type instead of getting it.
23043 * expression.cs (EventExpr): New kind of expressions.
23044 (Expressio::ExprClassFromMemberInfo): finish
23046 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23048 * assign.cs: Emit stores to static fields differently.
23050 2001-09-08 Ravi Pratap <ravi@ximian.com>
23052 * Merge in changes and adjust code to tackle conflicts. Backed out my
23053 code in Assign::Resolve ;-)
23055 2001-09-08 Ravi Pratap <ravi@ximian.com>
23057 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23058 instead Report.Error and also pass in the location.
23059 (CSharpParser::Lexer): New readonly property to return the reference
23060 to the Tokenizer object.
23061 (declare_local_variables): Use Report.Error with location instead of plain
23065 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23066 (Operator.CheckBinaryOperator): Ditto.
23068 * cs-parser.jay (operator_declarator): Update accordingly.
23070 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23071 (CheckBinaryOperator): Same here.
23073 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23074 on the name without any prefixes of namespace names etc. This is because we
23075 already might have something already fully qualified like
23076 'System.Console.WriteLine'
23078 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23080 2001-09-07 Ravi Pratap <ravi@ximian.com>
23082 * cs-tokenizer.cs (location): Return a string which also contains
23085 * expression.cs (ElementAccess): New class for expressions of the
23086 type 'element access.'
23087 (BaseAccess): New class for expressions of the type 'base access.'
23088 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23091 * cs-parser.jay (element_access): Implement action.
23092 (base_access): Implement actions.
23093 (checked_expression, unchecked_expression): Implement.
23095 * cs-parser.jay (local_variable_type): Correct and implement.
23096 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23098 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23100 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23101 name and the specifiers.
23103 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23105 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
23106 making them all public ;-)
23108 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23111 2001-09-07 Miguel de Icaza <miguel@ximian.com>
23113 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23115 (FieldExpr, PropertyExprs): New resolved expressions.
23116 (SimpleName::MemberStaticCheck): Perform static checks for access
23117 to non-static fields on static methods. Maybe this should be
23118 generalized for MemberAccesses.
23119 (SimpleName::ResolveSimpleName): More work on simple name
23122 * cs-parser.jay (primary_expression/qualified_identifier): track
23123 the parameter index.
23125 * codegen.cs (CodeGen::Save): Catch save exception, report error.
23126 (EmitContext::EmitBoolExpression): Chain to expression generation
23127 instead of temporary hack.
23128 (::EmitStatementExpression): Put generic expression code generation.
23130 * assign.cs (Assign::Emit): Implement variable assignments to
23131 local variables, parameters and fields.
23133 2001-09-06 Miguel de Icaza <miguel@ximian.com>
23135 * statement.cs (Block::GetVariableInfo): New method, returns the
23136 VariableInfo for a variable name in a block.
23137 (Block::GetVariableType): Implement in terms of GetVariableInfo
23139 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23140 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23142 2001-09-06 Ravi Pratap <ravi@ximian.com>
23144 * cs-parser.jay (operator_declaration): Continue on my quest : update
23145 to take attributes argument.
23146 (event_declaration): Ditto.
23147 (enum_declaration): Ditto.
23148 (indexer_declaration): Ditto.
23150 * class.cs (Operator::Operator): Update constructor accordingly.
23151 (Event::Event): Ditto.
23153 * delegate.cs (Delegate::Delegate): Same here.
23155 * enum.cs (Enum::Enum): Same here.
23157 2001-09-05 Ravi Pratap <ravi@ximian.com>
23159 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23161 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23163 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23164 being passed around as an arraylist.
23165 (Attributes::AddAttribute): Method to add attribute sections.
23167 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23168 (struct_declaration): Update accordingly.
23169 (constant_declaration): Update.
23170 (field_declaration): Update.
23171 (method_header): Update.
23172 (fixed_parameter): Update.
23173 (parameter_array): Ditto.
23174 (property_declaration): Ditto.
23175 (destructor_declaration): Ditto.
23177 * class.cs (Struct::Struct): Update constructors accordingly.
23178 (Class::Class): Ditto.
23179 (Field::Field): Ditto.
23180 (Method::Method): Ditto.
23181 (Property::Property): Ditto.
23182 (TypeContainer::OptAttribute): update property's return type.
23184 * interface.cs (Interface.opt_attributes): New member.
23185 (Interface::Interface): Update to take the extra Attributes argument.
23187 * parameter.cs (Parameter::Parameter): Ditto.
23189 * constant.cs (Constant::Constant): Ditto.
23191 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23192 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23193 the attributes as a parameter.
23194 (InterfaceProperty): Update constructor call.
23195 (InterfaceEvent): Ditto.
23196 (InterfaceMethod): Ditto.
23197 (InterfaceIndexer): Ditto.
23199 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23200 pass the attributes too.
23201 (interface_event_declaration): Ditto.
23202 (interface_property_declaration): Ditto.
23203 (interface_method_declaration): Ditto.
23204 (interface_declaration): Ditto.
23206 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23208 * class.cs (Method::Define): Track the "static Main" definition to
23209 create an entry point.
23211 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23212 EntryPoint if we find it.
23214 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23215 (EmitContext::ig): Make this variable public.
23217 * driver.cs: Make the default output file be the first file name
23218 with the .exe extension.
23220 Detect empty compilations
23222 Handle various kinds of output targets. Handle --target and
23223 rename -t to --dumper.
23225 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23226 methods inherited from Expression return now an Expression. This
23227 will is used during the tree rewriting as we resolve them during
23230 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23231 the spec. Missing entirely is the information about
23232 accessability of elements of it.
23234 (Expression::ExprClassFromMemberInfo): New constructor for
23235 Expressions that creates a fully initialized Expression based on
23236 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23239 (Invocation::Resolve): Begin implementing resolution of invocations.
23241 * literal.cs (StringLiteral): Implement Emit.
23243 2001-09-05 Ravi Pratap <ravi@ximian.com>
23245 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23248 2001-09-04 Ravi Pratap <ravi@ximian.com>
23250 * cs-parser.jay (attribute_arguments): Implement actions.
23251 (attribute): Fix bug in production. Implement action.
23252 (attribute_list): Implement.
23253 (attribute_target): Implement.
23254 (attribute_target_specifier, opt_target_specifier): Implement
23255 (CheckAttributeTarget): New method to check if the attribute target
23257 (attribute_section): Implement.
23258 (opt_attributes): Implement.
23260 * attribute.cs : New file to handle attributes.
23261 (Attribute): Class to hold attribute info.
23263 * cs-parser.jay (opt_attribute_target_specifier): Remove production
23264 (attribute_section): Modify production to use 2 different rules to
23265 achieve the same thing. 1 s/r conflict down !
23266 Clean out commented, useless, non-reducing dimension_separator rules.
23268 * class.cs (TypeContainer.attributes): New member to hold list
23269 of attributes for a type.
23270 (Struct::Struct): Modify to take one more argument, the attribute list.
23271 (Class::Class): Ditto.
23272 (Field::Field): Ditto.
23273 (Method::Method): Ditto.
23274 (Property::Property): Ditto.
23276 * cs-parser.jay (struct_declaration): Update constructor call to
23277 pass in the attributes too.
23278 (class_declaration): Ditto.
23279 (constant_declaration): Ditto.
23280 (field_declaration): Ditto.
23281 (method_header): Ditto.
23282 (fixed_parameter): Ditto.
23283 (parameter_array): Ditto.
23284 (property_declaration): Ditto.
23286 * constant.cs (Constant::Constant): Update constructor similarly.
23287 Use System.Collections.
23289 * parameter.cs (Parameter::Parameter): Update as above.
23291 2001-09-02 Ravi Pratap <ravi@ximian.com>
23293 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23294 (TypeContainer.delegates): New member to hold list of delegates.
23296 * cs-parser.jay (delegate_declaration): Implement the action correctly
23297 this time as I seem to be on crack ;-)
23299 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23301 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23302 tell whether an identifier represents a namespace.
23304 * expression.cs (NamespaceExpr): A namespace expression, used only
23305 temporarly during expression resolution.
23306 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23307 utility functions to resolve names on expressions.
23309 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23311 * codegen.cs: Add hook for StatementExpressions.
23313 * class.cs: Fix inverted test for static flag in methods.
23315 2001-09-02 Ravi Pratap <ravi@ximian.com>
23317 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23318 to make it coincide with MS' number.
23319 (Operator::CheckBinaryOperator): Ditto.
23321 * ../errors/errors.txt : Remove error numbers added earlier.
23323 * ../errors/cs1019.cs : Test case for error # 1019
23325 * ../errros/cs1020.cs : Test case for error # 1020
23327 * cs-parser.jay : Clean out commented cruft.
23328 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23329 used anywhere - non-reducing rule.
23330 (namespace_declarations): Non-reducing rule - comment out.
23332 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23333 with TypeContainer::AddEnum.
23335 * delegate.cs : New file for delegate handling classes.
23336 (Delegate): Class for declaring delegates.
23338 * makefile : Update.
23340 * cs-parser.jay (delegate_declaration): Implement.
23342 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23344 * class.cs (Event::Define): Implement.
23345 (Event.EventBuilder): New member.
23347 * class.cs (TypeContainer::Populate): Update to define all enums and events
23349 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23350 readonly fields for all these cases ?
23352 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23354 * class.cs (Property): Revamp to use the convention of making fields readonly.
23355 Accordingly modify code elsewhere.
23357 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23358 the Define method of the Property class.
23360 * class.cs : Clean up applied patch and update references to variables etc. Fix
23362 (TypeContainer::Populate): Update to define all the properties we have. Also
23363 define all enumerations.
23365 * enum.cs (Define): Implement.
23367 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23369 * cs-parser.jay (overloadable_operator): The semantic value is an
23370 enum of the Operator class.
23371 (operator_declarator): Implement actions.
23372 (operator_declaration): Implement.
23374 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23375 validity of definitions.
23376 (Operator::CheckBinaryOperator): Static method to check for binary operators
23377 (TypeContainer::AddOperator): New method to add an operator to a type.
23379 * cs-parser.jay (indexer_declaration): Added line to actually call the
23380 AddIndexer method so it gets added ;-)
23382 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23383 already taken care of by the MS compiler ?
23385 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23387 * class.cs (Operator): New class for operator declarations.
23388 (Operator::OpType): Enum for the various operators.
23390 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23392 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23393 ostensibly handle this in semantic analysis.
23395 * cs-parser.jay (general_catch_clause): Comment out
23396 (specific_catch_clauses, specific_catch_clause): Ditto.
23397 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23398 (catch_args, opt_catch_args): New productions.
23399 (catch_clause): Rewrite to use the new productions above
23400 (catch_clauses): Modify accordingly.
23401 (opt_catch_clauses): New production to use in try_statement
23402 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23403 and re-write the code in the actions to extract the specific and
23404 general catch clauses by being a little smart ;-)
23406 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23407 Hooray, try and catch statements parse fine !
23409 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23411 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23412 string from the hashtable of variables.
23414 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23415 I end up making that mistake ;-)
23416 (catch_clauses): Fixed gross error which made Key and Value of the
23417 DictionaryEntry the same : $1 !!
23419 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23421 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23423 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23424 when the add and remove accessors are specified.
23426 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23428 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23429 information about indexer_declarator.
23430 (indexer_declarator): Implement actions.
23431 (parsing_indexer): New local boolean used to keep track of whether
23432 we are parsing indexers or properties. This is necessary because
23433 implicit_parameters come into picture even for the get accessor in the
23434 case of an indexer.
23435 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23437 * class.cs (Indexer): New class for indexer declarations.
23438 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23439 (TypeContainer::indexers): New member to hold list of indexers for the
23442 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23444 * cs-parser.jay (add_accessor_declaration): Implement action.
23445 (remove_accessor_declaration): Implement action.
23446 (event_accessors_declaration): Implement
23447 (variable_declarators): swap statements for first rule - trivial.
23449 * class.cs (Event): New class to hold information about event
23451 (TypeContainer::AddEvent): New method to add an event to a type
23452 (TypeContainer::events): New member to hold list of events.
23454 * cs-parser.jay (event_declaration): Implement actions.
23456 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23458 * cs-parser.jay (dim_separators): Implement. Make it a string
23459 concatenating all the commas together, just as they appear.
23460 (opt_dim_separators): Modify accordingly
23461 (rank_specifiers): Update accordingly. Basically do the same
23462 thing - instead, collect the brackets here.
23463 (opt_rank_sepcifiers): Modify accordingly.
23464 (array_type): Modify to actually return the complete type string
23465 instead of ignoring the rank_specifiers.
23466 (expression_list): Implement to collect the expressions
23467 (variable_initializer): Implement. We make it a list of expressions
23468 essentially so that we can handle the array_initializer case neatly too.
23469 (variable_initializer_list): Implement.
23470 (array_initializer): Make it a list of variable_initializers
23471 (opt_array_initializer): Modify accordingly.
23473 * expression.cs (New::NType): Add enumeration to help us
23474 keep track of whether we have an object/delegate creation
23475 or an array creation.
23476 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23477 members to hold data about array creation.
23478 (New:New): Modify to update NewType
23479 (New:New): New Overloaded contructor for the array creation
23482 * cs-parser.jay (array_creation_expression): Implement to call
23483 the overloaded New constructor.
23485 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23487 * class.cs (TypeContainer::Constructors): Return member
23488 constructors instead of returning null.
23490 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23492 * typemanager.cs (InitCoreTypes): Initialize the various core
23493 types after we have populated the type manager with the user
23494 defined types (this distinction will be important later while
23495 compiling corlib.dll)
23497 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23498 on Expression Classification. Now all expressions have a method
23499 `Resolve' and a method `Emit'.
23501 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23502 generation from working. Also add some temporary debugging
23505 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23507 * codegen.cs: Lots of code generation pieces. This is only the
23508 beginning, will continue tomorrow with more touches of polish. We
23509 handle the fundamentals of if, while, do, for, return. Others are
23510 trickier and I need to start working on invocations soon.
23512 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23515 * codegen.cs (EmitContext): New struct, used during code
23516 emission to keep a context. Most of the code generation will be
23519 * cs-parser.jay: Add embedded blocks to the list of statements of
23520 this block. So code generation proceeds in a top down fashion.
23522 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23524 * statement.cs: Add support for multiple child blocks.
23526 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23528 * codegen.cs (EmitCode): New function, will emit the code for a
23529 Block of code given a TypeContainer and its ILGenerator.
23531 * statement.cs (Block): Standard public readonly optimization.
23532 (Block::Block constructors): Link children.
23533 (Block::Child): Child Linker.
23534 (Block::EmitVariables): Emits IL variable declarations.
23536 * class.cs: Drop support for MethodGroups here, delay until
23538 (Method::): Applied the same simplification that I did before, and
23539 move from Properties to public readonly fields.
23540 (Method::ParameterTypes): Returns the parameter types for the
23541 function, and implements a cache that will be useful later when I
23542 do error checking and the semantic analysis on the methods is
23544 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23545 and made a method, optional argument tells whether this is a class
23546 or a structure to apply the `has-this' bit.
23547 (Method::GetCallingConvention): Implement, returns the calling
23549 (Method::Define): Defines the type, a second pass is performed
23550 later to populate the methods.
23552 (Constructor::ParameterTypes): implement a cache similar to the
23553 one on Method::ParameterTypes, useful later when we do semantic
23556 (TypeContainer::EmitMethod): New method. Emits methods.
23558 * expression.cs: Removed MethodGroup class from here.
23560 * parameter.cs (Parameters::GetCallingConvention): new method.
23562 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23564 * class.cs (TypeContainer::Populate): Drop RootContext from the
23567 (Constructor::CallingConvention): Returns the calling convention.
23568 (Constructor::ParameterTypes): Returns the constructor parameter
23571 (TypeContainer::AddConstructor): Keep track of default constructor
23572 and the default static constructor.
23574 (Constructor::) Another class that starts using `public readonly'
23575 instead of properties.
23577 (Constructor::IsDefault): Whether this is a default constructor.
23579 (Field::) use readonly public fields instead of properties also.
23581 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23582 track of static constructors; If none is used, turn on
23583 BeforeFieldInit in the TypeAttributes.
23585 * cs-parser.jay (opt_argument_list): now the return can be null
23586 for the cases where there are no arguments.
23588 (constructor_declarator): If there is no implicit `base' or
23589 `this', then invoke the default parent constructor.
23591 * modifiers.cs (MethodAttr): New static function maps a set of
23592 modifiers flags into a MethodAttributes enum
23593 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23594 MethodAttr, TypeAttr to represent the various mappings where the
23595 modifiers are used.
23596 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23598 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23600 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23603 * interface.cs (PopulateIndexer): Implemented the code generator
23604 for interface indexers.
23606 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23608 * interface.cs (InterfaceMemberBase): Now we track the new status
23611 (PopulateProperty): Implement property population. Woohoo! Got
23612 Methods and Properties going today.
23614 Removed all the properties for interfaces, and replaced them with
23615 `public readonly' fields.
23617 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23619 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23620 initialize their hashtables/arraylists only when they are needed
23621 instead of doing this always.
23623 * parameter.cs: Handle refs and out parameters.
23625 * cs-parser.jay: Use an ArrayList to construct the arguments
23626 instead of the ParameterCollection, and then cast that to a
23629 * parameter.cs: Drop the use of ParameterCollection and use
23630 instead arrays of Parameters.
23632 (GetParameterInfo): Use the Type, not the Name when resolving
23635 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23637 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23638 and instead use public readonly fields.
23640 * class.cs: Put back walking code for type containers.
23642 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23644 * class.cs (MakeConstant): Code to define constants.
23646 * rootcontext.cs (LookupType): New function. Used to locate types
23649 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23651 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23652 this System.Reflection code is. Kudos to Microsoft
23654 * typemanager.cs: Implement a type cache and avoid loading all
23655 types at boot time. Wrap in LookupType the internals. This made
23656 the compiler so much faster. Wow. I rule!
23658 * driver.cs: Make sure we always load mscorlib first (for
23659 debugging purposes, nothing really important).
23661 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23662 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23664 * rootcontext.cs: Lookup types on their namespace; Lookup types
23665 on namespaces that have been imported using the `using' keyword.
23667 * class.cs (TypeContainer::TypeAttr): Virtualize.
23668 (Class::TypeAttr): Return attributes suitable for this bad boy.
23669 (Struct::TypeAttr): ditto.
23670 Handle nested classes.
23671 (TypeContainer::) Remove all the type visiting code, it is now
23672 replaced with the rootcontext.cs code
23674 * rootcontext.cs (GetClassBases): Added support for structs.
23676 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23678 * interface.cs, statement.cs, class.cs, parameter.cs,
23679 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23680 Drop use of TypeRefs, and use strings instead.
23682 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23686 * class.cs (Struct::Struct): set the SEALED flags after
23687 checking the modifiers.
23688 (TypeContainer::TypeAttr): new property, returns the
23689 TypeAttributes for a class.
23691 * cs-parser.jay (type_list): Oops, list production was creating a
23692 new list of base types.
23694 * rootcontext.cs (StdLib): New property.
23695 (GetInterfaceTypeByName): returns an interface by type name, and
23696 encapsulates error handling here.
23697 (GetInterfaces): simplified.
23698 (ResolveTree): Encapsulated all the tree resolution here.
23699 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23702 * driver.cs: Add support for --nostdlib, to avoid loading the
23703 default assemblies.
23704 (Main): Do not put tree resolution here.
23706 * rootcontext.cs: Beginning of the class resolution.
23708 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23710 * rootcontext.cs: Provide better error reporting.
23712 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23714 * rootcontext.cs (CreateInterface): Handle the case where there
23715 are no parent interfaces.
23717 (CloseTypes): Routine to flush types at the end.
23718 (CreateInterface): Track types.
23719 (GetInterfaces): Returns an array of Types from the list of
23720 defined interfaces.
23722 * typemanager.c (AddUserType): Mechanism to track user types (puts
23723 the type on the global type hash, and allows us to close it at the
23726 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23728 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23729 RecordInterface instead.
23731 * cs-parser.jay: Updated to reflect changes above.
23733 * decl.cs (Definition): Keep track of the TypeBuilder type that
23734 represents this type here. Not sure we will use it in the long
23735 run, but wont hurt for now.
23737 * driver.cs: Smaller changes to accomodate the new code.
23739 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23742 * rootcontext.cs (CreateInterface): New method, used to create
23743 the System.TypeBuilder type for interfaces.
23744 (ResolveInterfaces): new entry point to resolve the interface
23746 (CodeGen): Property, used to keep track of the code generator.
23748 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23750 * cs-parser.jay: Add a second production for delegate_declaration
23753 (enum_body): Put an opt_comma here instead of putting it on
23754 enum_body or enum_member_declarations so we can handle trailing
23755 commas on enumeration members. Gets rid of a shift/reduce.
23757 (type_list): Need a COMMA in the middle.
23759 (indexer_declaration): Tell tokenizer to recognize get/set
23761 * Remove old targets.
23763 * Re-add the parser target.
23765 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23767 * cs-parser.jay: Add precendence rules for a number of operators
23768 ot reduce the number of shift/reduce conflicts in the grammar.
23770 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23772 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23775 Get rid of old crufty code.
23777 * rootcontext.cs: Use this to keep track of the parsed
23778 representation and the defined types available to the program.
23780 * gen-treedump.cs: adjust for new convention.
23782 * type.cs: Split out the type manager, and the assembly builder
23785 * typemanager.cs: the type manager will live here now.
23787 * cil-codegen.cs: And the code generator here.
23789 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23791 * makefile: Fixed up for easy making.
23793 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23795 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23798 (unary_expression): Expand pre_increment_expression and
23799 post_decrement_expression to reduce a shift/reduce.
23801 2001-07-11 Simon Cozens
23803 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23805 Improve allow_keyword_as_indent name.
23807 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23809 * Adjustments for Beta2.
23811 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23813 * decl.cs: Added `Define' abstract method.
23814 (InTransit): new property, used to catch recursive definitions.
23816 * interface.cs: Implement `Define'.
23818 * modifiers.cs: Map Modifiers.constants to
23819 System.Reflection.TypeAttribute flags.
23821 * class.cs: Keep track of types and user-defined types.
23822 (BuilderInit): New method for creating an assembly
23823 (ResolveType): New function to launch the resolution process, only
23824 used by interfaces for now.
23826 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23827 that are inserted into the name space.
23829 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23831 * ARGH. I have screwed up my tree so many times due to the use of
23832 rsync rather than using CVS. Going to fix this at once.
23834 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23837 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23839 * Experiment successful: Use System.Type rather that our own
23842 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23844 * cs-parser.jay: Removed nsAliases from here.
23846 Use new namespaces, handle `using XXX;'
23848 * namespace.cs: Reimplemented namespace handling, use a recursive
23849 definition of the class. Now we can keep track of using clauses
23850 and catch invalid using clauses.
23852 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23854 * gen-treedump.cs: Adapted for all the renaming.
23856 * expression.cs (Expression): this class now has a Type property
23857 which returns an expression Type.
23859 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23860 `Type', as this has a different meaning now in the base
23862 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23864 * interface.cs, class.cs: Removed from all the sources the
23865 references to signature computation, as we can not do method
23866 signature computation during the parsing time, as we are not
23867 trying to solve at that point distinguishing:
23871 void a (NS.Blah x) {}
23874 Which depending on the context might be valid or not, as we do not
23875 know if Blah is the same thing as NS.Blah at that point.
23877 * Redid everything so the code uses TypeRefs now instead of
23878 Types. TypeRefs are just temporary type placeholders, that need
23879 to be resolved. They initially have a pointer to a string and the
23880 current scope in which they are used. This is used later by the
23881 compiler to resolve the reference to an actual Type.
23883 * DeclSpace is no longer a CIR.Type, and neither are
23884 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23885 are all DeclSpaces, but no Types.
23887 * type.cs (TypeRefManager): This implements the TypeRef manager,
23888 which keeps track of all the types that need to be resolved after
23889 the parsing has finished.
23891 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23893 * ARGH. We are going to have to store `foreach' as a class rather
23894 than resolving it, as we need to verify error 1579 after name
23895 resolution. *OR* we could keep a flag that says `This request to
23896 IEnumerator comes from a foreach statement' which we can then use
23897 to generate the error.
23899 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23901 * class.cs (TypeContainer.AddMethod): we now add methods to the
23902 MethodGroup instead of the method hashtable.
23904 * expression.cs: Add MethodGroup abstraction, which gets us one
23905 step closer to the specification in the way we handle method
23908 * cs-parser.jay (primary_expression): qualified_identifier now
23909 tried to match up an identifier to a local variable reference or
23910 to a parameter reference.
23912 current_local_parameters is now a parser global variable that
23913 points to the current parameters for the block, used during name
23916 (property_declaration): Now creates an implicit `value' argument to
23919 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23921 * parameter.cs: Do not use `param' arguments as part of the
23922 signature, per the spec.
23924 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23926 * decl.cs: Base class for classes, structs and interfaces. This
23927 is the "Declaration Space"
23929 * cs-parser.jay: Use CheckDef for checking declaration errors
23930 instead of having one on each function.
23932 * class.cs: Factor out some code for handling error handling in
23933 accordance to the "Declarations" section in the "Basic Concepts"
23934 chapter in the ECMA C# spec.
23936 * interface.cs: Make all interface member classes derive from
23937 InterfaceMemberBase.
23939 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23941 * Many things: all interfaces are parsed and generated in
23942 gen-treedump. Support for member variables, constructors,
23943 destructors, properties, constants is there.
23945 Beginning of the IL backend, but very little done, just there for
23948 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23950 * cs-parser.jay: Fix labeled statement.
23952 * cs-tokenizer.cs (escape): Escape " and ' always.
23953 ref_line, ref_name: keep track of the line/filename as instructed
23954 by #line by the compiler.
23957 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23959 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23960 to match the values in System.CodeDOM.
23962 Divid renamed to Divide.
23964 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23966 (Statements.set): remove.
23968 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23971 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23972 falseStatements always have valid values.
23974 * cs-parser.jay: Use System.CodeDOM now.