1 2007-06-14 Marek Safar <marek.safar@gmail.com>
3 * cs-parser.jay: Assembly and module attributes must precede all other
4 elements except using clauses and extern alias declarations.
6 2007-06-08 Marek Safar <marek.safar@gmail.com>
8 * cs-parser.jay: Uses newly defined GroupBy class.
10 * linq.cs (GroupBy): Implemented.
11 (AQueryClause.BuildQueryClause): Refactored to allow customize query
14 2007-06-08 Marek Safar <marek.safar@gmail.com>
16 * generics.cs (InferTypeArguments): Uses AnonymousMethodExpression
19 2007-06-06 Marek Safar <marek.safar@gmail.com>
21 * generics.cs (TypeArguments): New contructor fow known number of
24 2007-06-04 Raja R Harinath <rharinath@novell.com>
26 * linq.cs (Select.DoResolve): Pass the created parameters to the
29 2007-05-29 Raja R Harinath <rharinath@novell.com>
31 * cs-parser.jay: Update to changes in ToplevelBlock.
32 (top_current_block): Remove.
34 2007-05-27 Raja R Harinath <harinath@gmail.com>
36 * cs-parser.jay: Update to new ExplicitBlock invariant.
38 * cs-parser.jay: Update to changes introduced in Block and
41 2007-05-25 Raja R Harinath <rharinath@novell.com>
43 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
44 modifying current_block directly.
46 2007-05-22 Scott Peterson <lunchtimemama@gmail.com>
48 * cs-parser.jay: Implemented automatic properties (C# 3.0)
50 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
52 * cs-parser.jay: Improved grammar for object and collection
55 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
57 This code is contributed under the MIT X11 license
59 * cs-parser.jay: Added support for C# 3.0 language features:
60 Variable type inference (the "var" keyword)
64 Collection initialization
66 2007-05-06 Marek Safar <marek.safar@gmail.com>
69 * cs-parser.jay: Add special handling for coalescing operator.
71 2007-05-02 Raja R Harinath <rharinath@novell.com>
73 Fix regression in cs0631-3.cs
74 * cs-parser.jay (operator_declarator): Add opt_attributes to error
75 fallback. Make error fallback catch more cases.
77 2007-05-01 Miguel de Icaza <miguel@novell.com>
79 * cs-parser.jay: Allow parameters in operator declarations to have
82 2007-04-27 Miguel de Icaza <miguel@novell.com>
84 * generic.cs (TypeManager.LambdaInfer): now this routine will
85 make only one inference from the list of lambda expression that
86 have not participated in inferring a type.
88 (TypeManager.InferTypeArguments): The logic that drives the type
89 inference in lambda expressions is now driven here.
91 2007-04-23 Miguel de Icaza <miguel@novell.com>
93 * generic.cs: Large update to LambdaInfer, this is merely an
94 update to start the lambda type inference. It is by no means
95 complete. It is currently merely able to build a sample program
96 (with no iteration for the type parameters).
98 2007-04-12 Duncan Mak <duncan@a-chinaman.com>
100 * cs-parser.jay (interface_method_declaration_body): Fixed typo.
102 2007-04-08 Marek Safar <marek.safar@gmail.com>
104 * cs-parser.jay, linq.cs: First select implementation (hacky).
106 * generic.cs (InferTypeArguments): Simplified.
108 2007-03-31 Marek Safar <marek.safar@gmail.com>
110 * generic.cs (InferTypeArguments): Restored validation check.
111 (InferTypeArguments): Move all logic to Compatible method for re-usability.
113 2007-03-25 Marek Safar <marek.safar@gmail.com>
115 * generic.cs (InferTypeArguments): Infer arguments before they are used
116 for compatibility check.
118 2007-03-15 Marek Safar <marek.safar@gmail.com>
120 * generic.cs (InflatedConstraints): Fixed the check order.
121 (TypeArguments.Resolve): Small optimization for generic parameters.
122 (InferTypeArguments): Add infering support for anonymous methods.
124 2007-03-15 Martin Baulig <martin@ximian.com>
129 (TypeParameter.HasConstructorConstraint): Removed.
130 (ConstraintChecker.HasDefaultConstructor): Removed the
131 `TypeBuilder' argument here; correctly check for the ctor
132 constraint on type parameters.
134 2007-03-15 Martin Baulig <martin@ximian.com>
139 (TypeParameter): Create a `MemberCache' here as well. Note that
140 we need to create this on-demand when it's actually used.
142 2007-03-10 Marek Safar <marek.safar@gmail.com>
144 * generic.cs (TypeArguments.Resolve): Avoid redundant checks.
146 2007-03-09 Raja R Harinath <rharinath@novell.com>
148 * cs-parser.jay (WHERE): Move before QUERY_FIRST_TOKEN. 'where'
149 is a valid keyword outside a linq expression too.
151 2007-03-03 Marek Safar <marek.safar@gmail.com>
153 * cs-parser.jay: Implemented basic linq grammar.
155 * linq.cs: New file for hosting query specific classes.
157 2007-02-26 Marek Safar <marek.safar@gmail.com>
159 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
161 2007-02-20 Marek Safar <marek.safar@gmail.com>
164 * cs-parser.jay: Anonymous container starts at constructor declaration
165 and not at block beginning because it has to be usable in constructor
168 2007-02-18 Marek Safar <marek.safar@gmail.com>
170 A fix for bug #80493 by Atsushi Enomoto
171 * cs-parser.jay: Ignore invalid attribute target.
173 2007-02-15 Miguel de Icaza <miguel@novell.com>
175 * Remove the call to SetExpression for lambda expressions, we do
176 not actually need it.
178 Remove expression tracking code as its not needed.
180 2007-02-11 Miguel de Icaza <miguel@novell.com>
182 * cs-parser.jay (lambda_expression_body): when the body is an
183 expression add a statement of the form:
185 contextual-return expression.
187 Where `contextual-return' is similar to `return', the difference
188 being that if the delegate that the lambda will be converted to
189 has a void return type, it will check that the result is a
190 ExpressionStatement and the result is a plain ret (no return
191 values on the stack). If the return type of the delegate is of a
192 given type, this turns into a return with a value and does the
193 regular checking to check that the computed value can be
194 implicitly converted to the delegate return.
196 2007-01-30 Miguel de Icaza <miguel@novell.com>
198 * cs-parser.jay (anonymous_method_expression): move the
199 before/after productions to the start_anonymous and end_anonymous
200 methods so the code can be reused for lambda functions.
202 (lambda_expression_body): wrap expressions implicitly into a
205 (block): factor out the setup/teardown of parsing a block so we
206 can reuse that in lambda_expression_body
208 (lambda_expression): use new anonymous method helper methods.
210 2007-01-29 Miguel de Icaza <miguel@novell.com>
212 * cs-parser.jay: oob_stack make it static (am guessing that is why
213 we no longer initialize it anymore) and reuse it across
216 2007-01-28 Miguel de Icaza <miguel@novell.com>
218 * cs-parser.jay (open_parens): Introduce new non-terminal that
219 abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
220 be returned in places where types are followed by identifiers
221 (this is expected in declaration, fixed, using, foreach and catch
224 Use open_parens in those places, keep OPEN_PARENS in the
227 cs-parser.jay: New grammar bits for parsing lambda expressions.
229 2007-01-28 Raja R Harinath <rharinath@novell.com>
231 Fix #80534, gtest-309.cs
232 * generic.cs (UnifyType): Rename from InferType. Make unification
233 of generic insts simpler and don't insist on inferring all generic
234 parameters in a single generic inst unification.
236 (InferGenericInstance): Remove.
237 Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
239 2007-01-20 Marek Safar <marek.safar@gmail.com>
241 * cs-parser.jay: Better parameter error handling.
243 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
244 Raja R Harinath <rharinath@novell.com>
246 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
247 Note the order in which accessors are declared in the source.
249 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
251 * generic.cs (TypeParameter.FindMembers): Use the generic
252 constraints, not the constraints to check for methods (first fix
255 2006-12-30 Marek Safar <marek.safar@gmail.com>
257 * cs-parser.jay: Better syntax errors handling.
259 2006-11-21 Marek Safar <marek.safar@gmail.com>
261 * cs-parser.jay: Tiny change to work with mcs tokenizer.
263 * cs-tokenizer.cs: Remove after unification with mcs.
265 2006-10-28 Marek Safar <marek.safar@gmail.com>
268 * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
271 2006-10-26 Marek Safar <marek.safar@gmail.com>
274 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
276 2006-10-25 Brian Crowell <brian@fluggo.com>
279 * generic.cs (CheckConstraints): Allow generic parameters with
280 inheritance constraints to satisfy reference type constraints.
282 2006-10-09 Martin Baulig <martin@ximian.com>
285 (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
287 2006-09-25 Martin Baulig <martin@ximian.com>
289 * class.cs: Remove after unification with mcs source.
291 2006-09-24 Raja R Harinath <harinath@gmail.com>
293 * convert.cs: Remove after unification with mcs source.
295 2006-09-24 Marek Safar <marek.safar@seznam.cz>
297 * class.cs (MemberBase.VerifyClsCompliance): When method has type
298 parameters verify them as well.
300 * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
301 the type parameter constraints.
302 (Generics.VerifyClsCompliance): Ditto.
304 2006-09-24 Marek Safar <marek.safar@seznam.cz>
306 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
307 for anonymous block with out argument.
309 2006-09-24 Marek Safar <marek.safar@seznam.cz>
311 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
312 not used private events only.
314 2006-09-23 Marek Safar <marek.safar@seznam.cz>
316 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
318 * cs-parser.jay: Parse correctly cast of default (T).
320 * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
321 Store original type via EmptyConstantCast.
323 2006-09-22 Martin Baulig <martin@ximian.com>
325 * delegate.cs: Removed; this file is now shared with mcs.
327 * attribute.cs: Removed; this file is now shared with mcs.
329 2006-09-22 Martin Baulig <martin@ximian.com>
331 * ecore.cs: Removed; this file is now shared with mcs.
333 2006-09-21 Marek Safar <marek.safar@seznam.cz>
335 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
337 * ecore.cs (NullCast): Derives from NullConstant.
339 * generic.cs (DefaultValueExpression): Fixed to cope with the constant
342 2006-09-21 Martin Baulig <martin@ximian.com>
344 * decl.cs: Removed; this file is now shared with mcs.
346 2006-09-21 Raja R Harinath <rharinath@novell.com>
348 * rootcontext.cs: Remove after unification with mcs source.
350 * report.cs: Remove after unification with mcs source.
351 * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
353 (InitGenerics, CleanUpGenerics): Remove.
355 * support.cs: Remove after unification with mcs source.
357 2006-09-20 Raja R Harinath <rharinath@novell.com>
359 * codegen.cs: Remove after unification with mcs source.
361 2006-09-19 Martin Baulig <martin@ximian.com>
363 * expression.cs: Removed; this file is now shared with mcs.
365 2006-09-19 Martin Baulig <martin@ximian.com>
368 (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
369 (TypeManager.DropGenericTypeArguments): Likewise.
370 (TypeManager.DropGenericMethodArguments): Likewise.
371 (TypeManager.GetTypeArguments): Likewise.
372 (TypeManager.HasGenericArguments): Likewise.
374 2006-09-19 Martin Baulig <martin@ximian.com>
376 * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
378 2006-09-19 Martin Baulig <martin@ximian.com>
380 * typemanager.cs: Removed; this file is now shared with mcs.
382 2006-09-16 Raja R Harinath <rharinath@novell.com>
384 * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
385 * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
387 2006-09-16 Marek Safar <marek.safar@seznam.cz>
390 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
391 only if parent type is class.
392 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
395 2006-09-15 Marek Safar <marek.safar@seznam.cz>
398 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
400 * typemanager.cs(CSharpName): Converts NullType to null.
402 2006-09-15 Martin Baulig <martin@ximian.com>
404 * pending.cs: Removed; this file is now shared with mcs.
406 2006-09-15 Martin Baulig <martin@ximian.com>
408 * statement.cs: Removed; this file is now shared with mcs.
410 2006-09-15 Martin Baulig <martin@ximian.com>
412 * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
414 * driver.cs: Removed the `--broken-cycles' argument.
416 2006-09-15 Martin Baulig <martin@ximian.com>
418 * namespace.cs: Removed; this file is now shared with mcs.
420 2006-09-15 Martin Baulig <martin@ximian.com>
422 * decl.cs (MemberName): Minor code cleanups.
424 2006-09-15 Martin Baulig <martin@ximian.com>
426 * parameter.cs: Removed; this file is now shared with mcs.
428 2006-09-15 Martin Baulig <martin@ximian.com>
430 * enum.cs: Removed; this file is now shared with mcs.
432 2006-09-15 Martin Baulig <martin@ximian.com>
434 * Makefile: Define `GMCS_SOURCE'.
436 * flowanalysis.cs: Removed; this file is now shared with mcs.
438 2006-09-15 Martin Baulig <martin@ximian.com>
440 Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
441 assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
442 doc.cs - they are now shared with mcs.
444 * gmcs.exe.sources: Include these files from ../mcs/.
446 2006-09-15 Martin Baulig <martin@ximian.com>
448 * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
449 * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
451 2006-09-14 Marek Safar <marek.safar@seznam.cz>
453 * assign.cs, ecore.cs, expression.cs: Share error message text.
454 * class.cs (FieldMember.Define): Check for variable of static type.
455 * decl.cs (check_type_parameter): Report correct type name.
456 * driver.cs (LoadAssembly): Uses error output for errors.
457 * generic.cs (Constraints.Resolve): Add check for constraint accessibility
458 (TypeArguments.Resolve): Static class cannot be used as an argument.
459 * statement.cs (ResolveMeta): Constants cannot be generic types.
461 2006-09-12 Martin Baulig <martin@ximian.com>
463 * generic.cs (TypeManager.IsIList): Moved into convert.cs.
465 * convert.cs (Convert.Array_To_IList): Moved here and correctly
466 implement it; fixes #79345.
468 2006-09-08 Marek Safar <marek.safar@seznam.cz>
470 * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
472 * expression.cs (TypeOf.GetAttributableValue): Check for open generic
474 * generic.cs: Improved error messages.
475 * typemanager.cs (RemoveGenericArity): Made public.
477 2006-09-08 Martin Baulig <martin@ximian.com>
479 * typemanager.cs (TypeManager.interlocked_type): New public field.
480 (TypeManager.int_interlocked_compare-exchange): New public field.
481 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
482 enumerator types here and call InitGenericCoreTypes().
483 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
484 after calling InitEnumUnderlyingTypes().
487 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
488 `classes_second_stage'.
490 2006-09-07 Marek Safar <marek.safar@seznam.cz>
492 * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
494 * statement.cs (Block.Variables): Made public.
496 2006-09-07 Martin Baulig <martin@ximian.com>
499 (MainDriver): Revert r62663 from Marek; see #70506 for details.
501 2006-09-01 Martin Baulig <martin@ximian.com>
504 (TypeManager.IsIList): Also handle base classes and interfaces.
506 2006-09-01 Raja R Harinath <rharinath@novell.com>
509 * expression.cs (Invocation.MoreSpecific): Check for reference
512 2006-08-29 Miguel de Icaza <miguel@novell.com>
514 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
516 2006-08-17 Miguel de Icaza <miguel@novell.com>
518 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
519 #52019 and #79064, the use of the \uXXXX sequence in source code
520 to represent unicode characters.
522 2006-08-15 Marek Safar <marek.safar@seznam.cz>
524 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
526 * class.cs, ecore.cs, statement.cs: Merged to one error message.
528 2006-08-14 Raja R Harinath <rharinath@novell.com>
531 * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
532 parameter too. This only avoids a parse error -- the semantic
533 error is caught elsewhere.
535 2006-08-13 Miguel de Icaza <miguel@novell.com>
537 * assign.cs: Catch attempts to assign to a method groups in += and
540 2006-08-13 Marek Safar <marek.safar@seznam.cz>
543 * cs-parser.jay: Don't destroy current array type by typeof of array's.
545 2006-08-12 Marek Safar <marek.safar@seznam.cz>
547 * cs-parser.jay: Check whether a constraint clause has already been
548 specified for type parameter.
549 * generic.cs (Constraints): Exposed location.
551 2006-08-12 Marek Safar <marek.safar@seznam.cz>
553 * class.cs (Method.Define): Issue a warning when generic method looks like
555 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
557 * report.cs: New warning number.
559 2006-08-09 Marek Safar <marek.safar@seznam.cz>
561 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
563 * decl.cs (MemberCache.FindMembers): When container is interface we need to
564 search all base interfaces as a member can be ambiguous.
565 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
566 Constructor member type filter.
567 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
568 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
569 reporting for returned memberinfos.
570 * report.cs: Updated.
571 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
572 version to work on all runtimes.
573 (TypeManager.RealMemberLookup): Removed members filtering.
575 2006-08-08 Raja R Harinath <rharinath@novell.com>
577 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
578 (PropertyExpr.EmitAssign): Likewise.
579 * expression.cs (Indirection.EmitAssign): Likewise.
580 (LocalVariableReference.EmitAssign): Likewise.
581 (ParameterReference.EmitAssign): Likewise.
582 (Invocation.EmitArguments): Likewise.
583 (ArrayAccess.EmitAssign): Likewise.
584 (IndexerAccess.EmitAssign): Likewise.
585 (This.EmitAssign): Likewise.
586 (ConditionalLogicalOperator.Emit): Likewise.
589 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
590 instead of ArrayList. If the hashtable has a LocalBuilder, don't
591 leave it in after returning it.
592 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
594 2006-08-06 Marek Safar <marek.safar@seznam.cz>
596 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
599 2006-08-05 Marek Safar <marek.safar@seznam.cz>
601 * class.cs (TypeContainer.AddPartial): Add check for partial declarations
602 with different type names.
603 (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
605 2006-08-03 Raja R Harinath <rharinath@novell.com>
607 Fix cs0146-3.cs and cs0146-4.cs.
608 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
609 enclosing types don't depend on the current type.
611 2006-08-02 Raja R Harinath <rharinath@novell.com>
614 * class.cs (TypeContainer.DoDefineMembers): Use
615 FindBaseMemberWithSameName on Parent, since we're interested in
616 whether we hide inherited members or not.
617 (FindBaseMemberWithSameName): Make slightly more robust.
620 * codegen.cs (IResolveContext.GenericDeclContainer): New.
621 (EmitContext): Implement new interface requirement.
622 * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
623 * decl.cs (MemberCore): Likewise.
624 (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
625 * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
626 ec.GenericDeclContainer to check for generic parameters.
627 (SimpleName.DoSimpleNameResolve): Likewise.
628 * generic.cs (TypeParameter.DeclContainer): Remove override.
630 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
631 declspaces for doppelgangers too.
632 (UsingEntry): Implement IResolveContext.
633 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
634 'this' as the resolve context.
635 (LocalAliasEntry): Likewise.
637 Implement parts of #77403
638 * roottypes.cs (RootDeclSpace): New. Used to represent the
639 toplevel declaration space. Each namespace declaration introduces
640 a "partial" root declaretion space.
641 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
642 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
643 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
644 from 'current_namespace.SlaveDeclSpace'.
645 (namespace_declaration): Likewise.
646 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
647 check. It can't happen now.
648 * decl.cs (DeclSpace.LookupType): Likewise.
649 * driver.cs (MainDriver): Sanity check.
651 2006-08-01 Raja R Harinath <rharinath@novell.com>
653 * decl.cs (DeclSpace.FindNestedType): Remove.
654 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
655 LookupTypeContainer to get the container of the nested type.
656 * class.cs (TypeContainer.FindNestedType): Make non-override.
658 2006-07-31 Raja R Harinath <rharinath@novell.com>
660 * decl.cs (DeclSpace.PartialContainer): Move field from ...
661 * class.cs (TypeContainer.PartialContainer): ... here.
662 (TypeContainer.AddBasesForPart): New helper.
663 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
665 * cs-parser.jay (current_class): Convert to DeclSpace.
666 (struct_declaration, interface_declaration, class_declaration):
667 Use AddBasesForPart instead of .Bases directly.
668 * const.cs, iterators.cs: Update to changes.
670 2006-07-28 Raja R Harinath <rharinath@novell.com>
672 * class.cs (TypeContainer.AddMemberType): Rename from
674 (TypeContainer.AddMember): Rename from AddToMemberContainer.
675 (AddTypeContainer): New. Combine AddClassOrStruct and
677 (AddPartial): Update. Add 'is_partial' argument.
678 * roottypes.cs: Update to changes.
679 * cs-parser.jay (push_current_class): New helper for handling
680 current_container and current_class.
681 (struct_declaration, interface_declaration, class_declaration):
684 2006-07-26 Raja R Harinath <rharinath@novell.com>
686 * roottypes.cs: Rename from tree.cs.
688 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
689 * tree.cs (Tree, ITreeDump): Remove types.
690 * rootcontext.cs (tree, Tree): Remove fields.
691 (root, ToplevelTypes): New.
692 * *.cs: Update to rename.
694 * tree.cs (Tree.RecordDecl): Remove.
695 (RootTypes.AddToTypeContainer): Record the toplevel type in its
697 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
699 2006-07-23 Raja R Harinath <harinath@gmail.com>
701 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
702 DoFlowAnalysis and OmitStructFlowAnalysis here.
703 (ec.With): Rename from WithUnsafe and generalize.
704 (ec.WithCheckState): Remove. All users can be handled by 'With'.
705 (ec.WithFlowAnalyis): New.
706 * ecore.cs, expression.cs, statement.cs: Update.
708 2006-07-22 Raja R Harinath <harinath@gmail.com>
710 * statement.cs (Block.ResolveMeta): Simplify slightly.
712 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
713 multiple boolean fields. Convert InUnsafe, constant_check_state,
714 check_state to flags.
715 (CheckState, ConstantCheckState): Update.
716 (InUnsafe): New read-only property.
717 (FlagsHandle): Rename from CheckStateHandle and convert to handle
719 (WithUnsafe): New helper similar to WithCheckState.
720 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
721 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
723 2006-07-21 Raja R Harinath <rharinath@novell.com>
725 Make comparisons use the same IL irrespective of whether they're
726 in a 'checked' or 'unchecked' context: one of the issues in #78899
727 * codegen.cs (EmitContext.CheckState): Make read-only property.
728 (EmitContext.ConstantCheckState): Likewise.
729 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
730 helper that implement a save/restore stack for CheckState
731 values. This is the only way to change check-state.
732 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
733 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
734 (CheckedExpr.EmitBranchable): New forwarding method.
735 (UnCheckedExpr): Likewise.
736 * statement.cs (Block.ResolveMeta): Use WithCheckState.
737 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
738 (Checked.Resolve, checked.DoEmit): Likewise.
740 2006-07-21 Martin Baulig <martin@ximian.com>
742 * generic.cs (TypeManager.InferType): When inferring an array
743 type, also allow IList<T> and ICollection<T>. Fixes #78900.
745 2006-07-21 Martin Baulig <martin@ximian.com>
747 * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
748 and allow IList`1 and all its base interfaces.
750 * convert.cs (Convert.ImplicitReferenceConversion): Allow
751 converting from an array-type of T to IList<T>.
753 2006-07-21 Martin Baulig <martin@ximian.com>
755 * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
757 2006-07-20 Miguel de Icaza <miguel@novell.com>
759 * anonymous.cs: Cache the resolved anonymous delegate, and return
760 this so that the ResolveTopBlock is only triggered once, not
763 Currently we trigger ResolvetopBlock twice due to a first pass of
764 argument check compatibility, and a second pass that does the
767 2006-07-15 Marek Safar <marek.safar@seznam.cz>
769 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
771 * rootcontext.cs (Reset): Add helper_classes.
773 2006-07-15 Marek Safar <marek.safar@seznam.cz>
776 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
779 2006-07-13 Miguel de Icaza <miguel@novell.com>
781 * statement.cs (Lock): Handle expressions of type
782 TypeManager.null_type specially. Fixes #78770
784 2006-07-08 Marek Safar <marek.safar@seznam.cz>
786 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
789 2006-07-08 Marek Safar <marek.safar@seznam.cz>
791 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
792 for accessors as well.
793 * ecore.cs (EventExpr): Add AccessorTable.
795 2006-07-03 Martin Baulig <martin@ximian.com>
797 * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
798 instances of value types.
800 * convert.cs (Convert.ExplicitConversion): Correctly handle
801 object->nullable conversions.
803 2006-07-01 Marek Safar <marek.safar@seznam.cz>
806 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
807 for CS0122 where appropriate.
808 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
810 (Filter): Assembly can be null in the case of top level attributes.
812 2006-06-28 Raja R Harinath <rharinath@novell.com>
815 * generic.cs (TypeManager.InferParamsTypeArguments): If there are
816 no arguments, return 'false': nothing can be inferred.
818 2006-06-25 Marek Safar <marek.safar@seznam.cz>
822 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
823 is done at global level.
825 2006-06-24 Marek Safar <marek.safar@seznam.cz>
827 A fix for #77002, Implemented TypeForwarder support.
829 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
830 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
832 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
833 * typemanager.cs (): Add type_forwarder_attr_type.
835 2006-06-24 Marek Safar <marek.safar@seznam.cz>
837 * report.cs: Add CS0469 warning.
839 2006-06-22 Martin Baulig <martin@ximian.com>
842 (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
843 for interfaces; fixes #78686, which is a modification of #78380
844 with interfaces instead of classes.
846 2006-06-21 Martin Baulig <martin@ximian.com>
848 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
849 the `try'-block, so we also report CS0016 etc. there.
851 2006-06-21 Martin Baulig <martin@ximian.com>
853 * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
854 handle SetAssigned() and SetMemberIsUsed() for generic types;
857 2006-06-21 Martin Baulig <martin@ximian.com>
860 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
862 2006-06-21 Martin Baulig <martin@ximian.com>
864 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
865 also report CS1686 for parameters.
867 2006-06-21 Martin Baulig <martin@ximian.com>
869 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
870 instead of an error if the value is not implicitly convertible to
871 the switch types; fixes #77964.
873 2006-06-21 Raja R Harinath <rharinath@novell.com>
876 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
877 FieldBuilder is null.
880 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
881 'left' and 'right' before error-checking.
883 2006-06-19 Martin Baulig <martin@ximian.com>
886 (Convert.ImplicitConversionStandard): Cleanup and correctly
887 implement nullable conversions.
888 (Convert.ImplicitStandardConversionExists): Likewise.
889 (Convert.ExplicitConversion): Likewise.
891 2006-06-19 Martin Baulig <martin@ximian.com>
894 (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
895 methods; make the ctors protected.
897 2006-06-19 Martin Baulig <martin@ximian.com>
899 Fixed #78380; added gtest-273.cs.
902 (Expression.ResolveAsBaseTerminal): Move the constraint checking
903 into ResolveAsTypeTerminal().
906 (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
907 TypeManager.FindMembers() to check for the default ctor.
909 2006-06-18 Marek Safar <marek.safar@seznam.cz>
911 * generic.cs: Fixed NullableInfo accessibility.
913 2006-06-16 Martin Baulig <martin@ximian.com>
916 (Constraints.InflatedConstraints.inflate): Correctly inflate
917 generic types; fixes #78400.
919 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
921 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
923 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
924 (FieldExpr.DoResolve): likewise.
925 (PropertyExpr.InstanceResolve): likewise.
926 (EventExpr.InstanceResolve): likewise.
928 2006-06-15 Martin Baulig <martin@ximian.com>
931 (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
932 argument; always allow a `null' label if true.
933 (Switch.SwitchGoverningType): Take an `Expression expr' argument.
934 (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
935 we have a `null' label and mark the new `null_target' label;
936 default to the `default' label.
937 (Switch.Resolve): Add support for nullable types. Fixes #78630.
939 2006-06-15 Martin Baulig <martin@ximian.com>
941 * class.cs (Operator.Define): Allow an implicit/explicit operator
942 to convert to/from a nullable value of the enclosing type.
944 * generic.cs (TypeManager.IsNullableTypeOf): New public method.
945 (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
948 (Convert.ImplicitStandardConversionExists): Add support for lifted
949 implicit/explicit conversions.
950 (Convert.ImplicitConversionStandard): Likewise.
952 2006-06-13 Martin Baulig <martin@ximian.com>
954 * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
955 type arguments and create a ConstructedType if necessary. Fixes #78400.
957 2006-06-04 Marek Safar <marek.safar@seznam.cz>
959 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
960 attribute applicable tests for attribute argument.
962 2006-06-02 Raja R Harinath <rharinath@novell.com>
965 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
966 (Binary.OverloadResolve_PredefinedIntegral): New.
967 (Binary.OverloadResolve_PredefinedFloating): New.
968 (Binary.OverloadResolve_PredefinedString): New.
969 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
970 Follow the standard more closely, and treat numeric promotions in
971 terms of overload resolution.
972 (Binary.CheckShiftArguments): Simplify.
974 2006-06-01 Raja R Harinath <rharinath@novell.com>
976 * flowanalysis.cs (MyBitVector): Simplify representation.
977 (MyBitVector.Clone): Avoid allocating BitArray.
978 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
979 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
980 (*): Update. Change all references to MyBitVector.And and
981 MyBitVector.Or to &= and |=.
983 2006-05-31 Raja R Harinath <rharinath@novell.com>
985 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
986 Use bne.un instead of ceq+brfalse.
989 * typemanager.cs (IsUnmanagedType): Disallow generic types and
992 2006-05-29 Raja R Harinath <rharinath@novell.com>
995 * cs-parser.jay (formal_parameter_list): Extend the pattern below
996 to param arguments too.
998 2006-05-26 Miguel de Icaza <miguel@novell.com>
1000 * cs-parser.jay: Catch another parsing form for arglist being
1001 followed by other arguments. Fixes #78313.
1003 2006-05-25 Raja R Harinath <rharinath@novell.com>
1006 * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
1007 also when one of the operands is a null literal.
1008 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
1009 to improve clarity, and generate slightly better code.
1011 2006-05-24 Raja R Harinath <rharinath@novell.com>
1013 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1014 checking of out parameters to ...
1015 (FlowBranchingToplevel.Merge): ... here.
1016 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1017 set, propagate the origin upward, and only complain if there was
1019 (FlowBranchingException.AddContinueOrigin): Likewise.
1020 (FlowBranchingException.AddReturnOrigin): Likewise.
1021 (FlowBranchingException.AddGotoOrigin): Likewise.
1023 2006-05-23 Raja R Harinath <rharinath@novell.com>
1025 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1026 unreachable, skip it.
1027 (FlowBranchingException.Merge): Always propagate jumps, even if
1028 the finally block renders subsequent code unreachable.
1030 2006-05-18 Raja R Harinath <rharinath@novell.com>
1033 * statement.cs (Goto.Resolve): Move responsibility for resolving
1034 'goto' to FlowBranching.AddGotoOrigin.
1035 (Goto.SetResolvedTarget): New. Callback to set the
1036 LabeledStatement that's the target of the goto.
1037 (Goto.DoEmit): Use Leave instead of Br when crossing an
1038 unwind-protect boundary.
1039 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1040 LookupLabel and adjust to new semantics.
1041 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1042 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1043 Goto.SetResolvedTarget to update target.
1044 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1045 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1046 AddBreakOrigin & co. Delay propagation until ...
1047 (FlowBranchingException.Merge): ... this.
1049 * statement.cs (Block.Resolve): Always depend on flow-branching to
1050 determine unreachability. Kill workaround that originally emitted
1051 only one statement after an "unreachable" label (see infloop in
1054 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1055 This is still "wrong", but anything better would probably need a
1056 multi-pass algorithm.
1057 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1058 usage vector. Force current usage vector to be reachable, to
1059 optimistically signify backward jumps.
1060 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1062 (FlowBranchingLabeled.Merge): New. If no backward jump was
1063 detected, return the original salted-away usage vector instead,
1064 updated with appropriate changes. Print unreachable warning if
1066 * statement.cs (Block.Resolve): Don't print unreachable warning on
1067 a labeled statement.
1069 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
1071 * driver.cs: Pass filename without path to AssemblyBuilder's
1072 AddResourceFile. Fixes bug #78407.
1074 2006-05-17 Raja R Harinath <rharinath@novell.com>
1076 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1077 * flowanalysis.cs (FlowBranchingLabeled): ... here.
1078 (FlowBranching.MergeChild): Overwrite
1079 reachability information from Labeled branchings too.
1081 2006-05-16 Raja R Harinath <rharinath@novell.com>
1083 * statement.cs (Goto.Resolve): Merge jump origins here ...
1084 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1086 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1087 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
1088 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
1089 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1091 * statement.cs (Goto.Resolve): ... not here.
1092 (Goto.Emit): Remove CS1632 check.
1094 2006-05-14 Marek Safar <marek.safar@seznam.cz>
1096 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1099 2006-05-11 Raja R Harinath <rharinath@novell.com>
1101 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1102 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1103 (FlowBranchingException.Label): Likewise.
1105 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
1107 (MyBitVector.Or): Use it to avoid losing information (Count).
1108 (FlowBranching.MergeOrigins): Likewise.
1110 * flowanalysis.cs (UsageVector.IsDirty): Remove.
1111 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1112 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1113 (UsageVector.ToString): Simplify.
1114 (UsageVector.MergeSiblings): Move here from ...
1115 (FlowBranching.Merge): ... here.
1116 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1119 2006-05-10 Raja R Harinath <rharinath@novell.com>
1121 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1122 null bitvector is treated as all-true.
1124 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1125 (MyBitVector): Rationalize invariants. 'vector != null' implies
1126 that we have our own copy of the bitvector. Otherwise,
1127 'InheritsFrom == null' implies all inherited bits are true.
1129 2006-05-09 Marek Safar <marek.safar@seznam.cz>
1131 * statement.cs (LocalInfo): Add IsConstant.
1132 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1133 local variable for constants.
1135 2006-05-09 Raja R Harinath <rharinath@novell.com>
1137 * flowanalysis.cs (MyBitVector.Empty): New.
1138 (MyBitVector): Don't allow InheritedFrom to be null.
1139 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1140 (UsageVector, FlowBranching): Update to changes.
1142 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1143 recursion. The 'Parent == null' condition isn't sufficient for
1145 (FlowBranching.AddBreakOrigin): Likewise.
1146 (FlowBranching.AddContinueOrigin): Likewise.
1147 (FlowBranching.AddReturnOrigin): Likewise.
1148 (FlowBranching.StealFinallyClauses): Likewise.
1149 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1150 (FlowBranching.CheckOutParameters): Likewise.
1151 (FlowBranchingToplevel): Terminate all the above recursions here.
1152 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1153 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1155 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
1157 (FlowBranchingToplevel): New. Empty for now.
1158 (FlowBranching.MergeTopBlock): Update.
1159 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1160 branching for the anonymous delegate.
1161 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1163 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1164 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1165 information at the start of the merge. Reorganize.
1167 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1169 * class.cs (MethodData.Define): Method cannot implement interface accessor.
1171 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1173 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1174 to newly introduced ctor.
1176 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1177 message to one place.
1178 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1181 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1183 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1185 * ecore.cs (Expression.ResolveAsConstant): Updated.
1187 * statement.cs (ResolveMeta): Updated.
1189 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1191 * cs-parser.jay: __arglist cannot be used in initializer.
1193 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1196 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1199 2006-05-05 Raja R Harinath <rharinath@novell.com>
1201 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1202 (LabeledStatement): Add 'name' parameter.
1203 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1204 (Block.AddLabel): Update to changes.
1205 * cs-parser.jay (labeled_statement): Likewise.
1207 * flowanalysis.cs (BranchingType.Labeled): New.
1208 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1209 (FlowBranchingLabeled): New. Does nothing for now, but will
1210 eventually handle 'goto' flows.
1211 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1212 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1213 that's terminated ...
1214 (Block.Resolve): ... here.
1216 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1217 (UsageVector.MergeFinallyOrigins): Likewise.
1218 (FlowBranching.InTryOrCatch): Likewise.
1219 (FlowBranching.AddFinallyVector): Likewise.
1220 (FlowBranchingException): Update to changes.
1223 * statement.cs (Return.Resolve): Move error checking to ...
1224 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1225 (FlowBranchingException): Handle return origins like break and
1227 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1229 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1232 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1235 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1238 * class.cs (MethodData.Define): Do public accessor check only when method
1239 implements an interface.
1241 2006-05-04 Raja R Harinath <rharinath@novell.com>
1243 Remove special handling of 'break'
1244 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1245 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1246 (UsageVector.Break): Remove.
1247 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1249 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1251 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1252 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1254 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1257 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1258 be the interface member.
1260 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1263 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1264 for emitting small (int) values.
1266 2006-05-03 Raja R Harinath <rharinath@novell.com>
1269 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1270 control-flow passes through the 'finally' after merging-in all the
1271 control-flows from 'try' and the 'catch' clauses.
1273 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1274 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1275 always true at the only non-recursive entry point.
1276 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1277 FlowBranchingBreakable.
1278 (FlowBranchingLoop): Remove.
1279 * statement.cs (Return.DoResolve): Update to changes.
1282 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1283 (FlowBranching.CreateBranching): Handle it: create a
1284 FlowBranchingContinuable.
1285 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1286 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1287 except that it handles the 'continue' command.
1288 (FlowBranching.UsageVector.MergeOrigins): Rename from
1290 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1291 except that it overrides AddContinueOrigin.
1292 (FlowBranchingException): Override AddContinueOrigin, similar to
1294 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1295 Create a new branching around the embedded statement.
1296 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1297 control flow after the embedded statement.
1298 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1300 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1301 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1302 FlowBranchingBreakable.
1303 (FlowBranchingSwitch): Remove.
1306 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1307 error reporting to ...
1308 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1309 Rename from 'AddBreakVector'. Add new location argument. Return
1310 a bool indicating whether the 'break' crosses an unwind-protect.
1311 (FlowBranchingException.AddBreakOrigin): Add.
1312 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1313 flowbranching after updating with the effects of the 'finally'
1315 (FlowBranchingBreakable): New common base class for
1316 FlowBranchingLoop and FlowBranchingSwitch.
1318 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1320 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1322 2006-05-02 Raja R Harinath <rharinath@novell.com>
1324 * statement.cs (Do.Resolve): If the loop is infinite, set the
1326 (While.Resolve, For.Resolve): Set a barrier after the embedded
1327 statement. There's no direct control flow that goes from the end
1328 of the embedded statement to the end of the loop.
1329 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1330 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1331 above ensure that the reachability is correctly computed.
1333 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1334 (UsageVector.MergeBreakOrigins): If the current path is
1335 unreachable, treat it as if all parameters/locals are initialized.
1336 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1337 infinite loops before merging-in break origins.
1339 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1340 (Reachability.Reachable): Split part into ...
1341 (Reachability.Unreachable): ... this. Simplify.
1342 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1344 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1345 (Reachability.SetThrowsSometimes): Likewise.
1346 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1347 TriState.Always, use corresponding property.
1348 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1349 (Block.Resolve): Likewise. Remove some redundant checks.
1351 2006-05-02 Raja R Harinath <harinath@gmail.com>
1353 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1354 (Reachability.Meet): Don't bother checking AlwaysThrows --
1355 barrier is always set.
1356 (FlowBranchingBlock.Merge): Likewise.
1358 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1360 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1361 defined, so it's references should also compile only for NET_2_0
1362 (as occurs in mcs version)
1364 2006-05-01 Raja R Harinath <harinath@gmail.com>
1366 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1367 checks for unreachable.
1369 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1372 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1374 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1375 whether field is really assigned.
1377 2006-04-30 Raja R Harinath <harinath@gmail.com>
1379 * flowanalysis.cs (Reachability): Make 4-argument constructor
1381 (Reachability.Meet): Rename from 'And'. Remove static variant.
1382 (Reachability.Always): Rename from the highly misleading
1383 'Reachability.Never'.
1384 (FlowBranching.Merge): Update to changes. Mark an impossible
1385 situation with a 'throw'.
1386 (*): Update to changes.
1388 2006-04-29 Raja R Harinath <harinath@gmail.com>
1390 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1392 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1393 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1394 (*): Update to changes.
1395 * statement.cs: Update to changes.
1397 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1400 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1402 2006-04-28 Raja R Harinath <harinath@gmail.com>
1404 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1407 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1408 argument to two arguments: an usage-vector and a bool. Move call
1409 to FlowBranching.Merge () ...
1410 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1412 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1413 handling of loop and switch reachability to ...
1414 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1416 2006-04-27 Raja R Harinath <harinath@gmail.com>
1418 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1419 handling to FlowBranchingLoop.InLoop.
1420 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1422 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1425 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1426 anonymous method is allowed from AnonymousContainer here.
1428 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1430 2006-04-24 Raja R Harinath <rharinath@novell.com>
1433 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1435 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1438 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1439 (DoubleConstant.Reduce): Ditto.
1441 2006-04-23 Raja R Harinath <rharinath@novell.com>
1443 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1444 Remove 'lvalue_right_side' argument. Move parts to ...
1445 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1446 (LocalVariable.DoResolveLValue): ... these.
1448 2006-04-21 Raja R Harinath <rharinath@novell.com>
1451 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1452 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1453 (LocalVariableReference.DoResolveBase): Use it to implement new
1455 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1456 (Argument.Resolve): Simplify. Move CS1510 check ...
1457 * ecore.cs (Expression.ResolveLValue): ... here.
1458 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1459 (PropertyExpr.DoResolveLValue): Likewise.
1460 (FieldExpr.Report_AssignToReadonly): Likewise.
1461 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1462 LValueMemberAccess or LValueMemberOutAccess on instance depending
1464 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1465 DoResolve as appropriate.
1467 2006-04-20 Raja R Harinath <rharinath@novell.com>
1470 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1471 implicit conversions on 'out' and 'ref' arguments.
1473 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1474 improve clarity. Remove dead code.
1477 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1478 (Catch.Resolve): Resolve VarBlock if it exists.
1480 2006-04-19 Miguel de Icaza <miguel@novell.com>
1482 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1483 twice, this was some residual code, the enumerator was emitted
1484 properly in the two branche of if later.
1488 Thanks to Martin for finding the source of the problem
1490 2006-04-19 Raja R Harinath <rharinath@novell.com>
1492 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1493 cast is never an lvalue.
1494 (Cast.DoResolve, Cast.ResolveRest): Combine.
1495 (Argument.Emit): Simplify slightly. Move 'Expr is
1496 IMemoryLocation' check ...
1497 (Argument.Resolve): ... here.
1498 (Argument.Error_LValueRequired): Remove. Inline into only user.
1500 Simplifications. Fix cs0191-2.cs
1501 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1502 CS1649 and CS1651 to ...
1503 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1504 the actual selection of the error code and message to a lookup
1505 table. Add a dummy return value to simplify callsites.
1506 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1507 readonly fields of other instances of the same type. Move CS0197
1509 * expression.cs (Argument.Resolve): ... here. Simplify code.
1510 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1511 resolution of an out or ref argument. The code simplification
1512 above uses this invariant.
1514 2006-04-18 Raja R Harinath <rharinath@novell.com>
1516 Possibly fix #77752. Fix cs1690-[4-7].cs.
1517 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1518 CheckMarshallByRefAccess. Drop parameter.
1519 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1521 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1523 * report.cs (AllWarnings): Add CS1690.
1524 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1526 (LocalVariableReference.DoResolveBase): Update.
1528 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1530 * class.cs (MethodOrOperator): Moved common parts from method class.
1531 detect obsolete attributes.
1532 (Method.Define): Simplified as it reuses code from base.
1533 (Constructor.ValidAttributeTargets): Fixed issue found during
1535 (Destructor.ValidAttributeTargets): Fixed issue found during
1537 (Operator): Finished refactoring set off by #78020. Operator class is now
1538 ordinary method class.
1540 * anonymous.cs: Updated.
1542 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1544 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1546 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1548 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1549 detect obsolete attributes.
1550 (Method.CreateEmitContext): Moved to MethodOrOperator.
1552 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1555 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1556 customized exception to make crash detection easier.
1557 (MethodOrOperator): Started to work on new base class for methods and
1559 (Method): Derives from MethodOrOperator.
1560 (Constructor.Emit): Emits its own attributes.
1561 (AbstractPropertyEventMethod.Emit): Ditto.
1562 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1564 (Operator.Emit): It's temporary more tricky than should be.
1566 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1568 * report.cs (InternalErrorException): Add ctor with inner exception.
1570 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1573 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1576 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1579 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1582 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1584 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1585 attribute is present and Guid not.
1586 (Interface.ApplyAttributeBuilder): Ditto.
1588 * attribute.cs: Add error message.
1590 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1594 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1595 sources (it's composite) so hold them in extra array as they are used in
1596 Emit phase only. It worked in the previous versions by mistake.
1597 (Attribute.Emit): Emit attribute for more owners when exist.
1599 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1600 it has now different behaviour.
1602 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1604 * constant.cs (Constant.IsDefaultInitializer): New method.
1606 * class.cs: Updated.
1608 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1609 re-initialize default values. It saves KBs almost for every assembly.
1610 Thanks Zoltan for the idea.
1611 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1612 (ArrayCreation.DoResolve): Resolve only once.
1613 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1614 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1616 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1618 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1621 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1623 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1624 in an embedded statement too.
1626 2006-04-01 Raja R Harinath <rharinath@novell.com>
1629 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1633 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1636 * report.cs (SymbolRelatedToPreviousError): Drop generic type
1637 arguments before checking whether a type is reflected or not.
1640 * expression.cs (Invocation.IsApplicable): Ensure a generic method
1641 definition doesn't take part in overload resolution.
1642 (Invocation.IsParamsMethodApplicable): Likewise.
1643 (Invocation.OverloadResolve): When replacing a reflected override
1644 method with its base definition, ensure that type arguments are
1647 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1651 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1654 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1656 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1658 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1661 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1662 LocalTemporary change.
1664 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1666 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1667 initializers optimization.
1668 (ClassOrStruct.TypeAttr): Moved from modifiers.
1669 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1670 (FieldBase.ResolveInitializer): Resolves initializer.
1671 (FieldBase.HasDefaultInitializer): New property.
1673 * cs-parser.jay: Removed message.
1675 * expression.cs (CompilerGeneratedThis): New specialization.
1677 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1679 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1681 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1683 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1685 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1686 be now EnumConstants only.
1688 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1690 * attribute.cs, driver.cs: Reset more caches.
1692 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1694 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1696 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1698 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1699 for easier reuse. Updated all overrides.
1700 (IntegralConstant): New base class for all integral constants.
1701 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1702 of the constant range, report custom error.
1703 (UIntConstant.Reduce): Fixed uint conversion.
1705 * ecore.cs, literal.cs: Reduce updates.
1707 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1711 * class.cs (Constructor.Define): Removed extra if for default ctors.
1712 A patch from Atsushi Enomoto.
1714 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1716 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1717 GetAttributableValue.
1719 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1722 * convert.cs (ImplicitConversionRequired): Error message moved to
1725 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1726 automatic implicit conversion of an output value.
1727 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1729 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1731 (TypeOf.GetAttributableValue): Add extra handling for object type.
1733 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1734 special error message.
1736 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1738 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1740 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1741 compatible with MS runtime.
1743 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1745 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1746 attribute arguments here.
1748 * class.cs (Indexer.Define): The check was moved to attribute class.
1750 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1752 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1754 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1756 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1758 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1761 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1763 * doc-bootstrap.cs : fix build.
1765 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1767 * expression.cs (StringConcat.Append): Issue a warning when empty string
1770 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1772 * assign.cs (CompoundAssign.ResolveSource): Removed.
1774 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1777 * class.cs (TypeContainer.FindMethods): Removed.
1778 (TypeContainer.CheckMemberUsage): Made static.
1780 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1782 * constant.cs (CheckRange): Removed unused type argument.
1783 (CheckUnsigned): Removed unused type argument.
1785 * cs-parser.jay: Updated after MemberAccess clean up.
1786 Uses Length for empty string test.
1788 * cs-tokenizer.cs: Uses Length for empty string test.
1789 (IsCastToken): Made static.
1790 (is_hex): Made static.
1791 (real_type_suffix): Made static.
1793 * decl.cs (SetupCache): Made static.
1794 (OnGenerateDocComment): Removed unused ds argument.
1796 * delegate.cs (VerifyDelegate): Removed unused argument.
1798 * doc.cs: Uses Length for empty string test.
1800 * driver.cs: Uses Length for empty string test.
1802 * enum.cs (IsValidEnumType): Made static
1804 * expression.cs (EnumLiftUp): Removed unused argument.
1805 (ResolveMethodGroup): Ditto.
1806 (BetterConversion): Ditto.
1807 (GetVarargsTypes): Ditto.
1808 (UpdateIndices): Ditto.
1809 (ValidateInitializers): Ditto.
1810 (MemberAccess.ctor): Ditto.
1811 (GetIndexersForType): Ditto.
1813 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1815 * iterators.cs: Updated after MemberAccess clean up.
1817 * location.cs: Uses Length for empty string test.
1819 * namespace.cs: Uses Length for empty string test.
1821 * report.cs (CheckWarningCode): Made static.
1823 * statement.cs (LabeledStatement): Removed unused argument.
1825 * typemanager.cs (FilterNone): Removed.
1827 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1829 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1832 * class.cs: Updated.
1834 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1836 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1838 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1842 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1844 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1845 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1846 Add more error reporting; Fixed issue with params.
1848 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1850 * cs-parser.jay: AnonymousMethod requires host container.
1852 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1854 2006-03-18 Raja R Harinath <harinath@gmail.com>
1856 * class.cs: Change 'TypeContainer ds' constructor argument to
1857 'DeclSpace parent'. Some classes were missed below due to
1858 different naming convention.
1860 * class.cs (MemberCore.Parent): Delete. This makes the
1861 ParentContainer changes below enforceable by the compiler.
1863 Treat pointers to enclosing declaration space as 'DeclSpace', not
1865 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1866 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1868 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1870 (Block.AddThisVariable): Likewise.
1871 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1872 (AbstractPropertyEventMethod.Emit): Likewise.
1873 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1874 (GetMethod.Define, SetMethod.Define): Likewise.
1875 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1876 (DelegateMethod.EmitMethod): Likewise.
1878 Fix regression test-partial-13.cs.
1879 Rationalize use of PartialContainer. Ensure that the partial
1880 class semantics can be tied to type-correctness, i.e., any
1881 violation will cause a compile error.
1882 * class.cs, const.cs: Access all fields that belong to class
1883 TypeContainer via ParentContainer. Arguments of EmitContexts and
1884 Resolve()-like functions still use 'Parent'.
1886 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1887 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1888 (PropertyMethod.CheckModifiers): Remove unused argument.
1889 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1892 2006-03-28 Raja R Harinath <rharinath@novell.com>
1894 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1896 2006-03-17 Raja R Harinath <harinath@gmail.com>
1898 Make semantics of PartialContainer simpler.
1899 * decl.cs (DeclSpace.IsPartial): Remove.
1900 * class.cs (TypeContainer.IsPartial): Likewise.
1901 (TypeContainer..ctor): Set PartialContainer to point to self.
1902 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1903 (TypeContainer.FindNestedType): Likewise.
1904 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1906 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1908 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1910 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1912 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1915 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1917 * class.cs (Operator.Define): An error for base conversion was not
1920 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1922 A fix for #77593, #77574.
1924 * class.cs (MethodCore.CheckBase): Another if for operator.
1926 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1930 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1931 reporting, it's more tricky than I thought.
1933 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1935 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1938 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1939 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1942 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1945 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1949 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1950 (Event.Define): ditto
1951 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1953 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1954 Removed redundant code and set NewSlot for Invoke method too.
1956 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1957 (Parameters.MergeGenerated): New method. Use this method when you merge
1958 compiler generated argument with user arguments.
1960 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1962 * attribute.cs (ResolveAsTypeTerminal): Removed.
1964 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1965 specialization for predefined types; 30% speed up.
1966 Finally placed obsolete check to right place.
1967 (Expression.ResolveType): Removed.
1969 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1970 Updated after ResolveType was removed.
1972 * expression.cs (Cast.ctor): Check void cast.
1973 (Binary.ResolveAsTypeTerminal): Is never type.
1974 (Conditional.ResolveAsTypeTerminal): Is never type.
1976 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1978 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1980 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1982 2006-03-23 Martin Baulig <martin@ximian.com>
1984 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1985 type check if either of the types is an open generic type.
1987 2006-03-23 Martin Baulig <martin@ximian.com>
1990 (Convert.ExplicitTypeParameterConversion): New method; implement
1991 explicit type parameter conversions.
1993 2006-03-23 Martin Baulig <martin@ximian.com>
1995 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1996 blindly allow all conversions if we do not have any constraints.
1998 2006-02-27 Marek Safar <marek.safar@seznam.cz>
2000 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2001 these two separated members to simplify the code.
2002 (Attribute.Resolve): Refactored to use new fields and methods.
2003 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2004 implemented obsolete attribute checking.
2005 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2006 implemented obsolete checking again. It look line never ending quest ;-)
2007 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2009 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2011 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2013 *class.cs (Property.Define): Add RegisterProperty call.
2015 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2016 argument groups (only 2).
2018 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2019 encoding expression to arguments.
2020 (Expression.ExprClassToResolveFlags): Just turned to property.
2022 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2023 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2024 optimized as well as implemented support for zero-length attributes.
2026 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2027 Add caching of PropertyInfo's.
2029 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2031 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2032 error multiple times.
2034 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2036 New partial class implementation.
2037 A fix for #77027, #77029, #77403
2039 * attribute.cs (Attributable): Made attributes protected.
2041 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2042 the replacements of ClassPart and PartialContainer.
2043 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2044 (TypeContainer.AddInterface): Ditto.
2045 (TypeContainer.AddPartial): The main method for partial classes. It checks
2046 for errors and merges ModFlags and attributes. At the end class is added to
2048 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2050 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2051 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2052 from the rest of partial classes.
2053 (TypeContainer.GetClassBases): Simplified.
2054 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2056 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2057 (TypeContainer.HasExplicitLayout): Uses Flags now.
2058 (PartialContainer): Removed.
2059 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2060 (StaticClass): Was merged with Class.
2061 (Class.GetClassBases): class and static class bases are verified here.
2062 (Class.TypeAttr): Added static attributes when class is static.
2063 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2064 (MemberBase): In some cases we need to call parent container for partial
2065 class. It should be eliminated but it's not easy now.
2067 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2069 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2070 partial classed to accumulate class comments.
2071 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2073 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2075 * driver.cs (MainDriver): Tree.GetDecl was removed.
2077 * modifiers.cs (Modifiers): Add partial modifier.
2079 * tree.cs (Tree.decl): Removed.
2080 (RootTypes): Started to use this class more often for root types
2083 2006-03-23 Raja R Harinath <rharinath@novell.com>
2085 * generic.cs (TypeParameter.UpdateConstraints): Update
2086 'constraints' if null.
2088 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2092 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2093 external interface does not have an attribute.
2095 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2097 Another prerequisites for new partial classs implementation.
2099 * attribute.cs (Attribute.Equal): Implemented.
2100 (Attribute.Emit): Changed as attributes can be applied more than twice.
2101 (Attributes.Emit): Check for duplicate attributes here.
2103 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2104 as a parameter, clean-up.
2106 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2110 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2111 contains obsolete attribute check which can in some cases look for base
2112 type of current class which is not initialized yet.
2113 (TypeContainer.BaseType): Replacement of ptype.
2115 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2117 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2119 First of prerequisites for new partial classs implemention.
2121 * attribute.cs (Attributable): Extended by ResolveContext;
2122 Attributes finally have correct context for resolving in all cases.
2123 (AttachTo): Attribute owner is assigned here.
2125 * codegen.cs (IResolveContext): Introduce new interface to hold
2126 all information needed in resolving phase.
2127 (EmitContext): Implements IResolveContext; more clean-up needed here.
2129 * decl.cs (MemberCore): Implemented IResolveContext.
2131 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2132 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2133 parameter.cs, statement.cs, tree.cs, typemanager.cs:
2134 Refactored to use new IResolveContext instead of EmitContext; cleanup
2136 2006-03-22 Raja R Harinath <rharinath@novell.com>
2138 Support ParameterDefaultValueAttribute in gmcs. Also applied to
2139 mcs to keep code differences small.
2140 * attribute.cs (Attribute.GetParameterDefaultValue): New.
2141 * typemanager.cs (parameter_default_value_attribute_type): New.
2142 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
2145 2006-03-22 Martin Baulig <martin@ximian.com>
2148 (Nullable.NullableLiteral): Derive from `NullLiteral'.
2151 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
2152 instead of the normal `NullLiteral'.
2154 2006-03-21 Martin Baulig <martin@ximian.com>
2157 * generic.cs (TypeManager.InferType): If `pt' is a generic
2158 parameter, don't check whether `pt == at'.
2160 2006-03-20 Raja R Harinath <rharinath@novell.com>
2163 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2164 (TypeParameter.Resolve): Update to change.
2165 (ConstraintChecker.CheckConstraints): Resolve type-argument
2166 constraints before use.
2168 2006-03-16 Martin Baulig <martin@ximian.com>
2171 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2172 and don't have any instance constructors, also lookup in the base class.
2173 (TypeManager.IsNullableValueType): New public method.
2175 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2176 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2177 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2179 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2180 instead of just TypeManager.IsNullableType() to determine whether
2181 a lifted operator exists.
2182 (UnaryMutator.DoResolve): Likewise.
2183 (Conditional.DoResolve): Likewise.
2184 (Binary.DoResolve): A lifted operator only exists if both operands
2185 are valuetypes and at least one of them is a nullable type.
2187 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2189 * iterator.cs : yield break is allowed in try statement which has
2190 catch clauses. Fixed bug #77767.
2192 2006-03-12 Martin Baulig <martin@ximian.com>
2194 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2195 private IsSignatureEqual() to compare types; see the comment in
2196 that method; fixes #77674.
2198 2006-03-10 Raja R Harinath <rharinath@novell.com>
2200 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2201 (Expression.ResolveAsTypeTerminal): Likewise.
2202 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2203 * expression.cs, generic.cs, iterators.cs: Likewise.
2204 * parameter.cs, statement.cs, typemanager.cs: Likewise.
2206 2006-03-09 Martin Baulig <martin@ximian.com>
2208 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2209 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2211 2006-03-09 Martin Baulig <martin@ximian.com>
2213 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2214 `prepared' flag is set.
2216 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2217 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2218 issues; see gtest-254.cs.
2220 2006-03-07 Martin Baulig <martin@ximian.com>
2222 * generic.cs (TypeManager.InferType): Allow infering
2223 `IEnumerable<T>' with an array of T; see gtest-251.cs.
2225 2006-03-06 Martin Baulig <martin@ximian.com>
2228 (TypeManager.InferType): Fix gtest-250.cs.
2231 (TypeManager.IsSubclassOf): Also check the base class.
2234 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2237 2006-03-01 Raja R Harinath <rharinath@novell.com>
2240 * expression.cs (ParameterReference.DoResolveBase): Change return
2242 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2246 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2249 * typemanager.cs (GetFullNameSignature): Don't nullref on
2250 protected accessors.
2252 2006-02-16 Martin Baulig <martin@ximian.com>
2255 (TypeManager.GetGenericFieldDefinition): New public method; use it
2256 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2258 2006-02-14 Martin Baulig <martin@ximian.com>
2260 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2262 2006-02-14 Martin Baulig <martin@ximian.com>
2265 (TypeManager.DropGenericMethodArguments): New public method; don't
2266 use GetGenericMethodDefinition() on something which is not a
2269 2006-02-14 Martin Baulig <martin@ximian.com>
2272 (ConstraintChecker.CheckConstraints): If a type parameter has the
2273 `struct' constraint, the type must be a non-nullable valuetype.
2275 2006-02-10 Martin Baulig <martin@ximian.com>
2278 (TypeManager.IsOverride): Make this work for instantiated methods
2279 in a generic class; fixes #77509.
2280 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2281 rather than calling it directly; fixes #77488.
2283 2006-02-08 Martin Baulig <martin@ximian.com>
2285 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2286 reporting into CheckConstraint() so we can use the correctly
2289 2006-02-08 Martin Baulig <martin@ximian.com>
2291 * expression.cs (BaseAccess): Add support for generic methods.
2293 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2294 the new MethodGroupExpr.
2296 2006-02-07 Martin Baulig <martin@ximian.com>
2298 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2299 also reference types; fixes #77483.
2301 2006-02-07 Martin Baulig <martin@ximian.com>
2304 (TypeManager.IsGenericMethod): We now return whether something is
2305 an instantiated generic method (and not a generic method def).
2306 (TypeManager.IsGenericMethodDefinition): New public method.
2309 (TypeManager.CSharpSignature): Only include type arguments for
2310 "real" generic methods, not for any instantiated method.
2311 (TypeManager.GetMethodName): Likewise, but also allow generic
2312 method definitions here.
2314 2006-02-06 Miguel de Icaza <miguel@novell.com>
2316 * codegen.cs (EmitScopeInitFromBlock): check here the
2317 capture_context, there is no need to make two calls to the
2320 * anonymous.cs: Add some debugging messages that might help me
2321 track other instances of this problem in the future (the
2322 regression of test 467).
2324 * cs-parser.jay: track the variable block, as we need to initalize
2325 any captured variables declared in this block for the "catch"
2326 portion of the "Try" statement.
2328 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2329 scope initialization for captured variables.
2331 Also, move the emit for the variables after the block location has
2334 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2336 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2338 2006-02-06 Martin Baulig <martin@ximian.com>
2340 * class.cs (TypeContainer.DefineType): If we're a struct, pass
2341 `TypeManager.value_type' as parent type to
2342 ModuleBuilder.DefineType(). Fixes #77358.
2344 2006-02-02 Miguel de Icaza <miguel@novell.com>
2346 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2347 commit yesterday, the initialization for the roots is necessary.
2348 What is not necessary is the scope activation.
2350 2006-02-02 Raja R Harinath <rharinath@novell.com>
2352 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2353 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2355 (Argument.Resolve): Remove CS0206 checks.
2357 2006-02-01 Miguel de Icaza <miguel@novell.com>
2359 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2360 scopes for all the roots, the scopes will now be emitted when the
2361 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2363 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2364 code. This reduces a lot of existing cruft.
2366 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2367 that the ScopeInfo is generated as we enter the scope, not at the
2368 time of use, which is what we used to do before.
2370 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2371 every time a Block is about to be emitted if we have a
2374 2006-02-01 Raja R Harinath <rharinath@novell.com>
2376 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2377 attribute for mscorlib too.
2379 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2381 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2383 * typemanager.cs (cons_param_array_attribute): Make private.
2384 (Reset): Set it to null.
2385 (InitCoreHelpers): Don't initialize it.
2386 (ConsParamArrayAttribute): New. Initialize it as needed.
2387 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2389 2006-01-31 Miguel de Icaza <miguel@novell.com>
2391 * expression.cs: There might be errors reported during the
2392 selection of applicable methods. If there are errors, do not
2393 continue execution as it will lead the compiler to crash.
2395 2006-01-30 Miguel de Icaza <miguel@novell.com>
2397 * expression.cs: Member access is not allowed on anonymous
2398 methods. Fixes #77402.
2400 2006-01-30 Raja R Harinath <rharinath@novell.com>
2403 * cs-parser.jay (VariableDeclaration): Don't set
2404 current_array_type to null.
2405 (field_declaration, event_declaration, declaration_statement):
2406 Set it to null here.
2408 2006-01-29 Raja R Harinath <harinath@gmail.com>
2411 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2413 2006-01-28 Raja R Harinath <harinath@gmail.com>
2415 * typemanager.cs (GenericParameterPosition): New.
2418 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2420 * doc.cs : To process "include" elements, first we should create
2421 another list than XmlNodeList, because it could result in node
2422 removal, which could result in that the XmlNodeList gives up
2425 2006-01-25 Miguel de Icaza <miguel@novell.com>
2427 * expression.cs: Introduce an error report that we were not
2428 catching before. Gonzalo ran into it.
2430 2006-01-23 Miguel de Icaza <miguel@novell.com>
2432 A fix for bug: #76957
2434 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2435 ComputeMethodHost before creating the method, this is a new
2438 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2439 that this method references (RegisterScope). The actual scope
2440 where the method is hosted is computed with the ComputeMethodHost
2441 before we create the method.
2443 Moved the Deepest routine here.
2445 (AnonymousContainer.ComputeMethodHost): New routine used to
2446 compute the proper ScopeInfo that will host the anonymous method.
2448 (ScopeInfo): Deal with multiple roots. The problem was that we
2449 did not have a unique root where all ScopeInfos could be hanged
2450 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2453 Remove AdjustMethodScope which is now computed at the end. Remove
2454 LinkScope which did a partial link, instead link all ScopeInfos
2455 before code generation from the new "LinkScopes" routine.
2457 Simplify all the Add* routines as they no longer need to maintain
2458 the tree, they just need to record that they are using variables
2461 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2462 routines to produce the forest of ScopeInfo trees.
2464 * class.cs (TypeContainer.AppendMethod): This is just like
2465 AddMethod, but ensures that an interface implementation method
2466 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2467 methods, but at the end.
2469 We use this functionality to ensure that the generated MoveNext
2470 method in the iterator class is resolved/emitted before the
2471 enumerator methods created.
2473 This is required because the MoveNext method computes the right
2474 ScopeInfo for the method. And the other methods will eventually
2475 need to resolve and fetch information computed from the anonymous
2479 2006-01-23 Raja R Harinath <rharinath@novell.com>
2481 Improve implementation of section 14.4.2.2 (Better function member).
2482 * expression.cs (Invocation.MoreSpecific): Compare all type
2483 arguments before deciding if one type is more specific than
2484 another. Handle array types too. Return the more specific type.
2485 (Invocation.BetterFunction): Add more tie-breaking rules from
2486 section 14.4.2.2. Perform "more specific" check after
2487 other tie-breaking rules. Compare all parameter types before
2488 choosing the "more specific" method.
2490 2006-01-21 Raja R Harinath <harinath@gmail.com>
2491 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2494 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2496 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2497 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2499 2006-01-18 Martin Baulig <martin@ximian.com>
2501 * class.cs (TypeContainer.AddToMemberContainer): Use
2502 `symbol.MemberName.MethodName' instead of just `symbol.Name';
2505 2006-01-18 Martin Baulig <martin@ximian.com>
2507 Fix #76417: a generic class may now have methods which may unify
2508 for some type parameter substitutions.
2510 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2511 for methods which may unify anymore.
2513 * expression.cs (Invocation.MoreSpecific): New private static
2514 method; checks whether one method is more specific than another
2515 according to 14.4.2.2 of the spec.
2516 (Invocation.BetterFunction): Implement the tie-breaking rules from
2517 14.4.2.2 of the spec: if two methods unify for some type parameter
2518 substitution, we need to pick the more specific one.
2520 2006-01-18 Raja R Harinath <rharinath@novell.com>
2522 Fix #76656, cs0231-2.cs.
2523 * cs-parser.jay (formal_parameter_list): Make error case catch
2525 (parenthesized_expression_0): Add CS1026 check.
2526 (invocation_expression): Remove unused { $$ = lexer.Location }.
2528 2006-01-17 Raja R Harinath <rharinath@novell.com>
2531 * cs-parser.jay (statement_expression): Don't list out the
2532 individual statement-expressions. Convert syntax error into
2535 2006-01-16 Raja R Harinath <rharinath@novell.com>
2538 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2539 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2540 CheckIntermediateModification.
2541 (FieldExpr.DoResolve): Add new two-argument version that
2542 allows us to resolve the InstanceExpression as an lvalue.
2543 The one-argument variant is now just a wrapper.
2544 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2545 Resolve the lhs as an lvalue if the it has a value type.
2546 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2547 from Assign.DoResolve.
2548 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2549 resolved as an lvalue.
2550 (PropertyExpr.DoResolve): Update.
2551 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2552 has a value type. Move CS1612 check here from
2553 CheckIntermediateModification.
2554 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2555 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2556 'right_side' of a ResolveLValue on an 'out' argument.
2557 (EmptyExpression.LValueMemberAccess): New. Used as the
2558 'right_side' of a propagated ResolveLValue on a value type.
2559 (LocalVariableReference.DoResolveBase): Recognize
2560 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2562 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2563 EmptyExpression.Null.
2565 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2567 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2568 Type.IsGenericParameter(). Fixed bug #77183.
2569 * doc.cs : it is now identical to doc.cs in mcs.
2571 2006-01-16 Martin Baulig <martin@ximian.com>
2573 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2575 2006-01-16 Martin Baulig <martin@ximian.com>
2577 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2578 ctors; fixes #77250.
2580 2006-01-12 Miguel de Icaza <miguel@novell.com>
2582 This fixes the problem where we used ldfld instead of ldflda to
2583 load the "THIS" pointer on captured parameters, when THIS is a
2584 value type. See bug #77205.
2586 * iterators.cs (CapturedThisReference.Emit): Pass false to
2587 EmitThis (we do not need the address).
2589 * codegen.cs (EmitThis): it needs to know whether we need the
2590 address of `this' or not. This is used by value types.
2592 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2593 every other call passes false.
2595 2006-01-12 Raja R Harinath <rharinath@novell.com>
2598 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2600 * expression.cs (Invocation.OverloadResolve): Update.
2601 (Invocation.DoResolve): Avoid double resolution of invocation.
2603 2006-01-11 Raja R Harinath <rharinath@novell.com>
2606 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2607 unary negation of floating point types as 0-expr; negation cannot
2608 overflow in floating point types.
2611 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2612 on operands of 'void' type.
2615 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2616 and ExclusiveOr for boolean constants too.
2618 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2620 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2622 2006-01-12 Miguel de Icaza <miguel@novell.com>
2624 * cs-tokenizer.cs (Position): New class used to save and restore
2625 the position state in the tokenizer. Before this patch the save
2626 and restore was not complete enough so the line and columns would
2627 start to drift and the debugger and stack traces will get the
2630 2006-01-10 Martin Baulig <martin@ximian.com>
2633 (TypeParameter.InflateConstraints): New public method.
2635 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2636 constraints; fixes #77042.
2638 2006-01-10 Martin Baulig <martin@ximian.com>
2640 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2641 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2644 2006-01-09 Raja R Harinath <rharinath@novell.com>
2647 * expression.cs (Invocation.OverloadResolve): Replace reflected
2648 override methods with their base virtual methods, rather than
2650 * typemanager.cs (TypeManager.GetOverride): New.
2652 2005-12-21 Miguel de Icaza <miguel@novell.com>
2654 * driver.cs: Report the case of no source files and no -out:
2657 2005-12-20 Raja R Harinath <rharinath@novell.com>
2660 * expression.cs (ComposedCast.GetSignatureForError): Define.
2662 2006-01-05 Jb Evain <jbevain@gmail.com>
2664 * class.cs (Property.Define, Indexer.Define): do not tag the
2665 properties as SpecialName | RTSpecialName.
2667 2006-01-04 Miguel de Icaza <miguel@novell.com>
2669 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2670 doing a low-level comparission of parameter types. It was lacking
2671 a check for __argslist.
2673 2005-12-30 Miguel de Icaza <miguel@novell.com>
2675 * expression.cs (ParameterReference.DoResolveBase): Allow
2676 reference parameters if they are local to this block.
2678 This allows the ref and out parameters of a delegate to be used in
2679 an anonymous method, for example:
2681 delegate void set (out int x);
2683 set s = delegate (out int x){
2687 This is used by functionality introduced late in the C# language.
2689 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2690 method that take ref and out parameters.
2692 Fixes #77119 which was a late change in the spec.
2694 2005-12-23 Miguel de Icaza <miguel@novell.com>
2696 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2697 parent if its the same scope. Fixes #77060.
2699 2005-12-22 Marek Safar <marek.safar@seznam.cz>
2701 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2703 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2705 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2706 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
2707 that doesn't contain the full public key. This is a update of the
2708 friend assemblies in .Net 2.0 release.
2710 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2714 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2715 ListDictionary, to contain the ExternAliasEntry entries (in
2716 addition to the NamespaceEntry.aliases hashtable). This field is
2717 shared between the original entry and its doppelganger (bodyless
2719 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2720 extern_aliases field.
2721 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2722 lookup in extern_aliases.
2724 2005-12-16 Raja R Harinath <rharinath@novell.com>
2727 * class.cs (TypeContainer.Mark_HasEquals): New.
2728 (TypeContainer.Mark_HasGetHashCode): New.
2729 (ClassPart): Override them.
2730 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2732 * generic.cs (GenericMethod.DefineMembers): Update to changes.
2733 (TypeParameter.TypeParameter): Change type of 'parent' argument to
2737 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2738 'parent' argument to the base constructor.
2740 Remove all mention of TypeContainer from decl.cs.
2741 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2742 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2743 (DeclSpace.DeclSpace): Likewise.
2744 (DeclSpace.DefineMembers): Remove unused argument.
2745 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2746 debugging check -- we don't care if the debug code throws an
2747 InvalidCastException instead of an InternalErrorException.
2748 * class.cs (TypeContainer.DefineMembers): Update to changes.
2749 (TypeContainer.DoDefineMembers): Likewise.
2750 (TypeContainer.GetMethods): Likewise.
2751 (PropertyMember.Define): Likewise.
2752 (MemberBase.Parent): New property that forwards to
2753 MemberCore.Parent, but ensures that we get a TypeContainer.
2754 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2755 (RootContext.PopulateTypes): Likewise. Remove special case code
2756 for !RootContext.StdLib: DefineMembers is idempotent.
2758 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2760 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2762 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2764 * doc.cs : The search for referenced namespace was insufficient to
2765 get global one as it used to do. Fixed bug #76965.
2767 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2769 * doc.cs : check name in cref in the last phase that whether it is
2772 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2774 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2777 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2779 * doc.cs : so it turned out that we cannot skip override check for
2780 interface members. Fixed bug #76954.
2782 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2784 * cs-tokenizer.cs : fixed bug #75984:
2785 - #warning and #error should not be handled when the source line
2787 - #line is not checked strictly when the source line is disabled.
2788 - #define and #undef is on the other hand checked strictly at any
2791 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2793 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2796 2005-12-15 Raja R Harinath <rharinath@novell.com>
2798 * generic.cs (TypeManager.IsGeneric): Remove unused method.
2800 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2803 2005-12-14 Martin Baulig <martin@ximian.com>
2805 * typemanager.cs (TypeManager.GetFullName): Make this public;
2806 `Type.Fullname' now never returns null.
2808 * class.cs (Method.Define): Use TypeManager.GetFullName() for
2809 explicit interface implementations; we're now using the same
2810 naming convention than csc does.
2812 2005-12-14 Miguel de Icaza <miguel@novell.com>
2814 * convert.cs (ExplicitConversionCore): Check the return value from
2815 ExplicitConversionCore which can return null on failure. Fixes #76914
2817 2005-12-09 Raja R Harinath <rharinath@novell.com>
2819 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2820 instead of IsGenericInstance.
2821 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
2822 code that's now covered by the more general test.
2823 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2825 * generic.cs (DropGenericTypeArguments): New. Captures the common
2826 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2827 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2828 * generic.cs, report.cs, typemanager.cs: Likewise.
2830 2005-12-08 Martin Baulig <martin@ximian.com>
2832 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2834 * typemanager.cs (TypeManager.CSharpSignature): Include type
2835 arguments in the signature of a generic method.
2837 2005-12-07 Martin Baulig <martin@ximian.com>
2839 Add support for custom attributes on type parameters.
2841 * cs-parser.jay (type_arguments): Added `opt_attributes'.
2843 * generic.cs (TypeParameterName): New public class; we use this
2844 instead of a `string' to store the name of a type parameter, so we
2845 can also have `Attributes'.
2846 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2847 array instead of a `string[]' array.
2848 (TypeParameter.ctor): We now also take an `Attributes' argument.
2849 (TypeParameter.EmitAttributes): New public method; emit our
2850 `OptAttributes' here.
2851 (GenericMethod.EmitAttributes): New public method; emit the custom
2852 attributes on all our type parameters.
2854 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2855 our type parameters.
2856 (MethodData.Define): If we're a generic method, call
2857 EmitAttributes() on it.
2859 2005-12-07 Martin Baulig <martin@ximian.com>
2862 (ConstraintChecker): New public abstract class; move the
2863 constraint checking here from `ConstructedType' and also do
2864 constraint checking for generic methods here.
2866 * expression.cs (Invocation.OverloadResolve): Use
2867 ConstraintChecker.CheckConstraints() if we resolved to a generic
2870 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2872 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2874 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2876 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2877 (FieldBase.Initializer): Initializer is now optional.
2878 (EventField.Define): Only event field can have initializer.
2880 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2882 * const.cs (Const): Reuse initializer.
2884 * cs-parser.jay: Updated after FieldBase changes.
2885 Added current_array_type to simplify array initializers.
2887 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2889 * expression.cs, iterators.cs: Updated.
2891 * namespace.cs (NamespaceEntry): Made UsingFound private.
2893 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2895 * parameterCollection.cs: Obsolete, removed.
2896 * parser.cs: Obsolete, removed.
2898 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2901 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2903 * enum.cs (Enum.Define): Set obsolete context here.
2905 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2908 - FindDocumentedMember() now expects 1) paramList as null
2909 when "we don't have to check the number of parameters" and
2910 2) Type.EmptyTypes when "there is no arguments".
2911 - Introduced FoundMember struct to hold the exact type which was
2912 used to find the documented member (the above change broke
2913 test-xml-044; it might be better just to use DeclaringType than
2914 what MS does, like this change does, but it depends on usage.)
2916 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2918 * doc.cs : documented member might be from DeclaringType for nested
2919 types. Fixed bug #76782.
2921 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2923 * anonymous.cs: Have the param code handle leaving copies on the
2924 stack etc. Allows anonymous params to take part in the assignment
2925 code (++, +=, etc). Fixes bug #76550
2927 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2928 it down to the anon code.
2930 * iterators.cs: Use dummy var here
2932 * codegen.cs: Handle new vars
2934 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2937 * class.cs (MethodData.Define): Set proper Obsolete context.
2939 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2941 (FieldExpr.DoResolve): Ditto.
2943 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2946 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2947 parent is not obsolete.
2949 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2951 * doc.cs : (FindDocumentedMember) find parameterless members first
2952 and get CS0419 in the early stage. Fixed first case of bug #76727.
2954 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2957 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2958 no error was reported.
2960 *expression.cs (Binary.DoResolve): left can be null.
2962 2005-12-06 Raja R Harinath <rharinath@novell.com>
2964 * class.cs (MethodCore.CheckGenericOverride): Delete unused
2965 abstract method and all overrides.
2966 * support.cs (ParameterData.GenericConstraints): Delete.
2967 (ReflectionParameters.type_params): Delete.
2968 (ReflectionParameters.ReflectionParameters): Make private.
2969 (ReflectionParameters.GetConstaints): New factory method.
2970 * generic.cs (TypeParameterDefineType): Use it.
2971 (TypeManager.GetTypeParameterConstraints): Likewise.
2973 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2976 * class.cs (MethodData.Emit): Parameters should be labeled first.
2978 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2981 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2983 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2985 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2987 * class.cs (MethodCore): Parameter clean up.
2988 (IMethodData): Added ParameterInfo.
2989 (MethodData): Parameter clean up.
2990 (Indexer.Define): Parameter clean up.
3002 * typemanager.cs: Parameter clean up.
3004 * delegate.cs (Define): Get rid of duplicated code.
3006 * expression.cs (ParameterReference): Removed useless parameters
3008 (Invocation): Ditto.
3010 * parameter.cs (ParamsParameter): New class, params specialization.
3011 (ArglistParameter): Attemp to separate arglist.
3012 (Parameter): Refactored to be reusable and faster.
3013 (Parameter.Modifier): Made understandable.
3014 (Parameters): Changed to be used as a class for `this' assembly
3015 parameters. Refactored to use new specialized classes.
3017 * support.cs (ParameterData): Added Types property.
3018 (InternalParameters): Deleted.
3020 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3022 * doc.cs : the previous patch does not actually fix the bug.
3023 PropertyInfo override check is now implemented and really fixed it.
3024 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3026 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3028 * doc.cs : apply "override filter" also to properties.
3031 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3033 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3034 no need to check overrides. For classes, omit those results from
3035 interfaces since they must exist in the class. Fixed bug #76726.
3037 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3039 * typemanager.cs : (GetFullNameSignature) differentiate indexers
3040 with different parameters. Fixed the second problem in #76685.
3042 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3044 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3045 get expected 'protected' access in CheckValidFamilyAccess()).
3048 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3050 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3051 Fixed bug #76705. CS1569 was incorrectly commented out.
3053 2005-11-23 Martin Baulig <martin@ximian.com>
3055 * generic.cs (Constraints.Define): Removed.
3056 (TypeParameter.DefineConstraints): Removed.
3057 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
3058 on the GenericTypeParameterBuilder here.
3060 2005-11-23 Martin Baulig <martin@ximian.com>
3062 * typemanager.cs (TypeManager.GetProperty): Make this public.
3064 * generic.cs (Nullable.NullableInfo.ctor): Use
3065 TypeManager.GetProperty() rather than using reflection directly.
3067 2005-11-17 Martin Baulig <martin@ximian.com>
3069 * expression.cs (Indexers.GetIndexersForType): Added support for
3070 generic parameters; fixes #76587.
3072 2005-11-17 Martin Baulig <martin@ximian.com>
3075 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3076 inherit the scope from our parent. Fixes #76653.
3078 2005-11-15 Martin Baulig <martin@ximian.com>
3080 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
3081 instead of `ScopeTypeBuilder' to refer to the "current" type.
3082 (AnonymousMethod.CreateScopeType): Correctly create the helper
3083 class if we're inside a generic type definition.
3085 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3087 * doc.cs : use Invocation.IsOverride() to do real override check.
3088 * expression.cs : made Invocation.IsOverride() internal.
3090 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3092 * doc.cs : use TypeManager.FindMembers() instead of (possible)
3093 TypeBuilder.FindMembers() and filter overriden base members out.
3096 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3098 * doc.cs : ref/out parameters are represented as '@' (instead of
3099 '&' in type FullName). Fixed bug #76630 (additionally crefs).
3101 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3103 * doc.cs : when there was no '.' in cref to methods in doc comment,
3104 then parameters were missing in the output. Fixed bug #76691.
3106 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3108 * driver.cs : don't output docs when there is an error.
3111 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3114 Now it should detect indexers. Fixed primary concern in bug #76685.
3115 Fixed CS0419 message to not show the identical member signature in
3118 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3120 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3121 instead of Type.FindMembers() since it does not handle events.
3124 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3126 * codegen.cs: Fixed typo (speficied -> specified).
3128 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3131 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3133 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3135 * attribute.cs: Changed error message.
3137 * cs-tokenizer.cs: One more check.
3139 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3141 * statement.cs (Block.Resolve): Ignore empty statement.
3143 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3145 * report.cs: Made error/warning methods more strict to avoid
3148 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3149 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3150 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3151 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3153 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3155 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
3156 Use the more explicit AssemblyName.FullName instead of
3157 AssemblyName.Name to report errors.
3159 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3161 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3164 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3174 * report.cs: Fixed error reporting and typos.
3176 * generic.cs (TypeParameter.GetSignatureForError): New method.
3177 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3179 * typemanager.cs (GetFullName): Refactored.
3181 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3183 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3184 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3186 * class.cs (TypeContainer.IsComImport): New property.
3187 (Constructor.Define): Create proper ctor for ComImport types.
3189 * expression.cs (New.CheckComImport): Fixed.
3191 2005-11-07 Miguel de Icaza <miguel@novell.com>
3193 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3194 that a parameter has been captured does not mean that we do not
3195 have to do the rest of the processing. This fixes the second part
3196 of #76592. If there was another anonymous method capturing
3197 values in the past, the Scope would never be set for the second
3198 method that captured the same parameter.
3200 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3201 properly manipulate the stack. Second part of fix for #76592.
3203 * expression.cs (New): Add support for invoking "new" on
3204 interfaces that have been flagged with the ComImport attribute and
3205 the CoClass. Fixes #76637
3207 * statement.cs (Try.DoEmit): When a variable is captured, do not
3208 try to emit the vi.LocalBuilder variable as it has been captured.
3209 Create a temporary variable and store the results on the
3210 FieldBuilder. Fixes #76642
3212 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3214 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3216 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3218 * expression.cs (Binary.DoResolve): Added && optimalization.
3220 * typemanager.cs (AddUserType): Removed useless argument.
3222 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3224 * statement.cs (Block.variables): Uses ListDictionary.
3226 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3229 * class.cs (PartialContainer.EmitType): Customized to emit
3230 security attributes.
3231 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3232 for partial classes.
3234 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3237 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3238 access has to be fixed.
3240 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3242 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3245 * ecore.cs (NullCast.Reduce): Implemented.
3247 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3250 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3252 (Foreach.Resolve): Catch null properly.
3254 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3256 * cs-tokenizer.cs: Warning text fix.
3258 * driver.cs: AllWarningNumbers exposed on public interface.
3260 * report.cs (): Reviewed warning numbers.
3261 (IsValidWarning): Use binary search.
3263 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3265 * driver.cs: Implemeted resource visibility.
3266 (Resources): New class for code sharing between /res: and
3269 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3271 decl.cs (CurrentTypeParameters): Fixed to be public.
3273 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3275 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3277 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3279 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3281 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
3283 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3285 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3287 Add friend assembly access support.
3288 * typemanager.cs: assembly_internals_vis_attrs
3289 cache for friend assembly access.
3290 (TypeManager.IsFriendAssembly): New method for
3291 checking friend assembly access.
3292 (TypeManager.Error_FriendAccessNameNotMatching): New
3294 (TypeManager.CompareKeyTokens): Likewise.
3295 (TypeManager.Filter): Handle friend accessible
3298 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3299 friend accessible types.
3301 * ecore.cs (Expression.IsAccessorAccessible): Handle
3302 friend accessible properties.
3304 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3307 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3310 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3313 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3316 * ecore.cs (NullCast): Child is contant only.
3318 * literal.cs (NullLiteral.Reduce): null can be converted to any
3321 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3323 * driver.cs: Use Encoding.Default as default code page instead
3326 2005-10-27 Raja R Harinath <rharinath@novell.com>
3329 * expression.cs (Invocation.Error_InvalidArguments): Handle
3330 __arglist parameters.
3331 (Invocation.VerifyArgumentsCompat): Likewise.
3332 * support.cs (ReflectionParameters.GetSignatureForError): Print
3333 __arglist parameters.
3334 (InternalParamters.GetSignatureForError): Likewise.
3335 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3337 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3339 * attribute.cs (GetPropertyValue): Made public.
3341 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3343 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3345 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3348 * driver.cs: Reflect method name change.
3350 * statement.cs (Try.Resolve): Warn when try has both general
3353 * typemanager.cs: runtime_compatibility_attr_type new predefined
3356 2005-10-26 Raja R Harinath <harinath@gmail.com>
3359 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3360 treat it as an empty parameter list.
3362 2005-10-26 Raja R Harinath <rharinath@novell.com>
3365 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3366 ResolveAsTypeStep silent.
3367 * statement.cs (Block.AddConstant): Mark block as used.
3368 (Block.ResolveMeta): Avoid piling on error messages
3369 if a constant initializer resolution fails.
3371 2005-10-25 Raja R Harinath <rharinath@novell.com>
3373 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3375 (NamespaceEntry.VerifyAllUsing): New.
3376 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3377 behaviour. Delegates actual resolution of alias to ...
3378 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3379 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3381 * driver.cs (Driver.MainDriver): Update.
3383 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3384 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3386 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3388 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3389 RootNamespace.DefineNamespacesForAll.
3391 2005-10-24 Raja R Harinath <harinath@gmail.com>
3393 * typemanager.cs (assemblies, external_aliases, modules)
3394 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3395 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3396 overhead. Move resposibility ...
3397 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3398 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3400 2005-10-23 Raja R Harinath <harinath@gmail.com>
3402 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3403 cached_namespaces. Improve usage.
3404 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3405 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3406 Move from GlobalRootNamespace and simplify.
3407 (RootNamespace.Global): Make instance variable.
3408 (RootNamespace.RootNamespace): Add "alias name" parameter.
3409 (GlobalRootNamespace): Simplify drastically.
3410 (Namespace.Lookup): Don't use GetNamespace.
3411 * typemanager.cs (GetRootNamespace): Rename from
3412 ComputeNamespaceForAlias.
3413 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3415 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3417 * anonymous.cs (AnonymousContainer): Don't crash when container
3420 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3422 * expression.cs (Binary.DoResolve): Warn when comparing same
3425 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3428 * expression.cs (Binary.DoResolve): It looks like there are no
3429 convetsion rules in enum context.
3431 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3433 Add support for extern alias qualifiers.
3434 * typemanager.cs: Move some LookupTypeReflection code
3435 to namespace.cs, to have cleaner code. Added some methods
3436 to help us keep track of the extern aliased references.
3437 * driver.cs: Add suport for extern alias assemblies on command
3438 line and check for their warnings/errors. Also keep track of the
3439 extern aliased assemblies.
3440 * namespace.cs: Move the global functionality of Namespace
3441 to GlobalRootNamespace/RootNamespace. Now the global namespace
3442 is GlobalRootNamespace.Globa. Also the code moved from
3443 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3444 Finally added LocalAliasEntry (AliasEntry before) and
3445 ExternAliasEntry, to handle alias statements.
3446 * cs-parser.jay: Add support in the grammar for extern alias
3448 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3449 Update callings to Namespace (now in GlobalRootNamespace).
3451 2005-10-25 Martin Baulig <martin@ximian.com>
3453 * convert.cs (ImplicitTypeParameterConversion): Make base
3454 interfaces actually work; fixes #76557.
3456 2005-10-25 Martin Baulig <martin@ximian.com>
3459 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3460 all the type parameters; fixes #76551.
3462 2005-10-25 Martin Baulig <martin@ximian.com>
3467 (GenericMethod.ctor): Added `Expression return_type' and
3468 `Parameters parameters' arguments.
3469 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3470 parameter and return types to check their constraints if they're
3473 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3476 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3477 constraints of a generic type if `ec.ResolvingGenericMethod'.
3479 * class.cs (MethodCore.DoDefineParameters): Set
3480 `ec.ResolvingGenericMethod' if we're a generic method.
3481 (MemberBase.MemberType): Likewise.
3483 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3485 * typemanager.cs (TypeManager): Added
3486 TypeManager.internals_visible_attr_type to cache
3487 S.R.CompilerServices.InternalsVisibleToAttribute.
3489 * codegen.cs (AssemblyClass): Added checks for
3490 InternalsVisibleToAttribute in new method
3491 CheckInternalsVisibleAttribute () and also cache the
3492 AssemblyName in AssemblyClass.Name.
3494 2005-10-24 Martin Baulig <martin@ximian.com>
3497 (TypeManager.ExpandInterfaces): Added overloaded version which
3498 just takes a `Type[]' array.
3501 (Constraints.Resolve): Don't expand the interfaces here; ie. we
3502 just use the interfaces which were explicitly specified and not
3503 the interfaces they inherit. Fixes #76482.
3504 (TypeParameter.FindMembers): Expand the interfaces here.
3506 2005-10-21 Martin Baulig <martin@ximian.com>
3509 (Constraints.Resolve): Also resolve the actual types here.
3510 (Constraints.ResolveTypes): Just check the constraints here.
3511 Fixes #76363; see gtest-218.cs.
3513 2005-10-21 Martin Baulig <martin@ximian.com>
3516 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3517 instead of a `BoxedCast'; fixes gtest-217.cs.
3519 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
3521 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3522 1) "new()" is specified as generic parameter constraint and 2) the
3523 type is TypeBuilder and 3) the type is abstract even if it has a
3524 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3526 2005-10-20 Martin Baulig <martin@ximian.com>
3529 (GenericConstraints.TypeParameter): New public property.
3530 (TypeParameter.ctor): Also take a `DeclSpace' argument.
3531 (TypeParameter.DeclSpace): New public property.
3532 (TypeParameter.DefineType): Inflate the constraints if our
3533 `DeclSpace' is an `Iterator'.
3535 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
3537 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
3538 GenericMethod argument to compare methods' generic type arguments.
3541 2005-10-19 Martin Baulig <martin@ximian.com>
3543 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3544 not ResolveType() when resolving the base type, so we're not
3545 checking the constraints here.
3546 (TypeContainer.ResolveType): Call ResolveType() on our base_type
3549 2005-10-19 Martin Baulig <martin@ximian.com>
3551 * generic.cs (ConstructedType.CheckConstraints): Committing
3552 untested fix for #76441.
3554 2005-10-18 Raja R Harinath <rharinath@novell.com>
3557 * class.cs (TypeContainer.DefineType): Move updating of
3558 topological sort earlier in the code.
3559 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3561 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3564 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3566 * constant.cs (Constant.TryReduce): Moved from Cast class.
3567 (Reduce): Made little bit more OO and fixed missing conversions.
3569 * ecore.cs (Reduce): Implemented.
3570 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3572 * literal.cs (Reduce): Implemented.
3574 * class.cs: Reverted Miguel's wrong commit.
3576 2005-10-14 Miguel de Icaza <miguel@novell.com>
3578 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3580 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3582 * cs-parser.jay, expression.cs : CS0214 was missing error location
3583 for constants. Fixed bug #76404.
3585 2005-10-10 Raja R Harinath <rharinath@novell.com>
3587 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3589 (PropertyExpr.EmitCall): Likewise.
3590 * expression.cs (Invocation.EmitArguments): Handle case where
3592 (Invocation.EmitCall): Avoid allocating temporary variable if
3593 there are no arguments.
3595 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3598 * convert.cs (ExplicitConversionCore): Fixed object->enum
3601 2005-10-07 Raja R Harinath <rharinath@novell.com>
3604 * convert.cs (ImplicitConversionStandard): Move conversion of
3605 void* to arbitrary pointer types ...
3606 (ExplicitConversionStandard): .. here.
3607 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3608 error to always print typenames.
3610 2005-10-07 Raja R Harinath <rharinath@novell.com>
3612 * convert.cs (GetConversionOperator): Rename from
3613 GetConversionOperators. Move operator selection code from ...
3614 (UserDefinedConversion): ... here.
3616 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3618 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3621 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3623 * assign.cs (Assign.DoResolve): Error method changed.
3625 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3627 * const.cs (ResolveValue): Reset in_transit immediately.
3629 * constant.cs: Error method changed.
3631 * convert.cs: Removed useless location parameter.
3632 (ExplicitNumericConversion): Don't do double enum check.
3633 (ExplicitConversionCore): Renamed from ExplicitConversion.
3634 (ExplicitUnsafe): Extracted from ExplicitConversion.
3635 (ExplicitConversion): Uses for error reporting.
3637 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3639 (ResolveBoolean): Uses common error method.
3640 (CastToDecimal): Get rid of ec.
3641 (CastFromDecimal): Optimized.
3642 (ConvCast): Get rid of ec.
3644 * enum.cs (ResolveValue): Reset in_transit immediately.
3645 (Emit): Return after first error.
3647 * expression.cs: Convert changes.
3649 * literal.cs: Error method changed.
3651 * statement.cs: Error method changed.
3653 2005-10-06 Raja R Harinath <rharinath@novell.com>
3655 Fix gtest-131.cs and gtest-211.cs.
3656 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3657 Only emit code for a label if it is used. Unreachable code can
3658 violate ECMA evaluation stack invariants.
3660 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3662 * anonymous.cs: Implemented ExprClassName.
3664 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3667 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3670 * class.cs (StaticClass.DefineContainerMembers): Report protected
3673 * codegen.cs: if(ed) PRODUCTION.
3675 * convert.cs (Error_CannotImplicitConversion): Better error
3678 * cs-parser.jay: More error checks.
3680 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3682 * driver.cs (CSCParseOption): Enabled wrong option check.
3684 * ecore.cs (Expression.ExprClassName): Turned to property.
3685 (MemberExpr.CheckIntermediateModification): For checking boxed
3686 value types modification.
3688 * statement.cs (Fixed.Resolve): Expression type must be
3689 convertible to fixed type.
3690 (CollectionForeach.GetEnumeratorFilter,TryType):
3691 Small refactoring for easier error checking.
3693 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3695 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3698 * class.cs (GeneratedBaseInitializer): New class for customization
3699 compiler generated initializers.
3700 (MemberBase.DoDefine): Check Obsolete attribute here.
3701 (FieldMember.DoDefine): Ditto.
3703 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3706 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3707 (MemberCore.GetObsoleteAttribute): Removed argument.
3708 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3709 (MemberCore.CheckObsoleteType): New helper.
3713 * statement.cs: Updates after MemberCore changes.
3715 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3716 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3718 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3719 obsolete attribute for compiler construct.
3720 (As.DoResolve): Cache result.
3722 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3724 2005-10-01 Miguel de Icaza <miguel@novell.com>
3726 * expression.cs (Probe): instead of having a "Type probe_type"
3727 keep the extra information as a TypeExpr probe_type_expr since the
3728 "As" operator needs to perform some type checks.
3730 * (As.DoResolve): If the type is a type parameter, ensure that it
3731 is constrained by a class.
3733 2005-09-22 Miguel de Icaza <miguel@novell.com>
3735 * statement.cs (Lock): Use the TemporaryVariable class instead of
3736 manually using local variables as those do not work when variables
3739 * ecore.cs: Moved the TemporaryVariable class from being a nested
3740 class inside Foreach to be a public class that can be employed in
3743 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3745 * cs-parser.jay: interface_accessors replaced by
3746 accessor_declarations.
3748 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3751 * statement.cs (GotoCase.Resolve): Convert null constant to
3753 (SwitchLabel.ResolveAndReduce): Ditto.
3754 (SwitchLabel.NullStringCase): Custom null stamp.
3755 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3757 typemanager.cs (CSharpSignature): Don't skip first argument
3760 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3762 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3763 expression.cs, iterators.cs, literal.cs: Store constants and
3766 * class.cs (MemberBase.ShortName): Pass location.
3768 * cs-parser.jay: Some location fixes.
3770 * ecore.cs (Expression.Location): Made virtual.
3772 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3775 * const.cs (Const.ResolveValue): Check for assigning non-null
3776 value to reference type.
3778 2005-09-26 Raja R Harinath <rharinath@novell.com>
3781 * expression.cs (This.VerifyFixed): In a value type T, the type of
3782 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3783 value type R, 'this' is treated as a value parameter.
3785 2005-09-05 Miguel de Icaza <miguel@novell.com>
3787 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3788 if the underlying types are the same, otherwise we need to produce
3789 code that will do the proper cast.
3791 This was exposed by Marek's constant rewrite which produced
3792 invalid code for the call site:
3795 void Method (X v) {}
3799 This fixes test-49.cs
3801 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3803 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3804 Type/Object should be allowed as well. Fixed bug #75968.
3806 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3808 * expression.cs : (Binary.DoResolve): when one is enum constant and
3809 another is constant 0, then return enum one *as enum type*.
3812 2005-10-04 Martin Baulig <martin@ximian.com>
3814 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3815 `SetMemberIsUsed()' work for generics, too.
3817 2005-10-04 Martin Baulig <martin@ximian.com>
3819 * expression.cs (DelegateInvocation.EmitStatement): Make this work
3820 for corlib. Fixes #75691.
3822 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3825 * driver.cs: Fix compilation files with full root path.
3827 2005-09-25 Miguel de Icaza <miguel@novell.com>
3829 * report.cs (SymbolRelatedToPreviousError): Format the output so
3830 it does not use an open parenthesis that is never closed.
3832 * driver.cs: Follow coding guidelines
3834 2005-09-18 Miguel de Icaza <miguel@novell.com>
3836 * driver.cs: Set InEmacs based on the environment variable EMACS.
3838 * location.cs (InEmacs): in this mode, do not report column
3839 location as it confuses Emacs.
3841 2005-10-03 Raja R Harinath <rharinath@novell.com>
3843 * support.cs (SeekableStreamReader.Position): Don't error out when
3844 the requested position is just beyond the end of the current
3847 2005-09-28 Raja R Harinath <rharinath@novell.com>
3849 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3850 try to keep in sync with the byte count of the underlying Stream.
3851 However, this limits us to a window size of 2048 characters: i.e.,
3852 the maximum lookahead of our lexer/parser can be 2048 characters.
3854 2005-09-22 Martin Baulig <martin@ximian.com>
3856 * driver.cs: Removed a debugging FIXME.
3858 2005-09-21 Raja R Harinath <rharinath@novell.com>
3860 * cs-parser.jay (type_arguments): Add CS1644 check.
3861 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3863 2005-09-15 Raja R Harinath <rharinath@novell.com>
3865 * Makefile (PROGRAM): Make profile specific.
3866 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3867 the current directory.
3870 * expression.cs (Invocation.EmitCall): Remove optimization on
3871 this_call since it doesn't handle 'this' being a value type.
3873 2005-09-05 Geoff Norton <gnorton@customerdna.com>
3875 * driver.cs: Ensure file handles are closed after parsing
3877 2005-09-05 Miguel de Icaza <miguel@novell.com>
3879 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3880 if the underlying types are the same, otherwise we need to produce
3881 code that will do the proper cast.
3883 This was exposed by Marek's constant rewrite which produced
3884 invalid code for the call site:
3887 void Method (X v) {}
3891 This fixes test-49.cs
3893 2005-09-05 Martin Baulig <martin@ximian.com>
3895 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3896 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3898 * cs-parser.jay (delegate_declaration): Small fix for #75852.
3900 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3902 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3903 to be a pointer type due to the spec 25.2, so check if declaring
3904 type is generic type definition. Fixed bug #75772.
3906 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3909 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3910 both types are not defined by methods.
3911 * expression.cs : (Invocation.IsApplicable): it should work when
3912 the argument type is equal to the parameter type, not only when
3913 ImplicitConversionExists() returns true.
3915 2005-09-02 Raja R Harinath <rharinath@novell.com>
3917 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3921 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3922 flow-branching for LocalVariableReferences in case we were invoked
3923 from a MemberAccess.
3924 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3926 (LocalVariableReference.DoResolveBase): ... this.
3927 (MemberAccess.Resolve): Do the check that was disabled during
3930 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3933 (PartialContainer.Create): check abstract/sealed/static strictly
3934 but abstract/sealed can exist only at one side. Fixed bug #75883.
3936 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3939 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3940 specified, don't default to UnmanagedType.I4.
3942 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3944 * expression.cs : conditional operator should check possibly
3945 incorrect assign expression. Fixed bug #75946.
3947 2005-08-30 Raja R Harinath <rharinath@novell.com>
3950 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3951 (ScopeInfo.EmitScopeType): Use it to construct field names from
3952 names of captured locals.
3955 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3956 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3957 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3958 (ExplicitConversion): Remove enum cases already handled by
3959 implicit conversion. Move implicit conversion check to the beginning.
3960 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3961 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3962 Don't treat System.Enum as a struct.
3964 2005-08-30 Jb Evain <jbevain@gmail.com>
3966 * attribute.cs: handles as expression in parameters.
3968 2005-08-30 Raja R Harinath <rharinath@novell.com>
3971 * class.cs (TypeContainer.VerifyClsName): Don't use a
3972 PartialContainer when verifying CLS compliance.
3973 (AbstractPropertyEventMethod): Set Parent here, ...
3974 (PropertyMethod): ... not here.
3976 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3978 * attribute.cs : escaped attribute name should not be allowed to be
3979 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3981 2005-08-29 Raja R Harinath <rharinath@novell.com>
3984 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3985 when converting a long constant to unsigned long.
3986 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3987 detect where IsApplicable and VerifyArgumentsCompat disagree.
3989 2005-08-29 Raja R Harinath <rharinath@novell.com>
3990 and Carlos Alberto Cortez <carlos@unixmexico.org>
3993 * class.cs (TypeContainer.CanElideInitializer): New helper.
3994 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3995 can safely emitting the initializer of a field.
3997 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3999 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4000 allowed inside a switch (without loop). Fixed bug #75433.
4002 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4004 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4005 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4007 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4009 * driver.cs : kinda reverting the default encoding changes (not exact
4010 revert since I noticed that "codepage:reset" might not work fine).
4012 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4014 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4015 Location. Now getter and setter store location correctly.
4016 (errors/cs0111-12.cs now reports the expected location.)
4018 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4020 * driver.cs : Use default encoding on the environment.
4021 Removed (now that) extra parameter for SeekableStreamReader.
4022 * support.cs : (SeekableStreamReader) third .ctor() argument for
4023 StreamReader is not required (always true). preamble size could
4024 be acquired in simpler and safe way.
4026 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
4028 * cs-parser.jay: report CS0642 at warning level 3
4029 and report CS0642 for an if else statement also
4030 fixes bug #74745. Patch by John Luke (and a bit
4032 Removed extra CS0642 warning check for "while",
4034 * statement.cs: In Block.Resolve(), CS0642 check
4035 is reimplemented to check a sequence of an empty
4036 statement and a block.
4038 Both fix bug #66777.
4040 2005-08-24 Marek Safar <marek.safar@seznam.cz>
4042 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4043 detection until I fix it.
4045 * cs-tokenizer.cs: Changed error message.
4047 * cs-parser.jay: Fixed 2 error locations.
4049 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4050 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4053 * enum.cs (GetSignatureForError): Fixed.
4055 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4059 * typemanager.cs (RegisterProperty): Removed.
4061 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4063 2005-08-24 Raja R Harinath <rharinath@novell.com>
4066 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4067 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4069 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4071 * expression.cs : tiny fix is required for not warning positive ulong.
4074 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4076 * expression.cs : add CS0652 check for constant and integral
4077 expression. Fixed bug #53974.
4079 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4081 * expression.cs : in DoNumericPromotions(), check if there is implicit
4082 conversion overload for string (to check CS0034). Fixed bug #52492.
4084 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4086 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4088 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4090 * ecore.cs : report location when it is *not* Null.
4092 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4098 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4099 correctly. Fixed bug #75721.
4101 2005-08-23 Raja R Harinath <rharinath@novell.com>
4103 * support.cs (SeekableStreamReader.Position): Avoid an expensive
4104 loop that performs 'min (pos, char_count)'.
4107 * expression.cs (Unary.ResolveOperator): Don't discard implicit
4108 converted value in Operator.OnesComplement.
4110 2005-08-22 Ben Maurer <bmaurer@ximian.com>
4112 * anonymous.cs: If the anon method is pulled into a helper class,
4113 it needs to be `internal' not `private'. Fixes runtime behavior on
4116 2005-08-17 Marek Safar <marek.safar@seznam.cz>
4119 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4122 2005-08-16 Marek Safar <marek.safar@seznam.cz>
4124 The big constants rewrite
4125 Fix #75746, #75685 and more
4126 As a side effect saved 1MB for MWF ;-)
4128 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4129 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4130 enum based for corlib compilation.
4132 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4135 * class.cs (FixedField.Define): Use ResolveAsConstant.
4137 * const.cs (IConstant): Interface constants and enums.
4138 (Const.ResolveValue): New method for constant resolvning.
4139 (ExternalConstant): Constants from imported assemblies.
4141 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4142 conversion; like enums.
4143 (Constant.ToType): Converts this constant to different type.
4144 (Constant.Increment): Adds 1.
4146 * convert.cs (ImplicitConversionRequired): Simplified.
4148 * cs-parser.jay: Create EnumMember directly.
4150 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4152 * doc.cs (GenerateEnumDocComment): Removed.
4154 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4155 (ConvertIntLiteral): Removed.
4156 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4158 * enum.cs (EnumMember): Implement IConstant.
4159 (Enum.IsValidEnumConstant): Removed.
4160 (Enum.GetNextDefaultValue): Removed.
4161 (Enum.FindMembers): Updated.
4162 (Enum.GenerateDocComment): Iterate enum members.
4164 * expression.cs (Cast.TryReduce): Handle enums correctly.
4165 (New.Constantify): Made public.
4166 (MemberAccess.DoResolve): Removed contant specific if(s).
4168 * literal.cs (NullLiteral): Implement new abstract methods.
4170 * statement.cs (GotoCase.Resolve): Use new constant methods.
4171 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4173 * typemanager.cs (LookupEnum): Removed.
4174 (IsEnumType): Fixed to work with corlib.
4175 (RegisterConstant): Removed.
4176 (LookupConstant): Removed.
4177 (GetConstant): Changed to work with IConstant.
4179 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4181 * location.cs : Fixed overflown (>255) column number.
4183 2005-08-03 Raja R Harinath <rharinath@novell.com>
4185 First cut of the qualified-alias-member feature.
4186 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4188 * cs-parser.jay (DOUBLE_COLON): New token.
4189 (namespace_or_type_name): Add rule for recognizing
4190 qualified-alias-members.
4191 (primary_expression): Likewise.
4192 (element_access): Allow QualifiedAliasMember as a possible
4193 type-bearing expression.
4194 (local_variable_type, local_variable_pointer_type): Likewise.
4195 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4196 aliases in the current and enclosing namespace declarations.
4197 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4198 * decl.cs (MemberName.is_double_colon): New.
4199 (MemberName.MemberName): Add new constructor for alias-member.
4200 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4201 * expression.cs (QualifiedAliasMember): New expression type.
4203 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4205 * location.cs : it borked when no argument was specified.
4207 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4209 * location.cs : tiny ToString() format fix.
4211 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4213 * statement.cs : oops, it was missing.
4215 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4217 A set of fixes for precise line/column location.
4220 "token" field now holds a file/line "delta", a line number offset
4221 from the segment, and a column number. See also:
4222 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4223 December/009508.html
4224 Removed static IsNull. Use instance IsNull property instead.
4226 For some tokens it stores Location. For Identifier it stores
4227 LocatedToken which is a pair of string name and location.
4228 Column numbers are adjusted only at getChar().
4230 Use Location.ToString() for reporting (it now contains column).
4232 Largely modified to use LocatedToken instead of
4233 string (IDENTIFIER), and to acquire Location from some tokens.
4234 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4235 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4237 Now MemberName holds Location. DeclSpace.ctor() receives Location
4238 as a parameter. Removed extra parameters to all derived classes.
4239 Replaced Location.IsNull() with instance property.
4240 * assign.cs, expression.cs :
4241 Added .ctor() overload that omits Location.
4243 Added "nameEscaped" flag that indicates the identifier was escaped
4244 in the source file. This fixes bug #57047.
4246 2005-09-02 Martin Baulig <martin@ximian.com>
4248 * class.cs: Make CS3005 a warning, not an error.
4250 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4252 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4253 New method, looking for lo-case imported cls type.
4255 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4258 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4260 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4262 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4264 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4266 Optimized to save 3.5 MB for SWF compilation.
4268 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4270 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4271 (PartialContainer.Create): Moved logic AddToContainer.
4272 (PartialContainer.MarkForDuplicationCheck): Shares name.
4274 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4277 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4279 (Namespace.GetSignatureForError): New method.
4281 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4282 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4284 2005-08-01 Raja R Harinath <rharinath@novell.com>
4287 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4288 member lookup rather than qualifier_type, since qualifier_type can
4291 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4293 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4296 2005-07-31 Miguel de Icaza <miguel@novell.com>
4298 * statement.cs: Copy the local exception into the exception
4299 captured local. Fixes 75674
4301 2005-07-31 Raja R Harinath <harinath@gmail.com>
4304 * expression.cs (Invocation.OverloadResolve): Don't report error
4305 CS1501 if error CS1502 has been reported.
4306 (New.DoResolve): Delegate CS1501 reporting to
4307 Invocation.OverloadResolve.
4310 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4311 invariant-meaning-in-block property in an enclosing block if
4314 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4316 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4317 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4318 (Switch.CheckSwitch): Just save 50kb for SWF.
4320 2005-07-27 Martin Baulig <martin@ximian.com>
4322 * anonymous.cs (CaptureContext.AddField): Added
4323 `AnonymousContainer am' argument; compute its toplevel scope if
4324 it's not already computed. Fixes #75649.
4326 2005-07-26 Raja R Harinath <rharinath@novell.com>
4329 * class.cs (Constructor.Emit): Reset block to null if the block
4332 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4334 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4336 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4338 * class.cs (MethodData.Define): Check whether accessor implementing
4339 interface is public.
4341 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4343 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4346 * namespace.cs (LookupType): Moved same type check to...
4348 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4351 2005-07-21 Raja R Harinath <rharinath@novell.com>
4353 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4354 already found a typebuilder.
4355 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4356 MemberNames, not strings.
4358 * const.cs (Error_ExpressionMustBeConst):
4359 Rename from Error_EpressionMustBeConst.
4360 * const.cs, class.cs, statement.cd: Update.
4362 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4366 * const.cs (Const.LookupConstantValue): Report missing contant expression
4368 (Error_EpressionMustBeConstant): Only one error method.
4370 * class.cs, statement.c: Updated.
4372 2005-07-20 Raja R Harinath <rharinath@novell.com>
4374 * statement.cs (Block.Flags): Add back HasVarargs.
4375 (Block.flags): Make protected.
4376 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4378 * typemanager.cs (types, typecontainers, user_types): Remove.
4379 (UserTypes, TypeContainers): Likewise.
4380 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4381 (CleanUp, Reset): Update.
4382 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4383 (GetNestedType): Use Type.GetNestedType.
4384 (CoreLookupType): Take two arguments, the namespace and the
4385 basename of the type. Update to use the Namespace.Lookup
4387 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4388 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4389 string concatenation and substring matches.
4390 * class.cs, enum.cs, delegate.cs: Update to changes.
4392 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4394 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4395 Expression and made virtual.
4397 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4398 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4400 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4402 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4405 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4408 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4411 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4412 AssemblyCultureAttribute is not used on executable.
4415 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4417 2005-07-16 Raja R Harinath <rharinath@novell.com>
4420 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4421 New. Reports CS0252/CS0253.
4422 Mostly taken from preliminary patch by Duncak Mak.
4423 (Binary.DoResolveOperator): Store results of operator lookup.
4424 Use them to detect if we need to warn about unintended reference
4427 2005-07-15 Raja R Harinath <rharinath@novell.com>
4430 * namespace.cs (Namespace.Lookup): Add back location parameter.
4431 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4432 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4434 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4435 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4436 (Namespace.LookupType): ... this.
4437 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4439 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4440 purported to handle pointers.
4441 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4444 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4446 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4449 2005-07-15 Raja R Harinath <rharinath@novell.com>
4451 * namespace.cs (Namespace.Lookup): Drop location parameter.
4452 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4453 (NamespaceEntry.Lookup): ... this.
4454 (NamespaceEntry.Error_AmbiguousTypeReference):
4455 Move here from DeclSpace.
4456 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4458 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4459 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4460 Move to NamespaceEntry.
4461 * delegate.cs, expression.cs: Update to changes.
4463 2005-08-31 Martin Baulig <martin@ximian.com>
4465 Committing a patch from Atsushi Enomoto for #75850.
4467 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4468 Prefer a generic enumerator over a non-generic one.
4470 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4472 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4473 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4475 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4477 * driver.cs : reverting default encoding change as well as mcs.
4479 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4481 * driver.cs, support.cs : merged r48826.
4483 > could you integrate your mcs changes to gmcs otherwise
4484 > gmcs cannot compile some files.
4486 2005-08-20 Martin Baulig <martin@ximian.com>
4488 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4489 scope if we don't already have it.
4491 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4492 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4495 2005-07-31 Miguel de Icaza <miguel@novell.com>
4497 * statement.cs: Copy the local exception into the exception
4498 captured local. Fixes 75674
4500 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4502 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4505 2005-08-12 Martin Baulig <martin@ximian.com>
4507 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4508 for nested types here to avoid hitting the cache too early.
4510 2005-08-09 Miguel de Icaza <miguel@novell.com>
4512 * enum.cs: On the new compiler CLS error 3005 is now a warning not
4515 2005-08-03 Martin Baulig <martin@ximian.com>
4517 Make iterators in generic methods work; see gtest-191.cs.
4520 (Constraints.Resolve): Protect against being called twice.
4523 (TypeContainer.GetClassBases): Make this `protected virtual'.
4525 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4526 (Iterator.GetClassBases): Override this and compute the base
4528 (Iterator.DefineNestedTypes): If we're a generic method, all our
4529 method type parameters become class type parameters on the proxy
4533 (ToplevelBlock.Parameters): Make this a property, not a field.
4534 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4536 2005-08-03 Martin Baulig <martin@ximian.com>
4538 * typemanager.cs (TypeManager.IsSubclassOf): Use
4539 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4540 (TypeManager.GetFullName_recursed): Improved.
4542 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4545 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4546 Private accessor case, using TypeManager.IsPrivateAccessible instead of
4547 invocation_type == mi.DeclaringType, since the first one also checks
4548 other condition used by generic instances.
4550 2005-07-27 Martin Baulig <martin@ximian.com>
4552 * anonymous.cs (CaptureContext.AddField): Added
4553 `AnonymousContainer am' argument; compute its toplevel scope if
4554 it's not already computed. Fixes #75649.
4556 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4558 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4559 CheckAttributeType and refactored.
4560 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4561 ResolveAsTypeTerminal error handling.
4562 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4564 (GetSignatureForError): Print errors in same way.
4567 * codegen.cs: Reflect attribute GetSignatureForError change.
4570 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4572 * namespace.cs (UsingEntry): Refactored to make fields private.
4575 statement.cs: Error_UnexpectedKind has extra parameter.
4577 2005-07-14 Raja R Harinath <rharinath@novell.com>
4579 * ecore.cs (IAlias): Remove.
4580 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4581 that implement the interface.
4582 * namespace.cs (Namespace): Likewise.
4583 (Namespace.declspaces): Renamed from 'defined_names'.
4584 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4585 DeclSpace instead of an IAlias.
4586 * tree.cs (Tree.AddDecl): Update.
4588 2005-07-12 Raja R Harinath <rharinath@novell.com>
4590 * statement.cs (Block.Flags); Remove HasVarargs.
4591 (Block.HasVarargs): Move to ToplevelBlock.
4592 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4593 (Block.Variables): Make protected. Initialize variable hashtable
4595 (Block.AddVariable): Update.
4596 (Block.Resolve): Update to changes.
4597 (ToplevelBlock.HasVarargs): New boolean.
4598 (ToplevelBlock.ThisVariable): Move here from Block.
4599 (ToplevelBlock.AddThisVariable): Likewise.
4600 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4601 * expression.cs (This.ResolveBase): Update to changes.
4602 (ArglistAccess.DoResolve): Likewise.
4604 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4607 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4609 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4610 not used and not used & assigned.
4611 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4613 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4616 * expression.cs (Is.DoResolve): null is never provided type.
4618 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4621 * cs-parser.jay: Less strict event error rule to catch more errors.
4623 2005-07-11 Martin Baulig <martin@ximian.com>
4625 * generic.cs (ConstructedType.CheckConstraints): Improve the check
4626 for the constructor constraint: we do not only have to check
4627 whether the class has a public constructor, but also ensure that
4628 it's parameterless. Fixes #75492.
4630 2005-07-11 Martin Baulig <martin@ximian.com>
4632 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4633 between type parameters if they either have the reference type
4634 constraint or the class constraint.
4636 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
4638 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4640 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4643 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4644 (ExtractSecurityPermissionSet): Cope with self referencing security
4645 attributes properly.
4647 * driver.cs (SetOutputFile): Made public property OutputFile.
4649 2005-07-07 Raja R Harinath <rharinath@novell.com>
4652 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4653 has_nonstatic_fields. Make into a FieldBase pointer.
4654 (TypeContainer.AddField): Add CS0282 check.
4655 (TypeContainer.EmitType): Update.
4657 2005-07-06 Miguel de Icaza <miguel@novell.com>
4659 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4660 compare if they start with __.
4662 2005-07-06 Raja R Harinath <rharinath@novell.com>
4664 * statement.cs (Switch.SwitchGoverningType): Only look at
4665 UserCasts that don't need implicit standard conversions to one of
4666 the allowed switch types (Fixes test-322.cs).
4667 (LocalInfo.Resolve): Re-enable sanity-test.
4669 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4671 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4673 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4675 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4677 2005-07-06 Raja R Harinath <rharinath@novell.com>
4680 * ecore.cs (SimpleName.GetSignatureForError): Add.
4681 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4682 (MemberAccess.GetSignatureForError): Add.
4684 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4686 The big error and warning messages review.
4716 * typemanager.cs: Updated.
4718 * class.cs: (MethodCore.SetYields): Moved here to share.
4719 (PropertyMethod.Define): Moved iterator setup here.
4721 * iterators.cs: Add orig_method to have full access to parent
4724 2005-07-05 Raja R Harinath <rharinath@novell.com>
4726 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4727 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4728 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4729 variable of struct type.
4730 * expression.cs (Unary.ResolveOperator): Update to change.
4731 (Indirection.VerifyFixed): Likewise.
4732 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4733 (ParameterReference.VerifyFixed): Value parameters are fixed.
4734 (This.VerifyFixed): Treat 'this' as a value parameter.
4735 * statement.cs (LocalInfo.IsFixed): Remove.
4737 2005-07-01 Martin Baulig <martin@ximian.com>
4739 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4740 `ec.EmitThis ()' to get the correct scope.
4742 2005-07-01 Martin Baulig <martin@ximian.com>
4744 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4745 instance is a ParameterReference; fixes #75299.
4747 2005-06-30 Raja R Harinath <rharinath@novell.com>
4750 * expression.cs (Indexers.map): Remove.
4751 (Indexers.Append): Filter out inaccessible setters and getters.
4752 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4755 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4757 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4758 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4759 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4760 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4762 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4765 * class.cs (FieldBase.GetInitializerExpression): One more field
4768 2005-06-28 Miguel de Icaza <miguel@novell.com>
4770 * pending.cs: Do not define a proxy if the base method is virtual,
4771 it will be picked up by the runtime (bug 75270).
4773 2005-07-08 Martin Baulig <martin@ximian.com>
4775 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4776 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4778 2005-07-07 Martin Baulig <martin@ximian.com>
4780 * generic.cs (ConstructedType.CheckConstraint): Use
4781 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4782 called recursively; fixes #75329.
4784 2005-07-06 Martin Baulig <martin@ximian.com>
4786 * generic.cs (TypeManager.InferTypeArguments): Added support for
4787 anonymous methods; fixes #75461.
4789 2005-07-01 Martin Baulig <martin@ximian.com>
4791 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4792 `ec.EmitThis ()' to get the correct scope.
4794 2005-07-01 Martin Baulig <martin@ximian.com>
4796 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4797 instance is `This'; fixes #75299.
4799 2005-06-30 Martin Baulig <martin@ximian.com>
4801 * class.cs (Indexer): Implement IIteratorContainer; added support
4802 for iterators in indexers.
4805 (EmitContext.CurrentIterator): Make this a property, not a field.
4807 * anonymous.cs (AnonymousContainer.Iterator): New public property.
4809 2005-06-28 Miguel de Icaza <miguel@novell.com>
4811 * pending.cs: Do not define a proxy if the base method is virtual,
4812 it will be picked up by the runtime (bug 75270).
4814 2005-06-28 Martin Baulig <martin@ximian.com>
4816 * cs-parser.jay (interface_method_declaration): Avoid a
4817 reduce/reduce conflict by moving some of the code into a separate
4818 `interface_method_declaration_body' rule; fixes #75368.
4820 2005-06-28 Martin Baulig <martin@ximian.com>
4822 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4823 array check after the check for TypeBuilder's.
4825 2005-06-21 Raja R Harinath <rharinath@novell.com>
4827 * convert.cs (FindMostEncompassedType): Add two trivial special
4828 cases (number_of_types == 0 || number_of_types == 1).
4829 (FindMostEncompasingType): Likewise.
4831 2005-06-17 Raja R Harinath <rharinath@novell.com>
4833 Some cleanups preparing for the fix of #75283.
4834 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4836 (EventExpr.InstanceResolve): Likewise.
4837 (EventExpr.DoResolve): Remove redundant checks.
4839 2005-06-08 Miguel de Icaza <miguel@novell.com>
4841 * class.cs: Small fix.
4843 2005-06-08 Raja R Harinath <rharinath@novell.com>
4846 * class.cs (GetPartialBases): Fix return value check of
4849 2005-06-07 Raja R Harinath <rharinath@novell.com>
4851 Ensure that partial classes are registered in their enclosing
4852 namespace. Initial part of fix of #75160.
4853 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4854 Register declspace with namespace here, not in
4855 DeclSpace.RecordDecl.
4856 * cs-parser.jay: Pass namespace to RecordDecl.
4857 * class.cs (PartialContainer.Create): Likewise.
4858 (ClassPart.DefineType): New sanity-check. Throws an exception if
4860 * decl.cs (Declspace.RecordDecl): Remove.
4861 * namespace.cs (NamespaceEntry.DefineName): Remove.
4863 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4865 * rootcontext.cs: Reset TargetExt as well.
4867 2005-06-03 Raja R Harinath <rharinath@novell.com>
4869 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4872 2005-06-02 Raja R Harinath <rharinath@novell.com>
4874 Fix #75080, cs0119.cs.
4875 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4877 (Expression.Resolve): ... this. Use it. Remove bogus code
4878 allowing ExprClass.Type and ExprClass.Namespace for
4879 ResolveFlags.VariableOrValue.
4880 (Expression.Resolve) [1-argument variant]: Change default resolve
4881 flags based on language version.
4882 (Expression.Error_UnexpectedKind): Use a simple string array
4883 rather than an ArrayList.
4884 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4886 (TypeOfVoid.DoResolve): Likewise.
4887 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4888 flags argument -- it always has the same value.
4890 2005-05-31 Raja R Harinath <rharinath@novell.com>
4893 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4894 Use it in the error message.
4895 * assign.cs, expression.cs, statement.cs: Update.
4897 2005-05-30 Raja R Harinath <rharinath@novell.com>
4900 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4901 the "almostMatchedMember" case too.
4902 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4903 that failed the accessibility checks to 'almost_match'.
4905 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4907 * attribute.cs: Use internal MethodBuilder methods to set
4908 ExactSpelling and SetLastError on PInvoke methods, instead
4909 of passing them via charset. Fixes #75060.
4911 2005-05-27 Raja R Harinath <rharinath@novell.com>
4913 * parameter.cs (Parameter): Remove TODO comment.
4914 (Parameter.DefineParameter): Remove Location parameter.
4915 (Parameters.LabelParameters): Likewise.
4916 * class.cs (Constructor.Emit): Update to change.
4917 (MethodData.Emit): Likewise.
4918 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4919 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4921 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4924 Removed Parameters.Location and added Parameter.Location instead.
4925 Removed Location parameter from Emit() and GetSignature().
4932 Modified all related calls.
4934 2005-06-21 Martin Baulig <martin@ximian.com>
4936 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4937 left-hand side is not a nullable type; fixes #75328.
4939 2005-06-21 Martin Baulig <martin@ximian.com>
4942 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4943 (TypeManager.GetFullNameSignature): Likewise.
4945 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4946 `source.FullName' and `target.FullName' to check whether there are
4947 two conflicting definitions.
4949 2005-06-21 Martin Baulig <martin@ximian.com>
4951 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4952 a BoxedCast - also for reference types - to be compatible with csc.
4954 2005-06-21 Martin Baulig <martin@ximian.com>
4956 * expression.cs (MemberAccess.DoResolve): Add support for nested
4957 types in a generic instance; fixes #75320.
4959 2005-06-20 Martin Baulig <martin@ximian.com>
4961 * generic.cs (TypeManager.InferType): Also walk the class
4962 hierarchy for generic instances; fixes #75261.
4964 2005-06-17 Martin Baulig <martin@ximian.com>
4966 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4967 to make things work for corlib.
4969 2005-06-15 Martin Baulig <martin@ximian.com>
4971 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4972 obsolete `SecurityAction' values.
4974 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4976 * rootcontext.cs: Reset TargetExt as well.
4978 2005-06-09 Martin Baulig <martin@ximian.com>
4980 * delegate.cs (Delegate.VerifyMethod): Added
4981 `MethodGroupExpr old_mg' argument; inherit its
4982 `HasTypeParameters'; fix #75085.
4984 2005-06-09 Martin Baulig <martin@ximian.com>
4986 * expression.cs (Invocation.OverloadResolve): Correctly handle
4987 generic methods for the SetMemberIsUsed(); fix #75064.
4989 2005-06-09 Martin Baulig <martin@ximian.com>
4991 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4994 2005-06-08 Martin Baulig <martin@ximian.com>
4996 * cs-parser.jay (nullable_type_or_conditional): If we put the
4997 nullable back and our `type' is a `ComposedCast', remove the
4998 nullable from it. Fixes #75156.
5000 * expression.cs (ComposedCast.RemoveNullable): New public method.
5002 2005-06-08 Martin Baulig <martin@ximian.com>
5004 The big Iterators rewrite :-)
5006 * iterators.cs: Rewrite this to use the anonymous methods framework.
5008 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5009 before the TypeContainers; see 2test-21.cs.
5012 (TypeContainer.DefineType): Don't create a new EmitContext if we
5013 already have one (this only happens if we're an Iterator).
5014 (TypeContainer.Define): Also call Define() on all our iterators.
5015 (Method.CreateEmitContext): Added support for iterators.
5018 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5019 (AnonymousContainer.CreateMethodHost): Moved here from
5020 AnonymousMethod and made abstract.
5021 (AnonymousContainer.CreateScopeType): New abstract method.
5022 (AnonymousContainer.IsIterator): New public property.
5023 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5024 get the ScopeTypeBuilder rather than manually defining it here.
5025 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5028 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5029 before RootContext.DefineTypes().
5031 * codegen.cs (EmitContext.RemapToProxy): Removed.
5032 (EmitContext.CurrentAnonymousMethod): Changed type from
5033 AnonymousMethod -> AnonymousContainer.
5034 (EmitContext.ResolveTopBlock): Protect from being called twice.
5035 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5036 (EmitContext.EmitThis): Removed the iterators hacks; use the
5037 anonymous methods framework for that.
5040 (ToplevelBlock.Container): Make this a property, not a field.
5041 (ToplevelBlock.ReParent): New public method; move the
5042 ToplevelBlock into a new container.
5043 (Foreach.TemporaryVariable): Simplify.
5045 2005-06-05 Martin Baulig <martin@ximian.com>
5047 * statement.cs (LocalInfo.CompilerGenerated): New flag.
5048 (Block.AddTemporaryVariable): New public method; creates a new
5049 `LocalInfo' for a temporary variable.
5050 (Block.EmitMeta): Create the LocalBuilders for all the temporary
5052 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5053 non-iterator variables.
5055 2005-06-05 Martin Baulig <martin@ximian.com>
5057 * statement.cs (Foreach.TemporaryVariable): Create the
5058 LocalBuilder in the Emit phase and not in Resolve since in some
5059 situations, we don't have an ILGenerator during Resolve; see
5060 2test-19.cs for an example.
5062 2005-06-04 Martin Baulig <martin@ximian.com>
5064 The big Foreach rewrite - Part II.
5066 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5067 with `PropertyInfo ienumerator_getcurrent'.
5069 * codegen.cs (VariableStorage): Removed.
5072 (Foreach): Derive from Statement, not ExceptionStatement.
5073 (Foreach.CollectionForeach): New nested class. Moved all the code
5074 dealing with collection foreach here.
5075 (Foreach.ForeachHelperMethods): Removed.
5076 (Foreach.TemporaryVariable): Implement IMemoryLocation.
5078 2005-05-23 Martin Baulig <martin@ximian.com>
5080 * statement.cs (Try.DoResolve): Don't create a `finally' if we
5081 don't need to. Fix #75014.
5083 2005-05-26 Raja R Harinath <rharinath@novell.com>
5085 Improve user-defined conversion handling.
5086 * convert.cs (GetConversionOperators): Rewrite. Return only the
5087 applicable operators.
5088 (AddConversionOperators): New. Helper for GetConversionOperators.
5089 (FindMostEncompassedType, FindMostEncompassingType): Verify that
5090 there is only one most encompassed/encompassing type.
5091 (FindMostSpecificSource, FindMostSpecificTarget): Remove
5092 "applicable operator" handling.
5093 (UserConversion): Move cache here from GetConversionOperators.
5094 Directly cache the chosen operator, rather than the whole
5096 (ExplicitNumericConversion): Fix buggy implementation of Decimal
5097 case. Allow conversion of decimal to sbyte and byte too.
5098 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5099 New static methods. Used to avoid allocating EmptyExpressions in
5102 2005-05-24 Duncan Mak <duncan@novell.com>
5104 * ecore.cs (CastFromDecimal): New class for casting a decimal to
5105 another class, used in Convert.ExplicitNumericConversion.
5106 (CastToDecimal): New class, similar to above, but casts to
5107 System.Decimal, used in Convert.ImplicitNumericConversion and also
5108 in explicit convesion from double/float to decimal.
5110 * convert.cs (ImplicitNumericConversion): Handle implicit
5111 conversions to System.Decimal.
5112 (ExplicitNumericConversion): handle explicit conversions to
5117 2005-05-20 Miguel de Icaza <miguel@novell.com>
5119 * typemanager.cs: Do not throw an exception in the TypeBuilder
5120 case, we take care of it on the TypeCode.
5122 2005-05-17 Marek Safar <marek.safar@seznam.cz>
5124 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5127 * cs-parser.jay: Catch more lexical errors.
5129 * report.cs: Add one more Error method.
5132 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5134 2005-05-20 Martin Baulig <martin@ximian.com>
5136 * class.cs (TypeContainer.CircularDepException): Removed.
5137 (TypeContainer.DefineType): Removed the `InTransit' stuff.
5138 (TypeContainer.CheckRecursiveDefinition): Check for circular class
5139 (CS0146) and interface (CS0529) dependencies here.
5141 2005-05-20 Martin Baulig <martin@ximian.com>
5143 * expression.cs (New.DoResolve): Move the CS0712 check above the
5144 CS0144 check; otherwise it can never be reached.
5146 2005-05-20 Martin Baulig <martin@ximian.com>
5148 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
5150 2005-05-20 Martin Baulig <martin@ximian.com>
5152 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
5154 * typemanager.cs (TypeManager.IsAttributeType): New public method.
5156 2005-05-19 Martin Baulig <martin@ximian.com>
5159 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5160 to disable error reporting.
5162 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5163 here since we don't want to report an error; see the new test-336.cs.
5165 2005-05-19 Raja R Harinath <rharinath@novell.com>
5167 * statement.cs (ToplevelBlock.GetParameterReference)
5168 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5169 Move here from class Block.
5170 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5171 * expression.cs (ParameterReference.DoResolveBase): Likewise.
5173 2005-05-18 Martin Baulig <martin@ximian.com>
5178 (FlowBranching.Reachability): Add non-static public And() and Or()
5180 (FlowBranchingSwitch): New class; do the `break_origins' thing
5181 like in FlowBranchingLoop.
5182 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5183 reachability, not just locals and parameters.
5184 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5185 switch; MergeBreakOrigins() now takes care of that.
5187 2005-05-18 Martin Baulig <martin@ximian.com>
5189 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5190 a loop and may leave it, reset the barrier; fixes #74974.
5192 2005-05-16 Raja R Harinath <rharinath@novell.com>
5194 Fix test-382.cs. Emit values of decimal constants.
5195 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5197 (TypeContainer.AddField): ... this.
5198 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5199 with initializers to include 'Const's.
5200 (ClassPart.RegisterFieldForInitialization): Forward to
5202 * const.cs (Const.Const): Pass initializer to base class.
5203 (Const.Define): In case of decimal constants, register them for
5204 initialization in a static constructor.
5206 2005-05-14 Martin Baulig <martin@ximian.com>
5208 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5209 do not call ResolveUnreachable() on unreachable statements in
5210 here, see the comment in the source code.
5212 2005-05-13 Raja R Harinath <rharinath@novell.com>
5215 * expression.cs (BinaryResolveOperator): If one of the operands of
5216 an equality comparison is 'null' and the other is a pointer type,
5217 convert the null to a NullPointer.
5218 * convert.cs (ImplicitReferenceConversion): If the expression is a
5219 NullLiteral and the target type is a pointer type, return a
5220 NullPointer instead.
5221 (ImplicitConversionStandard): Likewise.
5223 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5225 * cs-parser.jay: Set readonly context based on special constructs.
5227 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5228 readonly variable error handling.
5230 * rootcontext.cs (EmitCode): Don't verify members when error
5233 * statement.cs (LocalInfo): Add reaodnly context information.
5234 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5236 2005-05-17 Martin Baulig <martin@ximian.com>
5238 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5241 2005-05-13 Martin Baulig <martin@ximian.com>
5243 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5244 handle unreachable blocks.
5246 2005-05-13 Martin Baulig <martin@ximian.com>
5249 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5250 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5253 2005-05-13 Martin Baulig <martin@ximian.com>
5255 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5256 instance variable, not a local. Fix #74873.
5257 (Block.ResolveUnreachable): Set it to true here.
5259 2005-05-12 Martin Baulig <martin@ximian.com>
5261 * cs-parser.jay (property_declaration): Pass the `current_class',
5262 not the `current_container' to Property's .ctor. Fixes #74912.
5264 2005-05-11 Martin Baulig <martin@ximian.com>
5266 * typemanager.cs (Closure): Copy this from MCS and merge all the
5267 GMCS-specific changes into it.
5269 2005-05-12 Raja R Harinath <harinath@gmail.com>
5272 * typemanager.cs (unmanaged_enclosing_types): New.
5273 (IsUnmanagedType): Avoid infloops by using
5274 'unmanaged_enclosing_types' to talk with recursive invocations.
5276 2005-05-11 Duncan Mak <duncan@novell.com>
5278 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5279 continuing to process for 'arg'.
5280 (handle_preprocessing_directive): Check the argument of the #endif
5281 directive and report error CS1025 if there are any trailing
5284 According to the C# spec, having even whitespace after the #endif
5285 directive is illegal; however, because we call arg.TrimEnd ()
5286 beforehand, we have the same behavior as csc, allowing whitespace
5287 after the directive.
5291 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5295 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5296 (Constructor.GetObsoleteAttribute): Implemented correctly.
5298 2005-05-10 Martin Baulig <martin@ximian.com>
5300 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5301 resolve the type; fixes #74864.
5302 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5303 in DoResolve(); fixes #74862.
5305 2005-05-10 Martin Baulig <martin@ximian.com>
5307 * support.cs (ReflectionParameters.ParameterModifier): Use
5308 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5309 and `ParameterAttributes.In'. Fixes #74884.
5311 2005-05-10 Martin Baulig <martin@ximian.com>
5313 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5314 the cache if we're just looking for `MemberTypes.NestedType' in a
5317 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5318 constraints if we're still resolving the type tree.
5319 (Expression.MemberLookup): If we're resolving the type tree, only
5320 look for `MemberTypes.NestedType' since we're only interested in
5323 * class.cs (TypeContainer.DefineType): Don't resolve the type
5324 parameters here; do this later in ResolveType() after the type
5325 tree has been resolved.
5326 (TypeContainer.ResolveType): New public method; this is called
5327 after the type tree is resolved and before the types are being
5328 populated. We resolve the generic constraints here.
5329 (TypeContainer.DoDefineMember): Check the constraints on our base
5330 class and interfaces.
5332 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5333 set the `ResolvingTypeTree' flag on the EmitContext.
5335 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5337 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5339 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5341 * expression.cs (Argument.GetParameterModifier): Turned to property.
5342 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5344 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5347 2005-05-09 Raja R Harinath <rharinath@novell.com>
5350 * decl.cs (MemberCache.AddMethods): Register override methods,
5351 rather than non-override methods.
5352 * typemanager.cs (RegisterOverride): New.
5353 (IsOverride): Update.
5355 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5357 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5359 2005-05-06 Martin Baulig <martin@ximian.com>
5362 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5363 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5365 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5369 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5370 recursive declaration.
5372 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5374 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5376 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5378 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5380 2005-05-05 Raja R Harinath <rharinath@novell.com>
5383 * decl.cs (DeclSpace.FamilyAccessible):
5384 Use TypeManager.IsNestedFamilyAccessible.
5386 Fix reopened #64812.
5387 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5390 2005-05-04 Raja R Harinath <rharinath@novell.com>
5391 Abin Thomas <projectmonokochi@rediffmail.com>
5392 Anoob V E <projectmonokochi@rediffmail.com>
5393 Harilal P R <projectmonokochi@rediffmail.com>
5396 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5397 allow access to all static members.
5399 2005-05-04 Martin Baulig <martin@ximian.com>
5401 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5403 2005-05-04 Martin Baulig <martin@ximian.com>
5407 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5408 section at the end; make things work if `default' is not the last
5411 2005-05-04 Martin Baulig <martin@ximian.com>
5415 * statement.cs (Switch): Replaced the `got_default' field with a
5416 `default_section' one.
5417 (Switch.CheckSwitch): Set `default_section' here.
5418 (Switch.Resolve): If we're a constant switch and the constant is
5419 not found, use the default section.
5421 2005-05-03 Martin Baulig <martin@ximian.com>
5423 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5425 * statement.cs (Foreach.ArrayForeach): New nested class.
5426 (Foreach.TemporaryVariable): New nested class.
5427 (Foreach.EmitArrayForeach): Removed; this is now in the new
5430 2005-05-03 Raja R Harinath <rharinath@novell.com>
5432 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5434 (VerifyPendingMethods): Revert change below.
5436 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5437 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5438 that used to trigger warning -28. Remove warning -28.
5439 * expression.cs (Invocation.OverloadResolve): Use
5440 TypeManager.IsOverride to distinguish override methods.
5443 * pending.cs (VerifyPendingMethods): If a base type implements the
5444 requested interface, don't bother checking individual methods of
5445 the base type. As a side-effect, this prevents the creation of
5446 unnecessary proxies.
5448 2005-05-02 Martin Baulig <martin@ximian.com>
5452 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5453 Also `And' the locals if the old vector is null.
5454 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5455 null; in this case we basically reset all the variables.
5457 2005-05-02 Martin Baulig <martin@ximian.com>
5461 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5462 Added `FlowBranching branching' argument; always `and' the
5463 variables instead of `or'ing them unless we're an infinite loop.
5465 * statement.cs (While.Resolve): Create a new sibling unless we're
5468 2005-05-02 Martin Baulig <martin@ximian.com>
5472 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5473 arguments; use it instead of creating a new TopLevelBlock.
5474 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5475 our ConstructorInitializer.
5478 (TopLevelBlock.TopLevelBranching): New public property.
5479 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5480 and create our `TopLevelBranching'.
5482 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5483 anonymous method host, use `block.TopLevelBranching' rather than
5484 creating a new branching.
5486 2005-04-20 Miguel de Icaza <miguel@novell.com>
5488 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5489 a ScopeInfo, if any of the current children is a child of the new
5490 entry, move those children there.
5492 2005-04-30 Martin Baulig <martin@ximian.com>
5494 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5495 at the beginning of a SwitchSection. Fix #73335.
5497 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5500 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5502 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5503 (FieldExpr.DoResolve): Obsolete members are ignored for field
5506 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5508 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5509 of arrays detection.
5511 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5513 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5515 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5518 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5520 * cs-parser.jay: Use the prefered version of -unsafe in error
5523 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5525 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5528 2005-04-20 John Luke <john.luke@gmail.com>
5530 * driver.cs: fix typo in error message, --outout to --output
5532 2005-04-30 Martin Baulig <martin@ximian.com>
5534 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5535 handle the .NET 2.x security attributes.
5537 2005-04-30 Martin Baulig <martin@ximian.com>
5540 (TypeManager.ExpandInterfaces): Don't add things twice.
5543 (TypeContainer.VerifyClsCompliance): Allow generic instances.
5545 2005-04-29 Martin Baulig <martin@ximian.com>
5547 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5549 * anonymous.cs: Added support for anonymous generic methods.
5551 2005-04-29 Martin Baulig <martin@ximian.com>
5553 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5556 2005-04-29 Martin Baulig <martin@ximian.com>
5558 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5560 * expression.cs (New.DoResolve): Fix the CS0304 check.
5562 2005-04-29 Martin Baulig <martin@ximian.com>
5564 * typemanager.cs (TypeManager.GetFullName): Updated to the new
5567 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5568 explicit interface implementation, compare the interface types.
5569 (MethodData.Define): Use the new naming scheme from the latest
5571 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5573 * decl.cs (MemberName.GetMemberName): Removed.
5574 (MemberName.MethodName, FullName): New properties.
5576 2005-04-25 Raja R Harinath <rharinath@novell.com>
5578 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5580 2005-04-22 Martin Baulig <martin@ximian.com>
5582 * generic.cs (GenericMethod): Create the EmitContext in the
5583 `Define()'; in `Define(MethodBuilder)', create the type parameters
5584 before calling `Define()'. Fixes #73933.
5586 2005-04-22 Martin Baulig <martin@ximian.com>
5589 (Constraints.Resolve): Make things work wrt. the new type lookup system.
5590 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5592 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5593 ConstructedType, check its constraints.
5595 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5597 * codegen.cs (InRefOutArgumentResolving): New field.
5599 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5600 fields outside contructor.
5602 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5604 2005-04-19 Miguel de Icaza <miguel@novell.com>
5606 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5607 parameter code was not completed ever, so it was not as up-to-date
5608 as local variables. Must finish it.
5610 The bug fix was to compare the Toplevel of the block, not the
5611 current block. Thanks for Ben for pointing this out.
5613 2005-04-19 Raja R Harinath <rharinath@novell.com>
5615 * decl.cs (AddMethods): Use the declaring type of the problem
5616 method to determine if we want to squash a warning.
5618 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5620 * attribute.cs: Removed debug output.
5622 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5624 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5627 2005-04-18 Raja R Harinath <rharinath@novell.com>
5630 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5631 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5632 all null comparisons against reference types.
5634 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5637 * class.cs (TypeContainer.CircularDepException) New nested
5639 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5640 (TypeContainer.DefineType): Removed error, reset InTransit before
5642 (Class.DefineType): Throw exception when is in Transit.
5643 Catch exception and report error.
5644 (Struct.DefineType): Throw exception when is in Transit.
5645 Catch exception and report error.
5646 (Interface.DefineType): Throw exception when is in Transit.
5647 Catch exception and report error.
5649 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5650 handle nested exception handlers.
5652 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5655 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5656 InFinally and InCatch storage.
5658 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5659 (Catch.Resolve): Set and Restore ec.InCatch.
5660 (Try.Resolve): Set and Restore ec.InFinally.
5661 (Try.HasCatch): True when try has catch.
5663 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5665 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5666 for the same event member, so exclude such cases from warning 419.
5669 2005-04-16 Miguel de Icaza <miguel@novell.com>
5671 * expression.cs (Binary.ResolveOperator): Apply patch from John
5672 Luke to fix bug 59864: operators &, | and ^ on enumerations
5673 require that the same enum type on both sides.
5675 * driver.cs: Add warnings to old flag usage, this is to assist
5676 people who produce Makefiles and hope that the Makefiles will be
5679 * class.cs (TypeContainer.EmitType): Moved the definition of the
5680 special $PRIVATE$ field from the resolve phase to the Emit phase.
5681 During resolve we do not know if we are a struct with
5682 HasExplicitLayout, we know this only after the attributes for the
5685 Set the FieldOffset to zero on the dummy field that we create for
5686 the class. Fixes 74590.
5688 2005-04-16 Raja R Harinath <rharinath@novell.com>
5691 * ecore.cs (PropertyExpr.resolved): New.
5692 (DoResolve): Use it to handle a case of double resolution here.
5693 Handle a case of identical-name-and-type-name.
5694 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5695 resolution by storing the results of expression resolution back
5696 into the "probes" array.
5698 2005-04-15 Raja R Harinath <rharinath@novell.com>
5700 Fix cs0208-7.cs and cs0208-8.cs.
5701 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5702 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5703 error reporting to point out the reason a struct is not unmanaged.
5705 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5707 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5708 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5710 2005-04-13 Raja R Harinath <rharinath@novell.com>
5713 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5714 IdenticalNameAndTypeName here.
5715 (EventExpr.InstanceResolve): Likewise.
5717 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5719 C# 2.0 DefaultCharSetAttribute implementation
5721 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5722 which allows us to set GlobalNamespace for every resolve.
5723 (Attribute.ResolveArguments): Cut from Resolve.
5724 (Attribute.GetCharSetValue): Returns CharSet named argument.
5725 (Attribute.DefinePInvokeMethod): Gets default charset from
5727 (GlobalAttribute.ResolveAsTypeStep): Override.
5728 (GlobalAttribute.ResolveArguments): Override.
5730 * class.cs (TypeAttr): Is protected.
5732 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5733 (ModuleClass.DefaultCharSetType): New memeber.
5734 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5736 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5737 charset from module.
5739 * delegate.cs (TypeAttr): Override.
5740 (Delegate.DefineType): Use this TypeAttr.
5742 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5743 at very early stage (before types are defined) to resolve model
5744 module attributes. It will probably not work with corlib but it
5747 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5748 charset from module.
5750 * typemanager.cs (default_charset_type): New type.
5752 2005-04-13 Raja R Harinath <rharinath@novell.com>
5754 * decl.cs (MemberCache.AddMethods): Don't warn if
5755 System.Object.Finalize has buggy MethodAttributes.
5757 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5760 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5762 * doc.cs : detect ambiguous reference to overloaded members.
5763 Fixed bug #71603. MS 1.1 csc does not detect it.
5765 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5767 * doc.cs : delegates must not be referenced with parameters.
5770 2005-04-12 Miguel de Icaza <miguel@novell.com>
5772 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5774 2005-04-10 Miguel de Icaza <miguel@novell.com>
5776 * driver.cs (MainDriver): Stop processing if the CLS stage found
5779 (CompilerCallableEntryPoint.InvokeCompiler): Always
5780 reset after execution; Take a TextWriter argument for the
5783 * report.cs: Use the error stream instead of hardcoding stderr.
5785 2005-04-09 Miguel de Icaza <miguel@novell.com>
5787 * class.cs: Reduce code paths to test, too small of an
5788 optimization to make it worth the extra testing. Always perform
5791 2005-04-08 Raja R Harinath <rharinath@novell.com>
5794 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5795 operators that had errors reported on them.
5797 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5799 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5801 (Attribute.Resolve): Add named argument type checking.
5803 * class.cs (FixedField.Define): Use IsPrimitiveType
5805 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5807 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5808 unsafe parameter types.
5810 * statement.cs (Using.ResolveExpression): Add better error description.
5812 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5814 2005-04-08 Raja R Harinath <rharinath@novell.com>
5817 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5818 AttributeUsageAttribute in the emitcontext of the attribute class,
5819 not in the emitcontext of the attributable entity it was attached to.
5820 * cs-parser.jay: Use 'current_class', not 'current_container',
5821 when creating a GlobalAttribute.
5823 2005-04-08 Alp Toker <alp@atoker.com>
5825 * pending.cs: The fix to #58413 failed to compile methods implementing
5826 interfaces with/without params modifiers and vice versa, even though
5827 params modifiers aren't part of the signature. Make the modifier check
5828 less strict as in csc.
5830 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5831 Anoob V E <projectmonokochi@rediffmail.com>
5832 Harilal P R <projectmonokochi@rediffmail.com>
5835 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5836 modifiers of pending methods.
5837 (PendingImplementation.PendingImplementation): Initialize it.
5838 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5839 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5840 with ParameterData. Add check for modifiers.
5841 * class.cs (MethodData.Define): Update to changes.
5843 2005-04-07 Raja R Harinath <rharinath@novell.com>
5845 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5847 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5849 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5852 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5855 * typemanager.cs: Registered RequiredAttributeAttribute.
5857 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5859 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5860 Warning CS0169 is back at level 3.
5861 (IMethodData.SetMemberIsUsed): New method.
5863 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5864 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5866 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5868 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5870 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5873 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5876 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5877 to avoid the problems with nested types.
5879 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5880 Anoob V.E <projectmonokochi@rediffmail.com>
5881 Harilal P.R <projectmonokochi@rediffmail.com>
5882 Raja R Harinath <rharinath@novell.com>
5885 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5887 * typemanager (GetConstructor): Make public.
5889 2005-04-05 John Luke <john.luke@gmail.com>
5890 Raja R Harinath <rharinath@novell.com>
5893 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5894 struct too. Return false quicker in a few cases.
5895 (VerifyUnManaged): Use it.
5897 2005-04-05 Raja R Harinath <rharinath@novell.com>
5900 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5901 not 'unreachable_seen'.
5903 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5905 * attribute.cs (Attribute.GetValue): Removed unused.
5907 * codegen.cs (CodeGen.TrimExt): Removed unused.
5909 * cs-parser.jay (output): Removed unused.
5911 * cs-tokenizer.cs (hex_digits): Removed unused.
5913 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5915 * expression.cs (Indirection.LoadExprValue): Removed unused.
5916 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5918 * iterators.cs (Iterator.param_types): Removed unused.
5920 * statement.cs (Goto.block): Removed unused.
5921 (ToplevelBlock.did): Removed unused.
5922 (Switch.ResolveConstantSwitch): Removed unused.
5924 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5926 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5929 2005-04-19 Martin Baulig <martin@ximian.com>
5931 Merged r42462 from MCS and made it work for GMCS.
5933 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5935 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5937 2005-04-01 Raja R Harinath <rharinath@novell.com>
5939 Fix #74232 and cs0208-3.cs.
5940 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5941 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5942 unmanaged type. Don't use FieldBuilders when 't' is a
5943 TypeBuilder. Use ModFlags and MemberType fields.
5944 * class.cs (MemberBase.member_type): Rename from MemberType.
5945 (MemberBase.MemberType): New property. Determines member_type on
5947 (MemberBase.DoDefine): Don't initialize MemberType here.
5948 (FieldMember.Define): Likewise.
5950 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5953 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5954 Attributes are emitted there.
5956 2005-04-01 Raja R Harinath <rharinath@novell.com>
5958 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5959 keyword in 'partial enum' too.
5960 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5962 Report from Kamil Skalski <nazgul@omega.pl>.
5965 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5966 have partial containers too.
5968 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5969 in block' checks to Block.CheckInvariantMeaningInBlock.
5970 * statement.cs (Block.GetKnownVariableInfo): Make private.
5971 (Block.IsVariableUsedInChildBlock): Remove.
5972 (Block.IsVariableUsedInBlock): Likewise.
5973 (Block.CheckInvariantMeaningInBlock): New. Show location of
5974 conflicting declaration.
5975 (Block.AddVariable): Make error messages less long-winded and more
5976 specific. Show location of conflicting declaration.
5977 * parameter.cs (Parameters.Location): New readonly property.
5979 2005-03-31 Raja R Harinath <rharinath@novell.com>
5981 Clean up semantics of invoking ResolveMemberAccess.
5982 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5983 can have an instance, ensure that we pass in a non-TypeExpression
5984 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5985 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5986 argument. Update to changes and simplify.
5987 (FieldExpr.Emitinstance): Remove CS0120 check.
5988 (PropertyExpr.EmitInstance): Likewise.
5989 * expression.cs (Argument.Resolve): Likewise.
5990 (Invocation.DoResolve): Update to changes in semantics of
5993 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5996 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5999 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6001 2005-03-31 Raja R Harinath <rharinath@novell.com>
6003 Fix difference in behaviour with commandline invocation.
6004 * driver.cs (Driver.Reset): New.
6005 (CompilerCallableEntryPoint): Call it.
6007 * statement.cs (If.Resolve): Avoid spurious "uninitialized
6008 variable" warnings if the boolean expression failed to resolve.
6010 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
6012 * attribute.cs: Fix the union of several permissions when some of them
6013 are unrestricted (so the result isn't an unrestricted permission set).
6016 2005-03-30 Raja R Harinath <rharinath@novell.com>
6018 * ecore.cs (MemberExpr): New class. Convert from interface
6020 (MemberExpr.ResolveMemberAccess): Refactor and move here from
6021 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
6023 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6024 (MethodGroupExpr.IsExplicitImpl): Remove.
6025 (Expression.GetFieldFromEvent): Remove.
6026 (SimpleName.MemberStaticCheck): Remove.
6027 (SimpleName.DoSimpleNameResolve): Update to changes.
6028 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6029 (MemberAccess.IdenticalNameAndTypeName): Remove.
6030 (MemberAccess.error176): Move to MemberExpr.
6031 (MemberAccess.DoResolve): Update to changes.
6032 (BaseAccess.DoResolve): Likewise.
6034 2005-03-30 Marek Safar <marek.safar@seznam.cz>
6036 C# 2.0 Conditional attribute class implementation
6038 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6039 Analyzes class whether it has attribute which has ConditionalAttribute
6040 and its condition is not defined.
6042 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6043 (Class.IsExcluded): New method. Search for at least one defined
6044 condition in ConditionalAttribute of attribute class.
6046 2005-03-30 Raja R Harinath <rharinath@novell.com>
6048 * ecore.cs (PropertyExpr): Derive from Expression, not
6049 ExpressionStatement.
6050 (PropertyExpr.EmitStatement): Remove.
6052 2005-03-29 Raja R Harinath <rharinath@novell.com>
6055 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6056 internal field "value__" of an enum be private. The examples for
6057 "value__" that I found on MSDN all used FieldAttributes.Private.
6059 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6060 Don't mention IL method attribute names.
6062 Fix #47991. Remove a TODO.
6063 * statement.cs (Block.Toplevel): Make into a field.
6064 (Block.Parameters): Move into ToplevelBlock.
6065 (Block.known_variables): Rename from child_variable_names.
6066 (Block.Block): Remove variants that take Parameters. Initialize
6067 'Toplevel' with the immediately surrounding toplevel block.
6068 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
6069 LocalInfo parameter.
6070 (Block.GetKnownVariableInfo): New.
6071 (Block.IsVariableNameUsedInChildBlock): Update.
6072 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
6073 the block, even though it may not be in scope.
6074 (Block.AddVariable): Remove Parameters parameter. Use
6075 Toplevel.Parameters instead.
6076 (Block.AddConstant): Remove Parameters parameter.
6077 (Block.GetParameterReference): Update to use Toplevel.Parameters.
6078 (Block.IsParamaterReference): Likewise.
6079 (Block.IsLocalParameter): Likewise. Simplify a lot.
6080 (ToplevelBlock.Parameters): New. Moved from Block.
6081 (ToplevelBlock.ToplevelBlock): Update to changes. Always
6082 initialize Parameters to a non-null value.
6083 * cs-parser.jay: Update to changes.
6084 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6085 simple names that mean different things in the same block. Use
6086 Block.IsVariableNameUsedInBlock.
6088 2005-03-28 Raja R Harinath <rharinath@novell.com>
6090 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6092 2005-03-26 Raja R Harinath <harinath@acm.org>
6095 * assign.cs (Assign.DoResolve): When the RHS of an assignment
6096 fails to resolve, ensure that the LHS is still resolved as an
6099 2005-03-25 Raja R Harinath <harinath@acm.org>
6101 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6103 (Enum.current_ec): Remove.
6104 (Enum.LookupEnumValue): Remove EmitContext argument.
6105 Just uses the one created during DefineType.
6106 (Enum.FindMembers): Update.
6107 * expression.cs (MemberAccess.DoResolve): Update.
6109 2005-03-22 Marek Safar <marek.safar@seznam.cz>
6111 * assign.cs (Assign.DoResolve): Check for CS1717 when
6112 source and target are same (uses Equals).
6114 * expression.cs (LocalVariableReference, ParameterReference,
6115 This): Implemented Equals, GetHashCode.
6117 * statement.cs (Block.GetParameterReference): Removed useless
6120 2005-03-22 Raja R Harinath <rharinath@novell.com>
6123 * statement.cs (Block.AddVariable): Ensure that we skip implicit
6124 blocks before deciding whether the error is cs0136 or cs0128.
6126 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6127 (using_alias_directive, using_namespace_directive): Pass
6128 MemberName, not an expression to Namespace.UsingAlias and
6130 (MakeName): Use the MemberName of the namespace.
6131 * namespace.cs (Namespace.MemberName): New.
6132 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6133 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6135 * decl.cs (MemberName.Name): Make readonly.
6136 (MemberName.FromDotted): New "constructor".
6137 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6138 (MemberCore.Name): Compute from MemberName on demand.
6139 (MemberCore.SetMemberName): Provide a way to change the
6141 (MemberCore.AddToContainer): Don't take a fullname parameter.
6142 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6143 fully qualified name of the container to the member name.
6144 (TypeContainer.AddToTypeContainer): Use a fully qualified name
6145 only if the type is a member of the root container.
6146 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6147 MemberName.Left rather than searching for an embedded ".".
6148 (PartialContainer.CreatePart): Update to changes in RootContext.
6149 (MemberBase.ShortName): Turn into a property. Use
6150 MemberCore.SetMemberName.
6151 (MemberBase.ExplicitInterfaceName): Remove.
6152 (MemberBase.UpdateMemberName): Remove.
6153 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6154 (PropertyBase.SetMemberName): New override.
6155 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6156 (Tree.GetDecl): New.
6157 (Tree.AllDecls): Rename from Decls.
6158 * attribute.cs, enum.cs, report.cs: Update to changes.
6159 * driver.cs (MainDriver): Use MemberName.FromDotted on
6160 RootContext.MainClass.
6162 2005-03-21 Marek Safar <marek.safar@seznam.cz>
6164 * class.cs (FixedField.Define): Check for CS1664 and more sanity
6167 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6169 2005-03-18 Marek Safar <marek.safar@seznam.cz>
6171 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6172 property accessor modifiers.
6174 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6175 fixed buffer attribute (CS1716).
6176 (PropertyMethod.HasCustomAccessModifier): When property accessor
6177 has custom modifier.
6179 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6181 (PropertyExpr.DoResolveLValue): Add CS0272.
6183 2005-03-17 Miguel de Icaza <miguel@novell.com>
6185 * convert.cs: When converting to a pointer, use the proper Conv.U
6186 or Conv.I depending on the source data type.
6188 * cs-tokenizer.cs: Make the size for large decimal constants,
6191 2005-03-17 Martin Baulig <martin@ximian.com>
6193 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6194 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6196 2005-03-17 Martin Baulig <martin@ximian.com>
6198 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6199 to bool so we can return an error condition.
6200 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6203 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6205 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6208 2005-03-16 Raja R Harinath <rharinath@novell.com>
6210 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6211 Refactor to avoid traversing the list of assemblies, and to avoid
6212 string concatenation.
6213 * typemanager.cs (guid_attr_type): Remove.
6214 (negative_hits, pointers, references): Remove hashes.
6216 (GetConstructedType): New. Uses type_hash to handle constructed
6217 types (arrays, references, pointers).
6218 (GetReferenceType, GetPointerType): Use it.
6219 (GetNestedType): New. Uses type_hash to handle nested types of
6221 (LookupType, LookupTypeDirect): Remove.
6222 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6223 'types' hash and LookupTypeReflection directly.
6224 (params_string, params_object): Use GetConstructedType.
6225 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6227 (Namespace.Lookup): Use cached_types.
6228 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6229 provided by old TypeManager.LookupType.
6230 * rootcontext.cs (MakeFQN): Remove.
6231 * decl.cs (DeclSpace.MakeFQN): Likewise.
6232 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6233 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6234 TypeManager.GetConstructedType.
6235 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6237 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
6239 * cs-parser.jay: Fix build.
6241 2005-03-15 Marek Safar <marek.safar@seznam.cz>
6243 * class.cs (TypeContainer.CircularDepException) New nested
6244 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6246 * cs-parser.jay: Reports CS1527 for any namespace element.
6248 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6251 * expression.cs (ParameterReference.IsAssigned): Changed error to
6253 (Error_WrongNumArguments): Moved CS0245 detection here.
6255 * statement.cs (Return.Resolve): Add CS1622 report.
6257 2005-03-11 Marek Safar <marek.safar@seznam.cz>
6259 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6261 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
6263 * attribute.cs expression.cs: Get rid of some allocations.
6265 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
6267 * doc.cs : just eliminate the latest change.
6269 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6271 * doc.cs : commented out the latest change. It breaks xml-030.cs
6273 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6275 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6276 fail. So invoke CreateType() in FindDocumentedType().
6278 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6280 * cs-tokenizer.cs : added IsKeyword().
6281 * doc.cs : Detect keyword incorrectly used as identifier.
6282 Allow identifiers prefixed by @.
6284 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6286 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6287 It caused exception in namespace resolving (again!).
6289 * class.cs (Class.ctor): Removed exit.
6290 (PropertyMethod.ctor): ditto.
6292 * codegen.cs (Codegen.Reset): Reset static data.
6293 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6295 * cs-tokenizer.cs (Cleanup): Removed.
6297 * driver.cs (GetSystemDir): Rewrote to one line command.
6298 It caused problem with unloaded dynamic modules.
6299 (UnixParseOption): Removed Exit.
6300 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6301 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6302 Now can be mcs used as library.
6304 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6307 * location.cs (Reset): Reset static data.
6309 * namespace.cs (Reset): Reset static data.
6311 * report.cs (Report.Reset): Reset static data.
6313 * rootcontext.cs (RootContext.Reset): Reset static data.
6315 * tree.cs (RootTypes.ctor): Use Location.Null
6317 * typemanager.cs (TypeManager.Reset): Reset static data.
6318 (CoreLookupType): Removed Exit.
6319 (TypeHandle.Reset): Reset static data.
6321 2005-03-10 Raja R Harinath <rharinath@novell.com>
6324 * typemanager.cs (ComputeNamespaces): Import namespaces from
6325 referenced modules too.
6327 2005-03-09 Raja R Harinath <rharinath@novell.com>
6329 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6332 2005-03-09 Raja R Harinath <rharinath@novell.com>
6334 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6335 enclosing DeclSpace. This ensures that a name-lookup populates
6336 more caches and there are fewer 'TypeExpression's. Carve out
6337 nested type lookup into ...
6338 (LookupNestedTypeInHierarchy): ... this.
6340 2005-04-15 Martin Baulig <martin@ximian.com>
6342 Merged r41590 from MCS and make it work in the generics land.
6344 * generic.cs (TypeParameter.UpdateConstraints): Removed the
6347 * class.cs (PartialContainer.UpdateConstraints): Removed.
6348 (PartialContainer.CheckConstraints): Removed.
6349 (PartialContainer.SetParameterInfo): Store the constraints here.
6350 (PartialContainer.DefineTypeParameters): New public method;
6351 resolve the type parameter's constraints here. Note that the
6352 PartialContainer doesn't have an EmitContext anymore, so we must
6353 do this in the ClassPart.
6355 2005-03-09 Raja R Harinath <rharinath@novell.com>
6357 Clean up a few partial-class semantics.
6358 Fixes test-357.cs and cs1618-2.cs.
6359 * cs-parser.jay (struct_declaration): Use 'current_class' as
6360 parent of newly-created struct. Remove call to Register ().
6361 Use 'pop_current_class' to complete handing the current struct.
6362 (interface_declaration): Likewise.
6363 (class_declaration): Likewise.
6364 (enum_declaration): Use 'current_class' as parent of newly created
6366 (delegate_declaration): Likewise.
6367 (pop_current_class): New function. This is used to handle closing
6368 up the 'current_class' and 'current_container', and pointing them
6369 to the enclosing class/container.
6370 (CSharpParser): Initialize 'current_class' too.
6371 * decl.cs (MemberCore): Add check for invariant: a partial
6372 container is not a parsed entity, and thus does not enclose any
6374 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6375 (DeclSpace.BaseTypeExpr): Use it.
6376 (DeclSpace.LookupType): Add check for invariant.
6377 * class.cs (TypeContainer): Add check for invariant: a nested
6378 class should have the same NamespaceEntry as its enclosing class.
6379 (TypeContainer.EmitFieldInitializers): Make virtual.
6380 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6382 (TypeContainer.Register): Remove.
6383 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6384 null. Use TypeResolveEmitContext for resolving base types and
6385 interfaces. Move initialization of Parts.TypeBuilder here from
6387 (TypeContainer.DefineNestedTypes): ... here.
6388 (PartialContainer): Take a Namespace not a NamespaceEntry.
6389 (PartialContainer.Create): Don't use Register. Call the
6390 appropriate Add... function directly.
6391 (ClassPart): Take both the PartialContainer and the enclosing
6392 class as constructor arguments.
6393 (ClassPart.EmitFieldInitializers): Override.
6394 (ClassPart.PartFindNestedTypes): Remove.
6395 (FieldBase.GetInitializerExpression): Resolve the initializer
6396 expression in the emit context of the enclosing class.
6397 * tree.cs (RootTypes): Remove Register ().
6399 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6401 * cs-parser.jay: Removed CS0134.
6403 * driver.cs: Removed CS1901.
6405 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6406 for predefined types.
6408 2005-03-07 Duncan Mak <duncan@novell.com>
6410 * codegen.cs (Save): Catch UnauthorizedAccessException as
6411 well. Fixes bug #73454.
6413 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6415 * cs-tokenizer.cs (xtoken): Add CS1035.
6417 * class.cs (MethodData.Define): Add CS0683.
6418 (FieldMember.ctor): Add CS0681.
6420 2005-03-07 Raja R Harinath <rharinath@novell.com>
6422 * ecore.cs (SimpleName.DoResolve): Rename from
6423 SimpleName.DoResolveAllowStatic.
6424 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6425 Pass 'intermediate' flag to MemberStaticCheck.
6426 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6427 of "intermediate" lookups via MemberAccess.
6428 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6429 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6431 2005-03-07 Raja R Harinath <rharinath@novell.com>
6434 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6435 slipped in because of variable names that are identical to a
6436 builtin type's BCL equivalent ('string String;', 'int Int32;').
6437 (PropertyExpr.EmitInstance): Likewise.
6439 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6441 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6443 * report.cs (warning_ignore_table): Made public.
6445 2005-03-04 Raja R Harinath <rharinath@novell.com>
6448 * class.cs (MethodData.Emit): Pass 'container' to
6449 container.GetObsoleteAttribute instead of 'container.Parent'.
6451 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6453 * cs-parser.jay: Add 1534 error test.
6455 * iterators.cs (Yield.CheckContext): Add error 1629.
6456 (Iterator.ctor): Save unsafe modifier.
6457 (MoveNextMethod.DoEmit): Restore unsafe context.
6459 * namespace.cs (UsingAlias): Better error message.
6461 2005-03-03 Dan Winship <danw@novell.com>
6463 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6464 the warning message [#73219]
6466 2005-03-03 Raja R Harinath <rharinath@novell.com>
6468 Fix compile with MCS 1.0.0.0.
6469 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6470 w_restore to not depend on string constant folding.
6472 2005-03-03 Raja R Harinath <rharinath@novell.com>
6474 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6475 CS0246 check to users who passed 'silent = false'.
6476 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6478 (SimpleName.SimpleNameResolve): Update.
6479 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6480 (MemberAccess.IdenticalNameAndTypeName): Update.
6481 * doc.cs (FindDocumentedTypeNonArray): Update.
6483 2005-03-03 Raja R Harinath <rharinath@novell.com>
6485 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6486 * parameters.cs (ComputeAndDefineParameters): Remove.
6487 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6488 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6489 Use GetParameterInfo.
6491 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6493 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6495 2005-03-02 Raja R Harinath <rharinath@novell.com>
6497 Unify DeclSpace.LookupType and DeclSpace.FindType.
6498 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6499 is in charge of defining nested types on demand.
6500 (DeclSpace.LookupType): Use it when the current_type is a
6501 TypeBuilder. Use LookupTypeDirect for reflected types.
6502 (DeclSpace.FindType): Remove.
6503 (DeclSpace.LookupInterfaceOrClass): Likewise.
6504 (DeclSpace.DefineTypeAndParents): Likewise.
6505 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6506 DeclSpace.LookupType.
6507 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6508 * typemanager.cs (LookupType): Simplify.
6509 (AddUserType): Remove type from negative_hits.
6510 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6511 * class.cs (TypeContainer.FindMembers): Move handling of nested
6513 (TypeContainer.FindMembers_NestedTypes): ... here.
6514 (TypeContainer.FindNestedType): Implement override.
6515 (ClassPart.FindNestedType): Delegate to PartialContainer.
6516 (ClassPart.PartFindNestedType): Looks up the nested types of the
6519 2005-04-14 Martin Baulig <martin@ximian.com>
6521 * generic.cs (ConstructedType): Moved all the type lookup and
6522 nested class logic into SimpleName.
6523 (ConstructedType.ResolveConstructedType): Our underlying type is
6524 already fully resolved; all the type lookup stuff is in
6527 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6528 constructed types here instead of in ConstructedType.
6530 * decl.cs (MemberName.GetTypeExpression): Always create a
6531 SimpleName, not a ConstructedType.
6532 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6534 2005-03-02 Martin Baulig <martin@ximian.com>
6536 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6537 static constructor in static classes.
6539 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6541 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6542 sizeParamIndex is not specified.
6544 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6547 * report.cs (WarningMessage.IsEnabled): Missing null check.
6549 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6551 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6552 in the fields and not in the properties.
6554 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6556 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6559 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6561 * attribute.cs: Small refactoring (improved robustness).
6562 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6563 (ValidateGuid): Removed.
6564 (Resolve): Removed referenced to above mentioned.
6565 (GetAttributeUsage): Made private and changed to work without
6567 (GetIndexerAttributeValue): Don't crash.
6568 (GetConditionalAttributeValue): Ditto.
6569 (GetClsCompliantAttributeValue): Ditto.
6570 (ExtractSecurityPermissionSet): All attributes exceptions are
6572 (GetPropertyValue): New helper.
6573 (GetMethodImplOptions): New method.
6574 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6575 some missing properties.
6577 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6578 (Method.ApplyAttributeBuilder): Updated.
6580 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6583 2005-02-28 Raja R Harinath <rharinath@novell.com>
6586 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6587 non-simple types (array, pointer, reference).
6589 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6591 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6593 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6595 (Method.CheckBase): Catch wrong destructor here.
6596 (MethodData.Define): Add errors 550, 668.
6598 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6600 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6602 * pending.cs (VerifyPendingMethods): Add error 551.
6604 * typemanager.cs (CSharpName): Next error report helper.
6606 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6608 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6609 attributes. Removed useless attribute double check.
6610 It saves almost 2MBs for corlib.
6612 2005-02-25 Raja R Harinath <rharinath@novell.com>
6615 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6616 called twice in case of error.
6618 2005-02-23 Chris Toshok <toshok@ximian.com>
6620 Fix compiler portions of #72827.
6621 * statement.cs (Block.Emit): call Begin/EndScope on the
6622 EmitContext instead of the ILGenerator.
6624 * codegen.cs (EmitContext.BeginScope): new method, call
6625 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6627 (EmitContext.BeginScope): same, but EndScope and CloseScope
6629 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6630 offset and call the superclass's OpenScope(int) with it.
6631 (SymbolWriter.CloseScope): get the current il
6632 offset and call superclass's CloseScope(int) with it.
6634 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6636 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6637 CS1677 for out and ref as well.
6639 * class.cs (Method.Define): Add error CS1599 detection.
6641 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6643 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6645 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6647 * support.cs.cs (ModifierDesc): New helper method.
6649 2005-02-23 Raja R Harinath <rharinath@novell.com>
6650 Abin Thomas <projectmonokochi@rediffmail.com>
6651 Anoob V E <projectmonokochi@rediffmail.com>
6652 Harilal P R <projectmonokochi@rediffmail.com>
6655 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6656 MemberLookup (used for error reporting) actually returns a result.
6657 Fix error report number (122, not 112).
6659 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6660 Anoob V E <projectmonokochi@rediffmail.com>
6661 Harilal P R <projectmonokochi@rediffmail.com>
6664 * pending.cs (PendingImplementation.GetAbstractMethods):
6665 Find NonPublic members too.
6667 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6669 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6672 * class.cs (MethodCore.CheckMethodAgainstBase):
6673 Add error 239 report.
6675 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6677 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6679 * class.cs (Operator.Define): Add error 217 report.
6681 2005-02-21 Raja R Harinath <rharinath@novell.com>
6684 * expression.cs (Invocation.IsApplicable): Make public.
6685 (Invocation.IsParamsMethodApplicable): Likewise.
6686 * delegate.cs (Delegate.VerifyApplicability): Don't use
6687 Invocation.VerifyArgumentCompat for parameter applicability
6688 testing. Use Invocation.IsApplicable and
6689 Invocation.IsParamsMethodApplicable.
6691 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6693 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6695 * class.cs (Operator.Define): Add error 217 report.
6697 2005-02-21 Raja R Harinath <rharinath@novell.com>
6699 * namespace.cs (UsingEntry.Resolve): Undo change below.
6701 2005-02-21 Raja R Harinath <rharinath@novell.com>
6704 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6705 disable the error message when the extended MemberLookup also
6707 (Expression.MemberLookupFinal): Update.
6708 (SimpleName.DoSimpleNameResolve): Update.
6709 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6710 Don't use MemberLookupFinal.
6711 (New.DoResolve): Update.
6712 (BaseAccess.CommonResolve): Update.
6714 2005-02-21 Raja R Harinath <rharinath@novell.com>
6717 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6718 occured previously, don't resolve again.
6720 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6723 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6724 argument. Call ResolveAttributeUsage for unresolved.
6725 when types doesn't match ctor arguments.
6727 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6728 for nested attribute classes.
6729 (Class.attribute_usage): Removed.
6730 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6731 for attribute class.
6733 * ecore.cs (IsAttribute): Removed.
6735 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6737 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6739 (attribute_types): Removed.
6740 (EmitCode): Global attributes are emited as the latest.
6742 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6744 * class.cs (EmitFieldInitializers): Don't emit field initializer
6745 for default values when optimilization is on.
6747 * constant.cs (Constant.IsDefaultValue): New property.
6749 * driver.cs: Add /optimize handling.
6753 * literal.cs: Implement new IsDefaultValue property.
6755 * rootcontext.cs (Optimize): New field, holds /optimize option.
6757 2005-02-18 Raja R Harinath <rharinath@novell.com>
6759 Fix crasher in re-opened #72347.
6760 * namespace.cs (Namespace.Lookup): Return null if
6761 DeclSpace.DefineType returns null.
6764 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6766 2005-02-18 Raja R Harinath <rharinath@novell.com>
6768 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6769 now returns null if it cannot resolve to an lvalue.
6770 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6771 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6772 returned null. Remove check for SimpleName.
6773 (EventExpr.DoResolveLValue): New.
6774 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6775 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6777 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6779 (Unary.ResolveOperator): Move CS0211 check ...
6780 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6782 (Unary.DoResolveLValue): Simplify.
6783 (AddressOf.DoResolveLValue): New.
6784 (ArrayAccess.DoResolveLValue): New.
6786 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6788 * attribute.cs (Attribute.Resolve): Add arguments casting for
6789 when types doesn't match ctor arguments.
6791 2005-02-16 Raja R Harinath <rharinath@novell.com>
6793 Fix parts of #63202.
6794 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6795 lookup of operator in base type. Ensure that all checks happen
6796 when the operator resolves to an "op_..." method.
6798 2005-02-15 Raja R Harinath <rharinath@novell.com>
6801 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6802 'ignore_cs0104' parameter. Pass it to ...
6803 (NamespaceEntry.Lookup): ... this.
6804 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6805 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6806 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6807 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6808 Update. Request that cs0104 errors be ignored.
6809 (ComposedCast.ResolveAsTypeStep): Update.
6811 2005-02-14 Raja R Harinath <rharinath@novell.com>
6814 * expression.cs (Invocation.BetterFunction): Remove support for
6815 comparing virtual functions and their overrides.
6816 (Invocation.IsOverride): New.
6817 (Invocation.OverloadResolve): Don't consider 'override' functions
6818 during candidate selection. Store them in a lookaside list.
6819 If the selected method is a 'virtual' function, use the list to
6820 find any overrides that are closer to the LHS type.
6822 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6824 * expression.cs (New.DoResolve): Add complex core type reduction.
6825 (New.Constantify): Converts complex core type syntax like 'new int ()'
6828 2005-02-14 Raja R Harinath <rharinath@novell.com>
6830 * decl.cs (EntryType.EntryType): New constructor to create an
6831 updated copy of a cache entry.
6832 (MemberCache.AddMethods): Use it.
6833 (MemberCache.ClearDeclaredOnly): Remove.
6834 (MemberCache.MemberCache): Update.
6836 2005-02-11 Miguel de Icaza <miguel@novell.com>
6838 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6839 variable. This one is represents the actual low-level declaration
6840 of the method, as opposed to the semantic level `IsStatic'.
6842 An anonymous method which is hosted into a static method might be
6843 actually an instance method. IsStatic would reflect the
6844 container, while MethodIsStatic represents the actual code
6847 * expression.cs (ParameterReference): Use the new MethodIsStatic
6848 instead of IsStatic.
6850 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6851 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6852 set on the current EmitContext.
6854 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6855 resolve our casted expression as an LValue. This triggers the
6856 proper LValue processing that is later required by Assign.
6860 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6862 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6864 C# 2.0 Fixed buffer implementation
6866 * anonymous.cs: Update after RegisterHelperClass renaming.
6868 * attribute.cs (AttributeTester.fixed_buffer_cache):
6869 Cache of external fixed buffers.
6870 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6871 implementation if field is fixed buffer else null.
6874 (TypeContainer.AddField): Accept FieldMember instead of Field.
6875 (FieldBase.IsFieldClsCompliant): Extracted code from
6876 VerifyClsCompliance descendant customization.
6877 (FixedField): New class handles fixed buffer fields.
6878 (FixedFieldExternal): Keeps information about imported fixed
6880 (IFixedField): Make access to internal or external fixed buffer
6883 * cs-parser.jay: Add fixed buffer parsing.
6885 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6888 * expression.cs (Indirection): Extended implementation to accept
6890 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6891 (ElementAccess.MakePointerAccess): Get type as parameter.
6892 (DoResolve): Add fixed buffer field expression conversion.
6893 (DoResolveLValue): Ditto.
6894 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6895 (ArrayPtr): Derives from FixedBufferPtr.
6896 (ArrayPtr.Emit): Add extra emit for array elements.
6898 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6900 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6901 for compiler generated types.
6902 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6904 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6905 and consume less memory.
6906 (Fixed.Resolve): Add fixed buffer case.
6908 * typemanager.cs (compiler_generated_attr_ctor,
6909 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6910 (HasElementType): Add our own implementation to work on every
6913 2005-02-11 Miguel de Icaza <miguel@novell.com>
6915 * anonymous.cs (CaptureContext): Track whether `this' has been
6918 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6919 only captured `this' if it was implicitly done (instance
6920 methods/variables were used).
6922 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6923 `this' must be captured.
6925 2005-01-30 Miguel de Icaza <miguel@novell.com>
6927 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6928 is null it means that there has been no need to capture anything,
6929 so we just create a sibling.
6931 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6933 Just a partial fix. The other half is fairly elusive.
6935 2005-02-10 Raja R Harinath <rharinath@novell.com>
6937 Fix #52586, cs0121-4.cs.
6938 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6939 and return a hashtable.
6940 (MemberCache.ClearDeclaredOnly): New.
6941 (MemberCache.MemberCache): Update to change. Make a deep copy of
6942 the method_hash of a base type too.
6943 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6944 type methods. Overwrite entries with the same MethodHandle so
6945 that the ReflectedType is correct. The process leaves in base
6946 virtual functions and their overrides as distinct entries.
6947 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6948 matters since it was boxed in a ArrayList before.
6949 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6951 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6952 case of a virtual function and its override (choose the overload
6954 (Invocation.OverloadResolve): Avoid 'override' members during
6955 'applicable_type' calculation.
6957 2005-03-28 Raja R Harinath <rharinath@novell.com>
6959 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6960 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6961 GetTypeHandle. It is possible for a reflected type to derive from
6962 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6963 System.Array during mscorlib compilation).
6964 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6965 contain a method_hash, don't create one either. Don't create a
6966 deep copy of the base cache's method_hash.
6967 (MemberCache.SetupCache): Rename back from DeepCopy.
6968 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6969 already initialized. If we see an override function, add its
6970 underlying base virtual function to the member_hash too.
6972 2005-02-09 Raja R Harinath <rharinath@novell.com>
6974 Combine two near-redundant caches.
6975 * typemanager.cs (method_params): Rename from method_internal_params.
6976 (TypeManager.GetParameterData): New. Replace
6977 Invocation.GetParameterData.
6978 (TypeManager.LookupParametersByBuilder): Remove.
6979 * expression.cs (Invocation.method_parameter_cache): Remove.
6980 (Invocation.GetParameterData): Remove.
6982 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6985 2005-02-08 Raja R Harinath <rharinath@novell.com>
6988 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6989 TypeManager.multicast_delegate_type is null, resolve it by looking
6990 up "System.MulticastDelegate".
6991 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6993 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6994 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6995 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6998 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6999 (LabeledStatement.AddReference): New. Set 'referenced'.
7000 (Goto.Resolve): Use it.
7002 2005-02-05 John Luke <john.luke@gmail.com>
7004 * driver.cs: remove duplicate -doc line in Usage ()
7006 2005-02-04 Raja R Harinath <rharinath@novell.com>
7008 * location.cs (Location.AddFile): Fix CS2002 error report.
7010 2005-02-02 Martin Baulig <martin@ximian.com>
7012 * delegate.cs (Delegate.DefineType): Report an internal error if
7013 TypeManager.multicast_delegate_type is null. See bug #72015 for
7016 2005-02-02 Raja R Harinath <rharinath@novell.com>
7018 Fix a crasher in a variant of #31984.
7019 * const.cs (Constant.CheckBase): New override that defers the
7020 new-or-override check in case the base type hasn't been populated
7022 (Constant.Define): Ensure the new-or-override check is performed.
7024 2005-02-01 Duncan Mak <duncan@ximian.com>
7026 * const.cs (LookupConstantValue): Check that `ce' is not null
7027 before calling GetValue ().
7029 2005-02-01 Raja R Harinath <rharinath@novell.com>
7031 Fix test-334.cs (#69519).
7032 * cs-parser.jay (using_alias_directive): Pass in an expression to
7033 NamespaceEntry.UsingAlias.
7034 (using_namespace_directive): Pass in an expression to
7035 NamespaceEntry.Using.
7036 (namespace_name): Don't flatten to a string.
7037 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7038 (NamespaceEntry.AliasEntry.Resolve): Lookup using
7040 (NamespaceEntry.UsingEntry): Likewise.
7041 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7043 (NamespaceEntry.LookupForUsing): Remove.
7044 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7046 (NamespaceEntry.Lookup): Remove support for dotted names.
7048 2005-02-01 Raja R Harinath <rharinath@novell.com>
7050 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7052 (NamespaceEntry.ImplicitParent): Compute on demand.
7053 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7054 parallels the current.
7055 (NamespaceEntry.LookupForUsing): Use it.
7056 (NamespaceEntry.Lookup): If the current namespace-entry is
7057 implicit, don't search aliases and using tables.
7059 2005-02-01 Raja R Harinath <rharinath@novell.com>
7062 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7064 (TypeContainer.BaseCache): Compute on demand.
7065 (TypeContainer.FindMembers): Define constants and types if they're
7066 not already created.
7067 (FieldMember.Define): Move resetting of ec.InUnsafe before error
7069 * const.cs (Constant.Define): Make idempotent.
7071 2005-01-29 Miguel de Icaza <miguel@novell.com>
7073 * pending.cs: Produce better code (no nops produced by using Ldarg
7076 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7077 i - 1' it should be arg + 1.
7081 2005-01-28 Raja R Harinath <rharinath@novell.com>
7083 * attribute.cs (Attribute.CheckAttributeType): Make private
7085 (Attribute.ResolveType): Make virtual.
7086 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7087 handling of RootContext.Tree.Types.
7089 2005-01-27 Raja R Harinath <rharinath@novell.com>
7091 Update attribute-handling to use the SimpleName/MemberAccess
7093 * cs-parser.jay (attribute): Pass in an expression to the
7094 constructors of Attribute and GlobalAttribute.
7095 * attribute.cs (Attribute): Take an expression for the name.
7096 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
7097 passed in attribute name expression.
7098 (Attribute.CheckAttributeType): Use it.
7099 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7100 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7101 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
7102 argument to prevent error messages if the lookup fails.
7104 2005-01-27 Marek Safar <marek.safar@seznam.cz>
7106 * expression.cs (Indirection): Implemented IVariable interface
7107 to support indirection in AddressOf operator.
7108 (PointerArithmetic.Emit): Add optimalization for case where
7109 result can be precomputed.
7111 2005-01-26 Martin Baulig <martin@ximian.com>
7113 * class.cs (TypeContainer.AttributeTargets): Return the correct
7114 AttributeTargets depending on our `Kind' instead of throwing an
7115 exception; fixes #71632.
7117 2005-01-26 Marek Safar <marek.safar@seznam.cz>
7120 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7123 2005-03-17 Martin Baulig <martin@ximian.com>
7125 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7126 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
7128 2005-03-17 Martin Baulig <martin@ximian.com>
7130 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7131 to bool so we can return an error condition.
7132 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7135 2005-03-17 Martin Baulig <martin@ximian.com>
7137 * generic.cs (TypeMananager.IsIEnumerable): New public method.
7139 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
7140 converting from an array-type of T to `IEnumerable<T>'.
7142 2005-03-16 Martin Baulig <martin@ximian.com>
7144 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
7145 (Nullable.LiftedUnaryMutator): New public class.
7147 * expression.cs (UnaryMutator.DoResolve): Added support for
7150 2005-03-14 Martin Baulig <martin@ximian.com>
7152 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
7154 2005-03-14 Martin Baulig <martin@ximian.com>
7156 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7157 the comparision operators `<', `>', `<=' and `>='.
7159 2005-03-13 Martin Baulig <martin@ximian.com>
7162 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7163 avoid confusion with the `NullLiteral'.
7164 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7166 2005-03-13 Martin Baulig <martin@ximian.com>
7168 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7169 comparing arbitrary types with the null literal.
7171 2005-03-13 Martin Baulig <martin@ximian.com>
7173 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7174 boolean operators '&&', '||', '&' and '|'.
7175 (Nullable.OperatorTrueOrFalse): New public class.
7177 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7178 instead of a `StaticCallExpr'; added support for nullables.
7180 2005-03-10 Martin Baulig <martin@ximian.com>
7183 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7184 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
7186 2005-03-07 Martin Baulig <martin@ximian.com>
7188 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7189 it work if `expr' is not an IMemoryLocation.
7190 (Nullable.Lifted): Implement IMemoryLocation.
7191 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7194 2005-03-05 Martin Baulig <martin@ximian.com>
7196 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7197 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7198 (Nullable): Added support for lifted unary and binary operators.
7200 * expression.cs (Unary.DoResolve): Added support for nullable types.
7201 (Binary.DoResolve): Likewise.
7202 (Conditional.DoResolve): Likewise.
7204 2005-03-02 Martin Baulig <martin@ximian.com>
7206 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7208 * class.cs (ClassPart.SetParameterInfo): Override this.
7209 (PartialContainer.SetParameterInfo): Override this.
7210 (TypeContainer.CheckConstraints): New protected method.
7211 (PartialContainer.CheckConstraints): Override this and check
7212 whether the same contraints were specified in all parts of a
7213 partial generic type definition.
7214 (PartialContainer.UpdateConstraints): New public method.
7216 * generic.cs (TypeParameter.UpdateConstraints): New public method.
7218 2005-03-02 Martin Baulig <martin@ximian.com>
7220 Committing a patch from Carlos Alberto Cortez to fix #72887.
7222 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7223 casts from `T []' to `int []'.
7225 2005-03-02 Martin Baulig <martin@ximian.com>
7227 * generic.cs (TypeManager.IsEqual): Make this symmetric.
7229 * expression.cs (Binary.ResolveOperator): When resolving a
7230 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7231 `=='. Fixes #71866. See gen-127.cs.
7233 2005-03-02 Martin Baulig <martin@ximian.com>
7235 * class.cs (TypeContainer.DoDefineMembers): We also need a default
7236 static constructor in static classes.
7238 2005-03-02 Martin Baulig <martin@ximian.com>
7241 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7242 (Nullable.LiftedConversion): Added support for user-defined
7245 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7247 * cs-parser.jay: Use ComposedCast everywhere instead of
7248 NullableType, so we don't need to check for NullableType
7250 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7251 case where we'll be resolved into a `parenthesized_expression_0'
7255 (Convert.UserDefinedConversion): Added nullable conversions.
7257 2005-02-28 Martin Baulig <martin@ximian.com>
7259 * generic.cs (TypeManager.IsNullableType): New static method.
7260 (Nullable): New abstract class.
7261 (Nullable.NullLiteral): New public class.
7262 (Nullable.LiftedConversion): New public class.
7264 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7265 `builtin_types opt_nullable'.
7268 (Convert.ImplicitConversionStandard): Added nullable conversions.
7269 (Convert.ExplicitConversionStandard): Likewise.
7270 (Convert.ExplicitConversion): Likewise.
7272 2005-02-26 Martin Baulig <martin@ximian.com>
7274 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7275 begin with a "?", for instance "?[]". Don't do a type lookup if
7278 2005-02-25 Martin Baulig <martin@ximian.com>
7280 The first part of Nullable Types :-)
7282 * generic.cs (NullableType): New public class.
7283 (NullCoalescingOperator): New public class.
7284 (TypeArguments.Resolve): Add a CS0306 check.
7286 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7287 (opt_nullable): New rule.
7288 (type): Added `opt_nullable' to `namespace_or_type_name',
7289 `builtin_types' and `pointer_type'.
7290 (array_type): Added `opt_nullable'.
7291 (opt_rank_specifier_or_nullable): New rule; this is the
7292 combination of `opt_rank_specifier' and `opt_nullable'.
7293 (opt_error): New rule; catch errors here.
7294 (nullable_type_or_conditional): New rule; we use this to check for
7295 nullable and still detect the conditional operator.
7296 (local_variable_type): Use `opt_rank_specifier_or_nullable'
7297 instead `opt_rank_specifier'.
7299 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7302 2005-02-24 Martin Baulig <martin@ximian.com>
7304 * README, README.Changes: Removed; they're old and obsolete.
7306 2005-02-22 Martin Baulig <martin@ximian.com>
7308 * generic.cs (TypeParameter.Resolve): If resolving the constraints
7309 returned an error, set `constraints' to null to avoid a crash
7311 (TypeParameter.ResolveType): Likewise.
7313 2005-02-22 Martin Baulig <martin@ximian.com>
7316 (Constraints.ResolveTypes): Protect against being called twice.
7317 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7318 (TypeParameter.ResolveType): New public method; calls
7319 constraints.ResolveTypes().
7320 (TypeParameter.DefineType): Moved constraints.ResolveType() out
7321 into the new ResolveType().
7322 (GenericMethod.Define): Call ResolveType() on all our
7325 2005-02-21 Martin Baulig <martin@ximian.com>
7328 (TypeManager.generic_nullable_type): New static public field.
7329 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7332 (RootContext.ResolveCore): Resolve "System.Nullable`1".
7334 2005-02-15 Martin Baulig <martin@ximian.com>
7336 * generic.cs (ConstructedType.Constraints): Correctly check
7337 constraints if the argument type is a type parameter; fixes
7340 2005-02-02 Martin Baulig <martin@ximian.com>
7342 * delegate.cs (Delegate.DefineType): Report an internal error if
7343 TypeManager.multicast_delegate_type is null. See bug #72015 for
7346 2005-01-29 Miguel de Icaza <miguel@novell.com>
7348 * pending.cs: Produce better code (no nops produced by using Ldarg
7351 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7352 i - 1' it should be arg + 1.
7356 2005-01-26 Martin Baulig <martin@ximian.com>
7358 * cs-parser.jay (indexer_declarator): Don't report an error if we
7359 have type parameters since we can be an explicit interface
7360 implementation; fixes #71449.
7362 2005-01-26 Martin Baulig <martin@ximian.com>
7364 * class.cs (TypeContainer.AttributeTargets): Return the correct
7365 AttributeTargets depending on our `Kind' instead of throwing an
7366 exception; fixes #71632.
7368 2005-01-26 Martin Baulig <martin@ximian.com>
7370 * delegate.cs (Delegate.DefineType): Correctly define our type
7371 parameters. Fixes #71483.
7373 2005-01-25 Raja R Harinath <rharinath@novell.com>
7376 * expression.cs (MemberAccess.DoResolve): Don't complain with
7377 cs0572 when the LHS of a member access has identical name and type
7380 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7383 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7385 Create custom PermissionSet only for PermissionSetAttribute.
7387 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7390 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7391 delegates in static class.
7393 2005-01-24 Martin Baulig <martin@ximian.com>
7395 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7396 merging an implicit block, just use its reachability.
7398 * statement.cs (Block.Resolve): Make the unreachable code check
7399 work wrt. implicit blocks; see test-337 from #63842.
7401 2005-01-21 Alp Toker <alp@atoker.com>
7403 * cs-parser.jay: destructor_declaration's container is PartialContainer
7404 not Class when partial types are used, so use Kind prop instead of
7407 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7409 * cs-parser.jay: Improve error reporting when an interface
7412 2005-01-20 Dick Porter <dick@ximian.com>
7414 * support.cs: SeekableStreamReader fix from Sandor Dobos
7415 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7416 chars are read. Fixes bug 70369.
7418 2005-01-20 Raja R Harinath <rharinath@novell.com>
7420 * cs-parser.jay (catch_clause): Simplify current_block handling
7423 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7425 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7426 code with ImplicitStandardConversion to handle the implicit
7427 conversion of method groups into valid delegate invocations.
7429 The problem is that in parameter handling we were using this code
7430 path. Fixes bug #64698
7432 2005-01-19 Raja R Harinath <rharinath@novell.com>
7434 * cs-parser.jay: Fix several infelicities.
7435 - Avoid assigning to the parser value stack. Code like
7436 '$3 = null' is unclean. Synthesize a value for the code block
7438 - Avoid using oob_stack for storing location information. Use ...
7439 (_mark_): ... this. New (empty) rule. Saves the current location
7441 (foreach_statement): Avoid using oob_stack for current_block
7442 handling. Use technique used in for_statement and
7443 using_statement. Synthesize a value for the code block to store
7444 additional intermediate information.
7446 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7448 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7449 of a different type is only allowed to private fields of a
7450 containing type, not on fields of a base class.
7452 See test-174.cs and error cs0122-9.cs
7454 2005-01-13 Raja R Harinath <rharinath@novell.com>
7456 Fix test-335.cs (bug #58126).
7457 * cs-parser.jay (argument): Split out non-expression parts of the
7458 rule into 'non_simple_argument'.
7459 (invocation_expression): Support parenthesized invocations with
7460 multiple arguments, and with single non-simple arguments.
7462 2005-01-13 Raja R Harinath <rharinath@novell.com>
7464 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7467 2005-01-12 Raja R Harinath <rharinath@novell.com>
7469 Fix cs0038-1.cs, cs1640-6.cs.
7470 * ecore.cs (Expression.Resolve): Remove special-case for
7471 SimpleName in error-handling.
7472 (Expression.almostMatchedMembers): Relax access permission to
7474 (Expression.MemberLookupFailed): Handle duplicates in
7475 almostMatchedMembers list.
7476 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7477 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7478 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7479 overload if the passed in MemberInfo is a MethodBase.
7481 2005-01-25 Martin Baulig <martin@ximian.com>
7484 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7486 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7489 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7490 for non-CAS & merge permission sets properly.
7492 2005-01-11 Raja R Harinath <rharinath@novell.com>
7494 Improve standard-compliance of simple name and member access
7495 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7496 * ecore.cs (FullNamedExpression): New abstract base class
7497 for Namespaces and TypeExpressions.
7498 (ResolveFlags.SimpleName): Remove.
7499 (SimpleName): Remove support for dotted names.
7500 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7501 DeclSpace.FindType and DeclSpace.LookupType.
7502 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7503 (Expression.ExprClassName): Make member function.
7504 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7505 a namespace. Remove creation of dotted "SimpleName"s.
7506 (MemberAccess.DoResolve): Likewise.
7507 * decl.cs (DeclSpace.Cache): Make private.
7508 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7509 (DeclSpace.FindType): Update.
7510 (DeclSpace.LookupType): Move here from RootContext. Return a
7511 FullNamedExpression.
7512 * namespace.cs (Namespace): Derive from FullNamedExpression
7513 so that it can be part of expression resolution.
7514 (Namespace.Lookup): Return an FullNamedExpression.
7515 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7517 * rootcontext.cs (NamespaceLookup): Remove.
7518 (LookupType): Move to DeclSpace.
7519 * attribute.cs (CheckAttributeType): Update.
7520 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7521 (FindDocumentedTypeNonArray): Likewise.
7523 2005-01-11 Raja R Harinath <rharinath@novell.com>
7525 Fix cs0509.cs, cs1632.cs.
7526 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7527 is the same as IsInterface.
7528 (TypeContainer.GetClassBases): Likewise.
7529 * statement.cs (LabeledStatement.ig): New field.
7530 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7532 (LabeledStatement.DoEmit): Check that the label was created with
7533 the same ILGenerator.
7535 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7538 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7539 accessors to its properties.
7541 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7542 from accessors to property.
7544 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7547 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7550 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7552 * attribute.cs: Check for null and empty strings.
7554 I have lost another battle to Paolo.
7556 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7559 * class.cs (PropertyMethod): Set Parent field in ctors.
7560 (SetMethod.InternalParameters): Add unsafe switch hack.
7561 Override MarkForDuplicationCheck where it is appropriate.
7563 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7564 It says whether container allows members with the same name.
7566 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7567 Removed is_method parameter.
7569 2005-01-06 Duncan Mak <duncan@ximian.com>
7571 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7572 because the previous change led to incorrect reporting of CS1032
7573 ("Cannot define/undefine preprocessor symbols after first token in
7574 file"). Instead of using `tokens_seen' as the only flag that
7575 triggers CS1040, introduce `comments_seen'. This new flag is used
7576 to signify having seen comments on the current line, so it is
7577 unset after a newline.
7579 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7581 * doc.cs : When searching for a type, find nested type too.
7582 This fixes bug #71040.
7584 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7587 - Warn missing member comment on those classes which also does not
7588 have doc comments. Fixed bug #71041.
7589 - Don't warn missing doc comment on default constructor.
7592 2005-01-06 Duncan Mak <duncan@ximian.com>
7594 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7595 comments, set `tokens_seen' to true. This allows us to detect
7596 misplaced preprocessor directives (i.e. not at the beginning of
7597 the a line, nor after whitespaces). In that case, report error
7598 CS1040. This fixes bug #56460.
7600 * cs-parser.jay (interface_member_declaration): Add checks for
7601 IsExplicitImpl, and report CS0541 error if an interface member is
7602 defined as an explicit interface declaration.
7604 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7607 * class.cs (PropertyMethod): Set Parent field in ctors.
7608 (SetMethod.InternalParameters): Add unsafe switch hack.
7610 * decl.cs (MemberCore.Parent): Cannot be readonly.
7612 2005-01-06 Raja R Harinath <rharinath@novell.com>
7614 * decl.cs (DeclSpace.ResolveType): Remove.
7615 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7616 Merge in code from ...
7617 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7618 * class.cs, enum.cs: Update to changes.
7620 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7622 * anonymous.cs: Ensure that we init the scope of our parent if it
7623 has not been initialized yet.
7625 2004-12-30 Duncan Mak <duncan@ximian.com>
7627 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7628 if field.FieldBuilder is null. Fixes #70758.
7630 * convert.cs: Fixed some typos and updated some of the comments.
7631 (ImplicitStandardConversionExists):
7632 (TryImplicitIntConversion): If `target_type' is an interface and
7633 the type of `ic' implements this interface, return true or a new
7634 BoxedCast instead of null. This fixes #70468.
7636 2004-12-29 Duncan Mak <duncan@ximian.com>
7638 * expression.cs (Argument.Emit): Check that Expr is
7639 IMemoryLocation before casting to it, and report CS1510 otherwise.
7643 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7645 * statement.cs (Block.ThisVariable): remove the recursion here, to
7646 make the --profile more sane.
7648 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7650 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7651 assembly, by JB Evain.
7653 2004-12-17 Raja R Harinath <rharinath@novell.com>
7655 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7656 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7657 "parent" refers to enclosing type/class. "base" refers to superclass.
7659 2004-12-17 Raja R Harinath <rharinath@novell.com>
7661 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7662 Ensure that we only have GlobalAttributes.
7663 * attribute.cs (Attribute.Emit): Make non-virtual.
7664 (GlobalAttribute.Emit): Remove.
7665 (Attribute.Resolve): Make virtual.
7666 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7667 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7668 the argument. Don't create one.
7669 (Attribute.GetObsoleteAttribute): Likewise.
7670 (Attribute.GetClsCompliantAttributeValue): Likewise.
7671 * class.cs, decl.cs: Update to changes.
7673 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7675 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7677 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7679 * statement.cs (Foreach.Resolve): Add error 186 report.
7681 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7683 * expression.cs (Conditional.DoResolve): Add warning 429.
7685 * statement.cs (If.Resolve): Add warning 665.
7687 2004-12-16 Raja R Harinath <rharinath@novell.com>
7689 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7690 except when in the parser, and in GlobalAttribute.
7691 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7692 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7693 RootContext.Tree.Types.NamespaceEntry once work is done.
7694 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7695 and resets RootContext.Tree.Types.NamespaceEntry.
7697 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7699 * cs-parser.jay: Don't create a block for every variable.
7701 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7703 * location.cs: Provide extra information.
7705 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7706 variables from the captured environment, it is the ldarg_0.
7708 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7710 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7713 * class.cs: Changed warning level for 169 to avoid developer
7714 displeasure from warning flooding. It will be changed back when they
7715 fix most of current BCL warnings.
7717 * RootContext.cs: Pushed default WarningLevel to 3.
7719 * statement.cs: Removed unused variable.
7721 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7723 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7724 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7725 Add error 502 report.
7726 (StaticClass.DefineType): Add error 441 report.
7727 (Class.AllowedModifiersProp): New virtual property as temporary
7728 extension to AllowedModifiers.
7729 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7730 to share implementation with StaticClass and don't call virtual
7733 * driver.cs (MainDriver): Add error 1558 test.
7735 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7736 report. Moved error 36 test here.
7738 * statement.cs (Throw.Resolve): Add error 724 report.
7740 * typemanager.cs: Add out_attribute_type core type.
7742 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7744 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7746 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7748 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7751 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7753 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7754 Add error 3023 report.
7755 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7757 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7760 2004-12-12 John Luke <john.luke@gmail.com>
7762 * driver.cs (AddArgs): take -- into account when
7763 adding arguments, fixes bug 65710
7765 2004-12-12 Martin Baulig <martin@ximian.com>
7767 * expression.cs (Unary.TryReduceNegative): Added support for
7768 SByteConstant and ByteConstant.
7769 (Unary.Reduce): Check error values from TryReduceNegative().
7771 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7773 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7774 and report exception as error 182.
7776 2004-12-10 Raja R Harinath <rharinath@novell.com>
7778 * driver.cs (Main): Fix message when there are warnings.
7780 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7782 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7784 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7786 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7787 Reduced number of warnings.
7789 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7791 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7793 * driver.cs: Removed message.
7795 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7797 2004-12-08 <vargaz@freemail.hu>
7799 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7801 2004-12-08 Martin Baulig <martin@ximian.com>
7803 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7804 instead of a CS3002 for properties and indexer.
7806 2004-12-08 Martin Baulig <martin@ximian.com>
7808 * decl.cs (MemberName.ToString): Make this work again.
7810 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7812 * attribute.cs (Resolve): Add error 591 detection.
7814 * class.cs (FieldMember.Define): Add error 1547 detection.
7815 (Indexer.Define): Add error 620 detection.
7816 (Operator.Define): Add error 590 detection.
7818 * ecore.cs: Missing argument for error 79.
7820 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7823 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7826 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7829 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7831 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7832 Some operator comments were suppressed.
7833 * doc.cs : Implicit/explicit operator name in doc comments are like
7834 "op_Explicit(type)~returnType", so added suffix handling.
7836 2005-01-21 Alp Toker <alp@atoker.com>
7838 * cs-parser.jay: destructor_declaration's container is PartialContainer
7839 not Class when partial types are used, so use Kind prop instead of 'is'.
7841 2004-12-12 Martin Baulig <martin@ximian.com>
7843 * expression.cs (Unary.TryReduceNegative): Added support for
7844 SByteConstant and ByteConstant.
7845 (Unary.Reduce): Check error values from TryReduceNegative().
7847 2004-12-11 Martin Baulig <martin@ximian.com>
7849 * support.cs (ReflectionParameters.ParameterName): If we have a
7850 `gpd', call `ParameterName' on it.
7852 * parameter.cs (Parameter.GetParameterAttributes): New static method.
7854 * pending.cs (PendingImplementation.DefineProxy): Call
7855 DefineParameter() for all of the MethodBuilder's arguments.
7857 2004-12-09 Martin Baulig <martin@ximian.com>
7859 * doc.cs (DocUtil): Make this a static class.
7861 2004-12-09 Martin Baulig <martin@ximian.com>
7863 * expression.cs (Invocation.InferType): Moved the type inference
7864 implementation into TypeManager.
7866 * generics.cs (TypeManager): Moved the type inference
7867 implementation here.
7869 2004-12-09 Martin Baulig <martin@ximian.com>
7871 * typemanager.cs (TypeManager): Make this a partial class.
7874 (TypeManager): Move the generics part of `TypeManager' here.
7876 2004-12-08 Martin Baulig <martin@ximian.com>
7878 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7879 instead of a CS3002 for properties and indexer. Added CS3024
7880 check for generic interfaces.
7882 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7883 instances are not CLS-compliant.
7885 2004-12-08 Martin Baulig <martin@ximian.com>
7888 (void_pointer_expression): New rule for `void*', `void**' etc.
7889 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
7891 2004-12-08 Martin Baulig <martin@ximian.com>
7893 * expression.cs (Invocation.InferType): Removed the hack for
7894 MethodCore.MayUnify().
7896 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7899 * class.cs (MethodCore.MayUnify): Use
7900 TypeManager.MayBecomeEqualGenericTypes().
7902 2004-12-08 Martin Baulig <martin@ximian.com>
7904 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7905 parameter, box it. Fixes #69233.
7907 2004-12-08 Martin Baulig <martin@ximian.com>
7909 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7910 have the ctor constraint. Fixes #68326.
7912 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7914 * cs-parser.jay : interface comment was not consumed because of
7915 extra opt_semicolon before doc handling.
7917 2004-12-03 Raja R Harinath <rharinath@novell.com>
7919 Fix test-327.cs, test-328.cs, and put in early infrastructure
7920 for eventually fixing #52697.
7921 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7922 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7924 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7925 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7926 (VerifyUsing, error246): Update.
7927 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7928 'NamespaceEntry.LookupNamespaceOrType'.
7930 2004-12-07 Martin Baulig <martin@ximian.com>
7932 * driver.cs: Call it "BETA SOFTWARE" :-)
7934 2004-12-06 Raja R Harinath <rharinath@novell.com>
7936 Fix crash on cs0657-17.cs.
7937 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7938 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7939 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7940 the case where the NamespaceEntry gets overwritten.
7942 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7944 Fixed #69195, #56821
7945 * ecore.cs (ResolveBoolean): Tiny refactoring.
7947 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7948 of right expression resolving when left is false constant and
7949 operator is LogicalAnd OR true constant and operator is LogicalOr.
7951 * statement.cs (ResolveUnreachable): Always reports warning.
7953 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7955 * class.cs: Distinguish between 1721 and 1722 (just a little help
7956 for the programmer).
7958 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7960 * delegate.cs: Only allow this on new versions of the language.
7962 2004-12-02 Duncan Mak <duncan@ximian.com>
7964 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7966 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7967 here as a static method. Take an additional bool out parameter
7968 `must_do_cs1540_check' for signaling to InstanceResolve.
7969 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7970 member field from PropertyExpr class and made it an argument of
7972 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7973 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7974 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7975 and `remove_accessor' as well as InstanceResolve: report CS0122
7980 2004-12-07 Martin Baulig <martin@ximian.com>
7982 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7983 and CS0692 where appropriate.
7985 2004-12-06 Martin Baulig <martin@ximian.com>
7987 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7988 IsDuplicateImplementation() and improved it.
7990 * expression.cs (Invocation.InferTypeArguments): Added
7991 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7992 and removed the "ref" modifier from `infered_types'.
7994 * decl.cs (MemberName.ToString): Removed the exception.
7996 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7998 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7999 comments are allowed.
8001 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8003 * delegate.cs: Add checks for subtypes in paramaters and return values
8004 in VerifyMethod () to add support for Covariance/Contravariance
8007 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8009 * report.cs: Remove extra closing parenthesis.
8011 * convert.cs (Error_CannotImplicitConversion): If the name of the
8012 types are the same, provide some extra information.
8014 2004-12-02 Marek Safar <marek.safar@seznam.cz>
8017 * attribute.cs (Resolve): Improved implementation of params
8018 attribute arguments.
8020 * support.cs (ParameterData): Add HasParams to be faster.
8022 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
8024 all things are for /doc support:
8026 * doc.cs: new file that supports XML documentation generation.
8027 * mcs.exe.sources: added doc.cs.
8029 Handle /doc command line option.
8030 Report error 2006 instead of 5 for missing file name for /doc.
8031 Generate XML documentation when required, after type resolution.
8033 Added support for picking up documentation (/// and /** ... */),
8034 including a new XmlCommentState enumeration.
8036 Added lines to fill Documentation element for field, constant,
8037 property, indexer, method, constructor, destructor, operator, event
8038 and class, struct, interface, delegate, enum.
8039 Added lines to warn incorrect comment.
8041 Added Documentation field (passed only when /doc was specified).
8043 Added DocComment, DocCommentHeader, GenerateDocComment() and
8044 OnGenerateDocComment() and some supporting private members for
8045 /doc feature to MemberCore.
8047 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8049 Added overriden DocCommentHeader.
8051 Added overriden DocCommentHeader and GenerateDocComment().
8053 2004-12-01 Miguel de Icaza <miguel@ximian.com>
8055 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8056 unwrapping the enumeration values, chain to
8057 DoConstantNumericPromotions again, so we can promote things to the
8058 fundamental types (takes care of enums that are bytes, sbytes).
8062 2004-12-01 Raja R Harinath <rharinath@novell.com>
8064 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8065 Fix long-standing bug in type-lookup. Use FindType instead of
8066 LookupType when ec.ResolvingTypeTree.
8067 (Attribute.ResolveType, Attribute.Resolve)
8068 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8070 (Attributes.Search): Remove internal version. Update.
8071 (Attributes.SearchMulti): Update.
8072 (Attributes.GetClsCompliantAttribute): Remove.
8073 (Attributes.GetIndexerNameAttribute): Remove.
8074 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8075 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8076 * class.cs (Indexer.Define): Likewise.
8078 2004-12-01 Marek Safar <marek.safar@seznam.cz>
8081 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8082 MarshallByReference members access.
8084 * expression.cs: Use CheckMarshallByRefAccess;
8085 Better error CS0197 message.
8087 * report.cs: Print whole related error message.
8089 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8091 * class (GetClassBases): Better error 60 report.
8092 (EventProperty): Disabled warning 67 detection.
8094 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8097 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8099 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8102 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8105 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8107 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8109 2004-11-26 Miguel de Icaza <miguel@ximian.com>
8111 * attribute.cs (Attribute.Resolve): Refine error reporting and
8112 report a cs0117 if the identifier does not exist, to distinguish
8113 from 0617 which is a miss-use of the actual identifier.
8115 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8116 between cs0070 and cs0079.
8118 * class.cs (MemberBase.DoDefine): When reporting a wrong
8119 accessibility level, we use MethodCore to compare instead of
8120 Method (this was a regression in some refactoring effort).
8122 So now we correctly report cs0056 again.
8124 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8125 testing the target_type (which was known to be object_type) and
8126 not the source type (which is anonymous_method).
8128 Fixed reporting of error cs1660.
8130 * expression.cs (UserCast.Source): Expose the underlying cast.
8132 * statement.cs (Switch.SwitchGoverningType): Sort the list of
8133 allowed types to find a match to int32 first (most common).
8135 In addition, it ignores any ImplicitUserConversions that did an
8136 internal implicit conversion (as the switch statement allows only
8137 one integral conversion to exist).
8139 * class.cs (PartialContainer.Create): rename `name' to
8140 `member_name' for clarity. Then replace the string calls with a
8141 call to MemberName.GetPartialName, as now using
8142 MemberName.ToString is an error (this is due to the side effects
8143 it had, that were fixed in the past).
8145 This will restore the error reporting on a number of partial class
8146 errors that were missusing this (and getting an exception as a
8147 results, which is now just a plain textual warning, because
8148 yyparse debug output would crash otherwise).
8150 2004-11-26 Raja R Harinath <rharinath@novell.com>
8152 * Makefile (PROGRAM_INSTALL_DIR): Remove.
8154 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8156 * rootcontext.cs (LookupType): Make sure to cache lookups that
8157 don't give us a negative result. This saves about 5% of corlib
8160 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8162 * report.cs (AbstractMessage.Print): messages are sent to stderr
8164 * class.cs (TypeContainer.GetClassBases): It is an error to have a
8165 non-interface in the list of interfaces (at this point, either
8166 parent was properly set, or a base class is being listed in the
8167 interfaces section).
8169 This flags error 1722, and resolves the crash from bug 69259.
8171 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8173 * statement.cs (Using.EmitExpressionFinally): make this work right
8174 for valuetypes. Fixes 69926.
8176 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8178 * const.cs (Const.ChangeType): Cope with the "0 literal can be
8179 converted to an enum" here, before we try to change the underlying
8180 type. This code exists, but it is a different code path than the
8181 one used while encoding constants.
8183 (ImplicitReferenceConversionExists): In addition, resynchronized
8184 the code here, so it matches the same code in
8185 ImplicitReferenceConversionExists for the `from any class-type S
8186 to any interface-type T'.
8188 2004-11-25 Marek Safar <marek.safar@seznam.cz>
8190 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8192 2004-11-24 Miguel de Icaza <miguel@ximian.com>
8194 * cs-parser.jay: Use verbosity accordingly.
8196 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8198 * expression.cs (Unary.ResolveOperator): Do not report warning;
8199 AddressOf reads from variable.
8201 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8203 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8207 * attribute.cs (Attributable): Removed CheckTargets.
8208 (Attributes.Emit): Explicit attribute targets are tested here.
8210 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8211 not enabled for interfaces.
8213 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8214 (GetAssemblyName): Ouch next bug there.
8216 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8218 * expression.cs: Error 275 added.
8220 2004-11-23 Marek Safar <marek.safar@seznam.cz>
8222 Fix bug #69177 (Implemented decimal constant support)
8224 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8225 (BinaryFold): Add DecimalConstant.
8227 * const.cs (Define): Decimal constant
8229 (ChangeType): Add decimal type handling.
8230 (LookupConstantValue): Don't set value for decimal type but
8231 emit DecimalConstantAttribute. Needed for constant optimization.
8233 * constant.cs (ToDecimal): New method.
8234 (ConvertToDecimal): New method.
8235 (IntConstant): Implemented ConvertToDecimal.
8236 (DecimalConstant.Emit): Emit optimized version for decimals in
8239 * expression.cs (ResolveOperator): Changed order of constant
8240 reduction to work correctly with native types which have
8241 overloaded operators.
8242 (ResolveMemberAccess): Extract constant value from attribute
8245 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8247 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8248 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8249 (ChangeType): Decimal is special.
8250 (TypeToCoreType): Add decimal type.
8252 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8254 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8257 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8259 * class.cs (EventField.ApplyAttributeBuilder): Fix error
8262 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8264 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8266 * pending.cs (PendingImplementation): Grab only interfaces.
8268 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8270 * statement.cs (ForeachHelperMethods): Add location member and
8271 error 202 detection.
8273 2004-11-18 Marek Safar <marek.safar@seznam.cz>
8275 * expression.cs (DoResolveBase): Fixed wrong warning for out
8278 2004-12-04 Martin Baulig <martin@ximian.com>
8280 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8281 to check whether the conversion is ok.
8283 * typemanager.cs (TypeManager.GetTypeArguments): Just return
8284 `Type.EmptyTypes' if we're not a generic TypeContainer.
8286 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8288 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8289 old bug: when converting from the null literal to a pointer,
8290 return an EmptyCast, not the NullLiteral.
8292 This fixes #69921, the recent null_type changes probably made this
8295 2004-12-03 Martin Baulig <martin@ximian.com>
8297 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8298 method as our child, call AnonymousMethod.Compatible() on it.
8300 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8302 * class.cs (FieldBase): Use an unused bit field from the field to
8303 encode the `has_offset' property from the FieldMember. This saves
8304 a couple of Ks on bootstrap compilation.
8306 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8307 method as our child, return the AnonymousMethod resolved
8310 * expression.cs (New.DoResolve): Allow return values from
8311 NewDelegate to also include AnonymousMethods.
8315 2004-11-29 Raja R Harinath <rharinath@novell.com>
8317 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8319 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8320 System.Runtime.InteropServices._Exception, since it's a base
8321 interface of the core type System.Exception in the net_2_0 profile.
8323 2004-11-27 Martin Baulig <martin@ximian.com>
8325 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8327 2004-11-26 Raja R Harinath <rharinath@novell.com>
8329 * Makefile: Convert to use executable.make.
8330 * gmcs.exe.sources: New.
8332 2004-11-25 Martin Baulig <martin@ximian.com>
8334 * expression.cs (Invocation.InferType): Added support for byref types.
8336 2004-11-25 Martin Baulig <martin@ximian.com>
8338 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8339 in TypeManager.TypeToCoreType().
8341 2004-11-25 Martin Baulig <martin@ximian.com>
8343 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8344 "Dispose" method from the `current_type'.
8345 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8346 DoDefineMembers() instead of using the MethodBuilder; this is
8347 required for generic iterators.
8349 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8351 2004-11-24 Martin Baulig <martin@ximian.com>
8353 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8355 2004-11-20 Martin Baulig <martin@ximian.com>
8357 * expression.cs (Invocation.InferType): Correctly infer generic
8358 instances; see gen-103.cs.
8359 (Invocation.InferTypeArguments): If a generic method doesn't have
8360 any unbound type parameters, we don't need to infer anything.
8362 2004-11-19 Raja R Harinath <rharinath@novell.com>
8364 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8366 2004-11-17 Raja R Harinath <rharinath@novell.com>
8368 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8369 (TypeHandle.GetMemberCache): New.
8370 (TypeHandle.TypeHandle): Update.
8371 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8372 (TypeManager.LookupParentInterfacesCache):
8373 Rename from LookupInterfaceCache. Optimize slightly.
8374 (TypeManager.MemberLookup_FindMembers): Update.
8375 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8377 (AddCacheContents): Rename from AddHashtable.
8378 * class.cs (TypeContainer.parent_container): Remove.
8379 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8380 (TypeContainer.DoDefineMembers): Don't initialize it.
8381 Update to name changes.
8383 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8385 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8386 that factors the code to check access modifiers on override.
8388 (PropertyBase): Use the code here.
8390 Patch from Lluis S'anchez, fixes bug #69361.
8392 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8394 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8395 routine that is used to report the use of a captured variable
8396 whose address has been taken.
8398 There are two checks: one when variables are being captured and
8399 the other check is when the address of a variable is taken.
8401 (because an anonymous methods might be resolved before *or* after
8402 the address has been taken) and
8404 * expression.cs (Conditional.DoResolve): Remove the special
8405 casing that Martin added to trueExpr and falseExpr being both
8406 NullLiteral. We get the right behavior now just by introducing
8407 the null_type into the compiler.
8409 * convert.cs (ExplicitConversion): Change the code to use
8410 null_type instead of testing `expr is NullLiteral'.
8411 (ImplicitConversionStandard): use null_type too.
8412 (ImplicitReferenceConversionExists): use null_type too.
8413 (ImplicitReferenceConversion): use null_type too.
8415 * literal.cs: The type of `NullLiteral' is now null_type instead
8417 (Resolve): Set the type here.
8419 * typemanager.cs: Introduce null_type.
8421 2004-11-18 Martin Baulig <martin@ximian.com>
8424 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8426 2004-11-18 Martin Baulig <martin@ximian.com>
8428 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8430 2004-11-18 Martin Baulig <martin@ximian.com>
8432 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8433 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
8434 call ResolveConstructedType() on it to resolve it without checking
8436 (Constraints.ResolveTypes): Check them here.
8437 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8438 but don't check constraints.
8439 (ConstructedType.ResolveAsTypeTerminal): Override this and also
8440 check constraints here.
8441 (ConstructedType.ResolveConstructedType): New public method. This
8442 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8443 resolve ourselves without checking constraints.
8445 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8447 2004-11-18 Martin Baulig <martin@ximian.com>
8450 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8452 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8454 2004-11-18 Martin Baulig <martin@ximian.com>
8456 * ecore.cs (TypeExpr.ResolveType): Removed.
8457 (Expression.ResolveAsTypeTerminal): We always return a fully
8458 resolved `TypeExpr', so we can just access its `Type'.
8460 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8462 2004-11-17 Martin Baulig <martin@ximian.com>
8464 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8465 sure we don't return any unresolved TypeExpr's.
8466 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8468 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8470 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8471 unresolved `ConstructedType's.
8473 2004-11-17 Martin Baulig <martin@ximian.com>
8475 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8477 2004-11-17 Martin Baulig <martin@ximian.com>
8480 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8482 * decl.cs (DeclSpace.ResolveType): Removed.
8483 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8485 2004-11-17 Martin Baulig <martin@ximian.com>
8487 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8488 direction, like FindMembers() does. Fixes #69546, testcase is in
8491 2004-11-16 Martin Baulig <martin@ximian.com>
8493 This is based on a patch from Marek Safar, see bug #69082.
8494 Fixes bugs #63705 and #67130.
8496 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8497 method; create a MemberCache for an interface type and cache the
8500 * decl.cs (IMemberContainer.ParentContainer): Removed.
8501 (IMemberContainer.ParentCache): New property.
8502 (MemberCache.SetupCacheForInterface): Removed.
8503 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8504 to create a cache for an interface's "parent".
8506 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8509 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8511 * statement.cs: Avoid adding bools to a hashtable.
8513 2004-11-15 Martin Baulig <martin@ximian.com>
8515 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8517 2004-11-11 Martin Baulig <martin@ximian.com>
8519 * typemanager.cs (TypeManager.GetMethodName): New method.
8521 * class.cs (MethodData.Define): Include the generic arity in the
8522 name of an explicit interface; also add it to the method name.
8524 * pending.cs (PendingImplementation.InterfaceMethod): The method
8525 name now includes the generic arity.
8527 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8529 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8530 calling an unsafe method from a safe location.
8532 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8535 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8537 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8539 * namespace.cs (VerifyUsing): use GetPartialName instead of
8542 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8544 * statement.cs (Return.Resolve): Fix regression in typo: if
8545 `in_exc', we have to request a NeedReturnLabel, this was a typo
8546 introduced in the anonymous method check-in. Fixes #69131.
8548 * Indexers were using the ShortName when defining themselves,
8549 causing a regression in the compiler bootstrap when applying the
8550 patch from 2004-11-02 (first part), now they use their full name
8551 and the bug is gone.
8553 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8555 * driver.cs: Strip the path from the names of embedded resources. Fixes
8558 2004-11-04 Raja R Harinath <rharinath@novell.com>
8560 Fix error message regression: cs0104-2.cs.
8561 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8562 (AliasEntry.Resolve): Update.
8563 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8565 (RootContext.LookupType): Update.
8567 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8569 * cs-parser.jay: Add support for handling accessor modifiers
8570 * class: Add support port accessor modifiers and error checking,
8571 define PropertyMethod.Define as virtual (not abstract anymore)
8572 * ecore.cs: Add checking for proeprties access with access modifiers
8573 * iterators.cs: Modify Accessor constructor call based in the modified
8575 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8577 * expression.cs (StringConcat): Handle being called twice,
8578 as when we have a concat in a field init with more than two
8581 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8583 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8584 special case explicit implementations, we should always produce
8585 the .property or .event declaration.
8587 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8588 since it will not return correct data if people use this
8589 unresolved in the presence of using statements (see test-313).
8591 * class.cs (MethodData.Define): If we are an explicit interface
8592 implementation, set the method name to the full name of the
8593 interface plus the name of the method.
8595 Notice that using the method.MethodName.GetFullName() does not
8596 work, as it will only contain the name as declared on the source
8597 file (it can be a shorthand in the presence of using statements)
8598 and not the fully qualifed type name, for example:
8602 class D : ICloneable {
8603 object ICloneable.Clone () {
8607 Would produce a method called `ICloneable.Clone' instead of
8608 `System.ICloneable.Clone'.
8610 * namespace.cs (Alias.Resolve): Use GetPartialName.
8612 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8614 * cs-parser.jay: Add error 1055 report.
8616 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8618 * assign.cs (Assign.DoResolve): Only do the transform of
8619 assignment into a New if the types are compatible, if not, fall
8620 through and let the implicit code deal with the errors and with
8621 the necessary conversions.
8623 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8625 * cs-parser.jay: Add error 1031 report.
8627 * cs-tokenizer.cs: Add location for error 1038.
8629 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8631 * cs-parser.jay: Add error 1016 report.
8633 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8635 * cs-parser.jay: Add errors 1575,1611 report.
8637 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8639 * cs-parser.jay: Add error 1001 report.
8641 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8644 * attribute.cs (GetMarshal): Add method argument for
8645 caller identification.
8647 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8648 agument for GetMarshal and RuntimeMissingSupport.
8650 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8652 * attribute.cs (ExtractSecurityPermissionSet): Removed
8653 TypeManager.code_access_permission_type.
8655 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8657 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8659 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8660 for obsolete use of a variable here. Fixes regression on errors
8661 cs0619-25 and cs0619-26.
8663 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8665 Fix #62358, implemented security attribute encoding.
8667 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8668 Tests permitted SecurityAction for assembly or other types.
8669 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8670 data from SecurityPermissionAttribute to PermisionSet class.
8672 * class.cs (ApplyAttributeBuilder): Added special handling
8673 for System.Security.Permissions.SecurityAttribute based types.
8675 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8676 special handling for System.Security.Permissions.SecurityAttribute
8679 * enum.cs (ApplyAttributeBuilder): Added special handling
8680 for System.Security.Permissions.SecurityAttribute based types.
8682 * parameter.cs (ApplyAttributeBuilder): Added special handling
8683 for System.Security.Permissions.SecurityAttribute based types.
8685 * rootcontext.cs: Next 2 core types.
8687 * typemanager.cs (TypeManager.security_permission_attr_type):
8688 Built in type for the SecurityPermission Attribute.
8689 (code_access_permission_type): Build in type.
8691 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8693 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8694 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8695 all of this information into
8696 EmitContext.EmitCapturedVariableInstance.
8698 * codegen.cs (EmitCapturedVariableInstance): move here the
8699 funcionality of emitting an ldarg.0 in the presence of a
8700 remapping. This centralizes the instance emit code.
8702 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8703 then emit a load of this: it means that we have reached the
8704 topmost ScopeInfo: the one that contains the pointer to the
8705 instance of the class hosting the anonymous method.
8707 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8708 captures to the topmost CaptureContext.
8710 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8712 * expression.cs (LocalVariableReference): Move the knowledge about
8713 the iterators into codegen's EmitCapturedVariableInstance.
8715 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8717 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8718 all code paths return a value from an anonymous method (it is the
8719 same as the 161 error, but for anonymous methods).
8721 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8723 The introduction of anonymous methods in the compiler changed
8724 various ways of doing things in the compiler. The most
8725 significant one is the hard split between the resolution phase
8726 and the emission phases of the compiler.
8728 For instance, routines that referenced local variables no
8729 longer can safely create temporary variables during the
8730 resolution phase: they must do so from the emission phase,
8731 since the variable might have been "captured", hence access to
8732 it can not be done with the local-variable operations from the runtime.
8736 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8737 is a toplevel block.
8739 (ToplevelBlock): A new kind of Block, these are the blocks that
8740 are created by the parser for all toplevel method bodies. These
8741 include methods, accessors and anonymous methods.
8743 These contain some extra information not found in regular blocks:
8744 A pointer to an optional CaptureContext (for tracking captured
8745 local variables and parameters). A pointer to the parent
8748 (Return.Resolve): Catch missmatches when returning a value from an
8749 anonymous method (error 1662).
8750 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8753 (Break.Resolve): ditto.
8755 (SwitchLabel): instead of defining the labels during the
8756 resolution phase, we now turned the public ILLabel and ILLabelCode
8757 labels into methods called GetILLabelCode() and GetILLabel() that
8758 only define the label during the Emit phase.
8760 (GotoCase): Track the SwitchLabel instead of the computed label
8761 (its contained therein). Emit the code by using
8762 SwitchLabel.GetILLabelCode ().
8764 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8765 whether the Local has been captured or not.
8767 (LocalInfo.IsCaptured): New property, used to tell whether the
8768 local has been captured.
8770 * anonymous.cs: Vastly updated to contain the anonymous method
8773 The main classes here are: CaptureContext which tracks any
8774 captured information for a toplevel block and ScopeInfo used to
8775 track the activation frames for various local variables.
8777 Each toplevel block has an optional capture context associated
8778 with it. When a method contains an anonymous method both the
8779 toplevel method and the anonymous method will create a capture
8780 context. When variables or parameters are captured, they are
8781 recorded on the CaptureContext that owns them, for example:
8785 MyDelegate d = delegate {
8790 Here `a' will be recorded as captured on the toplevel
8791 CapturedContext, the inner captured context will not have anything
8792 (it will only have data if local variables or parameters from it
8793 are captured in a nested anonymous method.
8795 The ScopeInfo is used to track the activation frames for local
8796 variables, for example:
8798 for (int i = 0; i < 10; i++)
8799 for (int j = 0; j < 10; j++){
8800 MyDelegate d = delegate {
8805 At runtime this captures a single captured variable `i', but it
8806 captures 10 different versions of the variable `j'. The variable
8807 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8808 recorded on a child.
8810 The toplevel ScopeInfo will also track information like the `this'
8811 pointer if instance variables were referenced (this is necessary
8812 as the anonymous method lives inside a nested class in the host
8813 type of the method).
8815 (AnonymousMethod): Expanded to track the Toplevel, implement
8816 `AnonymousMethod.Compatible' to tell whether an anonymous method
8817 can be converted to a target delegate type.
8819 The routine now also produces the anonymous method content
8821 (AnonymousDelegate): A helper class that derives from
8822 DelegateCreation, this is used to generate the code necessary to
8823 produce the delegate for the anonymous method that was created.
8825 * assign.cs: API adjustments for new changes in
8826 Convert.ImplicitStandardConversionExists.
8828 * class.cs: Adjustments to cope with the fact that now toplevel
8829 blocks are of type `ToplevelBlock'.
8831 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8832 insteda of standard blocks.
8834 Flag errors if params arguments are passed to anonymous methods.
8836 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8837 `CurrentAnonymousMethod' which points to the current Anonymous
8838 Method. The variable points to the AnonymousMethod class that
8839 holds the code being compiled. It is set in the new EmitContext
8840 created for the anonymous method.
8842 (EmitContext.Phase): Introduce a variable and an enumeration to
8843 assist in enforcing some rules about when and where we are allowed
8844 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8845 only one that enfonces this right now).
8847 (EmitContext.HaveCaptureInfo): new helper method that returns
8848 whether we have a CapturedContext initialized.
8850 (EmitContext.CaptureVariable): New method used to register that a
8851 LocalInfo must be flagged for capturing.
8853 (EmitContext.CapturedParameter): New method used to register that a
8854 parameters must be flagged for capturing.
8856 (EmitContext.CapturedField): New method used to register that a
8857 field must be flagged for capturing.
8859 (EmitContext.HaveCapturedVariables,
8860 EmitContext.HaveCapturedFields): Return whether there are captured
8861 variables or fields.
8863 (EmitContext.EmitMethodHostInstance): This is used to emit the
8864 instance for the anonymous method. The instance might be null
8865 (static methods), this (for anonymous methods that capture nothing
8866 and happen to live side-by-side with the current method body) or a
8867 more complicated expression if the method has a CaptureContext.
8869 (EmitContext.EmitTopBlock): Routine that drives the emission of
8870 code: it will first resolve the top block, then emit any metadata
8871 and then emit the code. The split is done so that we can extract
8872 any anonymous methods and flag any captured variables/parameters.
8874 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8875 during this phase, the ILGenerator should not be used as labels
8876 and local variables declared here might not be accessible to any
8877 code that is part of an anonymous method.
8879 Exceptions to this include the temporary variables that are
8880 created by some statements internally for holding temporary
8883 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8886 (EmitContext.TemporaryReturn): This method is typically called
8887 from the Emit phase, and its the only place where we allow the
8888 ReturnLabel to be defined other than the EmitMeta. The reason is
8889 that otherwise we would have to duplicate a lot of logic in the
8890 Resolve phases of various methods that today is on the Emit
8893 (EmitContext.NeedReturnLabel): This no longer creates the label,
8894 as the ILGenerator is not valid during the resolve phase.
8896 (EmitContext.EmitThis): Extended the knowledge in this class to
8897 work in anonymous methods in addition to iterators.
8899 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8900 code is necessary on the stack to access the instance to a local
8901 variable (the variable will be accessed as a field).
8903 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8904 EmitContext.EmitAddressOfParameter): Routines to support
8905 parameters (not completed at this point).
8907 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8908 will also remove the parameters.
8910 * convert.cs (Convert): Define a `ConstantEC' which points to a
8911 null. This is just to prefity some code that uses
8912 ImplicitStandardConversion code and do not have an EmitContext
8915 The idea is to flag explicitly that at that point in time, it is
8916 known that the conversion will not trigger the delegate checking
8917 code in implicit conversions (which requires a valid
8920 Everywhere: pass new EmitContext parameter since
8921 ImplicitStandardConversionExists now requires it to check for
8922 anonymous method conversions.
8924 (Convert.ImplicitStandardConversionExists): If the type of an
8925 expression is the anonymous_method_type, and the type is a
8926 delegate, we invoke the AnonymousMethod.Compatible method to check
8927 whether an implicit conversion is possible.
8929 (Convert.ImplicitConversionStandard): Only do implicit method
8930 group conversions if the language level is not ISO_1.
8932 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8933 MethodInfo for the Invoke method. used by Delegate and
8936 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8937 method conversions if the target type is a delegate.
8939 Removed extra debugging nops.
8941 (LocalVariableReference): Turn the `local_info' into a public
8944 Add `prepared' field, the same hack used for FieldExprs to cope
8945 with composed assignments, as Local variables do not necessarily
8946 operate purely on the stack as they used to: they can be captured
8949 Add `temp' for a temporary result, like fields.
8951 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8953 It now copes with Local variables that are captured and emits the
8954 proper instance variable to load it from a field in the captured
8957 (ParameterReference.DoResolveBase): During the resolve phase,
8958 capture parameters if we are in an anonymous method.
8960 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8961 anonymous method, use the EmitContext helper routines to emit the
8962 parameter reference.
8964 * iterators.cs: Set RemapToProxy to true/false during the
8967 * parameters.cs (GetParameterByName): New helper method.
8969 * typemanager.cs (anonymous_method_type) a new type that
8970 represents an anonyous method. This is always an internal type,
8971 used as a fencepost to test against the anonymous-methodness of an
8974 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8976 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8978 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8980 2004-11-10 Martin Baulig <martin@ximian.com>
8982 * expression.cs (Invocation.BetterFunction): If two methods have
8983 equal parameter types, but only one of them is generic, the
8984 non-generic one wins.
8985 (New.DoResolve): Don't set `is_struct' to false if we're a generic
8986 instance; just use `Type.IsValueType' to determine whether
8987 something is a struct or not.
8988 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8989 so we can be called multiple times.
8991 2004-11-10 Martin Baulig <martin@ximian.com>
8993 * generic.cs (TypeParameter.DefineConstraints): New public method.
8994 (TypeParameter.CheckAccessLevel): Override this and return true.
8995 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8996 override ResolveType() anymore.
8997 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8999 2004-11-10 Martin Baulig <martin@ximian.com>
9001 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
9002 call DeclSpace.ResolveNestedType() on it.
9004 2004-11-10 Martin Baulig <martin@ximian.com>
9006 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
9007 non-null, call ParameterModifier() on it.
9009 2004-11-10 Martin Baulig <martin@ximian.com>
9012 (Iterators): Added `current_type' and `this_type' fields.
9013 (Iterators.DefineIterator): Create a new EmitContext and store it
9014 in `ec'; compute `this_type'.
9016 2004-11-10 Martin Baulig <martin@ximian.com>
9019 (TypeManager.IsPrivateAccessible): New public method.
9020 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
9022 2004-11-10 Martin Baulig <martin@ximian.com>
9024 * class.cs (TypeContainer.DefineType): Call
9025 TypeBuilder.DefineGenericParameters() before resolving the type
9027 (MethodData.parent_method): New protected field.
9028 (MethodData..ctor): Added `MethodInfo parent_method' argument.
9029 (MethodData.Define): Compute `parent_method'.
9032 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
9033 (MemberCore.GetClsCompliantAttributeValue): Likewise.
9034 (DeclSpace.ec): New protected field; store the EmitContext here.
9035 (DeclSpace.EmitContext): New public property.
9036 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
9037 (DeclSpace.ResolveNestedType): New public method.
9038 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
9039 (DeclSpace.NestedAccessible): Added `Type tb' argument.
9040 (DeclSpace.FamilyAccessible): Likewise.
9041 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
9042 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
9045 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
9048 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
9049 (Enum.Emit): Don't create a new EmitContext.
9051 2004-10-18 Martin Baulig <martin@ximian.com>
9053 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9054 `Type' directly, but call ResolveType() on it.
9055 (Catch.Resolve): Likewise.
9056 (Foreach.Resolve): Likewise.
9058 2004-10-18 Martin Baulig <martin@ximian.com>
9060 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9061 `Type' directly, but call ResolveType() on it.
9062 (Probe.DoResolve): Likewise.
9063 (ArrayCreation.LookupType): Likewise.
9064 (TypeOf.DoResolve): Likewise.
9065 (SizeOf.DoResolve): Likewise.
9067 2004-10-18 Raja R Harinath <rharinath@novell.com>
9069 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9072 2004-10-17 John Luke <john.luke@gmail.com>
9074 * class.cs (Operator.GetSignatureForError): use CSharpName
9076 * parameter.cs (Parameter.GetSignatureForError): Returns
9077 correct name even if was not defined.
9079 2004-10-13 Raja R Harinath <rharinath@novell.com>
9082 * class.cs (TypeContainer.EmitContext): New property.
9083 (DefineNestedTypes): Create an emitcontext for each part.
9084 (MethodCore.DoDefineParameters): Use container's emitcontext.
9085 Pass type array to InternalParameters.
9086 (MemberBase.DoDefine): Use container's emitcontext.
9087 (FieldMember.Define): Likewise.
9088 (Event.Define): Likewise.
9089 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9090 Pass type array to InternalParameters.
9091 (SetIndexerMethod.GetParameterInfo): Likewise.
9092 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9093 * delegate.cs (Define): Pass emitcontext to
9094 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9095 array to InternalParameters.
9096 * expression.cs (ParameterReference.DoResolveBase): Pass
9097 emitcontext to GetParameterInfo.
9098 (ComposedCast.DoResolveAsTypeStep): Remove check on
9099 ec.ResolvingTypeTree.
9100 * parameter.cs (Parameter.Resolve): Change argument to
9101 EmitContext. Use ResolveAsTypeTerminal.
9102 (Parameter.GetSignature): Change argument to EmitContext.
9103 (Parameters.ComputeSignature): Likewise.
9104 (Parameters.ComputeParameterTypes): Likewise.
9105 (Parameters.GetParameterInfo): Likewise.
9106 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9107 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9108 * support.cs (InternalParameters..ctor): Remove variant that takes
9110 * typemanager.cs (system_intptr_expr): New.
9111 (InitExpressionTypes): Initialize it.
9113 2004-10-12 Chris Toshok <toshok@ximian.com>
9115 * cs-parser.jay: fix location for try_statement and catch_clause.
9117 2004-10-18 Martin Baulig <martin@ximian.com>
9119 * class.cs (FieldMember.Define): Don't access the TypeExpr's
9120 `Type' directly, but call ResolveType() on it.
9121 (MemberBase.DoDefine): Likewise.
9123 * expression.cs (New.DoResolve): Don't access the TypeExpr's
9124 `Type' directly, but call ResolveType() on it.
9125 (ComposedCast.DoResolveAsTypeStep): Likewise.
9127 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9128 `Type' directly, but call ResolveType() on it.
9130 2004-10-17 John Luke <john.luke@gmail.com>
9132 * class.cs (Operator.GetSignatureForError): use CSharpName
9134 * parameter.cs (Parameter.GetSignatureForError): Returns
9135 correct name even if was not defined.
9137 2004-10-13 Raja R Harinath <rharinath@novell.com>
9140 * class.cs (TypeContainer.EmitContext): New property.
9141 (DefineNestedTypes): Create an emitcontext for each part.
9142 (MethodCore.DoDefineParameters): Use container's emitcontext.
9143 Pass type array to InternalParameters.
9144 (MemberBase.DoDefine): Use container's emitcontext.
9145 (FieldMember.Define): Likewise.
9146 (Event.Define): Likewise.
9147 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9148 Pass type array to InternalParameters.
9149 (SetIndexerMethod.GetParameterInfo): Likewise.
9150 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9151 * delegate.cs (Define): Pass emitcontext to
9152 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9153 array to InternalParameters.
9154 * expression.cs (ParameterReference.DoResolveBase): Pass
9155 emitcontext to GetParameterInfo.
9156 (ComposedCast.DoResolveAsTypeStep): Remove check on
9157 ec.ResolvingTypeTree.
9158 * parameter.cs (Parameter.Resolve): Change argument to
9159 EmitContext. Use ResolveAsTypeTerminal.
9160 (Parameter.GetSignature): Change argument to EmitContext.
9161 (Parameters.ComputeSignature): Likewise.
9162 (Parameters.ComputeParameterTypes): Likewise.
9163 (Parameters.GetParameterInfo): Likewise.
9164 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9165 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9166 * support.cs (InternalParameters..ctor): Remove variant that takes
9168 * typemanager.cs (system_intptr_expr): New.
9169 (InitExpressionTypes): Initialize it.
9171 2004-10-12 Chris Toshok <toshok@ximian.com>
9173 * cs-parser.jay: fix location for try_statement and catch_clause.
9175 2004-10-07 Raja R Harinath <rharinath@novell.com>
9177 More DeclSpace.ResolveType avoidance.
9178 * decl.cs (MemberCore.InUnsafe): New property.
9179 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
9180 with newly created EmitContext.
9181 (FieldMember.Define): Likewise.
9182 * delegate.cs (Delegate.Define): Likewise.
9183 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9184 only if normal name-lookup fails.
9185 (TypeExpr.DoResolve): Enable error-checking.
9186 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9187 (SizeOf.DoResolve): Likewise.
9188 (ComposedCast.DoResolveAsTypeStep): Likewise.
9189 (StackAlloc.DoResolve): Likewise.
9190 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9191 (Block.Unsafe): New property.
9192 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9193 (Unsafe): Set 'unsafe' flag of contained block.
9194 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9195 (Fixed.Resolve): Likewise.
9196 (Catch.Resolve): Likewise.
9197 (Using.ResolveLocalVariableDecls): Likewise.
9198 (Foreach.Resolve): Likewise.
9200 2004-10-05 John Luke <john.luke@gmail.com>
9202 * cs-parser.jay: add location to error CS0175
9204 2004-10-04 Miguel de Icaza <miguel@ximian.com>
9206 * ecore.cs (Expression.Constantity): Add support for turning null
9209 * const.cs (Const.Define): Allow constants to be reference types
9210 as long as the value is Null.
9212 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
9214 * namespace.cs (NamespaceEntry.Using): No matter which warning
9215 level is set, check if this namespace name has already been added.
9217 2004-10-03 Ben Maurer <bmaurer@ximian.com>
9219 * expression.cs: reftype [!=]= null should always use br[true,false].
9222 2004-10-03 Marek Safar <marek.safar@seznam.cz>
9225 * attribute.cs: Enum conversion moved to
9226 GetAttributeArgumentExpression to be applied to the all
9229 2004-10-01 Raja R Harinath <rharinath@novell.com>
9231 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9232 * class.c (TypeContainer.DefineType): Flag error if
9233 base types aren't accessible due to access permissions.
9234 * decl.cs (DeclSpace.ResolveType): Move logic to
9235 Expression.ResolveAsTypeTerminal.
9236 (DeclSpace.ResolveTypeExpr): Thin layer over
9237 Expression.ResolveAsTypeTerminal.
9238 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9239 Refactor code into NestedAccess. Use it.
9240 (DeclSpace.NestedAccess): New.
9241 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9242 argument to silence errors. Check access permissions.
9243 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9244 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9245 (Cast.DoResolve): Likewise.
9246 (New.DoResolve): Likewise.
9247 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9248 (TypeOf.DoResolve): Likewise.
9250 * expression.cs (Invocation.BetterConversion): Return the Type of
9251 the better conversion. Implement section 14.4.2.3 more faithfully.
9252 (Invocation.BetterFunction): Make boolean. Make correspondence to
9253 section 14.4.2.2 explicit.
9254 (Invocation.OverloadResolve): Update.
9255 (Invocation): Remove is_base field.
9256 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
9257 (Invocation.Emit): Likewise.
9259 2004-09-24 Marek Safar <marek.safar@seznam.cz>
9261 * cs-parser.jay: Reverted 642 warning fix.
9263 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9266 * decl.cs (FindMemberWithSameName): Indexer can have more than
9269 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9271 * expression.cs (LocalVariableReference.DoResolveLValue):
9272 Do not report warning 219 for out values.
9273 (EmptyExpression.Null): New member to avoid extra allocations.
9275 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9277 * cs-parser.jay: Fix wrong warning 642 report.
9279 * cs-tokenizer.cs (CheckNextToken): New helper;
9280 Inspect next character if is same as expected.
9282 2004-09-23 Martin Baulig <martin@ximian.com>
9284 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9285 (Convert.ImplicitReferenceConversionExists): Likewise.
9287 2004-11-09 Raja R Harinath <rharinath@novell.com>
9289 * Makefile (DISTFILES): Comment out a few missing files.
9291 2004-10-29 Raja R Harinath <rharinath@novell.com>
9293 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9294 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
9295 (gmcs.exe): Invoke bootstrap-libs.
9296 (clean-local): Clean the net_2_0_bootstrap profile too.
9297 (PROGRAM_INSTALL_DIR): New.
9298 (install-local): Use it.
9300 2004-10-13 Martin Baulig <martin@ximian.com>
9302 * generic.cs (TypeManager.InflatedConstraints): New nested class.
9303 (TypeParameter.DefineType): If we're a method type parameter and
9304 that method is overriding something, "inflate" its constraints.
9306 2004-10-12 Martin Baulig <martin@ximian.com>
9308 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9309 and have type arguments, create and resolve a ConstructedType.
9311 2004-10-12 Martin Baulig <martin@ximian.com>
9313 * decl.cs (MemberCache.FindMemberToOverride): Use
9314 TypeManager.IsEqual() to compare the parameters and Type.Equals()
9315 to compare the invocationType.
9317 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9318 When comparing two type parameters, only do the signature-only
9319 comparision for method type parameters.
9321 2004-10-11 Martin Baulig <martin@ximian.com>
9323 * report.cs: Don't make --fatal abort on warnings, we have
9324 -warnaserror for that.
9326 2004-10-11 Martin Baulig <martin@ximian.com>
9329 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9330 (TypeManager.IsEqual): Call ourself recursively instead of using
9333 2004-10-11 Martin Baulig <martin@ximian.com>
9335 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9336 on our own type parameters, not on the ones we inherit from a containing
9339 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9342 * generic.cs (TypeParameter.Define): We may only be called once.
9344 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9345 instead of TypeManager.IsEqual().
9347 2004-09-28 Martin Baulig <martin@ximian.com>
9350 (GenericConstraints.EffectiveBaseClass): New public property.
9351 (TypeParameter.GenericConstraints): New public property.
9352 (ConstructedType.CheckConstraints): Improved.
9354 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9355 (Convert.TypeParameterConversion): New private method; use this in
9356 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9357 for all conversions related to type parameters.
9359 2004-09-24 Martin Baulig <martin@ximian.com>
9361 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9362 type parameter conversions for type parameters which are known to
9365 2004-09-24 Martin Baulig <martin@ximian.com>
9367 * generic.cs (GenericConstraints): Added `IsReferenceType' and
9368 `IsValueType' properties.
9370 * support.cs (ReflectionConstraints): Use
9371 Type.GetGenericParameterConstraints() instead of the old hack.
9373 2004-09-24 Martin Baulig <martin@ximian.com>
9375 * generic.cs (GenericConstraints): Moved here and made it an
9378 * support.cs (GenericConstraints): Moved to generic.cs.
9380 2004-09-24 Martin Baulig <martin@ximian.com>
9383 (ReflectionConstraints): Un-nested this class and made it public.
9386 (TypeManager.GetTypeParameterConstraints): New public method.
9387 (TypeManager.HasConstructorConstraint): Use the attributes.
9389 2004-09-24 Martin Baulig <martin@ximian.com>
9391 * support.cs (GenericConstraints): Replaced `HasConstructor',
9392 `IsReferenceType' and `IsValueType' with `Attributes'.
9393 (ReflectionParameters.ReflectionConstraints): Removed the Create()
9394 method and made the .ctor public.
9396 * generic.cs (Constraints.Attributes): New public property.
9397 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9398 `IsReferenceType' -> `HasReferenceTypeConstraint' and
9399 `IsValueType' -> `HasValueTypeConstraint'.
9401 2004-09-23 Martin Baulig <martin@ximian.com>
9403 * generic.cs (Constraints): Reflect latest runtime changes.
9405 2004-09-23 Martin Baulig <martin@ximian.com>
9407 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9408 (Convert.ImplicitReferenceConversionExists): Likewise.
9410 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9412 * class.cs (Operator.Define): Add error 448 and 559 report.
9414 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9416 * class.cs (MemberBase.IsTypePermitted): New protected
9417 method for checking error CS0610.
9419 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9421 * class.cs (TypeContainer.HasExplicitLayout): New property
9422 Returns whether container has StructLayout attribute set Explicit.
9423 (FieldMember): New abstract class for consts and fields.
9424 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9425 (Field): Reuse FieldMember.
9427 * const.cs (Const): Reuse FieldMember.
9429 * rootcontext.cs: EmitConstants call moved to class.
9431 2004-09-22 Martin Baulig <martin@ximian.com>
9433 Marek and me just fixed one of our oldest bugs: #28562 :-)
9435 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9437 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9438 we're an EnumConstant, just return that.
9439 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9440 an EnumConstant. In this case, we need to use GetValueAsEnumType()
9441 to get the value which'll actually be written into the attribute.
9442 However, we have to use GetValue() to access the attribute's value
9445 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9447 * constant.cs (Constant.IsNegative): New abstract property
9450 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9451 (StackAlloc.DoResolve): Reused IsNegative.
9453 2004-09-22 Martin Baulig <martin@ximian.com>
9455 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9456 public method; like LookupTypeContainer, but also works for
9459 * report.cs (Report.SymbolRelatedToPreviousError): Use
9460 TypeManager.LookupGenericTypeContainer().
9462 2004-09-22 Martin Baulig <martin@ximian.com>
9464 Thanks to Peter Sestoft for this bug report.
9466 * expression.cs (Conditional): If both the `trueExpr' and the
9467 `falseExpr' is a NullLiteral, return a NullLiteral.
9469 2004-09-22 Martin Baulig <martin@ximian.com>
9471 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9472 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9473 for the "get_Current" call.
9475 2004-09-21 Martin Baulig <martin@ximian.com>
9477 * convert.cs (Convert.ImplicitReferenceConversion): When
9478 converting to an interface type, first check whether we're
9479 converting from a reference type.
9481 2004-09-14 Martin Baulig <martin@ximian.com>
9483 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9485 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9488 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9489 called and is obsolete then this member suppress message
9490 when call is inside next [Obsolete] method or type.
9492 * expression.cs: Use TestObsoleteMethodUsage member.
9494 2004-09-14 Martin Baulig <martin@ximian.com>
9496 * genericparser.cs: Removed.
9498 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9500 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9502 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9504 * attribute.cs (Attribute.Resolve): Add error 653 report.
9506 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9508 (Method.ApplyAttributeBuilder): Add error 685 report.
9509 (Operator.Define): Add error 564 report.
9511 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9513 * expression.cs (Invocation.DoResolve): Add error
9516 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9519 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9521 * class.cs (ConstructorInitializer.Resolve):
9522 Wrong error number (515->516).
9524 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9526 * class.cs (Indexer.Define): Add error 631 report.
9528 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9530 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9532 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9534 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9536 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9538 * cs-parser.jay: Added error CS0241 report.
9540 2004-09-10 Raja R Harinath <rharinath@novell.com>
9542 * cs-parser.jay (fixed_statement): Introduce a scope for the
9543 declaration in the 'fixed' statement.
9545 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9547 * cs-parser.jay: Added CS0230 error report.
9549 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9551 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9553 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9555 * expression.cs (Argument.Resolve): Added error CS0192 and
9558 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9560 C# 2.0 #pragma warning feature
9562 * cs-tokenizer.cs (PreProcessPragma): New method;
9563 Handles #pragma directive.
9565 * report.cs (WarningRegions): New class; Support
9566 class for #pragma warning directive. It tests whether
9567 warning is enabled for a given line.
9569 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9571 * const.cs: Add more descriptive error report, tahnks to
9574 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9576 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9578 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9580 * expression.cs: Apply patch from Ben: Remove dead code from
9581 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9582 as that code just threw an exception anwyays.
9584 * const.cs: Remove the call to the turnintoconstant, for details
9587 * literal.cs: The type of the null-literal is the null type; So
9588 we use a placeholder type (literal.cs:System.Null, defined here)
9591 * expression.cs (Conditional.DoResolve): Remove some old code that
9592 is no longer needed, conversions have been fixed.
9594 (ArrayCreationExpression.DoResolve): Return false if we fail to
9595 resolve the inner expression.
9597 2004-09-07 Raja R Harinath <rharinath@novell.com>
9600 * cs-parser.jay (delegate_declaration): Record a delegate
9601 declaration as a type declaration.
9602 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9604 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9606 * parameter.cs: Do not crash if the type can not be resolved.
9608 * expression.cs: Report errors with unsafe pointers, fixes #64896
9610 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9612 * expression.cs: Pointer arith always needs to do a conv.i
9613 if the operand is a long. fix 65320
9615 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9617 Fixed cs0619-37.cs, cs0619-38.cs
9619 * enum.cs (GetObsoleteAttribute): Removed.
9621 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9622 on Enum member is double staged. The first is tested member
9625 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9627 Fixed #56986, #63631, #65231
9629 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9630 adds member to name container.
9631 (TypeContainer.AddToTypeContainer): New method, adds type to
9633 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9634 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9635 AddOperator): Simplified by reusing AddToMemberContainer.
9636 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9638 (Method.CheckForDuplications): Fixed implementation to test all
9640 (MemberBase): Detection whether member is explicit interface
9641 implementation is now in constructor.
9642 (MemberBase.UpdateMemberName): Handles IndexerName.
9643 (Accessor): Changed to keep also location information.
9644 (AbstractPropertyEventMethod): Is derived from MemberCore.
9645 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9646 will be emited or not.
9647 (PropertyBase.AreAccessorsDuplicateImplementation):
9648 Tests whether accessors are not in collision with some method.
9649 (Operator): Is derived from MethodCore to simplify common
9652 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9654 (DeclSpace.AddToContainer): Adds the member to defined_names
9655 table. It tests for duplications and enclosing name conflicts.
9657 * enum.cs (EnumMember): Clean up to reuse the base structures
9659 2004-09-03 Martin Baulig <martin@ximian.com>
9661 Merged latest changes into gmcs. Please keep this comment in
9662 here, it makes it easier for me to see what changed in MCS since
9663 the last time I merged.
9665 2004-09-03 Martin Baulig <martin@ximian.com>
9667 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9668 into TypeContainer, to make partial classes work again.
9670 2004-09-03 Martin Baulig <martin@ximian.com>
9672 * rootcontext.cs (RootContext.V2): Removed.
9674 2004-03-23 Martin Baulig <martin@ximian.com>
9676 * expression.cs (Invocation.OverloadResolve): Added `bool
9677 may_fail' argument and use it instead of the Location.IsNull() hack.
9679 2004-09-09 Martin Baulig <martin@ximian.com>
9681 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9683 2004-09-09 Martin Baulig <martin@ximian.com>
9685 * generic.cs (TypeParameter.DefineType): Added support for
9686 explicit interface methods.
9688 2004-09-09 Martin Baulig <martin@ximian.com>
9690 * README.Changes: New document. Started to list important changes
9691 between MCS and GMCS here.
9693 2004-09-08 Martin Baulig <martin@ximian.com>
9696 (TypeContainer.CheckRecursiveDefinition): New protected method.
9697 (TypeContainer.DefineType): Move the CS0146 check into
9698 CheckRecursiveDefinition().
9700 2004-09-06 Martin Baulig <martin@ximian.com>
9702 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9703 types for the constructor constraint.
9705 2004-09-03 Martin Baulig <martin@ximian.com>
9707 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9708 into TypeContainer, to make partial classes work again.
9710 2004-09-03 Martin Baulig <martin@ximian.com>
9712 * rootcontext.cs (RootContext.V2): Removed.
9714 2004-03-23 Martin Baulig <martin@ximian.com>
9716 * expression.cs (Invocation.OverloadResolve): Added `bool
9717 may_fail' argument and use it instead of the Location.IsNull() hack.
9719 2004-09-03 Martin Baulig <martin@ximian.com>
9721 Merged latest changes into gmcs. Please keep this comment in
9722 here, it makes it easier for me to see what changed in MCS since
9723 the last time I merged.
9725 2004-09-03 Raja R Harinath <rharinath@novell.com>
9728 * expression.cs (BetterConversion): Don't allow either conversion
9729 to be null. Remove redundant implicit conversion test when 'q ==
9730 null' -- when this function is invoked, we already know that the
9731 implicit conversion exists.
9732 (BetterFunction): Assume that 'best' is non-null. Remove
9733 redundant reimplementation of IsApplicable when 'best' is null.
9734 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9735 number of arguments.
9736 (IsAncestralType): Extract from OverloadResolve.
9737 (OverloadResolve): Make robust to the MethodGroupExpr being
9738 unsorted. Implement all the logic of Section 14.5.5.1, and
9739 support overloading of methods from multiple applicable types.
9740 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9742 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9743 (RealError, Warning): Append type of report to related symbol.
9745 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9747 * enum.cs: Fixed CLS-Compliance checks for enum members.
9748 Error tests cs3008-8.cs, cs3014-8.cs
9750 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9752 Fixed bug #62342, #63102
9753 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9754 like ImplementMethod.
9756 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9758 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9761 2004-09-02 Martin Baulig <martin@ximian.com>
9763 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9764 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9767 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9769 C# 2.0 Static classes implemented
9771 * class.cs (TypeContainer): instance_constructors,
9772 initialized_fields, initialized_static_fields,
9773 default_constructor, base_inteface_types are protected to be
9774 accessible from StaticClass.
9775 (TypeContainer.DefineDefaultConstructor): New virtual method
9776 for custom default constructor generating
9777 (StaticClass): New class to handle "Static classes" feature.
9779 * cs-parser.jay: Handle static keyword on class like instance
9782 * driver.cs: Added "/langversion" command line switch with two
9783 options (iso-1, default).
9785 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9787 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9789 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9791 * delegate.cs: Style.
9793 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9795 * delegate.cs: Add seperate instance expr field for miguel.
9797 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9799 * PointerArithmetic (Resolve): make sure we are not doing
9800 pointer arith on void*. Also, make sure we are resolved
9801 by not setting eclass until resolve.
9803 All callers: Make sure that PointerArithmetic gets resolved.
9805 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9807 * ArrayCreation (LookupType): If the type does not resolve
9808 to an array, give an error.
9810 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9812 * statement.cs (Try.Resolve): Fixed bug #64222
9814 2004-08-27 Martin Baulig <martin@ximian.com>
9817 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9820 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9822 * ecore.cs (Constantify): Get underlying type via
9823 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9824 Windows in special cases.
9826 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9828 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9829 for obtaining also private methods.
9830 (GetRemoveMethod): Used GetRemoveMethod (true)
9831 for obtaining also private methods.
9833 2004-09-02 Martin Baulig <martin@ximian.com>
9835 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9836 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9839 2004-08-27 Martin Baulig <martin@ximian.com>
9842 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9845 2004-08-25 Martin Baulig <martin@ximian.com>
9847 * support.cs (ReflectionParameters..ctor): If this is a generic
9848 method, retrieve and store its type parameters.
9849 (InternalParameters..ctor): Added `TypeParameter[]' argument.
9850 (ReflectionParameters.GenericConstraints): The argument specifies
9851 the type parameter, not the method parameter.
9852 (InternalParameters.GenericConstraints): Likewise.
9854 * generic.cs (TypeParameter.DefineType): Correctly handle
9855 constraints wrt. generic methods in interfaces and their
9858 2004-08-24 Martin Baulig <martin@ximian.com>
9860 * generic.cs (TypeParameter.IsSubclassOf): New public method.
9861 (Constraints.IsSubclassOf): New internal method.
9863 * typemanager.cs (TypeManager.FindMembers): Added special support
9864 for GenericTypeParameterBuilder's.
9865 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9868 2004-08-24 Martin Baulig <martin@ximian.com>
9871 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9872 this for accessibility checks.
9873 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9874 IsNestedFamilyAccessible.
9875 (TypeManager.IsSubclassOf): New method, do what the name actually
9878 2004-08-24 Martin Baulig <martin@ximian.com>
9880 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9881 as a SimpleName, include the generic arity.
9883 2004-08-24 Martin Baulig <martin@ximian.com>
9885 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9886 MethodAttributes.HideBySig for operators.
9888 2004-08-23 Martin Baulig <martin@ximian.com>
9890 Back to the old error reporting system :-)
9892 * report.cs (Message): Removed.
9893 (Report.MessageData, ErrorData, WarningData): Removed.
9894 (Report.Error, Warning): Back to the old system.
9896 2004-08-23 Martin Baulig <martin@ximian.com>
9898 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9900 * class.cs (TypeContainer.ParentContainer): New public virtual
9901 method; replaces the explicit interface implementation.
9902 (ClassPart.ParentContainer): Override.
9904 2004-08-23 Martin Baulig <martin@ximian.com>
9906 * statement.cs (Switch): Added support for constant switches; see
9907 #59428 or test-285.cs.
9909 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9912 * statement.cs (GetEnumeratorFilter): Removed useless
9913 logic because C# specs is strict. GetEnumerator must be
9916 2004-08-22 Martin Baulig <martin@ximian.com>
9918 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9919 a switch and may break, reset the barrier. Fixes #59867.
9921 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9923 CLS-Compliance speed up (~5% for corlib)
9925 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9926 New method. Tests container for CLS-Compliant names
9928 * class.cs (TypeContainer.VerifyClsName): New method.
9929 Checks whether container name is CLS Compliant.
9930 (Constructor): Implements IMethodData.
9932 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9933 low-case table for CLS Compliance test.
9934 (MemberCache.VerifyClsParameterConflict): New method.
9935 Checks method parameters for CS3006 error.
9937 * enum.cs (EnumMember): Is derived from MemberCore.
9938 (Enum.VerifyClsName): Optimized for better performance.
9940 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9942 * report.cs: Renamed Error_T to Error and changed all
9945 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9947 * class.cs (TypeContainer.IndexerArrayList): New inner class
9948 container for indexers.
9949 (TypeContainer.DefaultIndexerName): New constant for default
9950 indexer name. Replaced all "Item" with this constant.
9951 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9953 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9954 DefaultMemberAttribute constructor.
9956 2004-08-05 Martin Baulig <martin@ximian.com>
9958 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9961 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9963 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9964 multi platforms problem.
9966 * compiler.csproj: Included shared files.
9968 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9970 Fix bug 60333, 55971 in the more general way
9971 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9972 Added arg_type argument for constant conversion.
9973 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9975 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9978 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9979 OperatorArrayList, MethodCoreArrayList for typecontainer
9980 containers. Changed class member types to these new types.
9981 (MethodArrayList.DefineMembers): Added test for CS0659.
9983 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9985 * cfold.cs: Synchronize the folding with the code in expression.cs
9986 Binary.DoNumericPromotions for uint operands.
9988 * attribute.cs: Revert patch from Raja, it introduced a regression
9989 while building Blam-1.2.1 (hard to isolate a test case).
9991 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9995 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9997 (MethodCore.parent_method): New member. The method we're overriding
9998 if this is an override method.
9999 (MethodCore.CheckBase): Moved from Method class and made common.
10000 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10002 (MethodCore.CheckForDuplications): New abstract method. For custom
10003 member duplication search in a container
10004 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10005 method and its return type.
10006 (Event.conflict_symbol): New member. Symbol with same name in the
10010 (MemberCache.FindMemberWithSameName): New method. The method
10011 is looking for conflict with inherited symbols.
10013 2004-08-04 Martin Baulig <martin@ximian.com>
10015 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10017 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10019 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10021 * report.cs (Message): New enum for better error, warning reference in
10023 (MessageData): New inner abstract class. It generally handles printing of
10024 error and warning messages.
10025 Removed unused Error, Warning, Message methods.
10027 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10029 Fix for cs0592-8.cs test
10031 (Attributable.ValidAttributeTargets): Made public.
10032 (Attribute.ExplicitTarget): New member for explicit target value.
10033 (Attribute.CheckTargets): Now we translate explicit attribute
10034 target to Target here.
10036 2004-08-03 Ben Maurer <bmaurer@ximian.com>
10038 * ecore.cs (MethodGroupExpr): new IsBase property.
10040 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10042 * delegate.cs (DelegateCreation): store a MethodGroupExpr
10043 rather than an instance expr.
10045 (DelegateCreation.Emit): Use the method group rather than
10046 the instance expression. Also, if you have base.Foo as the
10047 method for a delegate, make sure to emit ldftn, not ldftnvirt.
10049 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
10051 (NewDelegate.DoResolve): Only check for the existance of Invoke
10052 if the method is going to be needed. Use MethodGroupExpr.
10054 (NewDelegate.Emit): Remove, DelegateCreation implements this.
10056 * expression.cs: For pointer arith., make sure to use
10057 the size of the type, not the size of the pointer to
10060 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10063 * class.cs (Class): Added error CS0502 test.
10065 2004-08-03 John Luke <jluke@cfl.rr.com>
10066 Raja R Harinath <rharinath@novell.com>
10069 * attribute.cs (Attribute.complained_before): New flag.
10070 (Attribute.ResolveType, Attribute.Resolve),
10071 (Attribute.DefinePInvokeMethod): Set it.
10072 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10074 2004-08-03 Martin Baulig <martin@ximian.com>
10076 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10077 use a user-defined operator; we still need to do numeric
10078 promotions in case one argument is a builtin type and the other
10079 one has an implicit conversion to that type. Fixes #62322.
10081 2004-08-18 Martin Baulig <martin@ximian.com>
10083 * class.cs (Method.Define): Use the correct method name when
10084 creating the MethodBuilder for a generic method.
10086 2004-08-17 Martin Baulig <martin@ximian.com>
10088 * generic.cs (Constraints): Support type parameter constraints.
10090 2004-08-16 Martin Baulig <martin@ximian.com>
10092 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
10093 (Token.GENERIC_DIMENSION): New token; this is returned if we
10094 encounter an unbound generic type in a typeof() expression.
10096 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
10097 this token is only generated while parsing a typeof() expression.
10098 (typeof_expression): Removed the old unbound_type hack.
10100 * generic.cs (TypeArguments.IsUnbound): New public property.
10102 * decl.cs (MemberName): Added support for unbound types.
10104 2004-08-14 Martin Baulig <martin@ximian.com>
10107 (TypeManager.IsEqualGenericInstance): New static method.
10108 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
10109 just used to check accessibility, so follow the rules of 26.1.6.
10111 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
10112 ConstructedType instead of a TypeExpression if we have type arguments.
10114 * cs-parser.jay (typeof_expression): Support unbound generic types.
10116 * ecore.cs (UnboundTypeExpression): New public class.
10118 2004-08-12 Martin Baulig <martin@ximian.com>
10120 * typemanager.cs (TypeManager.IsNestedChildOf): Use
10121 TypeManager.IsEqual() rather than `=='.
10123 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
10124 generic instances as well.
10126 2004-08-12 Martin Baulig <martin@ximian.com>
10128 * expression.cs (Invocation.InferType): We can only infer method
10129 type parameters. Fixes #62647.
10131 2004-08-11 Martin Baulig <martin@ximian.com>
10133 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
10134 before resolving the base classes.
10136 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10138 * Makefile: install .mdb file too.
10140 2004-08-05 Martin Baulig <martin@ximian.com>
10142 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
10143 initializer, the current type is just the TypeBuilder, not the
10144 instantiated generic type.
10145 (FieldExpr.IsFieldInitializer): New public property.
10147 2004-08-04 Martin Baulig <martin@ximian.com>
10149 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10151 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10153 2004-08-03 Martin Baulig <martin@ximian.com>
10155 * class.cs (MethodData.Define): If we're an explicit
10156 implementation, remove the generic arity from the type name.
10158 2004-08-03 Martin Baulig <martin@ximian.com>
10160 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10161 use a user-defined operator; we still need to do numeric
10162 promotions in case one argument is a builtin type and the other
10163 one has an implicit conversion to that type. Fixes #62322.
10165 2004-08-02 Martin Baulig <martin@ximian.com>
10167 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10168 `TypeExpr[]' array.
10169 (TypeContainer.GetClassBases): Return the unexpanded list of
10170 interfaces; we expand them later.
10171 (TypeContainer.DefineType): After creating the TypeBuilder, call
10172 TypeManager.ExpandInterfaces() to get an expanded and resolved
10173 list of interfaces.
10175 * ecore.cs (TypeExpr.GetInterfaces): Removed
10177 * generics.cs (Constraints.InterfaceConstraints): Remove.
10178 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10179 register the interface constraints.
10182 (TypeManager.AddUserType): Removed the `ifaces' argument.
10183 (TypeManager.AddTypeParameter): Likewise.
10184 (TypeManager.AddUserInterface): Removed, was unused.
10185 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10186 `TypeExpr[]' array for the interfaces.
10187 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10188 has been defined, returns a list of the resolved interfaces types.
10189 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10190 (TypeManager.GetExplicitInterfaces): Likewise.
10192 2004-08-02 Martin Baulig <martin@ximian.com>
10194 * expression.cs (Invocation.EmitCall): If we're invoking a method
10195 on a type parameter, use the new `Constrained' prefix opcode.
10197 2004-08-02 Martin Baulig <martin@ximian.com>
10199 * statement.cs (LocalInfo.Flags): Added `IsThis'.
10200 (LocalInfo.IsThis): New public property.
10201 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10203 2004-08-01 Martin Baulig <martin@ximian.com>
10205 * class.cs (TypeContainer.GetClassBases): Don't set the default
10206 here since we may get called from GetPartialBases().
10207 (TypeContainer.DefineType): If GetClassBases() didn't return a
10208 parent, use the default one.
10210 2004-07-30 Martin Baulig <martin@ximian.com>
10212 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10214 * class.cs (SourceMethod): New public class, derive from the
10215 symbol writer's ISourceMethod.
10216 (Method): Use the new symbol writer API.
10218 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10219 as argument and use the new symbol writer.
10222 (SourceFile): Implement the symbol writer's ISourceFile.
10223 (Location.SymbolDocument): Removed.
10224 (Location.SourceFile): New public property.
10226 * symbolwriter.cs: Use the new symbol writer API.
10228 2004-07-30 Raja R Harinath <rharinath@novell.com>
10230 * Makefile (install-local): Remove. Functionality moved to
10233 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
10235 * Makefile: Install mcs.exe.config file together with mcs.exe.
10236 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10237 correct runtime version.
10239 2004-07-25 Martin Baulig <martin@ximian.com>
10242 (TypeContainer.RegisterOrder): Removed, this was unused.
10243 (TypeContainer, interface_order): Removed.
10244 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10245 TypeContainer as argument since we can also be called with a
10246 `PartialContainer' for a partial class/struct/interface.
10247 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10248 of checking whether we're an `Interface' - we could be a
10249 `PartialContainer'.
10250 (PartialContainer.Register): Override; call
10251 AddClass()/AddStruct()/AddInterface() on our parent.
10253 * cs-parser.jay (interface_member_declaration): Add things to the
10254 `current_container', not the `current_class'.
10256 * rootcontext.cs (RegisterOrder): The overloaded version which
10257 takes an `Interface' was unused, removed.
10259 * typemanager.cs (TypeManager.LookupInterface): Return a
10260 `TypeContainer', not an `Interface'.
10261 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10262 contain a `PartialContainer' for an interface, so check it's
10263 `Kind' to figure out what it is.
10265 2004-07-25 Martin Baulig <martin@ximian.com>
10267 * class.cs (Class.DefaultTypeAttributes): New public constant.
10268 (Struct.DefaultTypeAttributes): Likewise.
10269 (Interface.DefaultTypeAttributes): Likewise.
10270 (PartialContainer.TypeAttr): Override this and add the
10271 DefaultTypeAttributes.
10273 2004-07-25 Martin Baulig <martin@ximian.com>
10275 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10276 we can just use the `Parent' field instead.
10278 2004-07-25 Martin Baulig <martin@ximian.com>
10280 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10282 2004-07-25 Martin Baulig <martin@ximian.com>
10284 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10285 our parts before defining any methods.
10286 (TypeContainer.VerifyImplements): Make this virtual.
10287 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10288 on our PartialContainer.
10290 2004-07-25 Martin Baulig <martin@ximian.com>
10292 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10294 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10295 argument, we can just use the `Parent' field instead.
10298 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10299 (MemberBase.DoDefine): Likewise.
10301 2004-07-24 Martin Baulig <martin@ximian.com>
10303 * decl.cs (MemberCore.Parent): New public field.
10304 (DeclSpace.Parent): Moved to MemberCore.
10306 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10307 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10309 (FieldBase, Field, Operator): Likewise.
10310 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10311 (EventField, Event): Likewise.
10313 2004-07-23 Martin Baulig <martin@ximian.com>
10315 * class.cs (PartialContainer): New public class.
10316 (ClassPart): New public class.
10317 (TypeContainer): Added support for partial classes.
10318 (TypeContainer.GetClassBases): Splitted some of the functionality
10319 out into GetNormalBases() and GetPartialBases().
10321 * cs-tokenizer.cs (Token.PARTIAL): New token.
10322 (Tokenizer.consume_identifier): Added some hacks to recognize
10323 `partial', but only if it's immediately followed by `class',
10324 `struct' or `interface'.
10326 * cs-parser.jay: Added support for partial clases.
10328 2004-07-23 Martin Baulig <martin@ximian.com>
10330 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10331 a `DeclSpace' and also made it readonly.
10332 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10333 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10334 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10336 * cs-parser.jay: Pass the `current_class', not the
10337 `current_container' (at the moment, this is still the same thing)
10338 to a new Method, Property, Event, Indexer or Constructor.
10340 2004-07-23 Martin Baulig <martin@ximian.com>
10342 * cs-parser.jay (CSharpParser): Added a new `current_class' field
10343 and removed the `current_interface' one.
10344 (struct_declaration, class_declaration, interface_declaration):
10345 Set `current_class' to the newly created class/struct/interface;
10346 set their `Bases' and call Register() before parsing their body.
10348 2004-07-23 Martin Baulig <martin@ximian.com>
10350 * class.cs (Kind): New public enum.
10351 (TypeContainer): Made this class abstract.
10352 (TypeContainer.Kind): New public readonly field.
10353 (TypeContainer.CheckDef): New public method; moved here from
10355 (TypeContainer.Register): New public abstract method.
10356 (TypeContainer.GetPendingImplementations): New public abstract
10358 (TypeContainer.GetClassBases): Removed the `is_class' and
10359 `is_iface' parameters.
10360 (TypeContainer.DefineNestedTypes): Formerly known as
10362 (ClassOrStruct): Made this class abstract.
10364 * tree.cs (RootTypes): New public type.
10366 2004-07-20 Martin Baulig <martin@ximian.com>
10368 * tree.cs (Tree.RecordNamespace): Removed.
10369 (Tree.Namespaces): Removed.
10371 * rootcontext.cs (RootContext.IsNamespace): Removed.
10373 * cs-parser.jay (namespace_declaration): Just create a new
10374 NamespaceEntry here.
10376 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
10378 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10379 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10380 entry to make sure it runs in the correct runtime version.
10382 2004-07-18 Martin Baulig <martin@ximian.com>
10384 * generic.cs (ConstructedType.CheckConstraints): Improved
10385 constraints checking.
10387 2004-07-18 Martin Baulig <martin@ximian.com>
10389 * expression.cs (Invocation.BetterMethod): Call
10390 TypeManager.TypeToCoreType() on all types and removed my previous
10391 hack; we're already doig the right thing here.
10393 2004-07-17 Martin Baulig <martin@ximian.com>
10395 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10397 2004-07-16 Martin Baulig <martin@ximian.com>
10399 * iterators.cs: Added generics support.
10401 2004-07-16 Martin Baulig <martin@ximian.com>
10403 * iterators.cs: Rewrote this. We're now using one single Proxy
10404 class for both the IEnumerable and the IEnumerator interface and
10405 `Iterator' derives from Class so we can use the high-level API.
10407 * class.cs (TypeContainer.AddIterator): New method.
10408 (TypeContainer.DoDefineType): New protected virtual method, which
10409 is called from DefineType().
10410 (TypeContainer.DoDefineMembers): Call DefineType() and
10411 DefineMembers() on all our iterators.
10412 (TypeContainer.Emit): Call Emit() on all our iterators.
10413 (TypeContainer.CloseType): Call CloseType() on all our iterators.
10415 * codegen.cs (EmitContext.CurrentIterator): New public field.
10417 2004-07-15 Martin Baulig <martin@ximian.com>
10420 (TypeManager.not_supported_exception_type): New type.
10422 2004-07-14 Martin Baulig <martin@ximian.com>
10425 (TypeManager.generic_ienumerable_type): New type.
10426 (TypeManager.generic_ienumerator_type): New type.
10429 (RootContext.interfaces_first_stage): Added
10430 "System.Collections.Generic.IEnumerator`1" and
10431 "System.Collections.Generic.IEnumerable`1".
10433 2004-07-14 Martin Baulig <martin@ximian.com>
10435 * iterators.cs: Use real error numbers.
10437 2004-07-14 Martin Baulig <martin@ximian.com>
10439 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10440 requires this to be a System.Collection.IEnumerable and not a
10441 class implementing that interface.
10442 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
10444 2004-07-13 Marek Safar <marek.safar@seznam.cz>
10446 * class.cs: Fixed previous fix, it broke some error tests.
10448 2004-07-12 Martin Baulig <martin@ximian.com>
10450 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10453 2004-07-14 Martin Baulig <martin@ximian.com>
10455 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10456 an exclamation mark (!) for the generic arity to reflect the
10457 latest spec changes; ie. use "System.Collections.Generic.IList`1".
10459 2004-07-13 Martin Baulig <martin@ximian.com>
10461 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10462 specifiers being part of a type argument.
10464 2004-07-13 Martin Baulig <martin@ximian.com>
10466 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10467 name for generic types.
10469 2004-07-13 Martin Baulig <martin@ximian.com>
10471 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10474 2004-07-09 Miguel de Icaza <miguel@ximian.com>
10476 * assign.cs (LocalTemporary): Add new argument: is_address,If
10477 `is_address' is true, then the value that we store is the address
10478 to the real value, and not the value itself.
10480 * ecore.cs (PropertyExpr): use the new local temporary
10481 stuff to allow us to handle X.Y += z (where X is a struct)
10483 2004-07-08 Martin Baulig <martin@ximian.com>
10485 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10486 not always return, just like we're doing in Using.Resolve().
10488 2004-07-07 Miguel de Icaza <miguel@ximian.com>
10490 * cs-parser.jay (fixed_statement): flag this as Pinned.
10492 2004-07-06 Miguel de Icaza <miguel@ximian.com>
10494 * typemanager.cs (TypeManager): Removed MakePinned method, this
10495 mechanism is replaced with the .NET 2.x compatible mechanism of
10496 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10498 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
10499 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10500 `IsFixed' property which has a different meaning.
10502 2004-07-02 Raja R Harinath <rharinath@novell.com>
10504 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10505 visible from inside a nested class, not just the names of the
10506 immediately enclosing class.
10507 Fix for bug #60730.
10509 2004-06-24 Raja R Harinath <rharinath@novell.com>
10511 * expression.cs (BetterConversion): Remove buggy special-case
10512 handling of "implicit constant expression conversions". At this
10513 point, we already know that the conversion is possible -- we're
10514 only checking to see which is better.
10516 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10518 * cs-parser.jay: Added error CS0210 test.
10520 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10522 * cs-parser.jay: Added error CS0134 test.
10524 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10527 * cs-parser.jay: Added error CS0145 test.
10529 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10531 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10533 2004-06-23 Ben Maurer <bmaurer@ximian.com>
10535 * expression.cs (StackAlloc.Resolve): The argument may not
10536 be a constant; deal with this case.
10538 2004-06-23 Marek Safar <marek.safar@seznam.cz>
10540 * attribute.cs (IndexerName_GetIndexerName): Renamed to
10541 GetIndexerAttributeValue.
10542 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10544 * class.cs (Indexer.Define): Added error tests for CS0415,
10547 2004-06-23 Miguel de Icaza <miguel@ximian.com>
10549 * attribute.cs (Attribute.Resolve): Keep field code in sync with
10552 2004-06-23 Martin Baulig <martin@ximian.com>
10554 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10555 neither return nor throw, reset the barrier as well. Fixes #60457.
10557 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
10559 * class.cs : EventAttributes is now set to None by default.
10560 This fixes bug #60459.
10562 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10565 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10566 Don't throw exception but return null (it's sufficient now).
10568 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10570 * typemanager.cs (GetArgumentTypes): Faster implementation.
10572 2004-06-18 Martin Baulig <martin@ximian.com>
10574 * attribute.cs (Attribute.Resolve): Check whether we're an
10575 EmptyCast which a Constant child. Fixes #60333.
10577 2004-06-17 Ben Maurer <bmaurer@ximian.com>
10579 * statement.cs (EmitCollectionForeach): Account for the fact that
10580 not all valuetypes are in areas which we can take the address of.
10581 For these variables, we store to a temporary variable. Also, make
10582 sure that we dont emit a `callvirt' on a valuetype method.
10584 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10586 * expression.cs (StackAlloc.DoReSolve): Added test for
10587 negative parameter (CS0247).
10589 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10592 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10594 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10597 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10600 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10602 Fix bug #58254 & cs1555.cs, cs1556.cs
10603 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10605 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10607 * cs-parser.jay: Added error CS1669 test for indexers.
10609 2004-06-18 Martin Baulig <martin@ximian.com>
10611 * generics.cs (GenericMethod.ctor): Don't take an Attributes
10612 argument. Fixes #60441.
10614 2004-06-16 Ben Maurer <bmaurer@ximian.com>
10615 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10616 The name needs to have the actual name of the method in order
10617 for other tests (such as the one in OverloadResolve for Invoke
10618 on a delegate) to work. As well, it does not really help
10619 error reporting because the method group had multiple methods.
10620 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10621 Make profiling work.
10623 2004-06-13 Martin Baulig <martin@ximian.com>
10625 * cs-parser.jay: Don't allow generic attributes.
10627 2004-06-13 Martin Baulig <martin@ximian.com>
10629 * class.cs (MemberBase.DoDefineBase): New protected method.
10630 (MemberBase.DoDefine): Compute the `flags' in the new
10631 DoDefineBase() which must be called first.
10632 (Method.Define): Call DoDefineBase() first so we have the flags
10633 when defining the generic method.
10635 * cs-parser.jay (interface_method_declaration): Support generic methods.
10637 2004-06-13 Martin Baulig <martin@ximian.com>
10639 * decl.cs (TypeName): Removed.
10640 (MemberName): Removed TypeName and MemberNow; now we just have
10643 * cs-parser.jay: Don't distinguish between type arguments and type
10644 parameters in the grammar and simplified the rules a bit. The
10645 reduce/reduce conflicts are now gone (except the one we inherited
10648 2004-06-11 Martin Baulig <martin@ximian.com>
10650 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10651 call this twice: for params and varargs methods.
10653 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10656 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10658 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10660 * attribute.cs (Attribute.GetValidTargets): Made public.
10663 (AbstractPropertyEventMethod): New class for better code sharing.
10664 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10666 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10668 2004-06-09 Martin Baulig <martin@ximian.com>
10670 * cs-parser.jay: Removed a reduce/reduce conflict.
10672 2004-06-03 Martin Baulig <martin@ximian.com>
10674 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10675 GetSimpleName() and return a SimpleName.
10677 * ecore.cs (SimpleName.Arguments): New public field.
10678 (SimpleName): Added overloaded ctor which takes an additional
10679 TypeArguments argument.
10680 (SimpleName.SimpleNameResolve): Added support for generic methods.
10681 (MethodGroupExpr.ResolveGeneric): New public method. The code was
10682 formerly in MemberAccess.DoResolve(), but we also need it in
10683 SimpleNameResolve().
10685 * expression.cs (MemberAccess.DoResolve): Use the new
10686 MethodGroupExpr.ResolveGeneric().
10688 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10690 * decl.cs: If possible, use lookuptypedirect here. We can only do
10691 this if there is no `.' after the namespace. Avoids using
10692 LookupType, which does lots of slow processing.
10693 (FindNestedType) New method, does what it says :-).
10694 * namespace.cs: use LookupTypeDirect.
10695 * rootcontext.cs: use membercache, if possible.
10696 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10698 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10701 According to the spec,
10703 In a member access of the form E.I, if E is a single identifier,
10704 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10705 field, property, localvariable, or parameter with the same type as
10706 the meaning of E as a type-name (§3.8), then both possible
10707 meanings of E are permitted.
10709 We did not check that E as a simple-name had the same type as E as
10712 This trivial check gives us 5-7% on bootstrap time.
10714 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10716 * expression.cs (Invocation.OverloadResolve): Avoid the
10717 use of hashtables and boxing here by allocating on demand.
10719 2004-05-30 Martin Baulig <martin@ximian.com>
10721 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10722 we're doing a silent lookup. Don't try to lookup nested types in
10723 TypeManager.object_type (thanks to Ben Maurer).
10725 2004-05-30 Martin Baulig <martin@ximian.com>
10727 Committing a patch from Ben Maurer.
10729 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10731 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10733 * convert.cs: add a trivial cache for overload operator resolution.
10735 2004-05-31 Marek Safar <marek.safar@seznam.cz>
10738 (AttributeTester.GetObsoleteAttribute): Returns instance of
10739 ObsoleteAttribute when type is obsolete.
10742 (TypeContainer.VerifyObsoleteAttribute): Override.
10743 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10744 (MethodCode.VerifyObsoleteAttribute): Override.
10745 (MemberBase.VerifyObsoleteAttribute): Override.
10748 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10749 and report proper error.
10752 (Delegate.VerifyObsoleteAttribute): Override.
10755 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10756 and report proper error.
10757 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10760 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10764 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10765 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10766 Added test for ObsoleteAttribute.
10769 (Catch): Derived from Statement.
10771 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10773 * decl.cs: If possible, use lookuptypedirect here. We can only do
10774 this if there is no `.' after the namespace. Avoids using
10775 LookupType, which does lots of slow processing.
10776 (FindNestedType) New method, does what it says :-).
10777 * namespace.cs: use LookupTypeDirect.
10778 * rootcontext.cs: use membercache, if possible.
10779 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10781 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10784 According to the spec,
10786 In a member access of the form E.I, if E is a single identifier,
10787 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10788 field, property, localvariable, or parameter with the same type as
10789 the meaning of E as a type-name (§3.8), then both possible
10790 meanings of E are permitted.
10792 We did not check that E as a simple-name had the same type as E as
10795 This trivial check gives us 5-7% on bootstrap time.
10797 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10799 Fixed bug #59071 & cs0160.cs
10800 * statement.cs (Try.Resolve): Check here whether order of catch
10801 clauses matches their dependencies.
10803 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10806 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10809 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10811 * expression.cs (Invocation.OverloadResolve): Avoid the
10812 use of hashtables and boxing here by allocating on demand.
10814 2004-05-30 Martin Baulig <martin@ximian.com>
10816 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10817 we're doing a silent lookup. Don't try to lookup nested types in
10818 TypeManager.object_type (thanks to Ben Maurer).
10820 2004-05-30 Martin Baulig <martin@ximian.com>
10822 Committing a patch from Ben Maurer.
10824 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10826 2004-05-29 Martin Baulig <martin@ximian.com>
10828 * class.cs (IMethodData.ShouldIgnore): New method.
10830 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10831 `Location' argument, we don't need it anywhere. Use
10832 `IMethodData.ShouldIgnore ()' instead of
10833 `MethodData.GetMethodFlags ()'.
10834 (TypeManager.AddMethod): Removed.
10835 (TypeManager.AddMethod2): Renamed to AddMethod.
10837 2004-05-29 Martin Baulig <martin@ximian.com>
10839 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10841 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10842 converting from a class type S to an interface type and we already
10843 have an object on the stack, don't box it again. Fixes #52578.
10845 2004-05-29 Martin Baulig <martin@ximian.com>
10847 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10848 Added support for `params' parameters. Fixes #59267.
10850 2004-05-29 Martin Baulig <martin@ximian.com>
10852 * literal.cs (NullPointer): Provide a private .ctor which sets
10853 `type' to TypeManager.object_type. Fixes #59048.
10855 2004-05-29 Martin Baulig <martin@ximian.com>
10857 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10858 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10860 * ecore.cs (EventExpr.instance_expr): Make the field private.
10862 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10864 Fixed bug #50080 & cs0214-2.cs
10865 * expression.cs (Cast.DoResolve): Check unsafe context here.
10867 * statement.cs (Resolve.DoResolve): Likewise.
10869 2004-05-26 Martin Baulig <martin@ximian.com>
10871 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10873 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10874 (RootContext.LookupType): Pass down the `silent' flag.
10876 2004-05-25 Martin Baulig <martin@ximian.com>
10879 (MethodGroupExpr.IdenticalTypeName): New public property.
10880 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10881 expression actually refers to a type.
10883 2004-05-25 Martin Baulig <martin@ximian.com>
10885 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10886 for #56176 and made it actually work.
10888 2004-05-25 Martin Baulig <martin@ximian.com>
10890 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10891 (FieldExpr, PropertyExpr): Override and implement
10892 CacheTemporaries. Fixes #52279.
10894 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10896 * location.cs: In the new compiler listing a file twice is a
10897 warning, not an error.
10899 2004-05-24 Martin Baulig <martin@ximian.com>
10901 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10902 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10904 2004-05-24 Martin Baulig <martin@ximian.com>
10906 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10907 walking the `using' list. Fixes #53921.
10909 2004-05-24 Martin Baulig <martin@ximian.com>
10911 * const.cs (Const.LookupConstantValue): Added support for
10912 EmptyCast's; fixes #55251.
10914 2004-05-24 Martin Baulig <martin@ximian.com>
10916 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10917 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10918 which does the CS0135 check. The reason is that we first need to
10919 check whether the variable actually exists.
10921 2004-05-24 Martin Baulig <martin@ximian.com>
10923 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10924 than RootContext.LookupType() to find the explicit interface
10925 type. Fixes #58584.
10927 2004-05-24 Raja R Harinath <rharinath@novell.com>
10929 * Makefile: Simplify. Use executable.make.
10930 * mcs.exe.sources: New file. List of sources of mcs.exe.
10932 2004-05-24 Anders Carlsson <andersca@gnome.org>
10936 Use the invariant culture when doing String.Compare for CLS case
10939 2004-05-23 Martin Baulig <martin@ximian.com>
10941 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10942 don't have any dots. Fixes #52622, added cs0246-8.cs.
10944 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10946 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10948 * class.cs (MemberBase.Define): Reuse MemberType member for
10949 resolved type. Other methods can use it too.
10951 2004-05-23 Martin Baulig <martin@ximian.com>
10953 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10954 the variable also exists in the current block (otherwise, we need
10955 to report a CS0103). Fixes #58670.
10957 2004-05-23 Martin Baulig <martin@ximian.com>
10959 * flowanalysis.cs (Reachability.Reachable): Compute this
10960 on-the-fly rather than storing it as a field.
10962 2004-05-23 Martin Baulig <martin@ximian.com>
10964 * flowanalysis.cs (Reachability.And): Manually compute the
10965 resulting `barrier' from the reachability.
10967 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10970 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10971 instance of ObsoleteAttribute when symbol is obsolete.
10974 (IMethodData): Extended interface for ObsoleteAttribute support.
10976 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10978 * attribute.cs: Fix bug #55970
10980 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10984 (GetObsoleteAttribute): New method. Creates the instance of
10986 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10987 ObsoleteAttribute when member is obsolete.
10988 (AttributeTester.Report_ObsoleteMessage): Common method for
10989 Obsolete error/warning reporting.
10992 (TypeContainer.base_classs_type): New member for storing parent type.
10995 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10996 for this MemberCore.
10998 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11000 * attribute.cs, const.cs: Fix bug #58590
11002 2004-05-21 Martin Baulig <martin@ximian.com>
11004 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11005 out parameters if the end of the method is unreachable. Fixes
11008 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11010 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11011 Hari was right, why extra method.
11013 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11015 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11017 2004-05-20 Martin Baulig <martin@ximian.com>
11019 * delegate.cs: Convert this file to Unix mode - like the original
11022 2004-05-20 Martin Baulig <martin@ximian.com>
11024 * attribute.cs: Convert this file to Unix mode - like the original
11027 2004-05-19 Marek Safar <marek.safar@seznam.cz>
11029 Fix bug #58688 (MCS does not report error when the same attribute
11032 * attribute.cs (Attribute.Emit): Distinction between null and default.
11034 2004-05-19 Raja R Harinath <rharinath@novell.com>
11036 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11037 of a top-level attribute without an attribute target.
11038 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
11040 (Attribute.Conditional_GetConditionName),
11041 (Attribute.Obsolete_GetObsoleteMessage): Update.
11042 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
11043 part of ScanForIndexerName.
11044 (Attribute.CanIgnoreInvalidAttribute): New function.
11045 (Attribute.ScanForIndexerName): Move to ...
11046 (Attributes.ScanForIndexerName): ... here.
11047 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11048 (Attributes.Search): New internal variant that can choose not to
11049 complain if types aren't resolved. The original signature now
11051 (Attributes.GetClsCompliantAttribute): Use internal variant, with
11052 complaints suppressed.
11053 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11054 only if it not useful.
11055 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11056 top-level for attributes that are shared between the assembly
11057 and a top-level class.
11058 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11059 * class.cs: Update to reflect changes.
11060 (DefineIndexers): Fuse loops.
11061 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
11062 a couple more variants of attribute names.
11064 2004-05-18 Marek Safar <marek.safar@seznam.cz>
11066 Fix bug #52585 (Implemented explicit attribute declaration)
11069 (Attributable.ValidAttributeTargets): New abstract method. It gets
11070 list of valid attribute targets for explicit target declaration.
11071 (Attribute.Target): It holds target itself.
11072 (AttributeSection): Removed.
11073 (Attribute.CheckTargets): New method. It checks whether attribute
11074 target is valid for the current element.
11077 (EventProperty): New class. For events that are declared like
11078 property (with add and remove accessors).
11079 (EventField): New class. For events that are declared like field.
11082 * cs-parser.jay: Implemented explicit attribute target declaration.
11084 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
11085 Override ValidAttributeTargets.
11088 (ReturnParameter): Class for applying custom attributes on
11090 (ParameterAtribute): New class. Class for applying custom
11091 attributes on the parameter type.
11093 2004-05-17 Miguel de Icaza <miguel@ximian.com>
11095 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11098 (Method): Allow UNSAFE here.
11100 * modifiers.cs: Support unsafe reporting.
11102 2004-05-17 Marek Safar <marek.safar@seznam.cz>
11104 * decl.cs: Fix bug #58478.
11106 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11108 * statement.cs: When checking for unreachable code on an EmptyStatement,
11109 set the location. Fixes bug #58488.
11111 2004-05-13 Miguel de Icaza <miguel@ximian.com>
11113 * driver.cs: Add -pkg handling.
11115 From Gonzalo: UseShelLExecute=false
11117 2004-05-12 Marek Safar <marek.safar@seznam.cz>
11120 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11122 (Attribute.IsClsCompliaceRequired): Moved to base for better
11124 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11125 when attribute is AttributeUsageAttribute.
11126 (Attribute.GetValidTargets): Simplified.
11127 (Attribute.GetAttributeUsage): New method returns AttributeUsage
11128 attribute for this type.
11129 (Attribute.ApplyAttributes): Method renamed to Emit and make
11131 (GlobalAttributeSection): New class for special handling of global
11132 attributes (assembly, module).
11133 (AttributeSection.Emit): New method.
11135 * class.cs: Implemented Attributable abstract methods.
11136 (MethodCore.LabelParameters): Moved to Parameter class.
11137 (Accessor): Is back simple class.
11138 (PropertyMethod): Implemented Attributable abstract class.
11139 (DelegateMethod): Implemented Attributable abstract class.
11140 (Event): New constructor for disctintion between normal Event
11141 and Event with accessors.
11143 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11145 * codegen.cs, const.cs, decl.cs, delegate.cs:
11146 (CommonAssemblyModulClass): Implemented Attributable abstract class
11149 * enum.cs: Implement IAttributeSupport interface.
11150 (EnumMember): New class for emum members. Implemented Attributable
11154 (ParameterBase): Is abstract.
11155 (ReturnParameter): New class for easier [return:] attribute handling.
11157 * typemanager.cs: Removed builder_to_attr.
11159 2004-05-11 Raja R Harinath <rharinath@novell.com>
11162 * attribute.cs (Attribute.GetPositionalValue): New function.
11163 * class.cs (TypeContainer.VerifyMembers): New function.
11164 (TypeContainer.Emit): Use it.
11165 (ClassOrStruct): New base class for Class and Struct.
11166 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
11167 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11169 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11170 then each non-static field should have a FieldOffset attribute.
11171 Otherwise, none of the fields should have a FieldOffset attribute.
11172 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
11173 and FieldOffset attributes.
11174 * typemanager.cs (TypeManager.struct_layout_attribute_type)
11175 (TypeManager.field_offset_attribute_type): New core types.
11176 (TypeManager.InitCoreTypes): Initialize them.
11178 2004-05-11 Michal Moskal <malekith@pld-linux.org>
11180 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11181 Return correct type.
11184 2004-05-09 Miguel de Icaza <miguel@ximian.com>
11186 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11187 be implicitly converted to ulong.
11189 * expression.cs: The logic for allowing operator &, | and ^ worked
11190 was wrong, it worked before because we did not report an error in
11191 an else branch. Fixes 57895.
11193 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11194 allow volatile fields to be reference types.
11196 2004-05-07 Miguel de Icaza <miguel@ximian.com>
11198 * driver.cs: Add support for /debug-
11200 2004-05-07 Raja R Harinath <rharinath@novell.com>
11202 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
11203 Add a 'complain' parameter to silence errors.
11204 (Attribute.Resolve): Update to changes. Put in sanity check to catch
11205 silently overlooked type-resolutions.
11206 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11207 to reflect changes.
11208 (Attributes.Search): New function.
11209 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11210 (Attributes.GetAttributeFullName): Remove hack.
11211 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
11212 Update to reflect changes.
11213 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11214 Use Attributes.Search instead of nested loops.
11216 2004-05-07 Marek Safar <marek.safar@seznam.cz>
11219 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11220 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11221 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11223 * report.cs: (Report.Warning): Renamed to Warning_T because of
11224 parameter collision.
11226 2004-05-05 Raja R Harinath <rharinath@novell.com>
11228 * expression.cs (MemberAccess.ResolveMemberAccess):
11229 Exit with non-zero status after Report.Error.
11230 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11232 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11234 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11236 * support.cs: Don't hang when the file is empty.
11238 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11240 * support.cs: In SeekableStreamReader, compute the preamble size of the
11241 underlying stream. Position changes should take into account that initial
11244 2004-05-03 Todd Berman <tberman@sevenl.net>
11246 * driver.cs: remove unused GetSysVersion function.
11248 2004-05-03 Todd Berman <tberman@sevenl.net>
11250 * driver.cs: Remove the hack from saturday, as well as the hack
11251 from jackson (LoadAssemblyFromGac), also adds the CWD to the
11252 link_paths to get that bit proper.
11254 2004-05-01 Todd Berman <tberman@sevenl.net>
11256 * driver.cs: Try a LoadFrom before a Load, this checks the current
11257 path. This is currently a bug in mono that is be fixed, however, this
11258 provides a workaround for now. This will be removed when the bug
11261 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
11263 * CryptoConvert.cs: Updated to latest version. Fix issue with
11264 incomplete key pairs (#57941).
11266 2004-05-01 Todd Berman <tberman@sevenl.net>
11268 * driver.cs: Remove '.' from path_chars, now System.* loads properly
11271 2004-04-30 Jackson Harper <jackson@ximian.com>
11273 * codegen.cs: Open keys readonly.
11275 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11277 * typemanager.cs: don't report cyclic struct layout when a struct
11278 contains 2 or more fields of the same type. Failed for Pango.AttrShape
11279 which has 2 Pango.Rectangle fields.
11281 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
11283 * expression.cs: Handle IntPtr comparisons with IL code
11284 rather than a method call.
11286 2004-04-29 Martin Baulig <martin@ximian.com>
11288 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
11289 the list of PropertyInfo's in class hierarchy and find the
11290 accessor. Fixes #56013.
11292 2004-04-29 Martin Baulig <martin@ximian.com>
11294 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11296 2004-04-29 Martin Baulig <martin@ximian.com>
11298 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11300 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11302 2004-04-29 Martin Baulig <martin@ximian.com>
11304 * class.cs (ConstructorInitializer.Resolve): Check whether the
11305 parent .ctor is accessible. Fixes #52146.
11307 2004-04-29 Martin Baulig <martin@ximian.com>
11309 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11311 * statement.cs (Using.EmitLocalVariableDecls): Use
11312 TypeManager.idisposable_type, not typeof (IDisposable).
11313 (Foreach.EmitCollectionForeach): Added support for valuetypes.
11315 2004-04-29 Martin Baulig <martin@ximian.com>
11317 * class.cs (Event.Define): Don't emit the field and don't set
11318 RTSpecialName and SpecialName for events on interfaces. Fixes
11321 2004-04-29 Raja R Harinath <rharinath@novell.com>
11323 Refactor Attribute.ApplyAttributes.
11324 * attribute.cs (Attributable): New base class for objects that can
11325 have Attributes applied on them.
11326 (Attribute): Make AttributeUsage fields public.
11327 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11328 (Attribute.IsInternalCall): New property.
11329 (Attribute.UsageAttr): Convert to a public read-only property.
11330 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11331 (Attribute.ResolveType, Attribute.Resolve)
11332 (Attribute.ScanForIndexerName): Update to reflect changes.
11333 (Attribute.CheckAttributeTarget): Re-format.
11334 (Attribute.ApplyAttributes): Refactor, to various
11335 Attributable.ApplyAttributeBuilder methods.
11336 * decl.cs (MemberCore): Make Attributable.
11337 * class.cs (Accessor): Make Attributable.
11338 (MethodData.ApplyAttributes): Use proper attribute types, not
11340 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11341 (TypeContainer.ApplyAttributeBuilder)
11342 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11343 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
11344 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11345 (Operator.ApplyAttributeBuilder): New factored-out methods.
11346 * const.cs (Const.ApplyAttributeBuilder): Likewise.
11347 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11348 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11349 * parameter.cs (ParameterBase): New Attributable base class
11350 that can also represent Return types.
11351 (Parameter): Update to the changes.
11353 2004-04-29 Jackson Harper <jackson@ximian.com>
11355 * driver.cs: Prefer the corlib system version when looking for
11356 assemblies in the GAC. This is still a hack, but its a better hack
11359 2004-04-29 Marek Safar <marek.safar@seznam.cz>
11361 * decl.cs, enum.cs: Improved error 3005 reporting.
11363 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11364 (related_symbols): New private member for list of symbols
11365 related to reported error/warning.
11367 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11369 2004-04-29 Martin Baulig <martin@ximian.com>
11371 * ecore.cs (Expression.Constantify): If we're an enum and
11372 TypeManager.TypeToCoreType() doesn't give us another type, use
11373 t.UnderlyingSystemType. Fixes #56178.
11375 2004-04-29 Martin Baulig <martin@ximian.com>
11377 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11378 interfaces and for each interface, only add members directly
11379 declared in that interface. Fixes #53255.
11381 2004-04-28 Martin Baulig <martin@ximian.com>
11383 * expression.cs (ConditionalLogicalOperator): Use a temporary
11384 variable for `left' to avoid that we evaluate it more than once;
11387 2004-04-28 Martin Baulig <martin@ximian.com>
11389 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11392 2004-04-28 Martin Baulig <martin@ximian.com>
11394 * statement.cs (LocalInfo.Resolve): Check whether the type is not
11397 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11398 whether the type is not void (CS1547).
11400 2004-04-28 Martin Baulig <martin@ximian.com>
11402 * expression.cs (Unary.DoResolveLValue): Override this and report
11403 CS0131 for anything but Operator.Indirection.
11405 2004-04-28 Martin Baulig <martin@ximian.com>
11407 Committing a patch from Ben Maurer; see bug #50820.
11409 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11412 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11415 2004-04-28 Martin Baulig <martin@ximian.com>
11417 Committing a patch from Ben Maurer; see bug #50820.
11419 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11422 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11425 2004-04-28 Martin Baulig <martin@ximian.com>
11427 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11428 (Block.AddLabel): Call DoLookupLabel() to only search in the
11431 2004-04-28 Martin Baulig <martin@ximian.com>
11433 * cfold.cs (ConstantFold.BinaryFold): Added special support for
11434 comparing StringConstants and NullLiterals in Equality and Inequality.
11436 2004-04-28 Jackson Harper <jackson@ximian.com>
11438 * driver.cs: Attempt to load referenced assemblies from the
11439 GAC. This is the quick and dirty version of this method that
11440 doesnt take into account versions and just takes the first
11441 canidate found. Will be good enough for now as we will not have more
11442 then one version installed into the GAC until I update this method.
11444 2004-04-28 Martin Baulig <martin@ximian.com>
11446 * typemanager.cs (TypeManager.CheckStructCycles): New public
11447 static method to check for cycles in the struct layout.
11449 * rootcontext.cs (RootContext.PopulateTypes): Call
11450 TypeManager.CheckStructCycles() for each TypeContainer.
11451 [Note: We only need to visit each type once.]
11453 2004-04-28 Martin Baulig <martin@ximian.com>
11455 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11457 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11458 success and added `out object value'. Use a `bool resolved' field
11459 to check whether we've already been called rather than
11460 `ConstantValue != null' since this breaks for NullLiterals.
11462 2004-04-28 Raja R Harinath <rharinath@novell.com>
11464 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11465 setting of this flag, since the 'set' method may be non-public.
11467 2004-04-28 Raja R Harinath <rharinath@novell.com>
11469 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11470 check on current_vector.Block.
11472 2004-04-27 Martin Baulig <martin@ximian.com>
11474 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11475 a field initializer. Fixes #56459.
11477 2004-04-27 Martin Baulig <martin@ximian.com>
11479 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11480 we're not attempting to use an indexer. Fixes #52154.
11482 2004-04-27 Martin Baulig <martin@ximian.com>
11484 * statement.cs (Return): Don't create a return label if we don't
11485 need it; reverts my change from January 20th. Thanks to Ben
11488 2004-04-27 Martin Baulig <martin@ximian.com>
11490 According to the spec, `goto' can only leave a nested scope, but
11493 * statement.cs (Block.LookupLabel): Only lookup in the current
11494 block, don't recurse into parent or child blocks.
11495 (Block.AddLabel): Check in parent and child blocks, report
11496 CS0140/CS0158 if we find a duplicate.
11497 (Block): Removed this indexer for label lookups.
11498 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11499 this already does the error reporting for us.
11502 (FlowBranching.UsageVector.Block): New public variable; may be null.
11503 (FlowBranching.CreateSibling): Added `Block' argument.
11504 (FlowBranching.LookupLabel): New public virtual method. Lookup a
11505 label for the target of a `goto' and check whether we're not
11506 leaving a `finally'.
11508 2004-04-27 Martin Baulig <martin@ximian.com>
11510 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11511 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11514 2004-04-27 Martin Baulig <martin@ximian.com>
11516 * statement.cs (Block.AddLabel): Also check for implicit blocks
11517 and added a CS0158 check.
11519 2004-04-27 Martin Baulig <martin@ximian.com>
11521 * flowanalysis.cs (FlowBranchingLoop): New class.
11522 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11523 UsageVector's instead of an ArrayList.
11524 (FlowBranching.Label): Likewise.
11525 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11526 (FlowBranching.AddBreakVector): New method.
11528 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11530 * attribute.cs: Small regression fix: only convert the type if we
11531 the type is different, fixes System.Drawing build.
11533 2004-04-27 Martin Baulig <martin@ximian.com>
11535 * attribute.cs (Attribute.Resolve): If we have a constant value
11536 for a named field or property, implicity convert it to the correct
11539 2004-04-27 Raja R Harinath <rharinath@novell.com>
11541 * statement.cs (Block.Block): Implicit blocks share
11542 'child_variable_names' fields with parent blocks.
11543 (Block.AddChildVariableNames): Remove.
11544 (Block.AddVariable): Mark variable as "used by a child block" in
11545 every surrounding block.
11546 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11547 been used in a child block, complain about violation of "Invariant
11548 meaning in blocks" rule.
11549 * cs-parser.jay (declare_local_variables): Don't use
11550 AddChildVariableNames.
11551 (foreach_statement): Don't create an implicit block: 'foreach'
11552 introduces a scope.
11554 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11556 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11557 converting from 0L to ulong. Fixes 57522.
11559 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11561 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11562 derived class hides via 'new' keyword field from base class (test-242.cs).
11563 TODO: Handle this in the more general way.
11565 * class.cs (CheckBase): Ditto.
11567 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11569 * decl.cs (caching_flags): New member for storing cached values
11571 (MemberCore.Flags): New enum where bit flags for caching_flags
11573 (MemberCore.cls_compliance): Moved to caching_flags.
11574 (DeclSpace.Created): Moved to caching_flags.
11576 * class.cs: Use caching_flags instead of DeclSpace.Created
11578 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11580 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11581 if we are only a derived class, not a nested class.
11583 * typemanager.cs: Same as above, but do this at the MemberLookup
11584 level (used by field and methods, properties are handled in
11585 PropertyExpr). Allow for the qualified access if we are a nested
11588 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11590 * class.cs: Refactoring.
11591 (IMethodData): New inteface; Holds links to parent members
11592 to avoid member duplication (reduced memory allocation).
11593 (Method): Implemented IMethodData interface.
11594 (PropertyBase): New inner classes for get/set methods.
11595 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11596 (Event): New inner classes for add/remove methods.
11597 (Event.DelegateMethod): Implemented IMethodData interface.
11599 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11600 EmitContext (related to class.cs refactoring).
11602 2004-04-21 Raja R Harinath <rharinath@novell.com>
11604 * delegate.cs (Delegate.VerifyApplicability): If the number of
11605 arguments are the same as the number of parameters, first try to
11606 verify applicability ignoring any 'params' modifier on the last
11610 2004-04-08 Martin Baulig <martin@ximian.com>
11612 Merged latest changes into gmcs. Please keep this comment in
11613 here, it makes it easier for me to see what changed in MCS since
11614 the last time I merged.
11616 2004-04-16 Raja R Harinath <rharinath@novell.com>
11618 * class.cs (TypeContainer.AddIndexer): Use
11619 'ExplicitInterfaceName' to determine if interface name was
11620 explicitly specified. 'InterfaceType' is not initialized at this time.
11621 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11622 Indexers array is already in the required order. Initialize
11623 'IndexerName' only if there are normal indexers.
11624 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11625 (TypeContainer.Emit): Emit DefaultMember attribute only if
11626 IndexerName is initialized.
11629 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11631 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11634 2004-04-15 Raja R Harinath <rharinath@novell.com>
11636 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11640 * attribute.cs (Attribute.Resolve): Check for duplicate named
11644 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11646 * iterators.cs (MarkYield): track whether we are in an exception,
11647 and generate code accordingly. Use a temporary value to store the
11648 result for our state.
11650 I had ignored a bit the interaction of try/catch with iterators
11651 since their behavior was not entirely obvious, but now it is
11652 possible to verify that our behavior is the same as MS .NET 2.0
11656 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11658 * iterators.cs: Avoid creating temporaries if there is no work to
11661 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11662 Enumerations, use TypeManager.EnumToUnderlying and call
11665 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11668 (This.Emit): Use EmitContext.EmitThis to emit our
11671 (This.EmitAssign): Ditto.
11673 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11674 codepaths, we will move all the functionality into
11677 (FieldExpr.EmitAssign): Ditto.
11679 This fixes several hidden bugs that I uncovered while doing a code
11680 review of this today.
11682 * codegen.cs (EmitThis): reworked so the semantics are more clear
11683 and also support value types "this" instances.
11685 * iterators.cs: Changed so that for iterators in value types, we
11686 do not pass the value type as a parameter.
11688 Initialization of the enumerator helpers is now done in the caller
11689 instead of passing the parameters to the constructors and having
11690 the constructor set the fields.
11692 The fields have now `assembly' visibility instead of private.
11694 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11696 * expression.cs (Argument.Resolve): Check if fields passed as ref
11697 or out are contained in a MarshalByRefObject.
11699 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11700 another compiler type.
11702 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11704 * class.cs (Indexer.Define): use the new name checking method.
11705 Also, return false on an error.
11706 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11707 (is_identifier_[start/part]_character): make static.
11709 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11711 * expression.cs (Binary.ResolveOperator): Do no append strings
11712 twice: since we can be invoked more than once (array evaluation)
11713 on the same concatenation, take care of this here. Based on a fix
11714 from Ben (bug #56454)
11716 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11718 * codegen.cs: Fix another case where CS1548 must be reported (when
11719 delay-sign isn't specified and no private is available #56564). Fix
11720 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11721 error when MCS is used on the MS runtime and we need to delay-sign
11722 (which seems unsupported by AssemblyBuilder - see #56621).
11724 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11726 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11727 (TypeManager.ComputeNamespaces): Faster implementation for
11730 * compiler.csproj: Updated AssemblyName to mcs.
11732 2004-05-11 Jackson Harper <jackson@ximian.com>
11734 * Makefile: Preserve MONO_PATH
11736 2004-05-11 Jackson Harper <jackson@ximian.com>
11738 * Makefile: Use mono and mcs to build gmcs
11740 2004-05-03 Miguel de Icaza <miguel@ximian.com>
11742 * codegen.cs: Add patch from Robert Shade
11743 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11746 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
11748 * CryptoConvert.cs: Updated to latest version. Fix issue with
11749 incomplete key pairs (#57941).
11751 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11753 * codegen.cs: Fix another case where CS1548 must be reported (when
11754 delay-sign isn't specified and no private is available #56564). Fix
11755 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11756 error when MCS is used on the MS runtime and we need to delay-sign
11757 (which seems unsupported by AssemblyBuilder - see #56621).
11759 2004-04-29 Jackson Harper <jackson@ximian.com>
11761 * Makefile: Set MONO_PATH to use the bootstrap corlib
11762 * driver.cs: Check the GAC for referenced assemblies.
11764 2004-04-29 Martin Baulig <martin@ximian.com>
11766 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11768 2004-04-07 Martin Baulig <martin@ximian.com>
11770 * expression.cs (Binary.ResolveOperator): Added special case for
11771 Equality/Inequality between a type parameter and a null literal.
11773 2004-04-07 Martin Baulig <martin@ximian.com>
11775 * convert.cs: Check null literal -> type parameter conversions.
11777 2004-04-07 Martin Baulig <martin@ximian.com>
11779 * generic.cs (ConstructedType.CheckConstraints): Enforce the
11780 `class' and `struct' constraints.
11782 2004-04-07 Martin Baulig <martin@ximian.com>
11784 * generic.cs (SpecialConstraint): New public enum.
11785 (Constraints.Resolve): Added support for the `class' and `struct'
11788 * cs-parser.jay (type_parameter_constraint): Added support for the
11789 `class' and `struct' constraints.
11791 2004-04-07 Martin Baulig <martin@ximian.com>
11793 * support.cs (GenericConstraints): Replaced `Types' by
11794 `ClassConstraint' and `InterfaceConstraints'; added
11795 `HasClassConstraint'.
11797 2004-04-07 Martin Baulig <martin@ximian.com>
11800 (Constraints.InterfaceConstraints): New public property.
11801 (Constraints.Types): Make this property public
11802 (TypeParameter): Implement IMemberContainer.
11803 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11804 instead of a TypeBuilder/MethodBuilder; pass the interface
11805 constraints to TypeManager.AddTypeParameter().
11806 (TypeParameter.DefineType): Just take an EmitContext and no
11807 TypeBuilder/MethodBuilder. Use the new public API.
11809 * typemanager.cs (TypeManager.AddTypeParameter): Added
11810 `TypeExpr[]' argument; add the interfaces to the
11811 `builder_to_ifaces' hash.
11812 (TypeManager.LookupMemberContainer): For
11813 GenericTypeParameterBuilders, get the TypeParameter from the
11814 `builder_to_type_param'.
11815 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11816 the TypeParameter and call FindMembers on it.
11818 2004-04-07 Martin Baulig <martin@ximian.com>
11821 (MethodCore.GenericMethod): Moved this field here from Method.
11822 (MethodCore.IsDuplicateImplementation): Take the number of type
11823 parameters into account if we're a generic method.
11825 * expression.cs (Invocation.InferTypeArguments): Don't return true
11826 if `arguments' is null; we still need to check whether we actually
11827 don't need to infer anything in this case.
11828 (MemberAccess): Merged the functionality from GenericMemberAccess
11831 * generic.cs (GenericMemberAccess): Removed.
11833 2004-04-05 Martin Baulig <martin@ximian.com>
11835 * decl.cs (MemberCore): For generic classes, interfaces and
11836 structs, `Name' now includes the number of type parameters
11837 ("Stack!1.Node!1").
11838 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11839 encode the number of type arguments in the type name.
11841 * expression.cs (Expression.MemberLookup): Removed the
11842 `num_type_args' argument; we now encode the number of type
11843 arguments in the type name.
11845 * ecore.cs (SimpleName): Encode the number of type arguments in
11846 the type name itself.
11848 * generic.cs (ConstructedType): Likewise.
11850 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11851 `MemberName'; we now include the number of type parameters in the
11854 * typemanager.cs (TypeManager.CheckGeneric): Removed.
11855 (TypeManager.MemberLookup): Removed the
11856 `num_type_args' argument; we now encode the number of type
11857 arguments in the type name.
11859 2004-04-03 Martin Baulig <martin@ximian.com>
11861 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11862 (MemberCore.MemberName): Moved here from MemberBase.
11863 (DeclSpace.SetParameterInfo): Just take the constraints as an
11864 ArrayList; we already have the type parameters in our
11865 `MemberName'; also do the CS0080 reporting here.
11867 * cs-parser.jay (struct_declaration): Use `member_name' instead of
11868 `IDENTIFIER opt_type_parameter_list'; when constructing our
11869 `MemberName', it'll already include our type parameters.
11870 (class_declaration, interface_declaration): Likewise.
11871 (delegate_declaration): Likewise.
11872 (MakeName): Take a MemberName and return a MemberName.
11873 The following two changes are required to avoid shift/reduce conflicts:
11874 (member_name): Don't include a TypeName anymore; ie. this is now
11875 just 'IDENTIFIER opt_type_parameter_list'.
11876 (property_declaration, event_declaration): Use a
11877 `namespace_or_type_name' instead of a `member_name'.
11879 2004-04-03 Martin Baulig <martin@ximian.com>
11881 * decl.cs (MemberName): Renamed to `TypeName' and created a new
11882 `MemberName' class.
11883 (TypeName): Formerly known as MemberName.
11885 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11886 instead of a `MemberName'.
11888 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11889 (member_name): New rule; create a MemberName.
11891 2004-04-02 Martin Baulig <martin@ximian.com>
11893 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11894 (CS0305 and CS0308).
11896 2004-04-02 Martin Baulig <martin@ximian.com>
11898 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11899 support for nested types.
11901 2004-04-02 Martin Baulig <martin@ximian.com>
11903 * ecore.cs (IAlias): New public interface.
11904 (TypeExpr, TypeExpression): Implement IAlias.
11905 (TypeAliasExpression): New public class.
11907 * namespace.cs (Namespace): Implement IAlias.
11908 (Namespace.Lookup): Return an IAlias instead on an object.
11909 (Namespace.DefineName): Take an IAlias instead of an object.
11910 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11912 (NamespaceEntry.UsingAlias): Take a Membername instead of an
11914 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11916 (NamespaceEntry.Lookup): Likewise.
11918 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11921 * decl.cs (DeclSpace): Implement IAlias.
11922 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11924 * generic.cs (ConstructedType): Improved error checking.
11926 2004-04-02 Martin Baulig <martin@ximian.com>
11928 * convert.cs: Added type parameter conversions.
11931 (UnboxCast.Emit): Emit an `unbox.any' for type params.
11932 (ClassCast.Emit): If the source type is a type parameter, box it.
11933 If the target type is a type parameter, emit an `unbox.any'
11934 instead of a `classcast'.1
11936 2004-04-01 Martin Baulig <martin@ximian.com>
11938 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11940 2004-04-01 Martin Baulig <martin@ximian.com>
11942 * generic.cs (ConstructedType.CheckConstraints): Use
11943 Convert.ImplicitStandardConversionExists(); user-defined implicit
11944 conversions are not allowed according to the spec.
11946 2004-03-30 Martin Baulig <martin@ximian.com>
11948 * expression.cs (New): Added support for type parameters.
11951 (TypeManager.activator_type): New public static field.
11952 (TypeManager.activator_create_instance): Likewise.
11954 2004-03-30 Martin Baulig <martin@ximian.com>
11956 * typemanager.cs (TypeManager.HasConstructorConstraint): New
11959 2004-03-30 Martin Baulig <martin@ximian.com>
11961 * generic.cs (ConstructedType.CheckConstraints): Actually follow
11962 the spec here: the argument type must be convertible to the
11965 2004-03-30 Martin Baulig <martin@ximian.com>
11968 (TypeParameter.Define, TypeParameter.DefineMethod): Call
11969 TypeManager.AddTypeParameter().
11970 (ConstructedType.CheckConstraints): Re-enable this and actually
11971 check whether we have a constructor constraint.
11974 (TypeManager.builder_to_type_param): New static field.
11975 (TypeManager.AddTypeParameter): New static method.
11976 (TypeManager.LookupTypeParameter): New public method.
11978 2004-03-30 Martin Baulig <martin@ximian.com>
11980 * generic.cs (TypeParameter.DefineType): Return a boolean and use
11981 the new API to actually define the constructor constraint.
11984 (TypeManager.new_constraint_attr_type): New static field.
11985 (TypeManager.InitCoreTypes): Initialize it.
11987 2004-03-30 Martin Baulig <martin@ximian.com>
11989 * generic.cs (Constraints): Completed error checking, use correct
11992 2004-03-29 Martin Baulig <martin@ximian.com>
11994 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11996 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11997 public version which takes a `ParameterData pd' instead of an
12000 2004-03-29 Martin Baulig <martin@ximian.com>
12002 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
12005 2004-03-29 Martin Baulig <martin@ximian.com>
12007 * expression.cs (Argument.ResolveMethodGroup): If we're a
12008 ConstructedType, call GetMemberAccess() on it.
12010 2004-03-29 Martin Baulig <martin@ximian.com>
12012 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
12013 (MethodCore.CheckGenericOverride): When overriding a generic
12014 method, check whether the constraints match.
12016 * support.cs (GenericConstraints): New public interface.
12017 (ParameterData.GenericConstraints): New public method.
12019 * parameter.cs (Parameter.Resolve): Check whether we're a generic
12020 method parameter and compute our constraints if appropriate.
12021 (Parameter.GenericConstraints): New public property.
12023 * generic.cs (Constraints): Implement GenericConstraints.
12025 2004-03-29 Martin Baulig <martin@ximian.com>
12027 * decl.cs (MemberCache.FindMemberToOverride): Use
12028 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
12030 2004-03-29 Martin Baulig <martin@ximian.com>
12032 * generic.cs (GenericMethod.Define): Resolve our type parameters.
12034 2004-03-29 Martin Baulig <martin@ximian.com>
12036 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
12037 not allowed on non-generic declarations").
12039 2004-03-29 Martin Baulig <martin@ximian.com>
12041 * expression.cs (Invocation.InferTypeArguments): Added overloaded
12042 public version of this method.
12044 * class.cs (MethodCore.IsDuplicateImplementation): Use
12045 Invocation.InferTypeArguments() to check this.
12047 2004-03-29 Martin Baulig <martin@ximian.com>
12049 * convert.cs: Use TypeManager.IsDelegateType() instead of
12050 comparing types correctly.
12052 2004-03-29 Martin Baulig <martin@ximian.com>
12054 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
12055 types directly to make it work for generic instances.
12057 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
12059 2004-03-29 Martin Baulig <martin@ximian.com>
12061 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
12062 support for arrays.
12064 2004-03-24 Martin Baulig <martin@ximian.com>
12066 * decl.cs (DeclSpace.FindType): Also use
12067 TypeManager.CheckGeneric() for types from the using clauses.
12069 2004-03-23 Martin Baulig <martin@ximian.com>
12071 * expression.cs (Invocation.OverloadResolve): Added `bool
12072 may_fail' argument and use it instead of the Location.IsNull() hack.
12074 2004-03-23 Martin Baulig <martin@ximian.com>
12076 * expression.cs (Invocation.InferType): Use correct type inference
12079 2004-03-23 Martin Baulig <martin@ximian.com>
12081 * ecore.cs (MethodGroupExpr.Name): Use
12082 TypeManager.CSharpSignature() instead of just the name.
12084 * expression.cs (Invocation.OverloadResolve): Provide better error
12086 (Invocation.DoResolve): OverloadResolve() never returns null
12087 without reporting an error, so removed the error -6 reporting here.
12089 2004-03-23 Martin Baulig <martin@ximian.com>
12091 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
12094 * cs-parser.jay (delegate_declaration): Support generic delegates.
12096 * delegate.cs: Support generic delegates.
12098 2004-03-22 Martin Baulig <martin@ximian.com>
12100 * expression.cs (Invocation.InferParamsTypeArguments): New static
12101 method; does type inference for params arguments.
12103 2004-03-21 Martin Baulig <martin@ximian.com>
12105 * typemanager.cs (TypeManager.IsGenericMethod): New public static
12106 method; checks whether a method is a generic method.
12108 * expression.cs (Invocation.InferTypeArguments): New static method;
12109 infer type arguments for generic method invocation.
12111 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
12112 property; we set this to true if we're resolving a generic method
12113 invocation and the user specified type arguments, ie. we're not
12114 doing type inference.
12116 2004-03-20 Martin Baulig <martin@ximian.com>
12118 * class.cs (MethodData.DeclaringType): New public property.
12119 (MethodData.Define): Set DeclaringType here.
12120 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
12121 instead of OperatorMethodBuilder.DeclaringType.
12123 2004-03-20 Martin Baulig <martin@ximian.com>
12125 * cs-tokenizer.cs (xtoken): Return a special
12126 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
12128 * cs-parser.jay (default_value_expression): Switch to the new
12131 2004-03-19 Martin Baulig <martin@ximian.com>
12133 * decl.cs (MemberName): New class. We use this to "construct"
12134 namespace_or_type_name's.
12136 * generics.cs (TypeArguments.GetDeclarations): New public method;
12137 returns the type arguments as a string[] and reports a CS0081 if
12138 one of them is not an identifier.
12140 * class.cs (MemberBase): The .ctor now takes the name as a
12141 MemberName instead of a string.
12142 (MemberBase.ExplicitInterfaceName): Changed type from string to
12144 (MemberBase.DoDefine): If we're an explicit implementation, the
12145 InterfaceType may be a generic instance.
12147 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
12148 (namespace_name): Call MemberName.GetName () to transform the
12149 MemberName into a string and ensure we don't have any type
12151 (type_name): Call MemberName.GetTypeExpression() to transfrom the
12152 MemberName into an expression.
12153 (method_header): Use namespace_or_type_name instead of member_name.
12155 2004-04-07 Miguel de Icaza <miguel@ximian.com>
12157 * rootcontext.cs: Add new types to the boot resolution.
12159 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12160 MulticastDelegate is not allowed.
12162 * typemanager.cs: Add new types to lookup: System.TypedReference
12165 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12166 check for TypedReference or ArgIterator, they are not allowed.
12168 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12169 makes us properly catch 1510 in some conditions (see bug 56016 for
12172 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
12174 * CryptoConvert.cs: update from corlib version
12177 2004-04-05 Miguel de Icaza <miguel@ximian.com>
12179 * class.cs (Indexer.Define): Check indexername declaration
12181 2004-04-05 Marek Safar <marek.safar@seznam.cz>
12183 * attribute.cs (IsClsCompliant): Fixed problem with handling
12184 all three states (compliant, not-compliant, undetected).
12186 2004-03-30 Marek Safar <marek.safar@seznam.cz>
12188 * attribute.cs (Attribute): Location is now public.
12189 (Resolve): Store resolved arguments (pos_values) in attribute class.
12190 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12191 (GetClsCompliantAttributeValue): New method that gets
12192 CLSCompliantAttribute value.
12193 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12194 if exists else null.
12195 (AttributeTester): New class for CLS-Compliant verification routines.
12197 * class.cs (Emit): Add CLS-Compliant verification.
12198 (Method.GetSignatureForError): Implemented.
12199 (Constructor.GetSignatureForError): Implemented
12200 (Constructor.HasCompliantArgs): Returns if constructor has
12201 CLS-Compliant arguments.
12202 (Constructor.Emit): Override.
12203 (Construcor.IsIdentifierClsCompliant): New method; For constructors
12204 is needed to test only parameters.
12205 (FieldBase.GetSignatureForError): Implemented.
12206 (TypeContainer): New member for storing base interfaces.
12207 (TypeContainer.FindMembers): Search in base interfaces too.
12209 * codegen.cs (GetClsComplianceAttribute): New method that gets
12210 assembly or module CLSCompliantAttribute value.
12211 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12213 (ModuleClass.Emit): Add error 3012 test.
12215 * const.cs (Emit): Override and call base for CLS-Compliant tests.
12217 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12218 state for all decl types.
12219 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12220 if CLS-Compliant tests are required.
12221 (IsClsCompliaceRequired): New method. Analyze whether code
12222 must be CLS-Compliant.
12223 (IsExposedFromAssembly): New method. Returns true when MemberCore
12224 is exposed from assembly.
12225 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12226 value or gets cached value.
12227 (HasClsCompliantAttribute): New method. Returns true if MemberCore
12228 is explicitly marked with CLSCompliantAttribute.
12229 (IsIdentifierClsCompliant): New abstract method. This method is
12230 used to testing error 3005.
12231 (IsIdentifierAndParamClsCompliant): New method. Common helper method
12232 for identifier and parameters CLS-Compliant testing.
12233 (VerifyClsCompliance): New method. The main virtual method for
12234 CLS-Compliant verifications.
12235 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12236 null. I don't know why is null (too many public members !).
12237 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12238 and get value of first CLSCompliantAttribute that found.
12240 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12241 (VerifyClsCompliance): Override and add extra tests.
12243 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12244 clscheck- disable CLS-Compliant verification event if assembly is has
12245 CLSCompliantAttribute(true).
12247 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12248 ApllyAttribute is now called in emit section as in the other cases.
12249 Possible future Emit integration.
12250 (IsIdentifierClsCompliant): New override.
12251 (VerifyClsCompliance): New override.
12252 (GetEnumeratorName): Returns full enum name.
12254 * parameter.cs (GetSignatureForError): Implemented.
12256 * report.cs (WarningData): New struct for Warning message information.
12257 (LocationOfPreviousError): New method.
12258 (Warning): New method. Reports warning based on the warning table.
12259 (Error_T): New method. Reports error based on the error table.
12261 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12262 verifications are done here.
12264 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12266 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12267 CLSCompliantAttribute.
12268 (all_imported_types): New member holds all imported types from other
12270 (LoadAllImportedTypes): New method fills static table with exported types
12271 from all referenced assemblies.
12272 (Modules): New property returns all assembly modules.
12274 2004-03-30 Miguel de Icaza <miguel@ximian.com>
12276 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12277 throwing a parser error.
12279 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12280 which removes the hardcoded get_/set_ prefixes for properties, as
12281 IL allows for the properties to be named something else.
12285 * expression.cs: Do not override operand before we know if it is
12286 non-null. Fix 56207
12288 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12290 * typemanager.cs: support for pinned variables.
12292 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12294 * decl.cs, typemanager.cs: Avoid using an arraylist
12295 as a buffer if there is only one result set.
12297 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12299 * expression.cs: Make sure you cant call a static method
12300 with an instance expression, bug #56174.
12302 2004-03-29 Miguel de Icaza <miguel@ximian.com>
12304 * class.cs (IsDuplicateImplementation): Improve error reporting to
12305 flag 663 (method only differs in parameter modifier).
12307 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12308 in preprocessor directives.
12310 * location.cs (LookupFile): Allow for the empty path.
12312 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
12313 better approach for some of that patch, but its failing with the
12314 CharSet enumeration. For now try/catch will do.
12316 * typemanager.cs: Do not crash if a struct does not have fields.
12319 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12321 * expression.cs: cs0213, cant fix a fixed expression.
12324 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12326 * cs-parser.jay: detect invalid embeded statements gracefully.
12329 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12331 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12334 the invocation type may not be a subclass of the tye of the item/
12335 The type of the item must be a subclass of the invocation item.
12340 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
12342 * attribute.cs: Added methods to get a string and a bool from an
12343 attribute. Required to information from AssemblyKeyFileAttribute,
12344 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12345 * codegen.cs: Modified AssemblyName creation to include support for
12346 strongnames. Catch additional exceptions to report them as CS1548.
12347 * compiler.csproj: Updated include CryptoConvert.cs.
12348 * compiler.csproj.user: Removed file - user specific configuration.
12349 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
12350 Mono.Security assembly. The original class is maintained and tested in
12351 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12352 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12353 like CSC 8.0 (C# v2) supports.
12354 * Makefile: Added CryptoConvert.cs to mcs sources.
12355 * rootcontext.cs: Added new options for strongnames.
12357 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
12359 * driver.cs: For --expect-error, report error code `2'
12360 if the program compiled with no errors, error code `1' if
12361 it compiled with an error other than the one expected.
12363 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
12365 * compiler.csproj: Updated for Visual Studio .NET 2003.
12366 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12367 * compiler.sln: Updated for Visual Studio .NET 2003.
12369 2004-03-24 Ravi Pratap M <ravi@ximian.com>
12371 * expression.cs: Fix bug #47234. We basically need to apply the
12372 rule that we prefer the conversion of null to a reference type
12373 when faced with a conversion to 'object' (csc behaviour).
12375 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12377 * statement.cs: Shorter form for foreach, eliminates
12378 a local variable. r=Martin.
12380 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12382 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12383 checks if we can use brtrue/brfalse to test for 0.
12384 * expression.cs: use the above in the test for using brtrue/brfalse.
12385 cleanup code a bit.
12387 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12389 * expression.cs: Rewrite string concat stuff. Benefits:
12391 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12392 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12393 rather than a concat chain.
12395 * typemanager.cs: Add lookups for more concat overloads.
12397 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12399 * expression.cs: Emit shorter il code for array init.
12416 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
12418 * statement.cs: Before, two switch blocks would be merged if the
12419 total size of the blocks (end_item - begin_item + 1) was less than
12420 two times the combined sizes of the blocks.
12422 Now, it will only merge if after the merge at least half of the
12427 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
12429 * class.cs : csc build fix for GetMethods(). See bug #52503.
12431 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
12433 * expression.cs: Make sure fp comparisons work with NaN.
12434 This fixes bug #54303. Mig approved this patch a long
12435 time ago, but we were not able to test b/c the runtime
12438 2004-03-19 Miguel de Icaza <miguel@ximian.com>
12440 * ecore.cs (TypExpr.GetHashCode): implement this overload.
12442 2004-03-19 Martin Baulig <martin@ximian.com>
12444 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12445 two overloads may unify for some type parameter substitutions and
12446 report a CS0408 if appropriate.
12448 2004-03-19 Martin Baulig <martin@ximian.com>
12450 * class.cs (MemberCore.IsDuplicateImplementation): Report the
12451 error here and not in our caller.
12453 2004-03-19 Martin Baulig <martin@ximian.com>
12455 * interface.cs: Completely killed this file.
12456 (Interface): We're now a TypeContainer and live in class.cs.
12458 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12459 argument; we're now also called for interfaces.
12460 (TypeContainer.DefineMembers): Allow this method being called
12462 (TypeContainer.GetMethods): New public method; formerly known as
12463 Interface.GetMethod(). This is used by PendingImplementation.
12464 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12465 it's now private and non-static.
12466 (Interface): Moved this here; it's now implemented similar to
12468 (Method, Property, Event, Indexer): Added `bool is_interface'
12469 argument to their .ctor's.
12470 (MemberBase.IsInterface): New public field.
12472 * cs-parser.jay: Create normal Method, Property, Event, Indexer
12473 instances instead of InterfaceMethod, InterfaceProperty, etc.
12474 (opt_interface_base): Removed; we now use `opt_class_base' instead.
12475 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12477 2004-03-19 Martin Baulig <martin@ximian.com>
12479 * class.cs (MethodCore.IsDuplicateImplementation): New private
12480 method which does the CS0111 checking.
12481 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12482 Use IsDuplicateImplementation().
12484 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
12486 * decl.cs (FindMemberToOverride): New method to find the correct
12487 method or property to override in the base class.
12489 - Make Method/Property use the above method to find the
12490 version in the base class.
12491 - Remove the InheritableMemberSignatureCompare as it is now
12494 This patch makes large code bases much faster to compile, as it is
12495 O(n) rather than O(n^2) to do this validation.
12497 Also, it fixes bug 52458 which is that nested classes are not
12498 taken into account when finding the base class member.
12500 Reviewed/Approved by Martin.
12502 2004-03-17 Martin Baulig <martin@ximian.com>
12504 * expression.cs (MemberAccess.DoResolve): Take the parent's number
12505 of type arguments into account; use the `real_num_type_args'
12506 approach like in DoResolveAsTypeStep().
12508 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12511 2004-03-17 Marek Safar <marek.safar@seznam.cz>
12513 * interface.cs: In all interface classes removed redundant
12514 member initialization.
12516 2004-03-16 Martin Baulig <martin@ximian.com>
12518 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12520 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12522 * decl.cs (DefineTypeAndParents): New helper method to define a
12523 type's containers before the type itself is defined; This is a
12524 bug exposed by the recent changes to Windows.Forms when an
12525 implemented interface was defined inside a class that had not been
12528 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12530 (Check): Loop correctly to report errors modifiers
12531 (UNSAFE was not in the loop, since it was the same as TOP).
12533 * interface.cs: Every interface member now takes a ModFlags,
12534 instead of a "is_new" bool, which we set on the base MemberCore.
12536 Every place where we called "UnsafeOk" in the interface, now we
12537 call the proper member (InterfaceMethod.UnsafeOK) instead to get
12538 the unsafe settings from the member declaration instead of the
12539 container interface.
12541 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
12543 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12544 `set_indexer_name' to the pending bits (one per type).
12546 We fixed a bug today that was picking the wrong method to
12547 override, since for properties the existing InterfaceMethod code
12548 basically ignored the method name. Now we make sure that the
12549 method name is one of the valid indexer names.
12551 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
12553 * support.cs (SeekableStreamReader): Keep track of stream byte
12554 positions and don't mix them with character offsets to the buffer.
12556 Patch from Gustavo Giráldez
12558 2004-03-15 Marek Safar <marek.safar@seznam.cz>
12560 * interface.cs (InterfaceSetGetBase): Removed double member
12561 initialization, base class does it as well.
12563 2004-03-13 Martin Baulig <martin@ximian.com>
12565 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12566 when compiling corlib.
12568 2004-03-13 Miguel de Icaza <miguel@ximian.com>
12570 * convert.cs (ExplicitConversion): We were reporting an error on
12571 certain conversions (object_type source to a value type, when the
12572 expression was `null') before we had a chance to pass it through
12573 the user defined conversions.
12575 * driver.cs: Replace / and \ in resource specifications to dots.
12578 * class.cs: Add check for duplicate operators. Fixes 52477
12580 2004-03-11 Miguel de Icaza <miguel@ximian.com>
12582 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12583 that are in the middle of the statements, not only at the end.
12586 * class.cs (TypeContainer.AddField): No longer set the
12587 `HaveStaticConstructor' flag, now we call it
12588 `UserDefineStaticConstructor' to diferentiate the slightly
12589 semantic difference.
12591 The situation is that we were not adding BeforeFieldInit (from
12592 Modifiers.TypeAttr) to classes that could have it.
12593 BeforeFieldInit should be set to classes that have no static
12598 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12600 And most importantly Zoltan's comment:
12602 http://bugzilla.ximian.com/show_bug.cgi?id=44229
12604 "I think beforefieldinit means 'it's ok to initialize the type sometime
12605 before its static fields are used', i.e. initialization does not need
12606 to be triggered by the first access to the type. Setting this flag
12607 helps the JIT to compile better code, since it can run the static
12608 constructor at JIT time, and does not need to generate code to call it
12609 (possibly lots of times) at runtime. Unfortunately, mcs does not set
12610 this flag for lots of classes like String.
12612 csc sets this flag if the type does not have an explicit static
12613 constructor. The reasoning seems to be that if there are only static
12614 initalizers for a type, and no static constructor, then the programmer
12615 does not care when this initialization happens, so beforefieldinit
12618 This bug prevents the AOT compiler from being usable, since it
12619 generates so many calls to mono_runtime_class_init that the AOT code
12620 is much slower than the JITted code. The JITted code is faster,
12621 because it does not generate these calls if the vtable is type is
12622 already initialized, which is true in the majority of cases. But the
12623 AOT compiler can't do this."
12625 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12627 * class.cs (MethodData.Emit): Refactor the code so symbolic
12628 information is generated for destructors; For some reasons we
12629 were taking a code path that did not generate symbolic information
12632 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12634 * class.cs: Create a Constructor.CheckBase method that
12635 takes care of all validation type code. The method
12636 contains some code that was moved from Define.
12638 It also includes new code that checks for duplicate ctors.
12639 This fixes bug #55148.
12641 2004-03-09 Joshua Tauberer <tauberer@for.net>
12643 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12644 a { ... }-style array creation invokes EmitStaticInitializers
12645 which is not good for reference-type arrays. String, decimal
12646 and now null constants (NullCast) are not counted toward
12647 static initializers.
12649 2004-03-05 Martin Baulig <martin@ximian.com>
12651 * location.cs (SourceFile.HasLineDirective): New public field;
12652 specifies whether the file contains or is referenced by a "#line"
12654 (Location.DefineSymbolDocuments): Ignore source files which
12655 either contain or are referenced by a "#line" directive.
12657 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12659 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12660 direct access to our parent, so check the method inline there.
12662 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12664 * expression.cs (Invocation.EmitCall): Miguel's last commit
12665 caused a regression. If you had:
12670 In Foo the implict this would be null.
12672 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12674 * expression.cs (Invocation.EmitCall): If the method is not
12675 virtual, do not emit a CallVirt to it, use Call.
12677 * typemanager.cs (GetFullNameSignature): Improve the method to
12678 cope with ".ctor" and replace it with the type name.
12680 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12681 as an argument the ConstructorBuilder where it is being defined,
12682 to catch the recursive constructor invocations.
12684 2004-03-16 Martin Baulig <martin@ximian.com>
12686 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12687 ConstructedType, call ResolveType() on it to get the type rather
12688 than just using `expr.Type'.
12690 2004-03-16 Martin Baulig <martin@ximian.com>
12692 * generics.cs (ConstructedType.GetMemberAccess): Take the
12693 EmitContext instead on the TypeExpr and use
12694 ec.TypeContainer.CurrentType/ec.ContainerType.
12696 2004-03-16 Martin Baulig <martin@ximian.com>
12698 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12699 parameters before aliases.
12701 2004-03-16 Martin Baulig <martin@ximian.com>
12703 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12704 New oublic function; checks whether two generic instances may become
12705 equal under some instantiations (26.3.1).
12707 * class.cs (TypeContainer.Define): Call
12708 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12711 2004-03-16 Martin Baulig <martin@ximian.com>
12713 * class.cs (TypeContainer.GetClassBases): Moved
12714 Error_TypeParameterAsBase() here and also check whether the base
12715 class is not an attribute.
12717 2004-03-16 Martin Baulig <martin@ximian.com>
12719 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12721 2004-03-16 Martin Baulig <martin@ximian.com>
12723 * class.cs (Error_TypeParameterAsBase): Use correct error number
12726 2004-03-16 Martin Baulig <martin@ximian.com>
12728 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12731 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12734 2004-03-15 Martin Baulig <martin@ximian.com>
12736 * typemanager.cs (TypeManager.GetFullName): New public method.
12737 (TypeManager.MemberLookup): Added `int_num_type_arguments'
12738 argument; only return members with the correct number of type
12740 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12741 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12742 whether the number of type arguments matches.
12744 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12745 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12747 * expression.cs (MemberAccess): Added public `NumTypeArguments'
12748 field; it's set by the protected .ctor when we're actually a
12749 GenericMemberAccess.
12750 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12751 arguments and pass it to MemberLookupFinal ().
12753 * ecore.cs (Expression.MemberLookup): Added `int
12754 num_type_arguments' argument; only return members with the correct
12755 number of type arguments.
12756 (Expression.MemberLookupFailed): Check whether the MemberLookup
12757 failed because we did not have the correct number of type
12758 arguments; report CS0305 in this case.
12760 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12761 `e.ResolveAsTypeTerminal()' already did so.
12763 2004-03-15 Martin Baulig <martin@ximian.com>
12765 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12766 we're a ConstructedType; in this case, the caller must report an
12767 error (for instance CS0131).
12769 * generic.cs (TypeArguments): Added Location argument to the .ctor.
12770 (TypeArguments.Resolve): Actually report errors here.
12772 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12774 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12775 `set_indexer_name' to the pending bits (one per type).
12777 We fixed a bug today that was picking the wrong method to
12778 override, since for properties the existing InterfaceMethod code
12779 basically ignored the method name. Now we make sure that the
12780 method name is one of the valid indexer names.
12782 2004-03-15 Martin Baulig <martin@ximian.com>
12784 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12785 for generic instances.
12787 2004-03-13 Martin Baulig <martin@ximian.com>
12789 * class.cs (TypeContainer.DefineType): Call
12790 TypeManager.AddUserType() immediately after creating the
12791 TypeBuilder; pass all type parameters when creating the
12794 * decl.cs (DeclSpace.FindNestedType): New public method.
12795 (DeclSpace.FindType): Added `int num_type_args' argument; only
12796 return types with the correct number of type parameters.
12797 (DeclSpace.CountTypeParams): New public property.
12799 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12800 the number of type parameters; defaults to zero.
12802 * generic.cs (TypeArguments.Count): New public property.
12803 (ConstructedType.DoResolveAsTypeStep): First call
12804 ds.FindNestedType() to find out whether we're nested in the
12805 current generic type; in this case, we inherit all type parameters
12806 from the current class.
12808 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12809 num_type_args' argument.
12810 (RootContext.LookupType): Added overloaded version which takes the
12811 number of type arguments; only return types with the correct
12812 number of type arguments.
12814 * typemanager.cs (TypeManager.CheckGeneric): New public function;
12815 checks whether `Type t' has `int num_type_args'.
12817 2004-03-13 Martin Baulig <martin@ximian.com>
12819 * generic.cs (GenericMethod.DefineType): New method; calls
12820 DefineType() on all the type parameters.
12822 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12823 (MethodData.Define): If we're a generic method, call
12824 GenericMethod.DefineType() to define the type parameters.
12826 2004-03-10 Martin Baulig <martin@ximian.com>
12828 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12829 instead of IsAssignableFrom.
12831 2004-03-10 Martin Baulig <martin@ximian.com>
12833 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12835 * support.cs (ParameterData.HasArrayParameter): New property.
12836 (ReflectionParameters.ctor): Take a MethodBase instead of a
12837 ParameterInfo[]. If we have any type parameters, get the generic
12838 method definition and ask it whether we have variable arguments.
12840 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12842 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12843 routines to check if a type is an enumerable/enumerator allow
12844 classes that implement the IEnumerable or IEnumerator interfaces.
12846 * class.cs (Property, Operator): Implement IIteratorContainer, and
12847 implement SetYields.
12849 (Property.Define): Do the block swapping for get_methods in the
12850 context of iterators. We need to check if Properties also
12851 include indexers or not.
12853 (Operator): Assign the Block before invoking the
12854 OperatorMethod.Define, so we can trigger the Iterator code
12857 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12858 Property and Operator classes are not created when we parse the
12859 declarator but until we have the block completed, so we use a
12860 singleton SimpleIteratorContainer.Simple to flag whether the
12861 SetYields has been invoked.
12863 We propagate this setting then to the Property or the Operator to
12864 allow the `yield' to function.
12866 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12868 * codegen.cs: Implemented attribute support for modules.
12869 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12870 Assembly/Module functionality.
12872 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12873 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12874 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12876 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12878 * interface.cs (FindMembers): The operation is performed on all base
12879 interfaces and not only on the first. It is required for future CLS Compliance patch.
12881 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12883 * statement.cs, codegen.cs:
12884 This patch deals with patterns such as:
12886 public class List : IEnumerable {
12888 public MyEnumerator GetEnumerator () {
12889 return new MyEnumerator(this);
12892 IEnumerator IEnumerable.GetEnumerator () {
12896 public struct MyEnumerator : IEnumerator {
12901 Before, there were a few things we did wrong:
12902 1) we would emit callvirt on a struct, which is illegal
12903 2) we emited ldarg when we needed to emit ldarga
12904 3) we would mistakenly call the interface methods on an enumerator
12905 type that derived from IEnumerator and was in another assembly. For example:
12907 public class MyEnumerator : IEnumerator
12909 Would have the interface methods called, even if there were public impls of the
12910 method. In a struct, this lead to invalid IL code.
12912 2004-02-11 Marek Safar <marek.safar@seznam.cz>
12914 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12917 * delegate.cs (Define): Fixed crash when delegate type is undefined.
12919 2004-02-11 Miguel de Icaza <miguel@ximian.com>
12921 * cs-parser.jay: Fix small regression: we were not testing V2
12922 compiler features correctly.
12924 * interface.cs: If the emit context is null, then create one
12926 2004-02-09 Marek Safar <marek.safar@seznam.cz>
12928 * decl.cs (GetSignatureForError): New virtual method to get full name
12929 for error messages.
12931 * attribute.cs (IAttributeSupport): New interface for attribute setting.
12932 Now it is possible to rewrite ApplyAttributes method to be less if/else.
12934 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12935 Duplicated members and code in these classes has been removed.
12936 Better encapsulation in these classes.
12938 2004-02-07 Miguel de Icaza <miguel@ximian.com>
12940 * assign.cs (Assign.DoResolve): When dealing with compound
12941 assignments, there is a new rule in ECMA C# 2.4 (might have been
12942 there before, but it is documented here) that states that in:
12946 If b is of type int, and the `op' is a shift-operator, then the
12947 above is evaluated as:
12951 * expression.cs (Binary.ResolveOperator): Instead of testing for
12952 int/uint/long/ulong, try to implicitly convert to any of those
12953 types and use that in pointer arithmetic.
12955 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12956 method to print information for from the type, not from the
12957 null-method we were given.
12959 2004-02-01 Duncan Mak <duncan@ximian.com>
12961 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12962 parsing for cmd, fixes bug #53694.
12964 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12966 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12967 in the member name duplication tests. Property and operator name duplication
12968 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12970 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12972 * interface.cs (PopulateMethod): Fixed crash when interface method
12973 returns not existing type (error test cs0246-3.cs).
12975 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12977 * cs-parser.jay (interface_accessors): Re-write actions to also
12978 store attributes attached to get and set methods. Fix spelling
12981 (inteface_property_declaration): Modify accordingly.
12983 (InterfaceAccessorInfo): New helper class to store information to pass
12984 around between rules that use interface_accessors.
12986 * interface.cs (Emit): Apply attributes on the get and set
12987 accessors of properties and indexers too.
12989 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12990 right MethodBuilder when applying attributes to the get and set accessors.
12992 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12994 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12996 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12998 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
13000 2004-01-25 Miguel de Icaza <miguel@ximian.com>
13002 * cs-parser.jay: Remove YIELD token, instead use the new grammar
13003 changes that treat `yield' specially when present before `break'
13004 or `return' tokens.
13006 * cs-tokenizer.cs: yield is no longer a keyword.
13008 2004-01-23 Marek Safar <marek.safar@seznam.cz>
13010 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13011 setting for default constructors.
13012 For default constructors are almost every time set wrong Modifier. The
13013 generated IL code has been alright. But inside mcs this values was
13014 wrong and this was reason why several of my CLS Compliance tests
13017 2004-02-27 Martin Baulig <martin@ximian.com>
13019 * generics.cs (ConstructedType.ResolveType): Make the nested type
13020 stuff actually work.
13022 2004-02-25 Martin Baulig <martin@ximian.com>
13024 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
13025 property; returns the type parameters just from the current type,
13026 ie. with the ones from outer classes.
13027 (DeclSpace.LookupGeneric): First search in the current class, then
13029 (DeclSpace.initialize_type_params): When hiding a type parameter
13030 from an outer class, put it into the `type_param_list' anyways.
13032 * expression.cs (MemberAccess.expr): Made this field protected.
13034 * class.cs (TypeContainer.Define): The `CurrentType' just contains
13035 the type parameters from the current class.
13037 * generic.cs (ConstructedType.ResolveType): Support nested generic
13038 types by taking the type parameters which we inherit from outer
13039 classes into account.
13040 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
13041 support for nested generic types.
13043 2004-02-23 Martin Baulig <martin@ximian.com>
13045 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
13046 field and check whether we're nested inside a generic type.
13047 (DeclSpace.ResolveType): If we're resolving to a generic type
13048 definition, create a ConstructedType and return its resolved type.
13049 (DeclSpace.initialize_type_params): New private method;
13050 initializes the `type_param_list' field from the type parameters
13051 from this and all enclosing classes.
13052 (DeclSpace.TypeParameters): Call initialize_type_params() unless
13053 we're already initialized.
13055 2004-02-23 Martin Baulig <martin@ximian.com>
13057 * class.cs (Method.Define): Create the generic method before
13058 calling DoDefine().
13059 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
13060 the TypeContainer one); we use this for generic methods.
13062 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
13063 parent's TypeBuilder.
13065 2004-02-18 Martin Baulig <martin@ximian.com>
13067 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
13068 to check for equality.
13070 2004-02-05 Martin Baulig <martin@ximian.com>
13072 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
13073 `ec.TypeContainer.CurrentType', use it instead of
13074 `ec.ContainerType' to check whether we're in the type's ctor.
13076 2004-01-29 Martin Baulig <martin@ximian.com>
13078 * expression.cs (Invocation.DoResolve): If we're a
13079 `ConstructedType', then we're actually a generic method, so
13080 rewrite the expr as a GenericMemberAccess.
13082 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
13083 here; manually parse it into a string.
13085 2004-01-28 Martin Baulig <martin@ximian.com>
13087 * typemanager.cs (TypeManager.IsEqual): New static method.
13088 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
13089 check for equality instead of using `=='.
13091 2004-01-26 Martin Baulig <martin@ximian.com>
13093 * decl.cs (DeclSpace.CurrentType): New public field.
13095 * expression.cs (This.ResolveBase): If we have an
13096 `ec.TypeContainer.CurrentType', use it instead of
13097 `ec.ContainerType'.
13099 * class.cs (TypeContainer.DefineType): If we're a generic type,
13100 create the `CurrentType' (unresolved).
13101 (TypeContainer.GenericType): New private field.
13102 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
13103 it and store it in `GenericType' before creating the MemberCache.
13104 (TypeContainer.GetMembers): If we have a `GenericType', call
13105 TypeManager.FindMembers() on it.
13107 * interface.cs (Interface.GenericType): New private field.
13108 (Interface.DefineType): If we're a generic type, create the
13109 `CurrentType' (unresolved).
13110 (Interface.DefineMembers): If we have a `CurrentType', resolve it
13111 and store it in `GenericType' before creating the MemberCache.
13112 (Interface.GetMembers): If we have a `GenericType', call
13113 TypeManager.FindMembers() on it.
13115 2004-01-22 Martin Baulig <martin@ximian.com>
13117 * cs-parser.jay (namespace_or_type_name): Return an Expression,
13118 not a QualifiedIdentifier. This is what `type_name_expression'
13119 was previously doing.
13120 (type_name_expression): Removed; the code is now in
13121 `namespace_or_type_name'.
13122 (qualified_identifier): Removed, use `namespace_or_type_name'
13124 (QualifiedIdentifier): Removed this class.
13126 2004-01-22 Martin Baulig <martin@ximian.com>
13128 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13129 not a string as alias name.
13131 2004-01-21 Miguel de Icaza <miguel@ximian.com>
13133 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13134 #52730 bug, and instead compute correctly the need to use a
13135 temporary variable when requesting an address based on the
13136 static/instace modified of the field and the constructor.
13138 2004-01-21 Martin Baulig <martin@ximian.com>
13140 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13141 class and namespace before looking up aliases. Fixes #52517.
13143 2004-01-21 Martin Baulig <martin@ximian.com>
13145 * flowanalysis.cs (UsageVector.Merge): Allow variables being
13146 assinged in a 'try'; fixes exception4.cs.
13148 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13149 * class.cs : Implemented parameter-less constructor for TypeContainer
13151 * decl.cs: Attributes are now stored here. New property OptAttributes
13153 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13155 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13157 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13159 * typemanager.cs (CSharpSignature): Now reports also inner class name.
13160 (CSharpSignature): New method for indexer and property signature.
13162 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13164 * pending.cs (IsVirtualFilter): Faster implementation.
13166 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13168 * typemanager.cs: Avoid inclusion of same assembly more than once.
13170 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13172 * cs-parser.jay: Fixed problem where the last assembly attribute
13173 has been applied also to following declaration (class, struct, etc.)
13175 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13177 * class.cs: Added error CS0538, CS0539 reporting.
13178 Fixed crash on Microsoft runtime when field type is void.
13180 * cs-parser.jay: Added error CS0537 reporting.
13182 * pending.cs: Added error CS0535 reporting.
13183 Improved error report for errors CS0536, CS0534.
13185 2004-01-20 Miguel de Icaza <miguel@ximian.com>
13187 Merge a few bits from the Anonymous Method MCS tree.
13189 * statement.cs (ToplevelBlock): New class for toplevel methods,
13190 will hold anonymous methods, lifted variables.
13192 * cs-parser.jay: Create toplevel blocks for delegates and for
13193 regular blocks of code.
13195 2004-01-20 Martin Baulig <martin@ximian.com>
13197 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13198 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13199 and `NeedExplicitReturn'; added `IsLastStatement'.
13200 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13201 have a `ReturnLabel' or we're not unreachable.
13203 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13204 child's reachability; don't just override ours with it. Fixes
13205 #58058 (lluis's example).
13206 (FlowBranching): Added public InTryOrCatch(), InCatch(),
13207 InFinally(), InLoop(), InSwitch() and
13208 BreakCrossesTryCatchBoundary() methods.
13210 * statement.cs (Return): Do all error checking in Resolve().
13211 Unless we are the last statement in a top-level block, always
13212 create a return label and jump to it.
13213 (Break, Continue): Do all error checking in Resolve(); also make
13214 sure we aren't leaving a `finally'.
13215 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13216 statement in a top-level block.
13217 (Block.Flags): Added `IsDestructor'.
13218 (Block.IsDestructor): New public property.
13220 2004-01-20 Martin Baulig <martin@ximian.com>
13222 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13224 2004-01-20 Martin Baulig <martin@ximian.com>
13226 * statement.cs (Statement.ResolveUnreachable): New public method.
13227 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13228 (Block.Resolve): Resolve unreachable statements.
13230 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13232 * expression.cs: We need to fix the case where we do
13233 not have a temp variable here.
13235 * assign.cs: Only expression compound assignments need
13236 temporary variables.
13238 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13240 * flowanalysis.cs: Reduce memory allocation in a few ways:
13241 - A block with no variables should not allocate a bit
13243 - A method with no out parameters does not need any tracking
13244 for assignment of the parameters, so we need not allocate
13247 public readonly Type[] VariableTypes;
13248 public readonly string[] VariableNames;
13249 Are redundant. The data is already stored in the variable
13250 map, so we need not allocate another array for it.
13251 - We need to add alot of checks for if (params | locals) == null
13252 due to the first two changes.
13254 2004-01-18 Miguel de Icaza <miguel@ximian.com>
13256 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13257 implement IMemoryLocation, we store a copy on a local variable and
13258 take the address of it. Patch from Benjamin Jemlich
13260 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13261 to use a special "type_name_expression" rule which reduces the
13262 number of "QualifiedIdentifier" classes created, and instead
13263 directly creates MemberAccess expressions.
13265 2004-01-17 Miguel de Icaza <miguel@ximian.com>
13267 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13268 that fixes #52853. Null literal assignment to ValueType
13270 * class.cs (MethodData.Emit): Instead of checking the name of the
13271 method to determine if its a destructor, create a new derived
13272 class from Method called Destructor, and test for that.
13274 * cs-parser.jay: Create a Destructor object instead of a Method.
13276 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13280 2004-01-16 Miguel de Icaza <miguel@ximian.com>
13282 * expression.cs (Binary.ResolveOperator): Perform an implicit
13283 conversion from MethodGroups to their delegate types on the
13284 Addition operation.
13286 * delegate.cs: Introduce a new class DelegateCreation that is the
13287 base class for `NewDelegate' and `ImplicitDelegateCreation',
13288 factor some code in here.
13290 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13291 conversion from MethodGroups to compatible delegate types.
13293 * ecore.cs (Expression.Resolve): Do not flag error 654
13294 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13295 we allow conversions from MethodGroups to delegate types now.
13297 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13298 assignments in v2 either.
13300 2004-01-10 Miguel de Icaza <miguel@ximian.com>
13302 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13303 static read-only fields in ctors.
13305 Applied patch from Benjamin Jemlich
13307 * expression.cs (UnaryMutator): Avoid leaking local variables.
13309 2004-01-09 Miguel de Icaza <miguel@ximian.com>
13311 * cs-tokenizer.cs (IsCastToken): Allow the various native types
13312 here to return true, as they can be used like this:
13314 (XXX) int.MEMBER ()
13316 Fixed 49836 and all the other dups
13318 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
13320 * driver.cs: Implement /win32res and /win32icon.
13322 2004-01-08 Miguel de Icaza <miguel@ximian.com>
13324 * cs-parser.jay: Add a rule to improve error handling for the
13325 common mistake of placing modifiers after the type.
13327 2004-01-07 Miguel de Icaza <miguel@ximian.com>
13329 * cs-parser.jay (interface_event_declaration): Catch
13330 initialization of events on interfaces, and report cs0068
13332 * cs-parser.jay (interface_event_declaration): Catch
13333 initialization of events.
13335 * ecore.cs: Better report missing constructors.
13337 * expression.cs (Binary.ResolveOperator): My previous bug fix had
13338 the error reporting done in the wrong place. Fix.
13340 * expression.cs (Binary.ResolveOperator): Catch the
13341 operator + (E x, E y) error earlier, and later allow for implicit
13342 conversions in operator +/- (E e, U x) from U to the underlying
13345 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13346 52596, if the container class is abstract, the default constructor
13347 is protected otherwise its public (before, we were always public).
13349 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13352 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13353 Jemlich that fixes bug #52597, MCS was generating invalid code for
13354 idisposable structs. Thanks to Ben for following up with this
13357 2004-01-06 Miguel de Icaza <miguel@ximian.com>
13359 * driver.cs: Allow assemblies without code to be generated, fixes
13362 2004-01-07 Nick Drochak <ndrochak@gol.com>
13364 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13366 2004-01-05 Miguel de Icaza <miguel@ximian.com>
13368 * cs-parser.jay: Add rules to improve error reporting if fields or
13369 methods are declared at the namespace level (error 116)
13371 * Add rules to catch event add/remove
13373 2004-01-04 David Sheldon <dave-mono@earth.li>
13375 * expression.cs: Added matching ")" to error message for
13378 2004-01-03 Todd Berman <tberman@gentoo.org>
13380 * ecore.cs, attribute.cs:
13381 Applying fix from #52429.
13383 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13385 * ecore.cs, expression.cs, statement.cs:
13386 Total rewrite of how we handle branching. We
13387 now handle complex boolean expressions with fewer
13388 jumps. As well if (x == 0) no longer emits a ceq.
13390 if (x is Foo) is much faster now, because we generate
13393 Overall, we get a pretty big improvement on our benchmark
13394 tests. The code we generate is smaller and more readable.
13396 I did a full two-stage bootstrap. The patch was reviewed
13397 by Martin and Miguel.
13399 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13401 * cs-parser.jay: Make primary_expression not take a QI.
13402 we dont need this because the member_access rule covers
13403 us here. So we replace the rule with just IDENTIFIER.
13405 This has two good effects. First, we remove a s/r conflict.
13406 Second, we allocate many fewer QualifiedIdentifier objects.
13408 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13410 * attribute.cs: Handle MarshalAs attributes as pseudo, and
13411 set the correct information via SRE. This prevents
13412 hanging on the MS runtime. Fixes #29374.
13414 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13416 * convert.cs: correctly handle conversions to value types
13417 from Enum and ValueType as unboxing conversions.
13419 Fixes bug #52569. Patch by Benjamin Jemlich.
13421 2004-01-02 Ravi Pratap <ravi@ximian.com>
13423 * expression.cs (BetterConversion): Prefer int -> uint
13424 over int -> ulong (csc's behaviour). This fixed bug #52046.
13426 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
13428 * decl.cs (MemberCache.FindMembers): now returns a
13431 * typemanager.cs: In general, go with with ^^.
13432 (CopyNewMethods): take an IList.
13433 (RealMemberLookup): Only allocate an arraylist
13434 if we copy from two sets of methods.
13436 This change basically does two things:
13437 1) Fewer array lists allocated due to CopyNewMethods.
13438 2) the explicit cast in MemberList costed ALOT.
13440 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
13442 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13443 a hashtable to avoid needless string allocations when an identifier is
13444 used more than once (the common case).
13446 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13448 * pending.cs: MS's TypeBuilder.GetInterfaces ()
13449 is broken, it will not return anything. So, we
13450 have to use the information we have in mcs to
13453 * typemanager.cs: Add a cache for GetInterfaces,
13454 since this will now be used more often (due to ^^)
13456 (GetExplicitInterfaces) New method that gets the
13457 declared, not effective, interfaces on a type
13458 builder (eg, if you have interface IFoo, interface
13459 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13462 This patch makes MCS able to bootstrap itself on
13465 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13467 * expression.cs: Remove the Nop's that Miguel put
13470 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13472 * report.cs, codegen.cs: Give the real stack trace to
13473 the error when an exception is thrown.
13475 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13477 * decl.cs: only allocate hashtables for ifaces if
13480 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13482 * expression.cs: fix the error from cs0121-2.cs
13483 (a parent interface has two child interfaces that
13484 have a function with the same name and 0 params
13485 and the function is called through the parent).
13487 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
13489 * class.cs, rootcontext.cs, typmanager.cs: do not
13492 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
13494 * codegen.cs: remove stack for the ec flow branching.
13495 It is already a linked list, so no need.
13497 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
13499 * Makefile: Allow custom profiler here.
13501 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13503 * typemanager.cs (LookupType):
13504 - Use a static char [], because split takes
13505 a param array for args, so it was allocating
13507 - Do not store true in a hashtable, it boxes.
13509 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13511 * flowanalysis.cs: bytify common enums.
13513 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13515 * modifiers.cs: Add a new set of flags for the
13516 flags allowed on explicit interface impls.
13517 * cs-parser.jay: catch the use of modifiers in
13518 interfaces correctly.
13519 * class.cs: catch private void IFoo.Blah ().
13521 All related to bug #50572.
13523 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13525 * decl.cs: Rewrite the consistant accessability checking.
13526 Accessability is not linear, it must be implemented in
13527 a tableish way. Fixes #49704.
13529 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13531 * expression.cs: Handle negation in a checked context.
13532 We must use subtraction from zero. Fixes #38674.
13534 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13536 * class.cs: Ignore static void main in DLLs.
13537 * rootcontext.cs: Handle the target type here,
13538 since we are have to access it from class.cs
13539 * driver.cs: account for the above.
13541 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13543 * report.cs: Give line numbers and files if available.
13545 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
13547 * driver.cs: Implement /addmodule.
13549 * typemanager.cs: Change 'modules' field so it now contains Modules not
13552 2003-12-20 Martin Baulig <martin@ximian.com>
13554 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13555 (FieldBase.IsAssigned): Removed this field.
13556 (FieldBase.SetAssigned): New public method.
13557 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13559 2003-12-20 Martin Baulig <martin@ximian.com>
13561 * expression.cs (LocalVariableReference.DoResolve): Don't set
13562 `vi.Used' if we're called from DoResolveLValue().
13564 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13565 returns the usage vector it just merged into the current one -
13566 pass this one to UsageWarning().
13567 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13568 of the `EmitContext', don't call this recursively on our children.
13570 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
13572 * driver.cs: Implement /target:module.
13574 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
13576 * support.cs (CharArrayHashtable): New helper class.
13578 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
13579 char arrays, not strings, so we can avoid creating a string in
13580 consume_identifier if the identifier is a keyword.
13582 2003-12-16 Martin Baulig <martin@ximian.com>
13584 * statement.cs (LocalInfo.Assigned): Removed this property.
13585 (LocalInfo.Flags): Removed `Assigned'.
13586 (LocalInfo.IsAssigned): New public method; takes the EmitContext
13587 and uses flow analysis.
13588 (Block.UsageWarning): Made this method private.
13589 (Block.Resolve): Call UsageWarning() if appropriate.
13591 * expression.cs (LocalVariableReference.DoResolve): Always set
13592 LocalInfo.Used here.
13594 2003-12-13 Martin Baulig <martin@ximian.com>
13596 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13597 any value here; we're now using flow analysis to figure out
13598 whether a statement/block returns a value.
13600 2003-12-13 Martin Baulig <martin@ximian.com>
13602 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13604 (FlowBranching.MergeFinally): Don't call
13605 `branching.CheckOutParameters()' here, this is called in
13607 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13608 when adding the `finally' vector.
13610 2003-12-13 Martin Baulig <martin@ximian.com>
13613 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13614 actually work and also fix #48962.
13616 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
13618 * decl.cs: Do not check System.Object for nested types,
13619 since we know it does not have any. Big bang for buck:
13622 Run 1: 8.35 seconds
13623 Run 2: 8.32 seconds
13624 corlib: 17.99 seconds
13626 Run 1: 8.17 seconds
13627 Run 2: 8.17 seconds
13628 corlib: 17.39 seconds
13630 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13632 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13633 time we are returning 0 members, so we save alot here.
13635 2003-12-11 Martin Baulig <martin@ximian.com>
13637 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13638 `MergeChild()', also just take the `FlowBranching' as argument;
13639 call Merge() on it and return the result.
13640 (FlowBranching.Merge): We don't need to do anything if we just
13643 2003-12-11 Martin Baulig <martin@ximian.com>
13645 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13646 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13647 Maurer for this idea.
13649 2003-12-11 Martin Baulig <martin@ximian.com>
13651 * flowanalysis.cs (MergeResult): This class is now gone; we now
13652 use the `UsageVector' for this. The reason for this is that if a
13653 branching just has one sibling, we don't need to "merge" them at
13654 all - that's the next step to do.
13655 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13658 2003-12-11 Martin Baulig <martin@ximian.com>
13660 Reworked flow analyis and made it more precise and bug-free. The
13661 most important change is that we're now using a special `Reachability'
13662 class instead of having "magic" meanings of `FlowReturns'. I'll
13663 do some more cleanups and optimizations and also add some more
13664 documentation this week.
13666 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13667 largely reworked this class.
13668 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13669 the new `Reachability' class instead of having "magic" values here.
13670 (FlowBranching): We're now using an instance of `Reachability'
13671 instead of having separate `Returns', `Breaks' etc. fields.
13673 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13674 based on flow analysis; ignore the return value of block.Emit ().
13676 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13678 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13679 if they are private.
13681 2003-12-09 Martin Baulig <martin@ximian.com>
13683 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13684 call them directly on the UsageVector.
13686 2003-12-09 Martin Baulig <martin@ximian.com>
13688 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13689 Changed return type from `FlowReturns' to `Reachability'.
13691 2003-12-09 Martin Baulig <martin@ximian.com>
13693 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13694 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13695 `Reachable' fields with a single `Reachability' one.
13697 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13699 * class.cs (FindMembers): Remove foreach's.
13704 Run 1: 8.74 seconds
13705 Run 2: 8.71 seconds
13708 Run 1: 8.64 seconds
13709 Run 2: 8.58 seconds
13712 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13717 This patch does a few things:
13718 1. EmptyStatement is now a singleton, so it is never reallocated.
13719 2. All blah is EmptyStatement constructs have been changed to
13720 blah == EmptyStatement.Value, which is much faster and valid
13721 now that EmptyStatement is a singleton.
13722 3. When resolving a block, rather than allocating a new array for
13723 the non-empty statements, empty statements are replaced with
13724 EmptyStatement.Value
13725 4. Some recursive functions have been made non-recursive.
13726 Mainly the performance impact is from (3), however (1) and (2) are needed for
13727 this to work. (4) does not make a big difference in normal situations, however
13728 it makes the profile look saner.
13733 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13734 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13735 Total memory allocated: 56397 KB
13738 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13739 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13740 Total memory allocated: 55666 KB
13742 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13744 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13745 than the hashtable in a hashtable version
13747 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13748 we always end up concating a string. This results in a huge perf
13749 loss, because many strings have to be tracked by the GC. In this
13750 patch, we first use a hashtable that works with two keys, so that
13751 the strings do not need to be concat'ed.
13755 Run 1: 8.74 seconds
13756 Run 2: 8.71 seconds
13759 Run 1: 8.65 seconds
13760 Run 2: 8.56 seconds
13762 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13764 * Makefile: Add a new target `do-time' that does a quick and simple
13765 profile, leaving easy to parse output.
13767 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13769 * codegen.cs (Init): Create the dynamic assembly with
13770 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13772 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13774 * support.cs: Make the PtrHashtable use only one
13775 instance of its comparer.
13777 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13779 * typemanager.cs: Fix lookup of GetNamespaces.
13781 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13783 * expression.cs: Removed redundant line.
13785 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13786 ArrayLists, use for loops with bounds.
13788 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13791 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13792 arraylists, use for loop with bounds.
13794 The above three changes give us a 0.071 second performance
13795 improvement out of 3.294 seconds down to 3.223. On my machine
13796 the above changes reduced the memory usage by 1,387 KB during
13797 compiler bootstrap.
13799 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13800 QualifiedIdentifiers. Before we created a new string through
13801 concatenation, and mostly later on, the result would be
13802 manipulated by DecomposeQI through string manipulation.
13804 This reduced the compiler memory usage for bootstrapping from
13805 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13806 compile times in 0.05 seconds.
13808 2003-11-28 Dick Porter <dick@ximian.com>
13810 * support.cs: Do string compares with the Invariant culture.
13818 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13819 the comparison is done with the Invariant culture.
13821 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13823 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13824 GetEnumerator method.
13826 (ProbeCollectionType): Iterate starting at the most specific type
13827 upwards looking for a GetEnumerator
13829 * expression.cs: Shift count can be up to 31 for int/uint and 63
13832 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13834 * statement.cs (Block.LookupLabel): Also look for the label on the
13835 children blocks. Use a hash table to keep track of visited
13838 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13839 we actually did transform the other operand, otherwise fall back
13840 to the common codepath that casts to long.
13842 * cs-tokenizer.cs: Use the same code pattern as the int case.
13843 Maybe I should do the parsing myself, and avoid depending on the
13844 Parse routines to get this done.
13846 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13848 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13849 which fixes bug 51347. This time test it.
13851 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13852 attributes for example can not tell the difference between these.
13853 The difference was only a syntax feature of the language.
13855 * attribute.cs: Apply attributes to delegates.
13857 * delegate.cs: Call the apply attributes method.
13859 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13861 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13862 comparing 0 vs Byte.MinValue, not the value
13864 (ImplicitConversionRequired): When reporting a conversion error,
13865 use error 31 to print out the constant error instead of the
13868 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13869 which fixes bug 51347.
13871 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13873 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13874 which fixes the -warnaserror command line option.
13876 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13878 * cfold.cs (DoNumericPromotions): During constant folding of
13879 additions on UIntConstant, special case intconstants with
13880 IntConstants like we do on the expression binary operator.
13882 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13884 * convert.cs (ImplicitReferenceConversion): We were missing a case
13885 (System.Enum are not value types or class types, so we need to
13886 classify them separatedly).
13888 * driver.cs: We do not support error 2007.
13890 2003-11-12 Jackson Harper <jackson@ximian.com>
13892 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13893 system directory. Also use the full file name so users can
13894 libraries names mscorlib-o-tron.dll in a non system dir.
13896 2004-01-04 David Sheldon <dave-mono@earth.li>
13898 * expression.cs: Added matching ")" to error message for CS0077.
13900 2003-12-19 Martin Baulig <martin@ximian.com>
13902 * typemanager.cs (TypeManager.IsEqualGenericType): New public
13903 static method; see documentation in the method.
13904 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13906 * convert.cs (Convert.ImplicitReferenceConversion,
13907 Convert.ImplicitReferenceConversionExists): Add support for
13908 generic type declarations; see gen-36.cs.
13910 2003-12-19 Martin Baulig <martin@ximian.com>
13912 * pending.cs (Pending.InterfaceMethod): Use
13913 `Type.IsAssignableFrom()' instead of `=='.
13915 2003-12-18 Martin Baulig <martin@ximian.com>
13917 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13920 * convert.cs (Convert.ImplicitStandardConversionExists): Use
13921 `expr_type.Equals (target_type)' instead of `=='.
13923 2003-12-08 Martin Baulig <martin@ximian.com>
13925 * generics.cs (Constraints.Types): Removed.
13926 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13928 (Constraints.ResolveTypes): New public method; resolves the
13929 TypeExpr's to Type's.
13930 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13931 longer takes the constraints.
13932 (TypeParameter.DefineMethod): Likewise.
13933 (TypeParameter.DefineType): New public method. Calls
13934 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13937 2003-12-08 Martin Baulig <martin@ximian.com>
13939 * convert.cs (Convert.ImplicitConversionStandard): Use
13940 `expr_type.Equals (target_type)' instead of `=='.
13942 2003-12-08 Martin Baulig <martin@ximian.com>
13944 * typemanager.cs (TypeManager.GetReferenceType): Call
13945 `Type.MakeByRefType ()'.
13947 2003-12-08 Martin Baulig <martin@ximian.com>
13949 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13950 just has some special meaning in some situations. For instance,
13951 it is allowed to use `where' as the name of a variable etc.
13953 2003-12-04 Martin Baulig <martin@ximian.com>
13955 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13956 `Type.MakeArrayType()' for array types.
13958 2003-11-18 Miguel de Icaza <miguel@ximian.com>
13960 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13963 (SizeOf.DoResolve): assign the `type_queried' field. This gets
13966 2003-11-16 Martin Baulig <martin@ximian.com>
13968 * codegen.cs (EmitContext.IsGeneric): Removed.
13970 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13971 ResolveGeneric() on the DeclSpace.
13973 2003-11-16 Martin Baulig <martin@ximian.com>
13975 * generic.cs (TypeArguments.Resolve):
13976 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13977 `ResolveType()' on it to get the Type.
13979 2003-11-15 Martin Baulig <martin@ximian.com>
13981 * generic.cs (ConstructedType.GetInterfaces): Override this.
13983 2003-11-14 Martin Baulig <martin@ximian.com>
13985 * interface.cs (Interface.DefineType): Define all type parameters
13986 before adding the interfaces we inherit.
13988 2003-11-11 Martin Baulig <martin@ximian.com>
13990 * generic.cs (ConstructedType.ResolveType): Always call
13991 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13993 2003-11-10 Martin Baulig <martin@ximian.com>
13995 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13996 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13997 calling `ResolveType()' on them, directly assign their `Type'.
13999 2003-11-08 Martin Baulig <martin@ximian.com>
14001 * generic.cs (ConstructedType): Override `IsClass' etc.
14003 2003-11-08 Martin Baulig <martin@ximian.com>
14005 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
14006 return value and the `out parent' parameter.
14007 (TypeContainer.DefineType): Moved the CS0644 check into
14008 GetClassBases(). Don't pass the interface types to the
14009 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
14010 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
14012 * ecore.cs (TypeExpr.IsAttribute): New property.
14013 (TypeExpr.GetInterfaces): New method.
14015 * interface.cs (Interface.GetInterfaceTypeByName): Return a
14016 TypeExpr instead of a Type.
14017 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
14018 (Interface.DefineType): Don't pass the interface types to the
14019 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
14020 them later and then call `TypeBulider.AddInterfaceImplementation()'.
14022 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
14023 instead of a `Type[]'.
14024 (TypeManager.RegisterBuilder): Likewise.
14025 (TypeManager.AddUserInterface): Likewise.
14026 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
14027 `Type[]' and also return a `TypeExpr[]'.
14028 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
14030 2003-11-08 Martin Baulig <martin@ximian.com>
14032 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
14035 2003-11-08 Martin Baulig <martin@ximian.com>
14037 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14038 TypeManager.ResolveExpressionTypes().
14040 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14041 instead of an Expression.
14042 (TypeExpr): This is now an abstract base class for `TypeExpression'.
14043 (TypeExpression): New public class; formerly known as `TypeExpr'.
14045 * expression.cs (ComposedCast): Derive from TypeExpr.
14047 * typemanager.cs (TypeManager.system_*_expr): These are now
14048 TypExpr's instead of Expression's.
14049 (TypeManager.ResolveExpressionTypes): New public static function;
14050 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14053 2003-11-06 Miguel de Icaza <miguel@ximian.com>
14055 * expression.cs (New.DoResolve): Do not dereference value that
14056 might be a null return.
14058 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14059 sure that the constant value has the right type. Fixes an
14060 unreported bug, similar to 50425.
14062 * const.cs (Const.LookupConstantValue): Call
14063 ImplicitStandardConversionExists before doing a conversion to
14064 avoid havng the TypeManager.ChangeType do conversions.
14066 Reduced the number of casts used
14068 (Const.ChangeType): New routine to enable reuse of the constant
14069 type changing code from statement.
14071 * typemanager.cs (ChangeType): Move common initialization to
14072 static global variables.
14076 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14077 every value type to go through, even if it was void. Fix that.
14079 * cs-tokenizer.cs: Use is_identifier_start_character on the start
14080 character of the define, and the is_identifier_part_character for
14081 the rest of the string.
14083 2003-11-05 Miguel de Icaza <miguel@ximian.com>
14085 * expression.cs (UnaryMutator.EmitCode): When I updated
14086 LocalVariableReference.DoResolve, I overdid it, and dropped an
14087 optimization done on local variable references.
14089 2003-11-04 Miguel de Icaza <miguel@ximian.com>
14091 * ecore.cs: Convert the return from Ldlen into an int.
14093 2003-10-20 Miguel de Icaza <miguel@ximian.com>
14095 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14096 the accessibility, this is a special case for toplevel non-public
14097 classes (internal for instance).
14099 2003-10-20 Nick Drochak <ndrochak@gol.com>
14101 * ecore.cs: Fix typo and build. Needed another right paren.
14103 2003-10-19 Miguel de Icaza <miguel@ximian.com>
14105 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
14106 `internal' case regular and protected, but not allowing protected
14107 to be evaluated later. Bug 49840
14109 2003-10-15 Miguel de Icaza <miguel@ximian.com>
14111 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14112 to kb.Nlast, and not the kb.nFirst to isolate the switch
14115 Extract the underlying type, so enumerations of long/ulong are
14116 treated like long/ulong.
14118 2003-10-14 Miguel de Icaza <miguel@ximian.com>
14120 * expression.cs (New): Overload the meaning of RequestedType to
14121 track the possible creation of the NewDelegate type, since
14122 DoResolve is invoked more than once for new constructors on field
14125 See bugs: #48800 and #37014
14127 * cs-parser.jay (declare_local_constants): Take an arraylist
14128 instead of a single constant.
14130 (local_constant_declaration): It should take a
14131 constant_declarators, not a constant_declarator. Fixes 49487
14133 * convert.cs: Fix error report.
14135 2003-10-13 Jackson Harper <jackson@ximian.com>
14137 * typemanager.cs (TypeToCoreType): Add float and double this fixes
14140 2003-11-03 Martin Baulig <martin@ximian.com>
14142 * expression.cs (ArrayAccess.GetStoreOpcode): Added
14143 `out bool has_type_arg'; if set, we need to pass the type to
14145 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
14146 Stelem_Any/Ldelem_Any for generic parameters.
14148 2003-11-02 Martin Baulig <martin@ximian.com>
14150 * expression.cs (Invocation.EmitCall): Use
14151 `TypeManager.IsValueType()' to check whether it's a value type.
14152 Don't set `struct_call' when calling a method on a type parameter.
14154 2003-11-02 Martin Baulig <martin@ximian.com>
14156 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14157 and removed the TypeBuilder argument.
14159 * typemanager.cs (TypeManager.IsValueType): Return
14160 `t.IsGenericParameter || t.IsValueType'.
14162 2003-10-25 Martin Baulig <martin@ximian.com>
14164 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14165 call ConstructedType.Resolve() on it.
14167 * generic.cs (ConstructedType.Resolve): Set `type' on success.
14169 2003-10-25 Martin Baulig <martin@ximian.com>
14171 * class.cs (TypeContainer.GetClassBases): Changed
14172 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
14173 CS8214 reporting here.
14174 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14175 instead of a `Type' for our parent. In case of a recursive
14176 declaration (see tests/gen-23.cs for an example), our parent is a
14177 ConstructedType and it doesn't have its type set. So, first
14178 create our own TypeBuilder, then call constructed.Resolve() to get
14179 the parent's type and finally TypeBuilder.SetParent() it.
14181 * ecore.cs (TypeExpr.Name): New public virtual property.
14184 (ConstructedType): We're now a TypeExpr and not just an Expression.
14185 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14186 arguments here; this is done later.
14187 (ConstructedType.Resolve): New public method to resolve the type
14188 arguments and bind them.
14190 2003-10-21 Martin Baulig <martin@ximian.com>
14192 * convert.cs: Use `TypeManager.IsValueType' instead of
14193 'type.IsValueType' everywhere.
14195 * typemanager.cs (TypeManager.IsValueType): Return true for type
14196 parameters. The reason for this is that we need to box a type
14197 parameter when converting it to a reference type.
14199 * cs-parser.jay: Added support for default value expressions.
14201 * generics.cs (DefaultValueExpression): New public class.
14203 2003-10-17 Martin Baulig <martin@ximian.com>
14205 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14206 TypeContainer so we can also use this for Interfaces.
14207 (TypeParameter.Resolve): Likewise.
14209 * interface.cs (Interface.DefineType): Added support for generic
14212 * cs-parser.jay: Added support for generic structs and interfaces.
14214 2003-10-17 Martin Baulig <martin@ximian.com>
14216 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14217 call generic methods :-)
14219 2003-10-16 Martin Baulig <martin@ximian.com>
14221 * cs-parser.jay (namespace_or_type_name): Only create a
14222 GenericMemberAccess if we actually have type arguments.
14224 2003-10-13 Martin Baulig <martin@ximian.com>
14226 * class.cs (Method.Define): If we're a generic method, call
14227 TypeBuilder.DefineGenericMethod () before resolving
14229 (MethodData): Added .ctor which takes an additional MethodBuilder
14230 argument; this is used for generic methods.
14231 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14232 we already have a MethodBuilder.
14234 2003-10-10 Martin Baulig <martin@ximian.com>
14236 * class.cs (Method): Added .ctor which takes a `GenericMethod'
14237 instead of a `DeclSpace'. This is used for generic methods.
14239 * cs-parser.jay (method_header): Added support for generic
14240 methods; create a `GenericMethod' instance and pass it to the
14241 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14242 parameters and locals.
14244 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14245 since we already have the location. Check whether we're a generic
14246 type declaration or a generic method and create the correct type
14249 * generic.cs (TypeParameter.DefineMethod): New public method.
14250 (GenericMethod): New public class; derives from DeclSpace and is
14251 used for generic methods.
14253 2003-10-09 Martin Baulig <martin@ximian.com>
14255 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14257 (MethodCore.DoDefineParameters): Removed the TypeContainer
14258 argument; use the DeclSpace which was passed to the .ctor instead.
14259 (MethodCore.CheckParameter): Take a DeclSpace instead of a
14260 TypeContainer; we only need a DeclSpace here.
14262 2003-10-09 Martin Baulig <martin@ximian.com>
14264 * class.cs (MethodData): Added additional `DeclSpace ds' argument
14266 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14267 EmitContext's .ctor.
14269 2003-10-09 Martin Baulig <martin@ximian.com>
14271 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14272 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14273 AsAccessible(), moved them as well.
14275 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14277 2003-10-07 Miguel de Icaza <miguel@ximian.com>
14279 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14280 generation for >=, as spotted by Paolo, bug 48679.
14281 Patch from David Waite.
14283 * cs-tokenizer.cs: Add handling for #pragma.
14285 * cs-parser.jay: Allow for both yield and yield return in the
14286 syntax. The anti-cobolization of C# fight will go on!
14288 * class.cs (TypeBuilder.DefineType): Catch error condition here
14289 (Parent.DefineType erroring out and returning null).
14291 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14292 coping with enumerations variables, we were mistakenly processing
14293 them as a regular value type instead of built-in types. Fixes the
14296 * typemanager.cs (IsBuiltinOrEnum): New method.
14298 2003-09-30 Miguel de Icaza <miguel@ximian.com>
14300 * cs-parser.jay: Upgrade: yield now needs the return clause.
14302 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14304 * cs-parser.jay : Renamed yyName to yyNames related to jay.
14306 2003-09-29 Martin Baulig <martin@ximian.com>
14308 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14309 inflated generic methods.
14311 * generics.cs (ConstructedType): Distinguish between open and
14312 closed constructed types; correctly resolve the arguments.
14314 2003-09-22 Martin Baulig <martin@ximian.com>
14316 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14317 all type arguments meet their constraints.
14319 2003-09-19 Martin Baulig <martin@ximian.com>
14321 * decl.cs (MemberCache.SetupCacheForInterface): Take a
14322 `MemberCache parent' argument. Normally, an interface doesn't
14323 have a parent type except System.Object, but we use this in gmcs
14324 for generic type parameters.
14326 2003-09-18 Martin Baulig <martin@ximian.com>
14328 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14329 on `type.IsInterface'; don't check whether the type has a parent
14330 to determine whether it's an interface.
14332 2003-09-17 Martin Baulig <martin@ximian.com>
14334 * generic.cs (ConstructedType.ToString): Always use `name' as the
14337 2003-09-15 Martin Baulig <martin@ximian.com>
14339 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14341 * generic.cs (Constraints.Resolve): New public method; this is
14342 called to resolve the constraint types and to check whether all
14343 the constraints are correct.
14344 (Constraints.Types): New public property.
14345 (TypeParameter.Resolve): New public method; resolves all the
14346 type's constraints.
14348 * class.cs (TypeContainer.DefineType): Call
14349 TypeParameter.Resolve() before actually defining the type.
14351 2003-09-15 Martin Baulig <martin@ximian.com>
14353 * class.cs (TypeContainer.DefineType): Added an error flag to
14354 avoid reporting duplicate CS0146's ("class definition is
14357 * driver.cs (Driver.MainDriver): Abort if
14358 RootContext.ResolveTree() reported any errors.
14360 2003-09-07 Martin Baulig <martin@ximian.com>
14362 * report.cs (Error, Warning): Added overloaded versions which take
14363 a `params object[] args' and call String.Format().
14365 2003-09-07 Martin Baulig <martin@ximian.com>
14367 * decl.cs (DeclSpace..ctor): Don't call
14368 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14369 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
14370 (DeclSpace.RecordDecl): New method.
14372 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14374 2003-09-02 Ravi Pratap <ravi@ximian.com>
14376 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14377 value attributes to be applied to ParameterBuilders.
14379 * class.cs (MethodCore.LabelParameters): Make static and more
14380 generic so that it can be used from other places - like interface
14381 methods, for instance.
14383 * interface.cs (Interface.Emit): Call LabelParameters before
14384 emitting attributes on the InterfaceMethod.
14386 2003-09-07 Martin Baulig <martin@ximian.com>
14388 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14389 if the number of type parameters doesn't match.
14391 2003-09-04 Martin Baulig <martin@ximian.com>
14393 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14394 for arrays of generic type params (ie. `!0[]').
14396 2003-09-04 Martin Baulig <martin@ximian.com>
14398 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14401 2003-09-04 Martin Baulig <martin@ximian.com>
14403 * decl.cs (DeclSpace.LookupGeneric): New method.
14404 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14407 * generic.cs (TypeParameterExpr): Take a TypeParameter as
14408 argument, not just a string.
14409 (TypeParameter.Define): New public method; this is called to
14410 actually define the generic parameter; after this, you can use the
14411 new `Type' property to get the type.
14413 2003-09-04 Martin Baulig <martin@ximian.com>
14415 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14416 is now an ArrayList; initialize the result of the `TypeParameters'
14418 (DeclSpace.GetGenericData): Removed.
14419 (DeclSpace.LookupGeneric): Temporarily removed; we need to
14420 implement this in a different way.
14421 (DeclSpace.GetTypeParameters): Removed; there's now a
14422 `TypeParameters' property.
14423 (DeclSpace.TypeParameters): New public property.
14425 * generic.cs (Constraints): Make this class public.
14426 (TypeParameter): New public class.
14428 2003-09-04 Martin Baulig <martin@ximian.com>
14430 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14431 generic parameters.
14433 * class.cs (TypeContainer.DefineType): Call
14434 TypeBuilder.DefineGenericParameter () on all generic parameters if
14435 this is a generic type.
14437 2003-08-28 Martin Baulig <martin@ximian.com>
14439 * sample-stack.il: Compile this with ilasm: "ilasm /dll
14442 * sample-hello.cs: Compile this with gmcs: "gmcs
14443 /r:sample-stack.dll sample-hello.cs".
14445 2003-08-28 Martin Baulig <martin@ximian.com>
14447 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14448 the parameters to the generic type.
14450 2003-08-28 Martin Baulig <martin@ximian.com>
14452 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14454 2003-08-28 Martin Baulig <martin@ximian.com>
14456 * cs-parser.jay (opt_type_argument_list): Use
14457 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14458 (primary_expression): Replace `qualified_identifier' with `type_name'.
14459 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14461 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14462 parser to check whether it is syntactically a type parameter list;
14463 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14466 2003-08-26 Martin Baulig <martin@ximian.com>
14468 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14469 resolving aliases; fixes #47927.
14471 2003-08-26 Martin Baulig <martin@ximian.com>
14473 * statement.cs (Using.DoResolve): This is internally emitting a
14474 try/finally clause, so we need to set ec.NeedExplicitReturn if we
14475 do not always return. Fixes #47681.
14477 2003-08-26 Martin Baulig <martin@ximian.com>
14479 * decl.cs (MemberCore): Moved WarningNotHiding(),
14480 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14482 (AdditionResult): Make this nested in DeclSpace.
14483 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14484 argument; call NamespaceEntry.Define() unless we're nested in a
14487 * namespace.cs (Namespace.DefineName): New public function. This
14488 is called from DeclSpace's .ctor to add
14489 (Namespace.Lookup): Include DeclSpaces in the lookup.
14491 * class.cs (Operator): Derive from MemberBase, not MemberCore.
14493 * const.cs (Const): Derive from MemberBase, not MemberCore.
14495 2003-08-25 Martin Baulig <martin@ximian.com>
14497 * convert.cs (Convert.ExplicitReferenceConversion): When
14498 converting from an interface type to a class, unbox if the target
14499 type is a struct type. Fixes #47822.
14501 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14503 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14506 2003-08-22 Martin Baulig <martin@ximian.com>
14508 * class.cs (TypeManager.DefineType): When defining a nested type,
14509 call DefineType() on our parent; fixes #47801.
14511 2003-08-22 Martin Baulig <martin@ximian.com>
14513 * class.cs (MethodData.Define): While checking if a method is an
14514 interface implementation, improve the test a bit more to fix #47654.
14516 2003-08-22 Martin Baulig <martin@ximian.com>
14518 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14519 correctly; fixes #47722.
14521 2003-08-22 Martin Baulig <martin@ximian.com>
14523 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14524 LocalVariableReference, ensure it's not read-only. Fixes #47536.
14526 * statement.cs (Fixed.DoResolve): Make all variables read-only.
14528 2003-08-22 Martin Baulig <martin@ximian.com>
14530 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14531 can only be assigned in static constructors. Fixes #47161.
14533 2003-08-22 Martin Baulig <martin@ximian.com>
14535 Rewrote and improved the flow analysis code.
14537 * flowbranching.cs (FlowBranching): Make this class abstract.
14538 (FlowBranching.CreateBranching): New static function to create a
14539 new flow branching.
14540 (FlowBranchingBlock, FlowBranchingException): New classes.
14541 (FlowBranching.UsageVector.Type): New public readonly field.
14542 (FlowBranching.UsageVector.Breaks): Removed the setter.
14543 (FlowBranching.UsageVector.Returns): Removed the setter.
14544 (FlowBranching.UsageVector): Added Break(), Return(),
14545 NeverReachable() and Throw() methods to modify the reachability.
14546 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14547 done by FlowBranching.Merge().
14548 (FlowBranching.UsageVector.MergeChild): New method; merges the
14549 merge result into the current vector.
14550 (FlowBranching.Merge): New abstract method to merge a branching.
14552 2003-08-12 Martin Baulig <martin@ximian.com>
14554 * expression.cs (Indirection.CacheTemporaries): Create the
14555 LocalTemporary with the pointer type, not its element type.
14557 2003-08-10 Miguel de Icaza <miguel@ximian.com>
14559 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14560 token was a keyword or not.
14562 Add `error' options where an IDENTIFIER was expected; Provide
14563 CheckToken and CheckIdentifierToken convenience error reporting
14566 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14568 * decl.cs: Rename `NamespaceEntry Namespace' public field into
14569 NameSpaceEntry NameSpaceEntry.
14571 (LookupInterfaceOrClass): Avoid creating a full qualified name
14572 from namespace and name: avoid doing lookups when we know the
14573 namespace is non-existant. Use new Tree.LookupByNamespace which
14574 looks up DeclSpaces based on their namespace, name pair.
14576 * driver.cs: Provide a new `parser verbose' to display the
14577 exception thrown during parsing. This is turned off by default
14578 now, so the output of a failure from mcs is more graceful.
14580 * namespace.cs: Track all the namespaces defined in a hashtable
14583 (IsNamespace): New method
14585 2003-08-09 Miguel de Icaza <miguel@ximian.com>
14587 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
14588 we know that we need to concatenate (full typename can never be
14593 * statement.cs: Use a bitfield; Do not initialize to null things
14594 which are done by the constructor by default.
14596 * cs-parser.jay: bug fix, parameter was 4, not 3.
14598 * expression.cs: Just use the property;
14600 * statement.cs: No need for GetVariableInfo method.
14602 2003-08-08 Martin Baulig <martin@ximian.com>
14604 * flowanalysis.cs (FlowReturns): This is now nested in the
14605 `FlowBranching' class.
14606 (MyBitVector): Moved this here from statement.cs.
14607 (FlowBranching.SiblingType): New enum type.
14608 (FlowBranching.CreateSibling): Added `SiblingType' argument.
14610 2003-08-07 Martin Baulig <martin@ximian.com>
14612 * flowanalysis.cs (FlowBranchingType): This is now nested in the
14613 `FlowBranching' class and called `BranchingType'.
14615 2003-08-07 Martin Baulig <martin@ximian.com>
14617 * flowanalysis.cs: Moved all the control flow analysis code into
14620 2003-08-07 Martin Baulig <martin@ximian.com>
14622 * assign.cs (Assign.DoResolve): `target' must either be an
14623 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
14626 2003-08-07 Miguel de Icaza <miguel@ximian.com>
14628 * expression.cs (BinaryMethod): This kind of expression is created by the
14629 Binary class if it determines that the operator has to be handled
14632 (BinaryDelegate): This kind of expression is created if we are
14633 dealing with a + or - operator on delegates.
14635 (Binary): remove method, argumetns, and DelegateOperator: when
14636 dealing with methods,
14638 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14640 * statement.cs (Block): use bitfields for the three extra booleans
14641 we had in use. Remove unused topblock parameter.
14643 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14645 * assign.cs: Drop extra unneeded tests.
14647 2003-08-06 Miguel de Icaza <miguel@ximian.com>
14649 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14651 * statement.cs (Foreach): Use VariableStorage instead of
14654 * codegen.cs (VariableStorage): New class used by clients that
14655 require a variable stored: locals or fields for variables that
14656 need to live across yield.
14658 Maybe provide a convenience api for EmitThis+EmitLoad?
14660 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14663 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14665 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14666 RemapParameterLValue): New methods that are used to turn a
14667 precomputed FieldInfo into an expression like this:
14671 The idea is to use this instead of making LocalVariableReference
14672 have more than one meaning.
14674 * cs-parser.jay: Add error production to BASE.
14676 * ecore.cs: Deal with TypeManager.GetField returning null, which
14677 is now a valid return value.
14679 (FieldExprNoAddress): New expression for Fields whose address can
14682 * expression.cs (LocalVariableReference): During the resolve
14683 phases, create new expressions if we are in a remapping context.
14684 Remove code that dealt with remapping here.
14686 (ParameterReference): same.
14688 (ProxyInstance): New expression, like the `This' expression, but
14689 it is born fully resolved. We know what we are doing, so remove
14690 the errors that are targeted to user-provided uses of `this'.
14692 * statement.cs (Foreach): our variable is now stored as an
14693 Expression; During resolution, follow the protocol, dont just
14694 assume it will return this.
14696 2003-08-06 Martin Baulig <martin@ximian.com>
14698 * support.cs (SeekableStreamReader.cs): New public class.
14700 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14701 SeekableStreamReader instead of the normal StreamReader.
14703 2003-08-04 Martin Baulig <martin@ximian.com>
14705 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14706 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14707 deambiguate casts and delegate invocations.
14708 (parenthesized_expression): Use the new tokens to ensure this is
14709 not a cast of method invocation.
14711 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14712 when reading a `)' and Deambiguate_CloseParens () was previously
14715 * expression.cs (ParenthesizedExpression): New class. This is
14716 just used for the CS0075 test.
14717 (Binary.DoResolve): Check for CS0075.
14719 2003-07-29 Ravi Pratap <ravi@ximian.com>
14721 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14722 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14723 reference comparison.
14725 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14726 examine the ReturnType for equality - this is necessary in the
14727 cases of implicit and explicit operators whose signature also
14728 includes the return type.
14730 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14732 * namespace.cs: Cache the result of the namespace computation,
14733 instead of computing it every time.
14735 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14737 * decl.cs: Use a global arraylist that we reuse over invocations
14738 to avoid excesive memory consumption. Reduces memory usage on an
14739 mcs compile by one meg (45 average).
14741 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14742 private, work around that.
14744 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14746 * literal.cs (IntLiteral): Define Zero and One static literals.
14748 * cs-parser.jay (integer_literal): use static literals to reduce
14749 memory usage for the most used literals (0, 1 and -1). 211kb
14750 reduced in memory usage.
14752 Replace all calls to `new ArrayList' with `new
14753 ArrayList(4)' which is a good average number for most allocations,
14754 and also requires only 16 bytes of memory for its buffer by
14757 This reduced MCS memory usage in seven megabytes for the RSS after
14760 2003-07-28 Ravi Pratap <ravi@ximian.com>
14762 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14763 handle params methods the correct way by forming only one
14764 applicable set with params and normal methods in them. Earlier we
14765 were looking at params methods only if we found no normal methods
14766 which was not the correct thing to do.
14768 (Invocation.BetterFunction): Take separate arguments indicating
14769 when candidate and the best method are params methods in their
14772 This fixes bugs #43367 and #46199.
14774 * attribute.cs: Documentation updates.
14776 (CheckAttribute): Rename to CheckAttributeTarget.
14777 (GetValidPlaces): Rename to GetValidTargets.
14779 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14780 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14784 2003-07-28 Miguel de Icaza <miguel@ximian.com>
14786 * codegen.cs: Compute IsGeneric correctly.
14788 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14791 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14792 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
14793 regressions, and I was chasing more bugs than I required.
14795 * interface.cs: Use expressions for base type names (like classes
14796 and structs have been doing for a while now), and resolve that.
14797 This patch should probably go into head as well.
14799 This makes it one less user of FindType.
14801 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14803 This compiler can not self host currently. Need to fix that.
14805 * Makefile: compile to `gmcs.exe'
14807 * driver.cs: Turn on v2 by default on gmcs.
14809 * generic.cs (ConstructedType): Does no longer take a container
14810 type argument; That will be taken care of later.
14812 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14813 Use SimpleName to resolve for now, so we can continue the work on
14814 the parser, until we get Type.GetType that understands generics.
14816 (ConstructedType.ToString): Implement
14818 (TypeArguments.Resolve): Resolve the child expressions as types.
14820 * cs-parser.jay: Rename interface_constraints to
14821 type_parameter_constraints
14823 (namespace_or_type_name): Only use constructed types for the basic
14824 construction, we will deal with identifier<...> later.
14826 (type/type_name): No longer call DecomposeQI, as
14827 namespace_or_type_name is always decoded now.
14829 2003-07-22 Ravi Pratap <ravi@ximian.com>
14831 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14832 closely: we eliminate methods in base types when we have an
14833 applicable method in a top-level type.
14835 Please see section 14.5.5.1 for an exact description of what goes
14838 This fixes bug #45127 and a host of other related to corlib compilation.
14840 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14841 array is the method corresponding to the top-level type (this is
14842 because of the changes made to icall.c) so we change this
14845 (MethodGroupExpr.Name): This too.
14847 * typemanager.cs (GetElementType): New method which does the right
14848 thing when compiling corlib.
14850 * everywhere: Make use of the above in the relevant places.
14852 2003-07-22 Martin Baulig <martin@ximian.com>
14854 * cs-parser.jay (invocation_expression): Moved
14855 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14856 `cast_expression', but create a InvocationOrCast which later
14857 resolves to either an Invocation or a Cast.
14859 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14860 method; call this before EmitStatement() to make sure that this
14861 expression can be used as a statement.
14863 * expression.cs (InvocationOrCast): New class; resolves to either
14864 an Invocation or a Cast.
14866 * statement.cs (StatementExpression): Call ResolveStatement() on
14867 the ExpressionStatement before emitting it.
14869 2003-07-21 Martin Baulig <martin@ximian.com>
14871 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14872 `ref' and `out' attributes match; fixes #46220.
14873 (MemberAccess.ResolveMemberAccess): You can't reference a type
14874 through an expression; fixes #33180.
14875 (Indexers.GetIndexersForType): Don't return the indexers from
14876 interfaces the class implements; fixes #46502.
14878 2003-07-21 Martin Baulig <martin@ximian.com>
14880 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14881 CS0661 checks; fixes bug #30442.
14883 2003-07-21 Martin Baulig <martin@ximian.com>
14885 * decl.cs (AdditionResult): Added `Error'.
14887 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14889 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14890 cs0031.cs actually work.
14892 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14894 * cs-parser.jay (namespace_name): do not use
14895 namespace_or_type_name, use qualified_identifier, because
14896 namespace_or_type_name will soon return a composed expression
14897 instead of a string.
14899 (namespace_or_type_name): Instead of returning a string, now this
14900 production returns an expression.
14902 * codegen.cs (EmitContext): Setup IsGeneric property based on
14903 whether our DeclSpace is generic, our the method is generic.
14905 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14906 the method is generic.
14908 * cs-parser.jay (type_arguments, opt_type_argument_list,
14909 type_parameters, type_parameter_list, opt_type_parameter_list,
14910 type_parameter,, opt_type_parameter_constraints_clauses,
14911 type_parameter_constraints_clauses,
14912 type_parameter_constraint_clause, type_parameter_constraint,
14913 interface_constraints): Add new production
14915 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14916 DeclSpace is generic or not.
14918 (DeclSpace.SetParameterInfo): New routine, used to set the
14919 parameter info for a type.
14921 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14922 returns a GenericTypeExpr
14924 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14925 generic, lookup the generic argument.
14927 * attribute.cs: Do not allow TypeParameterExpressions in
14930 * class.cs: Do not allow the Main method to be defined in a
14933 * expression.cs (SizeOf): Do not allow generic types to be used as
14934 arguments to sizeof.
14936 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14937 it: whether a type is generic or not. Only works for types we are
14938 currently building for now.
14940 2003-07-20 Martin Baulig <martin@ximian.com>
14942 * namespace.cs: Fixed that bug which caused a crash when compiling
14943 the debugger's GUI.
14945 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14947 * typemanager.cs (LookupTypeReflection): Never expose types which
14948 are NotPublic, NestedPrivate, NestedAssembly, or
14949 NestedFamANDAssem. We used to return these, and later do a check
14950 that would report a meaningful error, but the problem is that we
14951 would not get the real match, if there was a name override.
14953 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14955 * namespace.cs (Namespace, Name): Do not compute the namespace
14956 name dynamically, compute it in the constructor. This reduced
14957 memory usage by 1697 KB.
14959 * driver.cs: Use --pause to pause at the end.
14961 2003-07-17 Peter Williams <peter@newton.cx>
14963 * Makefile: Change the name of the test target so that it doesn't
14964 conflict with the recursive test target.
14966 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14968 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14969 AddressOf): Do not use EmitThis, that was wrong, use the actual
14972 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14974 * class.cs (MethodData.Define): While checking if a method is an
14975 interface implementation, improve the test: If we are not public
14976 (use new test here: use the computed MethodAttributes directly,
14977 instead of the parsed modifier flags) check if the `implementing'
14978 method comes from an interface or not.
14980 * pending.cs (VerifyPendingMethods): Slightly better error
14983 * makefile: add test target that does the mcs bootstrap.
14985 2003-07-16 Ravi Pratap <ravi@ximian.com>
14987 * interface.cs (Define): Do nothing here since there are no
14988 members to populate etc. Move the attribute emission out of here
14989 since this was just totally the wrong place to put it. Attribute
14990 application happens during the 'Emit' phase, not in the 'Define'
14993 (Emit): Add this method and move the attribute emission here
14995 * rootcontext.cs (EmitCode): Call the Emit method on interface
14998 2003-07-14 Ravi Pratap M <ravi@ximian.com>
15000 * expression.cs (OverloadResolve): Report error only if Location
15001 is not 'Null' which means that there was a probe going on.
15003 2003-07-14 Martin Baulig <martin@ximian.com>
15005 * expression.cs (ConditionalLogicalOperator): New public class to
15006 implement user defined conditional logical operators.
15007 This is section 14.11.2 in the spec and bug #40505.
15009 2003-07-14 Martin Baulig <martin@ximian.com>
15011 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
15013 2003-07-14 Martin Baulig <martin@ximian.com>
15015 * codegen.cs (EmitContext.InFixedInitializer): New public field.
15017 * ecore.cs (IVariable.VerifyFixed): New interface method.
15019 * expression.cs (Unary.ResolveOperator): When resolving the `&'
15020 operator, check whether the variable is actually fixed. Fixes bug
15021 #36055. Set a variable definitely assigned when taking its
15022 address as required by the spec.
15024 * statement.cs (LocalInfo.IsFixed): New field.
15025 (LocalInfo.MakePinned): Set `IsFixed' to true.
15027 2003-07-14 Ravi Pratap M <ravi@ximian.com>
15029 * attribute.cs (Attribute.Resolve): While doing a Member lookup
15030 for .ctors, ensure that we only ask for members declared in the
15031 attribute type (BindingFlags.DeclaredOnly).
15035 * expression.cs (Error_WrongNumArguments): Report error 1501
15036 correctly the way CSC does.
15038 2003-07-13 Martin Baulig <martin@ximian.com>
15040 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
15041 lookup on the fully qualified name, to make things like "X.X" work
15042 where "X.X" is a fully qualified type name, but we also have a
15043 namespace "X" in the using list. Fixes #41975.
15045 2003-07-13 Martin Baulig <martin@ximian.com>
15047 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
15048 function. If we're a CompoundAssign, we need to create an embedded
15049 CompoundAssign, not an embedded Assign.
15050 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
15053 2003-07-13 Martin Baulig <martin@ximian.com>
15055 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
15056 work to fix bug #46088.
15058 2003-07-13 Ravi Pratap <ravi@ximian.com>
15060 * class.cs (Operator.Emit): Do not emit attributes here - it is
15061 taken care of by the Method class that we delegate too. This takes
15062 care of bug #45876.
15064 2003-07-10 Martin Baulig <martin@ximian.com>
15066 * expression.cs (TypeOfVoid): New class.
15067 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
15069 2003-07-10 Martin Baulig <martin@ximian.com>
15071 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
15074 2003-07-10 Martin Baulig <martin@ximian.com>
15076 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
15077 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
15079 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
15081 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
15083 2003-07-10 Martin Baulig <martin@ximian.com>
15085 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
15086 of decimal. Fixes #42850.
15088 NOTE: I also fixed the created byte blob, but this doesn't work on
15089 the MS runtime and csc never produces any byte blobs for decimal
15092 2003-07-10 Martin Baulig <martin@ximian.com>
15094 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
15095 structs; fixes #32068.
15096 (Block.AddChildVariableNames): Fixed #44302.
15098 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15100 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
15102 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15104 * attribute.cs: And this test is onger needed.
15106 2003-07-08 Martin Baulig <martin@ximian.com>
15108 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
15109 inaccessible types. Fixes #36313.
15111 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
15113 * namespace.cs (NamespaceEntry): Create implicit entries for all
15114 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
15115 implicit entries for N1.N2 and N1.
15117 2003-07-08 Martin Baulig <martin@ximian.com>
15119 Rewrote the handling of namespaces to fix a lot of the issues
15120 wrt. `using' aliases etc.
15122 * namespace.cs (Namespace): Splitted this class into a
15123 per-assembly `Namespace' and a per-file `NamespaceEntry'.
15125 * typemanager.cs (TypeManager.IsNamespace): Removed.
15126 (TypeManager.ComputeNamespaces): Only compute namespaces from
15127 loaded assemblies here, not the namespaces from the assembly we're
15128 currently compiling.
15130 2003-07-08 Martin Baulig <martin@ximian.com>
15132 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
15134 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15136 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
15139 I thought about the memory savings here, but LookupTypeReflection
15140 is used under already very constrained scenarios. Compiling
15141 corlib or mcs only exposes one hit, so it would not really reduce
15142 any memory consumption.
15144 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15146 * typemanager.cs: fixes bug #45889 by only adding public types from
15147 other assemblies to the list of known types.
15149 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15151 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
15152 on the type we resolved.
15154 2003-07-05 Martin Baulig <martin@ximian.com>
15156 * pending.cs (PendingImplementation.ParentImplements): Don't
15157 create the proxy if the parent is abstract.
15159 * class.cs (TypeContainer.DefineIndexers): Process explicit
15160 interface implementations first. Fixes #37714.
15162 2003-07-04 Miguel de Icaza <miguel@ximian.com>
15164 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15165 defined recursively; but since we modify the input parameters
15166 (left is set to `this' temporarily), we reset this value if the
15167 left_is_explicit is false, which gives the original semantics to
15170 * literal.cs (NullPointer): new class used to represent a null
15171 literal in a pointer context.
15173 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15174 type is a pointer, use a NullPointer object instead of a
15175 NullLiteral. Closes 43687
15177 (ExplicitConversion): Convert pointer values using
15178 the conv opcode to the proper type.
15180 * ecore.cs (New): change ValueTypeVariable property into a method,
15181 that returns whether the valuetype is suitable for being used.
15183 * expression.cs (Binary.DoNumericPromotions): Only return if we
15184 the int constant was a valid uint, and we can return both left and
15185 right as uints. If not, we continue processing, to trigger the
15186 type conversion. This fixes 39018.
15188 * statement.cs (Block.EmitMeta): During constant resolution, set
15189 the CurrentBlock property on the emitcontext, so that we resolve
15190 constants propertly.
15192 2003-07-02 Martin Baulig <martin@ximian.com>
15194 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15195 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15197 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15198 than emitting it here.
15200 * statement.cs: Fixed some more flow analysis bugs.
15202 2003-07-02 Martin Baulig <martin@ximian.com>
15204 * class.cs (MethodData.Define): When implementing interface
15205 methods, set Final unless we're Virtual.
15207 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15208 check work for interface methods.
15210 2003-07-01 Martin Baulig <martin@ximian.com>
15212 * ecore.cs (EmitContext.This): Replaced this property with a
15213 GetThis() method which takes a Location argument. This ensures
15214 that we get the correct error location for a CS0188.
15216 2003-07-01 Miguel de Icaza <miguel@ximian.com>
15218 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15219 ImplicitStandardConversion.
15221 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15223 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
15225 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15228 2003-06-30 Miguel de Icaza <miguel@ximian.com>
15230 * class.cs (Constructor.Define): Turn off initlocals for unsafe
15233 (MethodData.Define): Turn off initlocals for unsafe methods.
15235 2003-06-29 Miguel de Icaza <miguel@ximian.com>
15237 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15238 complete; Fixes #37521.
15240 * delegate.cs: Use Modifiers.TypeAttr to compute the
15241 TypeAttributes, instead of rolling our own. This makes the flags
15242 correct for the delegates.
15244 2003-06-28 Miguel de Icaza <miguel@ximian.com>
15246 * class.cs (Constructor.Define): Set the private flag for static
15247 constructors as well.
15249 * cs-parser.jay (statement_expression): Set the return value to
15250 null, to avoid a crash when we catch an error.
15252 2003-06-24 Miguel de Icaza <miguel@ximian.com>
15254 * cs-parser.jay: Applied patch from Jackson that adds support for
15255 extern and unsafe modifiers to destructor declarations.
15257 * expression.cs: Report error 21 if the user is trying to index a
15260 * driver.cs: Add an error message, suggested by the bug report.
15262 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15263 if we do not have a ": this ()" constructor initializer. Fixes 45149
15265 2003-06-14 Miguel de Icaza <miguel@ximian.com>
15267 * namespace.cs: Add some information to reduce FAQs.
15269 2003-06-13 Miguel de Icaza <miguel@ximian.com>
15271 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15272 underlying enumeration types. Fixes #43915.
15274 * expression.cs: Treat ushort/short as legal values to be used in
15275 bitwise operations.
15277 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15279 * delegate.cs: transfer custom attributes for paramenters from
15280 the delegate declaration to Invoke and BeginInvoke.
15282 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15284 * attribute.cs: handle custom marshalers and emit marshal info
15287 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
15289 * makefile.gnu: Added anonymous.cs to the compiler sources.
15291 2003-05-28 Miguel de Icaza <miguel@ximian.com>
15293 * iterators.cs: Change the name of the proxy class to include two
15296 * cs-parser.jay: Update grammar to include anonymous methods.
15298 * anonymous.cs: new file.
15300 2003-05-27 Miguel de Icaza <miguel@ximian.com>
15302 * class.cs (Field.Define): Add missing test for pointers and
15305 2003-05-27 Ravi Pratap <ravi@ximian.com>
15307 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15308 we use the stobj opcode.
15310 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15311 since it wasn't the correct fix.
15313 It still is puzzling that we are required to use stobj for IntPtr
15314 which seems to be a ValueType.
15316 2003-05-26 Miguel de Icaza <miguel@ximian.com>
15318 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15319 during regular simple name resolution. Now, the trick is that
15320 instead of returning for processing the simplename, we do a
15321 TypeManager.LookupType (ie, a rooted lookup as opposed to a
15322 contextual lookup type). If a match is found, return that, if
15323 not, return for further composition.
15325 This fixes long-standing 30485.
15327 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15328 using the address to initialize an object, do an Stobj instead of
15329 using the regular Stelem.
15331 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15332 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15333 Because if we are a BaseIndexerAccess that value will be true.
15336 * statement.cs (GotoCase.Resolve): Return after reporting an
15337 error, do not attempt to continue.
15339 * expression.cs (PointerArithmetic.Emit): If our operand is a
15340 long, convert our constants to match the operand before
15341 multiplying. Convert to I type before adding. Fixes 43670.
15343 2003-05-14 Ravi Pratap <ravi@ximian.com>
15345 * enum.cs (ImplicitConversionExists) : Rename to
15346 ImplicitEnumConversionExists to remove ambiguity.
15348 * ecore.cs (NullCast): New type of cast expression class which
15349 basically is very similar to EmptyCast with the difference being
15350 it still is a constant since it is used only to cast a null to
15352 (eg. (string) null)
15354 * convert.cs (ImplicitReferenceConversion): When casting a null
15355 literal, we return a NullCast.
15357 * literal.cs (NullLiteralTyped): Remove - I don't see why this
15358 should be around anymore.
15360 The renaming (reported was slightly wrong). Corrections:
15362 ConvertImplicitStandard -> ImplicitConversionStandard
15363 ConvertExplicitStandard -> ExplicitConversionStandard
15365 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15366 before passing them in !
15368 * convert.cs (ImplicitConversionStandard): When comparing for
15369 equal expr and target types, ensure that expr is not a
15372 In general, we must not be checking (expr_type ==
15373 target_type) in the top level conversion methods
15374 (ImplicitConversion, ExplicitConversion etc). This checking is
15375 done in the methods that they delegate to.
15377 2003-05-20 Miguel de Icaza <miguel@ximian.com>
15379 * convert.cs: Move Error_CannotConvertType,
15380 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15381 ImplicitNumericConversion, ImplicitConversionExists,
15382 ImplicitUserConversionExists, StandardConversionExists,
15383 FindMostEncompassedType, FindMostSpecificSource,
15384 FindMostSpecificTarget, ImplicitUserConversion,
15385 ExplicitUserConversion, GetConversionOperators,
15386 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15387 TryImplicitIntConversion, Error_CannotConvertImplicit,
15388 ConvertImplicitRequired, ConvertNumericExplicit,
15389 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15390 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15393 Perform the following renames:
15395 StandardConversionExists -> ImplicitStandardConversionExists
15396 ConvertImplicit -> ImplicitConversion
15397 ConvertImplicitStandard -> ImplicitStandardConversion
15398 TryImplicitIntConversion -> ImplicitIntConversion
15399 ConvertImplicitRequired -> ImplicitConversionRequired
15400 ConvertNumericExplicit -> ExplicitNumericConversion
15401 ConvertReferenceExplicit -> ExplicitReferenceConversion
15402 ConvertExplicit -> ExplicitConversion
15403 ConvertExplicitStandard -> ExplicitStandardConversion
15405 2003-05-19 Martin Baulig <martin@ximian.com>
15407 * statement.cs (TypeInfo.StructInfo): Made this type protected.
15408 (TypeInfo): Added support for structs having structs as fields.
15410 * ecore.cs (FieldExpr): Implement IVariable.
15411 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15412 VariableInfo for the field.
15414 2003-05-18 Martin Baulig <martin@ximian.com>
15416 * expression.cs (This.DoResolve): Report a CS0027 if we're
15417 emitting a field initializer.
15419 2003-05-18 Martin Baulig <martin@ximian.com>
15421 * expression.cs (This.ResolveBase): New public function.
15422 (This.DoResolve): Check for CS0188.
15424 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15427 * ecore.cs (MethodGroupExpr.DoResolve): Set the
15428 `instance_expression' to null if we don't have any non-static
15431 2003-05-18 Martin Baulig <martin@ximian.com>
15433 Reworked the way how local variables and parameters are handled by
15434 the flow analysis code.
15436 * statement.cs (TypeInfo, VariableMap): New public classes.
15437 (VariableInfo): New public class. This is now responsible for
15438 checking whether a variable has been assigned. It is used for
15439 parameters and local variables.
15440 (Block.EmitMeta): Take the InternalParameters as argument; compute
15441 the layout of the flow vectors here.
15442 (Block.LocalMap, Block.ParameterMap): New public properties.
15443 (FlowBranching): The .ctor doesn't get the InternalParameters
15444 anymore since Block.EmitMeta() now computes the layout of the flow
15446 (MyStructInfo): This class is now known as `StructInfo' and nested
15447 in `TypeInfo'; we don't access this directly anymore.
15449 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15450 property and removed IsAssigned(), IsFieldAssigned(),
15451 SetAssigned() and SetFieldAssigned(); we now call them on the
15452 VariableInfo so we don't need to duplicate this code everywhere.
15454 * expression.cs (ParameterReference): Added `Block block' argument
15456 (LocalVariableReference, ParameterReference, This): The new
15457 VariableInfo class is now responsible for all the definite
15460 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15461 IsParameterAssigned, SetParameterAssigned): Removed.
15463 2003-05-18 Martin Baulig <martin@ximian.com>
15465 * typemanager.cs (InitCoreTypes): Try calling
15466 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15467 the 3-args-version. Corlib now also needs our `void_type'.
15468 (GetMethod): Added overloaded version which takes an optional
15469 `bool report_errors' to allow lookups of optional methods.
15471 2003-05-12 Martin Baulig <martin@ximian.com>
15473 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15474 only used for locals and not for parameters.
15476 2003-05-12 Miguel de Icaza <miguel@ximian.com>
15478 * support.cs (InternalParameters.ParameterType): Return the
15479 ExternalType of the parameter.
15481 * parameter.cs (Parameter.ExternalType): drop the two arguments,
15484 2003-05-11 Miguel de Icaza <miguel@ximian.com>
15486 * class.cs (MethodData.Define): Do not set the `newslot' on
15487 interface members, if they are also flagged as "override".
15489 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15490 better code for ++i and i++. This only works for static fields
15491 and local variables.
15493 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15494 want to pull the DeclSpace out of the builder_to_declspace instead
15495 of the TypeBuilder (like in TypeContainer.FindMembers).
15497 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15498 instead of LookupTypeContainer. Fixes the crash on .NET for
15499 looking up interface members.
15501 * const.cs: Create our own emit context during the Definition
15502 stage, so that constants are evaluated in the proper context, when
15503 a recursive definition happens.
15505 2003-05-11 Martin Baulig <martin@ximian.com>
15507 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
15508 new block for a switch section.
15509 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15510 the adding/lookup in the switch block. Fixes #39828.
15512 2003-05-09 Miguel de Icaza <miguel@ximian.com>
15514 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15515 functionality: I needed to convert the data after I had performed
15516 the add/sub operation into the operands type size.
15518 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15519 pass the type for the box operation, otherwise the resulting
15520 object would have been of type object.
15522 (BoxedCast): Add constructor to specify the type to box as.
15524 2003-05-07 Miguel de Icaza <miguel@ximian.com>
15526 * iterators.cs: I was reusing the `count' variable inadvertently,
15527 take steps to not allow this to happen.
15529 2003-05-06 Miguel de Icaza <miguel@ximian.com>
15531 * attribute.cs (Attribute.Resolve): Params attributes are encoded
15532 by creating an array at the point where the params starts and
15533 putting all those arguments there, then adjusting the size of the
15536 2003-05-05 Miguel de Icaza <miguel@ximian.com>
15538 * expression.cs (New.AddressOf): Implement interface
15539 IMemoryLocation. This is used when the `new' operator is used in
15540 the context of an invocation to a method on a value type.
15542 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15545 * namespace.cs: Also check the using aliases here.
15547 * driver.cs: Move the test for using validity after the types have
15548 been entered, so we do a single pass that also includes the using
15551 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15552 in the regular case. CreateSiblingForFinally is doing extra
15555 * attribute.cs (GetAttributeArgumentExpression): Store the result
15556 on an out value, and use the return value to indicate failure
15557 instead of using null (which is a valid return for Constant.GetValue).
15559 * statement.cs: Perform the analysis flow for the increment
15560 portion after the statement, because this will be the real flow of
15561 execution. Fixes #42385
15563 * codegen.cs (EmitContext.EmitArgument,
15564 EmitContext.EmitStoreArgument): New helper functions when the
15565 RemapToProxy flag is set.
15567 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15570 Add support for remapping parameters.
15572 * iterators.cs: Propagate parameter values; Store parameter
15573 values in the proxy classes.
15575 2003-05-04 Miguel de Icaza <miguel@ximian.com>
15577 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
15578 need a proxy reference; I do not know what I was thinking
15580 * cs-parser.jay (constructor_initializer): catch another error,
15581 and display nice message.
15583 (field_declaration): catch void field declaration
15584 to flag a better error.
15586 * class.cs (MemberBase.CheckBase): Report an error instead of a
15587 warning if a new protected member is declared in a struct.
15588 (Field.Define): catch the error of readonly/volatile.
15590 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15592 (FieldExpr.AddressOf): ditto. Catch error where the address of a
15593 volatile variable is taken
15595 2003-05-02 Miguel de Icaza <miguel@ximian.com>
15597 * statement.cs (Fixed.Resolve): Report an error if we are not in
15600 2003-05-01 Miguel de Icaza <miguel@ximian.com>
15602 * typemanager.cs: reuse the code that handles type clashes for
15603 delegates and enumerations.
15605 * class.cs (Report28): Always report.
15607 * expression.cs (EncodeAsAttribute): Allow nulls here.
15609 2003-04-28 Miguel de Icaza <miguel@ximian.com>
15611 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15612 the functionality for testing whether an expression is valid for
15613 an attribute here. Also handle the case of arrays of elements
15616 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15617 encoding a linear array into an array of objects that are suitable
15618 to be passed to an CustomAttributeBuilder.
15620 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15622 * ecore.cs: (FieldExpr): Handle field remapping here.
15624 * iteratators.cs: Pass the instance variable (if the method is an
15625 instance method) to the constructors, so we can access the field
15626 variables on the class.
15628 TODO: Test this with structs. I think the THIS variable on
15629 structs might have to be a pointer, and not a refenrece
15631 2003-04-27 Miguel de Icaza <miguel@ximian.com>
15633 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15634 local variables to fields in a proxy class.
15636 * iterators.cs (PopulateProxy): Rename our internal fields to
15638 Create a <THIS> field if we are an instance method, so we can
15639 reference our parent container variables.
15640 (MapVariable): Called back from the EmitContext code to enter a
15641 new variable to field mapping into the proxy class (we just create
15645 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15646 for using the remapped locals to fields.
15648 I placed the code here, because that gives the same semantics to
15649 local variables, and only changes the Emit code.
15651 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15652 statements inside iterators.
15653 (VariableInfo): Add a FieldBuilder for the cases when we are
15654 remapping local variables to fields in a proxy class
15656 * ecore.cs (SimpleNameResolve): Avoid testing two times for
15657 current_block != null.
15659 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15660 not cope with strings, as it has been moved to the
15661 TableSwitchEmit. Fixed bug in switch generation.
15663 * expression.cs (New.DoResolve): Provide more context for the user
15664 when reporting an error.
15666 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15669 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15670 check the permissions for it. Note than in a type-resolution
15671 context the check was already present in DeclSpace.ResolveType,
15672 but was missing from the MemberAccess.
15674 (ArrayCreation.CheckIndices): warn if the user has
15675 more nested levels of expressions, but there are no more
15676 dimensions specified. Avoids crash on bug 41906.
15678 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15680 * statement.cs (Block): replace Implicit bool, for a generic
15682 New flag: `Unchecked'. This is used during the EmitMeta phase
15683 (which is out-of-line with the regular Resolve/Emit process for a
15684 statement, as this is done ahead of time, but still gets a chance
15685 to call constant resolve).
15687 (Block.Flags): new enum for adding a new flag.
15689 (Block.EmitMeta): track the state of unchecked.
15691 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15692 to enable constant resolution to work there as well.
15694 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15696 * typemanager.cs (ienumerable_type): Also look up
15697 System.Collections.IEnumerable.
15699 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15701 TODO: Test more than one conditional per method.
15703 * class.cs (Indexer.Define): Report the location where the user is
15704 referencing the unsupported feature.
15706 (MethodData): Overload the use of `conditionals' to
15707 minimize the creation of needless ArrayLists. This saves roughly
15708 212kb on my machine.
15710 (Method): Implement the new IIteratorContainer interface.
15711 (Method.SetYields): Implement the method by setting the ModFlags
15712 to contain METHOD_YIELDS.
15714 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15715 which just got set to null.
15717 * iterators.cs: New file.
15719 (Yield, YieldBreak): New statements.
15721 * statement.cs (Return.Resolve): Flag an error if we are used in
15722 an iterator method.
15724 * codegen.cs (InIterator): New flag set if the code is being
15725 compiled in an iterator method.
15727 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15728 internal modifier, and we just use it to avoid adding extra
15729 fields, as this is seldom used.
15731 * cs-parser.jay: Add yield_statement (yield and yield break).
15733 * driver.cs: New flag -v2 to turn on version 2 features.
15735 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15736 hashtable when v2 is enabled.
15738 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15740 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15741 there is already a namespace defined with this name.
15743 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15744 people upgraded their corlibs.
15746 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15747 always use fully qualified types, no need to use the compiler
15750 (TypeManager.IsNamespace): Use binarysearch.
15752 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15753 AddDelegate): I did not quite use the new IsValid API properly: I
15754 have to pass the short-name and the fullname. I was passing only
15755 the basename instead of the fullname sometimes.
15757 (TypeContainer.DefineType): call NamespaceClash.
15759 * interface.cs (Interface.DefineType): use NamespaceClash before
15762 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15765 * enum.cs: (Enum.DefineType): use NamespaceClash before
15768 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15769 speed increase. First, use the negative_hits cache when we get a
15770 negative. Second, add the type with its full original name
15771 instead of the new . and + encoded name (reflection uses + to
15772 separate type from a nested type). Use LookupTypeReflection
15773 directly which bypasses the type->name hashtable (that we already
15774 know does not contain the type.
15776 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15777 location/container type.
15779 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15781 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15783 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15785 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15786 method is being referenced in the method group from a static
15787 context, and report error 120 if so.
15789 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15792 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15793 is created, we create the A namespace).
15795 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15798 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15800 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15801 invocation to ModuleBuilder.GetType with the same values will
15802 return a new type instance, so we need to cache its return
15805 * expression.cs (Binary.ResolveOperator): Only allow the compare
15806 operators on enums if they are of the same type.
15808 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15809 types of ValueType on their own case. Before we were giving them
15810 the same treatment as objects.
15812 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15813 fullname. Short name is used to compare against container name.
15814 Fullname is used to check against defined namespace names.
15816 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15817 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15819 (Method.CheckBase): Call parent.
15820 (MemberBase.CheckBase): Check for protected members on sealed
15822 (PropertyBase.CheckBase): Call parent.
15823 (Field.Define): Call parent.
15825 * report.cs: Negative error codes are now mapped to 8000 - code,
15826 so that the display is render more nicely.
15828 * typemanager.cs: Do not use try/catch, instead report a regular
15831 (GetPointerType, GetReferenceType): These methods provide
15832 mechanisms to obtain the T* and T& from a T. We had the code
15833 previously scattered around the code base, and it also used
15834 TypeManager.LookupType that would go through plenty of caches.
15835 This one goes directly to the type source.
15837 In some places we did the Type.GetType followed by
15838 ModuleBuilder.GetType, but not in others, so this unifies the
15839 processing as well.
15841 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15842 statements now that we have namespace information.
15844 * typemanager.cs (IsNamespace): New method, returns whether the
15845 string presented is a namespace or not.
15847 (ComputeNamespaces): New public entry point, computes the list of
15848 available namespaces, using the GetNamespaces API call in Mono, or
15849 the slower version in MS.NET.
15851 Now before we start the semantic analysis phase, we have a
15852 complete list of namespaces including everything that the user has
15855 Deleted old code to cache namespaces in .nsc files.
15857 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15859 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15860 class/struct location definition Location for the implicit
15861 constructor location.
15863 (Operator.Define): Use the location of the operator for the
15864 implicit Method definition.
15866 (Constructor.Emit): use the constructor location for the implicit
15867 base initializer constructor.
15869 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15870 and the Expression class now contains two new methods:
15872 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15873 isolate type lookup from the rest of the resolution process.
15875 Since we use Expressions to hold type definitions due to the way
15876 we parse the input we have historically overloaded Resolve to
15877 perform the Type lookups if a special flag is passed. Now this is
15878 eliminated and two methods take their place.
15880 The differences in the two methods between xStep and xTerminal is
15881 that xStep is involved in our current lookup system that uses
15882 SimpleNames to compose a name, while xTerminal is used just to
15883 catch the case where the simplename lookup failed.
15885 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15887 * expression.cs (ResolveMemberAccess): Remove redundant code.
15888 TypeExpr expressions are always born fully resolved.
15890 * interface.cs (PopulateMethod): Do not lookup the types twice.
15891 We were doing it once during SemanticAnalysis and once during
15894 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15895 in local variable type definitions, were being returned as a
15896 SimpleName (we decomposed everything into a string), that is
15897 because primary_expression was being used instead of a type in the
15898 grammar (reduce/reduce conflicts).
15900 The part that was wrong is that we converted the expression into a
15901 string (an oversimplification in one hand, compounded with primary
15902 expressions doing string concatenation).
15908 Would return "A.B.C[]" as a SimpleName. This stopped things like
15909 using clauses from working on this particular context. And a type
15910 was being matched directly against "A.B.C[]".
15912 We now use the correct approach, and allow for ComposedCast to be
15913 part of the unary expression. So the "A.B.C []" become a composed
15914 cast of "A.B.C" (as a nested group of MemberAccess with a
15915 SimpleName at the end) plus the rank composition "[]".
15919 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15921 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15922 for the access level checking.
15924 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15925 `TypeContainer container', because I kept getting confused when I
15926 was debugging this code.
15928 * expression.cs (Indexers): Instead of tracking getters/setters,
15929 we now track them in parallel. We create one arraylist less, but
15930 most importantly it is possible now for the LValue code to find a
15931 matching get for a set.
15933 (IndexerAccess.DoResolveLValue): Update the code.
15934 GetIndexersForType has been modified already to extract all the
15935 indexers from a type. The code assumed it did not.
15937 Also make the code set the correct return type for the indexer.
15938 This was fixed a long time ago for properties, but was missing for
15939 indexers. It used to be void_type.
15941 (Binary.Emit): Test first for doubles instead of
15942 floats, as they are more common.
15944 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15945 when dealing with floats and the <=, >= operators. This fixes bug
15948 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15949 to load the array value by emitting a load on the foreach variable
15950 type. This was incorrect.
15952 We now emit the code to load an element using the the array
15953 variable type, and then we emit the conversion operator.
15957 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15959 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15961 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15963 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15964 test for protection before we test for signatures.
15966 (MethodSignature.ToString): implement.
15968 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15969 to the case where we reduced into a LongConstant.
15971 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15972 depend on whether the information is acurrate, because the
15973 Microsoft runtime will always claim that the array type is public,
15974 regardless of the real state.
15976 If the type is a pointer, another problem happens: the type is
15977 reported as non-public in Microsoft.
15979 In both cases we have to call CheckAccessLevel recursively with
15980 the underlying type as the argument to be tested.
15982 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15984 * assign.cs (Assign.Emit): If we are dealing with a compound
15985 assignment expression, we should use the code path that stores the
15986 intermediate result in a temporary value. This fixes #40903.
15988 *expression.cs (Indirection.ToString): Provide ToString method for
15991 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15993 * class.cs: Null out fields holding references to Block objects so
15994 they can be garbage collected.
15996 * expression.cs (OverloadResolve): Remove unused local.
15998 2003-04-07 Martin Baulig <martin@ximian.com>
16000 * codegen.cs (EmitContext.CurrentFile): New public field.
16001 (EmitContext.Mark): Use the CurrentFile to check whether the
16002 location is in the correct file.
16003 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
16005 2003-04-07 Martin Baulig <martin@ximian.com>
16007 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
16009 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
16010 location. [FIXME: The location argument which gets passed to this
16011 method is sometimes wrong!]
16013 2003-04-07 Nick Drochak <ndrochak@gol.com>
16015 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
16017 2003-04-07 Miguel de Icaza <miguel@ximian.com>
16019 * expression.cs (Indirection.EmitAssign): We were using the
16020 temporary, but returning immediately instead of continuing the
16023 2003-04-06 Martin Baulig <martin@ximian.com>
16025 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
16026 if it's a nested child, but also deriving from the outer class.
16029 * typemanager.cs (IsNestedChildOf): Make this work if it's a
16030 nested child, but also deriving from the outer class. See
16032 (FilterWithClosure): We may access private members of the outer
16033 class if we're a nested child and deriving from the outer class.
16034 (RealMemberLookup): Only set `closure_private_ok' if the
16035 `original_bf' contained BindingFlags.NonPublic.
16037 2003-04-05 Martin Baulig <martin@ximian.com>
16039 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
16040 probe if its a type parameter, and if so, flag an error.
16042 * decl.cs: Move here the SetParameterInfo code from class.cs.
16043 Handle IsGeneric here.
16045 Handle a variety of errors in the parameter info definition.
16047 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
16048 type parameters here.
16050 * cs-parser.jay (class_declaration): report errors for parameters
16053 2003-01-21 Miguel de Icaza <miguel@ximian.com>
16055 * generic.cs: New file, contains support code for generics.
16057 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
16058 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
16060 Update parser for the above removals.
16062 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
16063 now taken care of in the parser.
16065 2003-04-02 Miguel de Icaza <miguel@ximian.com>
16067 * class.cs (Event.Define): Do not allow abstract events to have
16070 2003-04-01 Miguel de Icaza <miguel@ximian.com>
16072 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
16073 block in event declarations.
16075 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
16076 value type, get its address.
16078 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
16079 leaving a class on the stack instead of a boolean value (int
16080 0/1). Change the code so we compare against null, and then the
16081 result against zero.
16083 * class.cs (TypeContainer.GetClassBases): We were checking for the
16084 parent class being sealed too late.
16086 * expression.cs (Binary.Emit): For <= and >= when dealing with
16087 floating point values, use cgt.un and clt.un instead of cgt and
16090 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
16092 * statement.cs: Apply the same optimization as MS: skip the
16093 GetEnumerator returning an IEnumerator, and use the one returning a
16094 CharEnumerator instead. This allows us to avoid the try-finally block
16097 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
16099 * cs-parser.jay: Attributes cannot be applied to
16100 namespaces. Fixes #40473
16102 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16105 (Add*): check if the name is valid using the full name for constants,
16106 fields, properties and events.
16108 2003-03-28 Miguel de Icaza <miguel@ximian.com>
16110 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
16111 char constants to be part of the enumeration.
16113 * expression.cs (Conditional.DoResolve): Add support for operator
16114 true. Implements the missing functionality from 14.12
16116 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
16117 operator true/false as required by the spec.
16119 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
16120 implicit conversion to boolean.
16122 * statement.cs (Statement.ResolveBoolean): A boolean expression is
16123 also one where the type implements `operator true'.
16125 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
16126 get an expression that will invoke operator true based on an
16129 (GetConversionOperators): Removed the hack that called op_True
16132 (Expression.ResolveBoolean): Move this from Statement.
16134 2003-03-17 Miguel de Icaza <miguel@ximian.com>
16136 * ecore.cs (FieldExpr): do not allow initialization of initonly
16137 fields on derived classes
16139 2003-03-13 Martin Baulig <martin@ximian.com>
16141 * statement.cs (Block.Emit): Call ig.BeginScope() and
16142 ig.EndScope() when compiling with debugging info; call
16143 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
16145 2003-03-08 Miguel de Icaza <miguel@ximian.com>
16147 * expression.cs (Indexers): Do not construct immediately, allow
16148 for new members to be appended as we go. Fixes 38143
16150 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16152 * expression.cs: save/restore context when resolving an unchecked
16155 2003-03-05 Miguel de Icaza <miguel@ximian.com>
16157 * cfold.cs: Catch division by zero in modulus operator during
16160 2003-03-03 Miguel de Icaza <miguel@ximian.com>
16162 * interface.cs (Interface.DefineMembers): Avoid defining members
16165 2003-02-27 Miguel de Icaza <miguel@ximian.com>
16167 * driver.cs: handle the +/- options for -noconfig
16169 * statement.cs (Unckeched.Resolve): Also track the state of
16170 unchecked in the Resolve phase.
16172 2003-02-27 Martin Baulig <martin@ximian.com>
16174 * ecore.cs (Expression.MemberLookup): Don't create a
16175 MethodGroupExpr for something which is not a method. Fixes #38291.
16177 2003-02-25 Miguel de Icaza <miguel@ximian.com>
16179 * class.cs (MemberBase.CheckParameters): Also check that the type
16180 is unmanaged if it is a pointer.
16182 * expression.cs (SizeOf.Resolve): Add location information.
16184 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16185 a managed type is declared.
16187 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16188 parameter modifiers as well. Fixes bug 38606
16190 * class.cs: Very sad. Am backing out the speed up changes
16191 introduced by the ArrayList -> Array in the TypeContainer, as they
16192 were not actually that much faster, and introduced a bug (no error
16193 reports on duplicated methods).
16195 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16196 source first, this will guarantee that we have a valid expression
16197 before calling in lower levels functions that will require a
16198 resolved object. Then use this original_source in the
16199 target.ResolveLValue instead of the original source that was
16202 Another change. Use target.Resolve instead of LValueResolve.
16203 Although we are resolving for LValues, we will let the Assign code
16204 take care of that (it will be called again from Resolve). This
16205 basically allows code like this:
16207 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16208 class Y { void A (X x) { x [0] += o; }
16210 The problem was that the indexer was trying to resolve for
16211 set_Item (idx, object o) and never finding one. The real set_Item
16212 was set_Item (idx, X). By delaying the process we get the right
16217 2003-02-23 Martin Baulig <martin@ximian.com>
16219 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16220 while calling DoEmit ().
16222 * codegen.cs (EmitContext.Mark): Don't mark locations in other
16223 source files; if you use the #line directive inside a method, the
16224 compiler stops emitting line numbers for the debugger until it
16225 reaches the end of the method or another #line directive which
16226 restores the original file.
16228 2003-02-23 Martin Baulig <martin@ximian.com>
16230 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16232 2003-02-23 Martin Baulig <martin@ximian.com>
16234 * statement.cs (Block.AddChildVariableNames): We need to call this
16235 recursively, not just for our immediate children.
16237 2003-02-23 Martin Baulig <martin@ximian.com>
16239 * class.cs (Event.Define): Always make the field private, like csc does.
16241 * typemanager.cs (TypeManager.RealMemberLookup): Make events
16242 actually work, fixes bug #37521.
16244 2003-02-23 Miguel de Icaza <miguel@ximian.com>
16246 * delegate.cs: When creating the various temporary "Parameters"
16247 classes, make sure that we call the ComputeAndDefineParameterTypes
16248 on those new parameters (just like we do with the formal ones), to
16249 allow them to be resolved in the context of the DeclSpace.
16251 This fixes the bug that Dick observed in Bugzilla #38530.
16253 2003-02-22 Miguel de Icaza <miguel@ximian.com>
16255 * expression.cs (ResolveMemberAccess): When resolving a constant,
16256 do not attempt to pull a constant if the value was not able to
16257 generate a valid constant.
16259 * const.cs (LookupConstantValue): Do not report more errors than required.
16261 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16263 * expression.cs: fixes bug #38328.
16265 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16267 * class.cs: Changed all the various members that can be part of a
16268 class from being an ArrayList to be an Array of the right type.
16269 During the DefineType type_list, interface_list, delegate_list and
16270 enum_list are turned into types, interfaces, delegates and enums
16273 And during the member population, indexer_list, event_list,
16274 constant_list, field_list, instance_constructor_list, method_list,
16275 operator_list and property_list are turned into their real arrays.
16277 Although we could probably perform this operation earlier, for
16278 good error reporting we need to keep the lists and remove the
16279 lists for longer than required.
16281 This optimization was triggered by Paolo profiling the compiler
16282 speed on the output of `gen-sample-program.pl' perl script.
16284 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16285 not crash in methods like MemberLookupFailed that use this field.
16287 This problem arises when the compiler fails to resolve a type
16288 during interface type definition for example.
16290 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16292 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16293 inherit from System.Object, so we have to stop at null, not only
16294 when reaching System.Object.
16296 2003-02-17 Miguel de Icaza <miguel@ximian.com>
16298 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16299 DeclaredOnly because the parent indexer might have had a different
16300 name, but did not loop until the top of the hierarchy was reached.
16302 The problem this one fixes is 35492: when a class implemented an
16303 indexer from an interface, we were getting the interface method
16304 (which was abstract) and we were flagging an error (can not invoke
16307 This also keeps bug 33089 functioning, and test-148 functioning.
16309 * typemanager.cs (IsSpecialMethod): The correct way of figuring
16310 out if a method is special is to see if it is declared in a
16311 property or event, or whether it is one of the predefined operator
16312 names. This should fix correctly #36804.
16314 2003-02-15 Miguel de Icaza <miguel@ximian.com>
16316 The goal here is to remove the dependency on EmptyCast.Peel ().
16317 Killing it completely.
16319 The problem is that currently in a number of places where
16320 constants are expected, we have to "probe" for an EmptyCast, and
16321 Peel, which is not the correct thing to do, as this will be
16322 repetitive and will likely lead to errors.
16324 The idea is to remove any EmptyCasts that are used in casts that
16325 can be reduced to constants, so we only have to cope with
16328 This bug hunt was triggered by Bug 37363 and the desire to remove
16329 the duplicate pattern where we were "peeling" emptycasts to check
16330 whether they were constants. Now constants will always be
16333 * ecore.cs: Use an enumconstant here instead of wrapping with
16336 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16337 throwing me off. By handling this we can get rid of a few hacks.
16339 * statement.cs (Switch): Removed Peel() code.
16341 2003-02-14 Miguel de Icaza <miguel@ximian.com>
16343 * class.cs: Location information for error 508
16345 * expression.cs (New.DoResolve): Add a guard against double
16346 resolution of an expression.
16348 The New DoResolve might be called twice when initializing field
16349 expressions (see EmitFieldInitializers, the call to
16350 GetInitializerExpression will perform a resolve on the expression,
16351 and later the assign will trigger another resolution
16353 This leads to bugs (#37014)
16355 * delegate.cs: The signature for EndInvoke should contain any ref
16356 or out parameters as well. We were not doing this in the past.
16358 * class.cs (Field.Define): Do not overwrite the type definition
16359 inside the `volatile' group. Turns out that volatile enumerations
16360 were changing the type here to perform a validity test, which
16363 2003-02-12 Miguel de Icaza <miguel@ximian.com>
16365 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16366 and structs, we do not want to load the instance variable
16368 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16369 enum_type has to be handled like an object reference (implicit
16370 conversions exists from this to object), but the regular IsClass
16371 and IsValueType tests will never return true for this one.
16373 Also we use TypeManager.IsValueType instead of type.IsValueType,
16374 just for consistency with the rest of the code (this is only
16375 needed if we ever use the construct exposed by test-180.cs inside
16376 corlib, which we dont today).
16378 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
16380 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16383 2003-02-09 Martin Baulig <martin@ximian.com>
16385 * namespace.cs (Namespace..ctor): Added SourceFile argument.
16386 (Namespace.DefineNamespaces): New static public method; this is
16387 called when we're compiling with debugging to add all namespaces
16388 to the symbol file.
16390 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16391 pass it to the Namespace's .ctor.
16393 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16394 and MethodBase arguments; pass the namespace ID to the symwriter;
16395 pass the MethodBase instead of the token to the symwriter.
16396 (SymbolWriter.DefineNamespace): New method to add a namespace to
16399 2003-02-09 Martin Baulig <martin@ximian.com>
16401 * symbolwriter.cs: New file. This is a wrapper around
16402 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
16403 methods here in near future.
16405 2003-02-09 Martin Baulig <martin@ximian.com>
16407 * codegen.cs (EmitContext.Mark): Just pass the arguments to
16408 ILGenerator.MarkSequencePoint() which are actually used by the
16411 2003-02-09 Martin Baulig <martin@ximian.com>
16413 * location.cs (SourceFile): New public sealed class. This
16414 contains the name and an index which is used in the location's token.
16415 (Location): Reserve an appropriate number of bits in the token for
16416 the source file instead of walking over that list, this gives us a
16417 really huge performance improvement when compiling with debugging.
16419 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16420 `SourceFile' argument instead of a string.
16421 (Driver.ProcessFile): Add all the files via Location.AddFile(),
16422 but don't parse/tokenize here, we need to generate the list of all
16423 source files before we do that.
16424 (Driver.ProcessFiles): New static function. Parses/tokenizes all
16427 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16428 instead of a string.
16430 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16433 2003-02-09 Martin Baulig <martin@ximian.com>
16435 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16436 filename on `#line default'.
16438 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16440 * statement.cs: don't clear the pinned var when the fixed statement
16441 returns from the method (fixes bug#37752).
16443 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16445 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
16448 2003-02-07 Martin Baulig <martin@ximian.com>
16450 * driver.cs: Removed the `--debug-args' command line argument.
16452 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16453 automatically by the AsssemblyBuilder.
16454 (CodeGen.InitializeSymbolWriter): We don't need to call any
16455 initialization function on the symbol writer anymore. This method
16456 doesn't take any arguments.
16458 2003-02-03 Miguel de Icaza <miguel@ximian.com>
16460 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16461 from referenced assemblies as well.
16463 2003-02-02 Martin Baulig <martin@ximian.com>
16465 * class.cs (MethodData.Emit): Generate debugging info for external methods.
16467 2003-02-02 Martin Baulig <martin@ximian.com>
16469 * class.cs (Constructor.Emit): Open the symbol writer before
16470 emitting the constructor initializer.
16471 (ConstructorInitializer.Emit): Call ec.Mark() to allow
16472 single-stepping through constructor initializers.
16474 2003-01-30 Miguel de Icaza <miguel@ximian.com>
16476 * class.cs: Handle error 549: do not allow virtual methods in
16479 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16481 * decl.cs: Check access levels when resolving types
16483 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16485 * statement.cs: Add parameters and locals set in catch blocks that might
16486 return to set vector
16488 2003-01-29 Miguel de Icaza <miguel@ximian.com>
16490 * class.cs (Operator): Set the SpecialName flags for operators.
16492 * expression.cs (Invocation.DoResolve): Only block calls to
16493 accessors and operators on SpecialName methods.
16495 (Cast.TryReduce): Handle conversions from char constants.
16498 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16500 * statement.cs: small memory and time optimization in FlowBranching.
16502 2003-01-28 Pedro Mart <yoros@wanadoo.es>
16504 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16505 problem that the last fix but in the other sid (Set).
16507 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16508 access when there is no indexer in the hierarchy.
16510 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16512 * class.cs: Combine some if statements.
16514 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16516 * driver.cs: fixed bug #37187.
16518 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
16520 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16521 any indexer, it's needed to build a list with all the indexers in the
16522 hierarchy (AllGetters), else we have problems. Fixes #35653.
16524 2003-01-23 Miguel de Icaza <miguel@ximian.com>
16526 * class.cs (MethodData.Define): It is wrong for an interface
16527 implementation to be static in both cases: explicit and implicit.
16528 We were only handling this in one case.
16530 Improve the if situation there to not have negations.
16532 * class.cs (Field.Define): Turns out that we do not need to check
16533 the unsafe bit on field definition, only on usage. Remove the test.
16535 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16537 * driver.cs: use assembly.Location instead of Codebase (the latest
16538 patch made mcs fail when using MS assemblies).
16540 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
16542 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16543 get the path to *corlib.dll.
16545 2003-01-21 Nick Drochak <ndrochak@gol.com>
16549 * typemanager.cs: Remove compiler warnings
16551 2003-01-20 Duncan Mak <duncan@ximian.com>
16553 * AssemblyInfo.cs: Bump the version number to 0.19.
16555 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16557 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16559 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
16561 * class.cs (Constructor::Emit): Emit debugging info for constructors.
16563 2003-01-17 Miguel de Icaza <miguel@ximian.com>
16565 * cs-parser.jay: Small fix: we were not comparing the constructor
16566 name correctly. Thanks to Zoltan for the initial pointer.
16568 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16570 * cs-tokenizer.cs: Set file name when specified with #line
16572 2003-01-15 Miguel de Icaza <miguel@ximian.com>
16574 * cs-parser.jay: Only perform the constructor checks here if we
16575 are named like the class; This will help provider a better
16576 error. The constructor path is taken when a type definition is
16577 not found, but most likely the user forgot to add the type, so
16578 report that rather than the constructor error.
16580 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16582 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16585 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16587 * cs-parser.jay: Add cleanup call.
16589 2003-01-13 Duncan Mak <duncan@ximian.com>
16591 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16592 consistent with other methods.
16594 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16596 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16598 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16600 * attribute.cs: only set GuidAttr to true when we have a
16603 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16607 * typemanager.cs: fixes to allow mcs compile corlib with the new
16608 Type.IsSubclassOf fix.
16610 2003-01-08 Miguel de Icaza <miguel@ximian.com>
16612 * expression.cs (LocalVariableReference.DoResolve): Classify a
16613 constant as a value, not as a variable. Also, set the type for
16616 * cs-parser.jay (fixed_statement): take a type instead of a
16617 pointer_type, so we can produce a better error message later.
16619 * statement.cs (Fixed.Resolve): Flag types that are not pointers
16622 (For.DoEmit): Make inifinite loops have a
16623 non-conditional branch back.
16625 (Fixed.DoEmit): First populate the pinned variables, then emit the
16626 statement, then clear the variables. Before I was emitting the
16627 code once for each fixed piece.
16630 2003-01-08 Martin Baulig <martin@ximian.com>
16632 * statement.cs (FlowBranching.MergeChild): A break in a
16633 SWITCH_SECTION does not leave a loop. Fixes #36155.
16635 2003-01-08 Martin Baulig <martin@ximian.com>
16637 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16638 lives in the same number space than `param_map'. Fixes #36154.
16640 2003-01-07 Miguel de Icaza <miguel@ximian.com>
16642 * cs-parser.jay (constructor_declaration): Set the
16643 Constructor.ModFlags before probing for it. This makes the
16644 compiler report 514, 515 and 132 (the code was there, but got
16647 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16648 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16649 (GotoCase.Resolve): Set `Returns' to ALWAYS.
16651 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16653 * enum.cs: create the enum static fields using the enum type.
16655 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16657 * class.cs: don't try to create the ParamBuilder for the return
16658 type if it's not needed (and handle it breaking for the ms runtime
16661 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16663 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16665 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16667 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16668 the command. This showed up while compiling the JANET source
16669 code, which used \r as its only newline separator.
16671 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16673 * class.cs (Method.Define): If we are an operator (because it
16674 reuses our code), then set the SpecialName and HideBySig. #36128
16676 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16678 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16679 exception, report error 120 `object reference required'.
16681 * driver.cs: Add --pause option, used during to measure the size
16682 of the process as it goes with --timestamp.
16684 * expression.cs (Invocation.DoResolve): Do not allow methods with
16685 SpecialName to be invoked.
16687 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16689 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16690 number before adding it.
16692 2002-12-21 Ravi Pratap <ravi@ximian.com>
16694 * ecore.cs (StandardImplicitConversion): When in an unsafe
16695 context, we allow conversion between void * to any other pointer
16696 type. This fixes bug #35973.
16698 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16700 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16701 is not thrown when extensionless outputs are used
16703 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16705 * rootcontext.cs: fixed compilation of corlib.
16707 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16709 * attribute.cs (Attributes.Contains): Add new method.
16711 * class.cs (MethodCore.LabelParameters): if the parameter is an
16712 `out' parameter, check that no attribute `[In]' has been passed.
16714 * enum.cs: Handle the `value__' name in an enumeration.
16716 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16718 * decl.cs: Added special case to allow overrides on "protected
16721 2002-12-18 Ravi Pratap <ravi@ximian.com>
16723 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16724 since it makes much more sense.
16726 (Attributes.ctor): Don't require a Location parameter.
16728 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16730 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16731 since we already have that information per attribute.
16733 * everywhere : make appropriate changes.
16735 * class.cs (LabelParameters): Write the code which actually
16736 applies attributes to the return type. We can't do this on the MS
16737 .NET runtime so we flag a warning in the case an exception is
16740 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16742 * const.cs: Handle implicit null conversions here too.
16744 2002-12-17 Ravi Pratap <ravi@ximian.com>
16746 * class.cs (MethodCore.LabelParameters): Remove the extra
16747 Type [] parameter since it is completely unnecessary. Instead
16748 pass in the method's attributes so that we can extract
16749 the "return" attribute.
16751 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16753 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16754 of ignoring it and letting the compile continue.
16756 * typemanager.cs (ChangeType): use an extra argument to return an
16757 error condition instead of throwing an exception.
16759 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16761 * expression.cs (Unary.TryReduce): mimic the code for the regular
16762 code path. Perform an implicit cast in the cases where we can
16763 implicitly convert to one of the integral types, and then reduce
16764 based on that constant. This fixes bug #35483.
16766 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16768 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16770 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16772 * namespace.cs: fixed bug #35489.
16774 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16776 * class.cs: Remove some dead code.
16778 * cs-parser.jay: Estimate the number of methods needed
16779 (RootContext.MethodCount);
16781 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16782 numbers instead of StringBuilders.
16784 * support.cs (PtrHashtable): Add constructor with initial size;
16785 We can now reduce reallocations of the method table.
16787 2002-12-10 Ravi Pratap <ravi@ximian.com>
16789 * attribute.cs (ApplyAttributes): Keep track of the emitted
16790 attributes on a per-target basis. This fixes bug #35413.
16792 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16794 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16795 default to the Windows 1252 encoding.
16797 (UnixParseOption): Support version, thanks to Alp for the missing
16800 * AssemblyInfo.cs: Add nice assembly information.
16802 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16805 * cs-parser.jay: Allow a trailing comma before the close bracked
16806 in the attribute_section production.
16808 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16809 address of the instance was being taken, I will take this out,
16810 because we take the address of the object immediately here.
16812 2002-12-09 Ravi Pratap <ravi@ximian.com>
16814 * typemanager.cs (AreMultipleAllowed): Take care of the most
16815 obvious case where attribute type is not in the current assembly -
16818 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16820 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16821 definitions, instead of doing that afterwards.
16823 Also we use a nice little hack, depending on the constructor, we
16824 know if we are a "composed" name or a simple name. Hence, we
16825 avoid the IndexOf test, and we avoid
16827 * codegen.cs: Add code to assist in a bug reporter to track down
16828 the source of a compiler crash.
16830 2002-12-07 Ravi Pratap <ravi@ximian.com>
16832 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16833 types have been emitted for a given element and flag an error
16834 if something which does not have AllowMultiple set is used more
16837 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16838 attribute types and their corresponding AllowMultiple properties
16840 (AreMultipleAllowed): Check the property for a given type.
16842 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16843 property in the case we have a TypeContainer.
16845 (Attributes.AddAttribute): Detect duplicates and just skip on
16846 adding them. This trivial fix catches a pretty gross error in our
16847 attribute emission - global attributes were being emitted twice!
16849 Bugzilla bug #33187 is now fixed.
16851 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16853 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16854 instead of pp_and).
16856 * expression.cs (Binary.ResolveOperator): I can only use the
16857 Concat (string, string, string) and Concat (string, string,
16858 string, string) if the child is actually a concatenation of
16861 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16863 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16864 context where we need a 2-character lookahead.
16866 * pending.cs (PendingImplementation): Rework so we can keep track
16867 of interface types all the time, and flag those which were
16868 implemented by parents as optional.
16870 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16872 * expression.cs (Binary.ResolveOperator): Use
16873 String.Concat(string,string,string) or
16874 String.Concat(string,string,string,string) when possible.
16876 * typemanager: More helper methods.
16879 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16881 * pending.cs: remove the bogus return from GetMissingInterfaces()
16882 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16884 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16886 * namespace.cs: avoid duplicated 'using xxx' being added to
16887 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16888 when we get more than one 'using' statement for the same namespace.
16889 Report a CS0105 warning for it.
16891 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16893 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16894 of calling getChar/putback, uses internal knowledge of it.
16896 (xtoken): Reorder tokenizer so most common patterns are checked
16897 first. This reduces the compilation time in another 5% (from 8.11s
16898 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16900 The parsing time is 22% of the compilation in mcs, and from that
16901 64% is spent on the tokenization process.
16903 I tried using a binary search for keywords, but this is slower
16904 than the hashtable. Another option would be to do a couple of
16907 * Not use a StringBuilder, instead use an array of chars,
16908 with a set value. Notice that this way we could catch
16909 the 645 error without having to do it *afterwards*.
16911 * We could write a hand-parser to avoid the hashtable
16912 compares altogether.
16914 The identifier consumption process takes 37% of the tokenization
16915 time. Another 15% is spent on is_number. 56% of the time spent
16916 on is_number is spent on Int64.Parse:
16918 * We could probably choose based on the string length to
16919 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16922 Another 3% is spend on wrapping `xtoken' in the `token' function.
16924 Handle 0xa0 as whitespace (#34752)
16926 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16928 * typemanager.cs (IsCLRType): New routine to tell whether a type
16929 is one of the builtin types.
16931 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16932 typecode in more places instead of doing pointer comparissions.
16933 We could leverage some knowledge about the way the typecodes are
16936 New code to cache namespaces in assemblies, it is currently not
16937 invoked, to be used soon.
16939 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16941 * expression.cs (Binary.ResolveOperator): specially handle
16942 strings, and do not perform user-defined operator overloading for
16945 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16947 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16948 internalcall as it is a pretty simple operation; Avoid whenever
16949 possible to call Char.IsLetter.
16951 (consume_identifier): Cut by half the number of
16952 hashtable calls by merging the is_keyword and GetKeyword behavior.
16954 Do not short-circuit, because if we do, we
16955 report errors (ie, #if false && true would produce an invalid
16959 2002-11-24 Martin Baulig <martin@ximian.com>
16961 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16962 check constant ranges and report a CS0221. Fixes #33186.
16964 2002-11-24 Martin Baulig <martin@ximian.com>
16966 * cs-parser.jay: Make this work for uninitialized variable
16967 declarations in the `for' initializer. Fixes #32416.
16969 2002-11-24 Martin Baulig <martin@ximian.com>
16971 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16972 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16974 2002-11-24 Martin Baulig <martin@ximian.com>
16976 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16977 argument; if true, we also check for user-defined conversions.
16978 This is only needed if both arguments are of a user-defined type.
16979 Fixes #30443, added test-175.cs.
16980 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16982 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16984 2002-11-24 Martin Baulig <martin@ximian.com>
16986 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16987 function to get the store opcode.
16988 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16989 only emit the Ldelema if the store opcode is Stobj. You must run
16990 both test-34 and test-167 to test this. Fixes #34529.
16992 2002-11-23 Martin Baulig <martin@ximian.com>
16994 * ecore.cs (Expression.MemberLookup): Added additional
16995 `qualifier_type' argument which is used when we're being called
16996 from MemberAccess.DoResolve() and null if we're called from a
16998 (Expression.MemberLookupFailed): New method to report errors; this
16999 does the CS1540 check and reports the correct error message.
17001 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
17002 argument for the CS1540 check and redone the way how we're dealing
17003 with private members. See the comment in the source code for details.
17004 (FilterWithClosure): Reverted this back to revision 1.197; renamed
17005 `closure_start_type' to `closure_qualifier_type' and check whether
17006 it's not null. It was not this filter being broken, it was just
17007 being called with the wrong arguments.
17009 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
17010 and pass it the correct `qualifier_type'; this also does the error
17013 2002-11-22 Miguel de Icaza <miguel@ximian.com>
17015 * expression.cs (Invocation.EmitParams): If the we are dealing
17016 with a non-built-in value type, load its address as well.
17018 (ArrayCreation): Use a a pretty constant instead
17019 of the hardcoded value 2. Use 6 instead of 2 for the number of
17020 static initializers.
17022 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
17023 because they are not really value types, just glorified integers.
17025 * driver.cs: Do not append .exe, the CSC compiler does not do it.
17027 * ecore.cs: Remove redundant code for enumerations, make them use
17028 the same code path as everything else, fixes the casting issue
17029 with enumerations in Windows.Forms.
17031 * attribute.cs: Do only cast to string if it is a string, the
17032 validation happens later.
17034 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
17035 people upgrade their corlibs.
17037 * ecore.cs: Oops, enumerations were not following the entire code path
17039 2002-11-21 Miguel de Icaza <miguel@ximian.com>
17041 * typemanager.cs (FilterWithClosure): Commented out the test for
17042 1540 in typemanager.cs, as it has problems when accessing
17043 protected methods from a parent class (see test-174.cs).
17045 * attribute.cs (Attribute.ValidateGuid): new method.
17046 (Attribute.Resolve): Use above.
17048 2002-11-19 Miguel de Icaza <miguel@ximian.com>
17050 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
17052 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
17053 handling for enumerations, as we only needed the TypeContainer
17054 functionality to begin with (this is required for the fix below to
17055 work for enums that reference constants in a container class for
17058 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
17060 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
17061 a valid TypeBuilder to perform lookups on.o
17063 * class.cs (InheritableMemberSignatureCompare): Use true in the
17064 call to GetGetMethod and GetSetMethod, because we are comparing
17065 the signature, and we need to get the methods *even* if they are
17068 (PropertyBase.CheckBase): ditto.
17070 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
17071 GotoCase.Resolve): Use Peel on EmpytCasts.
17073 * ecore.cs (EmptyCast): drop child, add Peel method.
17075 2002-11-17 Martin Baulig <martin@ximian.com>
17077 * ecore.cs (EmptyCast.Child): New public property.
17079 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
17080 label resolved to an EmptyCast. Fixes #34162.
17081 (GotoCase.Resolve): Likewise.
17082 (Block.EmitMeta): Likewise.
17084 2002-11-17 Martin Baulig <martin@ximian.com>
17086 * expression.cs (Invocation.BetterConversion): Prefer int over
17087 uint; short over ushort; long over ulong for integer literals.
17088 Use ImplicitConversionExists instead of StandardConversionExists
17089 since we also need to check for user-defined implicit conversions.
17090 Fixes #34165. Added test-173.cs.
17092 2002-11-16 Martin Baulig <martin@ximian.com>
17094 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
17095 with the `true' and `false' literals. Fixes #33151.
17097 2002-11-16 Martin Baulig <martin@ximian.com>
17099 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
17100 October 22nd; don't do the cs1540 check for static members.
17102 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
17103 now using our own filter here and doing the cs1540 check again.
17105 2002-11-16 Martin Baulig <martin@ximian.com>
17107 * support.cs (InternalParameters): Don't crash if we don't have
17108 any fixed parameters. Fixes #33532.
17110 2002-11-16 Martin Baulig <martin@ximian.com>
17112 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
17113 when looking up static methods to make this work on Windows.
17116 2002-11-16 Martin Baulig <martin@ximian.com>
17118 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
17119 a setter rather than using PropertyInfo.CanWrite.
17121 2002-11-15 Nick Drochak <ndrochak@gol.com>
17123 * class.cs: Allow acces to block member by subclasses. Fixes build
17126 2002-11-14 Martin Baulig <martin@ximian.com>
17128 * class.cs (Constructor.Emit): Added the extern/block check.
17131 2002-11-14 Martin Baulig <martin@ximian.com>
17133 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
17134 iteration while looking for indexers, this is needed because the
17135 indexer may have a different name in our base classes. Fixed the
17136 error reporting (no indexers at all, not get accessor, no
17137 overloaded match). Fixes bug #33089.
17138 (IndexerAccess.DoResolveLValue): Likewise.
17140 2002-11-14 Martin Baulig <martin@ximian.com>
17142 * class.cs (PropertyBase.CheckBase): Make this work for multiple
17143 indexers. Fixes the first part of bug #33089.
17144 (MethodSignature.InheritableMemberSignatureCompare): Added support
17147 2002-11-13 Ravi Pratap <ravi@ximian.com>
17149 * attribute.cs (Attribute.Resolve): Catch the
17150 NullReferenceException and report it since it isn't supposed to
17153 2002-11-12 Miguel de Icaza <miguel@ximian.com>
17155 * expression.cs (Binary.EmitBranchable): Also handle the cases for
17156 LogicalOr and LogicalAnd that can benefit from recursively
17157 handling EmitBranchable. The code now should be nice for Paolo.
17159 2002-11-08 Miguel de Icaza <miguel@ximian.com>
17161 * typemanager.cs (LookupType): Added a negative-hit hashtable for
17162 the Type lookups, as we perform quite a number of lookups on
17163 non-Types. This can be removed once we can deterministically tell
17164 whether we have a type or a namespace in advance.
17166 But this might require special hacks from our corlib.
17170 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17171 and double which avoids a conversion from an integer to a double.
17173 * expression.cs: tiny optimization, avoid calling IsConstant,
17174 because it effectively performs the lookup twice.
17176 2002-11-06 Miguel de Icaza <miguel@ximian.com>
17178 But a bogus return here to keep the semantics of the old code
17179 until the Mono runtime is fixed.
17181 * pending.cs (GetMissingInterfaces): New method used to remove all
17182 the interfaces that are already implemented by our parent
17183 classes from the list of pending methods.
17185 * interface.cs: Add checks for calls after ResolveTypeExpr.
17187 2002-11-05 Miguel de Icaza <miguel@ximian.com>
17189 * class.cs (Class.Emit): Report warning 67: event not used if the
17190 warning level is beyond 3.
17192 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17193 being a NullLiteral.
17195 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17198 * class.cs (TypeContainer.GetClassBases): Cover a missing code
17199 path that might fail if a type can not be resolved.
17201 * expression.cs (Binary.Emit): Emit unsigned versions of the
17204 * driver.cs: use error 5.
17206 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17208 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17210 2002-11-01 Miguel de Icaza <miguel@ximian.com>
17212 * cs-parser.jay (switch_section): A beautiful patch from Martin
17213 Baulig that fixed 33094.
17215 2002-10-31 Miguel de Icaza <miguel@ximian.com>
17217 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17218 Check whether the base is abstract and report an error if so.
17220 * expression.cs (IndexerAccess.DoResolveLValue,
17221 IndexerAccess.DoResolve): ditto.
17223 (Invocation.DoResolve): ditto.
17225 (Invocation.FullMethodDesc): Improve the report string.
17227 * statement.cs (Block): Eliminate IsVariableDefined as it is
17228 basically just a wrapper for GetVariableInfo.
17230 * ecore.cs (SimpleName): Use new
17232 * support.cs (ReflectionParamter.ParameterType): We unwrap the
17233 type, as we return the actual parameter ref/unref state on a
17236 2002-10-30 Miguel de Icaza <miguel@ximian.com>
17238 * support.cs: Return proper flags REF/OUT fixing the previous
17241 * expression.cs: Reverted last patch, that was wrong. Is_ref is
17242 not used to mean `ref' but `ref or out' in ParameterReference
17244 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17245 full type signature instead of calling TypeManger.CSharpName
17248 * support.cs (InternalParameters.ParameterDesc): Do not compare
17249 directly to the modflags, because REF/OUT will actually be bitsets
17252 * delegate.cs (VerifyMethod): Check also the modifiers.
17254 * cs-tokenizer.cs: Fix bug where floating point values with an
17255 exponent where a sign was missing was ignored.
17257 * driver.cs: Allow multiple assemblies to be specified in a single
17260 2002-10-28 Miguel de Icaza <miguel@ximian.com>
17262 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
17263 because identifiers after a parenthesis would end up in this kind
17264 of production, and we needed to desamiguate it for having casts
17267 (UserDefinedType *) xxx
17269 2002-10-24 Miguel de Icaza <miguel@ximian.com>
17271 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17272 we should set on the Bindingflags.NonPublic, but not turn on
17273 private_ok. private_ok controls whether a Private member is
17274 returned (this is chekced on the filter routine), while the
17275 BindingFlags.NonPublic just controls whether private/protected
17276 will be allowed. This fixes the problem part of the problem of
17277 private properties being allowed to be used in derived classes.
17279 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17280 so we can call the children DoResolveLValue method (this will
17281 properly signal errors on lvalue assignments to base properties)
17283 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17284 getter are null, and we have a property info, we know that this
17285 happened because the lookup failed, so we report an error 122 for
17286 protection level violation.
17288 We also silently return if setter and getter are null in the
17289 resolve functions, this condition only happens if we have flagged
17290 the error before. This is the other half of the problem.
17292 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17293 not have accessibility information, that is why we were returning
17294 true in the filter function in typemanager.cs.
17296 To properly report 122 (property is inaccessible because of its
17297 protection level) correctly, we report this error in ResolveAccess
17298 by failing if both the setter and the getter are lacking (ie, the
17301 DoResolve and DoLResolve have been modified to check for both
17302 setter/getter being null and returning silently, the reason being
17303 that I did not want to put the knowledge about this error in upper
17306 int old = Report.Errors;
17307 x = new PropertyExpr (...);
17308 if (old != Report.Errors)
17313 So the property expr is returned, but it is invalid, so the error
17314 will be flagged during the resolve process.
17316 * class.cs: Remove InheritablePropertySignatureCompare from the
17317 class, as we no longer depend on the property signature to compute
17318 whether it is possible to implement a method or not.
17320 The reason is that calling PropertyInfo.GetGetMethod will return
17321 null (in .NET, in Mono it works, and we should change this), in
17322 cases where the Get Method does not exist in that particular
17327 class X { public virtual int A { get { return 1; } } }
17329 class Z : Y { public override int A { get { return 2; } } }
17331 Would fail in Z because the parent (Y) would not have the property
17332 defined. So we avoid this completely now (because the alternative
17333 fix was ugly and slow), and we now depend exclusively on the
17336 (PropertyBase.CheckBase): Use a method-base mechanism to find our
17337 reference method, instead of using the property.
17339 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17340 routines are gone now.
17342 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17343 names, they were incorrectly named.
17345 * cs-tokenizer.cs: Return are more gentle token on failure.
17347 * pending.cs (PendingImplementation.InterfaceMethod): This routine
17348 had an out-of-sync index variable, which caused it to remove from
17349 the list of pending methods the wrong method sometimes.
17351 2002-10-22 Miguel de Icaza <miguel@ximian.com>
17353 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17354 CanWrite, because those refer to this particular instance of the
17355 property, and do not take into account the fact that we can
17356 override single members of a property.
17358 Constructor requires an EmitContext. The resolution process does
17359 not happen here, but we need to compute the accessors before,
17360 because the resolution does not always happen for properties.
17362 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17363 subclass, before we did not update this flag, but we did update
17366 (GetAccessors): Drop this routine, as it did not work in the
17367 presence of partially overwritten set/get methods.
17369 Notice that this broke the cs1540 detection, but that will require
17372 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17376 * driver.cs: issue a warning instead of an error if we don't support
17377 debugging for the platform. Also ignore a couple of errors that may
17378 arise when trying to write the symbols. Undo my previous patch.
17380 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17382 * driver.cs: ignore /debug switch except for Unix platforms.
17384 2002-10-23 Nick Drochak <ndrochak@gol.com>
17386 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17388 2002-10-21 Miguel de Icaza <miguel@ximian.com>
17390 * driver.cs: Do not make mcs-debug conditional, so we do not break
17391 builds that use it.
17393 * statement.cs (UsageVector.MergeChildren): I would like Martin to
17394 review this patch. But basically after all the children variables
17395 have been merged, the value of "Breaks" was not being set to
17396 new_breaks for Switch blocks. I think that it should be set after
17397 it has executed. Currently I set this to the value of new_breaks,
17398 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17399 conservative, but I do not understand this code very well.
17401 I did not break anything in the build, so that is good ;-)
17403 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17405 2002-10-20 Mark Crichton <crichton@gimp.org>
17407 * cfold.cs: Fixed compile blocker. Really fixed it this time.
17409 2002-10-20 Nick Drochak <ndrochak@gol.com>
17411 * cfold.cs: Fixed compile blocker.
17413 2002-10-20 Miguel de Icaza <miguel@ximian.com>
17415 * driver.cs: I was chekcing the key, not the file.
17417 2002-10-19 Ravi Pratap <ravi@ximian.com>
17419 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17420 message that we were generating - we just need to silently return
17423 2002-10-19 Miguel de Icaza <miguel@ximian.com>
17425 * class.cs (Event.Define): Change my previous commit, as this
17426 breaks the debugger. This is a temporary hack, as it seems like
17427 the compiler is generating events incorrectly to begin with.
17429 * expression.cs (Binary.ResolveOperator): Added support for
17430 "U operator - (E x, E y)"
17432 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17435 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17436 init-only variables, but this path did not take into account that
17437 there might be also instance readonly variables. Correct this
17440 This fixes bug 32253
17442 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17445 * driver.cs: Change the extension for modules to `netmodule'
17447 * cs-parser.jay: Improved slightly the location tracking for
17448 the debugger symbols.
17450 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17451 modifiers that were specified instead of the hardcoded value
17452 (FamAndAssem). This was basically ignoring the static modifier,
17453 and others. Fixes 32429.
17455 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17456 fixed a bug in the process (32476)
17458 * expression.cs (ArrayAccess.EmitAssign): Patch from
17459 hwang_rob@yahoo.ca that fixes bug 31834.3
17461 2002-10-18 Miguel de Icaza <miguel@ximian.com>
17463 * driver.cs: Make the module extension .netmodule.
17465 2002-10-16 Miguel de Icaza <miguel@ximian.com>
17467 * driver.cs: Report an error if the resource file is not found
17468 instead of crashing.
17470 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17471 false, like Emit does.
17473 2002-10-16 Nick Drochak <ndrochak@gol.com>
17475 * typemanager.cs: Remove unused private member. Also reported mcs
17476 bug to report this as a warning like csc.
17478 2002-10-15 Martin Baulig <martin@gnome.org>
17480 * statement.cs (Statement.Emit): Made this a virtual method; emits
17481 the line number info and calls DoEmit().
17482 (Statement.DoEmit): New protected abstract method, formerly knows
17483 as Statement.Emit().
17485 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17487 2002-10-11 Miguel de Icaza <miguel@ximian.com>
17489 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17490 have fixed a remaining problem: not every AddXXXX was adding a
17491 fully qualified name.
17493 Now everyone registers a fully qualified name in the DeclSpace as
17494 being defined instead of the partial name.
17496 Downsides: we are slower than we need to be due to the excess
17497 copies and the names being registered this way.
17499 The reason for this is that we currently depend (on the corlib
17500 bootstrap for instance) that types are fully qualified, because
17501 we dump all the types in the namespace, and we should really have
17502 types inserted into the proper namespace, so we can only store the
17503 basenames in the defined_names array.
17505 2002-10-10 Martin Baulig <martin@gnome.org>
17507 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17508 from bug #31834, see the bug report for a testcase which is
17511 2002-10-10 Martin Baulig <martin@gnome.org>
17513 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17514 flow analysis code for this.
17516 * statement.cs (Do, While, For): Tell the flow analysis code about
17518 (FlowBranching.UsageVector): Added support for infinite loops.
17519 (Block.Resolve): Moved the dead code elimination here and use flow
17522 2002-10-09 Miguel de Icaza <miguel@ximian.com>
17524 * class.cs (Field.Define): Catch cycles on struct type
17527 * typemanager.cs (IsUnmanagedtype): Do not recursively check
17528 fields if the fields are static. We only need to check instance
17531 * expression.cs (As.DoResolve): Test for reference type.
17533 * statement.cs (Using.ResolveExpression): Use
17534 ConvertImplicitRequired, not ConvertImplicit which reports an
17536 (Using.ResolveLocalVariableDecls): ditto.
17538 * expression.cs (Binary.ResolveOperator): Report errors in a few
17539 places where we had to.
17541 * typemanager.cs (IsUnmanagedtype): Finish implementation.
17543 2002-10-08 Miguel de Icaza <miguel@ximian.com>
17545 * expression.cs: Use StoreFromPtr instead of extracting the type
17546 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
17548 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17549 an enumeration value to a System.Enum, but System.Enum is not a
17550 value type, but an class type, so we need to box.
17552 (Expression.ConvertExplicit): One codepath could return
17553 errors but not flag them. Fix this. Fixes #31853
17555 * parameter.cs (Resolve): Do not allow void as a parameter type.
17557 2002-10-06 Martin Baulig <martin@gnome.org>
17559 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17560 if it's a class type and not a struct. Fixes #31815.
17562 2002-10-06 Martin Baulig <martin@gnome.org>
17564 * statement.cs: Reworked the flow analysis code a bit to make it
17565 usable for dead code elimination.
17567 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17569 * cs-parser.jay: allow empty source files. Fixes bug #31781.
17571 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17573 * expression.cs (ComposedCast.DoResolveType): A quick workaround
17574 to fix the test 165, will investigate deeper.
17576 2002-10-04 Martin Baulig <martin@gnome.org>
17578 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17579 finally blocks actually work.
17580 (Try.Resolve): We don't need to create a sibling for `finally' if
17581 there is no finally block.
17583 2002-10-04 Martin Baulig <martin@gnome.org>
17585 * class.cs (Constructor.Define): The default accessibility for a
17586 non-default constructor is private, not public.
17588 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17590 * class.cs (Constructor): Make AllowedModifiers public, add
17593 * cs-parser.jay: Perform the modifiers test here, as the
17594 constructor for the Constructor class usually receives a zero
17595 because of the way we create it (first we create, later we
17596 customize, and we were never checking the modifiers).
17598 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17599 is a version of LookupTypeReflection that includes the type-name
17600 cache. This can be used as a fast path for functions that know
17601 the fully qualified name and are only calling into *.GetType() to
17602 obtain a composed type.
17604 This is also used by TypeManager.LookupType during its type
17607 (LookupType): We now also track the real type name, as sometimes
17608 we can get a quey for the real type name from things like
17609 ComposedCast. This fixes bug 31422.
17611 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17612 complete type fullname, it does not have to go through the type
17613 resolution system to obtain the composed version of the type (for
17614 obtaining arrays or pointers).
17616 (Conditional.Emit): Use the EmitBoolExpression to
17617 generate nicer code, as requested by Paolo.
17619 (ArrayCreation.CheckIndices): Use the patch from
17620 hwang_rob@yahoo.ca to validate the array initializers.
17622 2002-10-03 Miguel de Icaza <miguel@ximian.com>
17624 * class.cs (ConstructorInitializer.Emit): simplify code by using
17625 Invocation.EmitCall, and at the same time, fix the bugs in calling
17626 parent constructors that took variable arguments.
17628 * ecore.cs (Expression.ConvertNumericExplicit,
17629 Expression.ImplicitNumericConversion): Remove the code that
17630 manually wrapped decimal (InternalTypeConstructor call is now gone
17633 * expression.cs (Cast.TryReduce): Also handle decimal types when
17634 trying to perform a constant fold on the type.
17636 * typemanager.cs (IsUnmanagedtype): Partially implemented.
17638 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17639 that only turned off an error report, and did nothing else.
17641 2002-10-02 Miguel de Icaza <miguel@ximian.com>
17643 * driver.cs: Handle and ignore /fullpaths
17645 2002-10-01 Miguel de Icaza <miguel@ximian.com>
17647 * expression.cs (Binary.ResolveOperator): Catch the case where
17648 DoNumericPromotions returns true,
17650 (Binary.DoNumericPromotions): Simplify the code, and the tests.
17652 2002-09-27 Miguel de Icaza <miguel@ximian.com>
17654 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17657 2002-09-26 Miguel de Icaza <miguel@ximian.com>
17659 * ecore.cs (ConvertNumericExplicit): It is not enough that the
17660 conversion exists, but it is also required that the conversion be
17661 performed. This manifested in "(Type64Enum) 2".
17663 * class.cs (TypeManager.AddMethod): The fix is not to change
17664 AddEnum, because that one was using a fully qualified name (every
17665 DeclSpace derivative does), but to change the AddMethod routine
17666 that was using an un-namespaced name. This now correctly reports
17667 the duplicated name.
17669 Revert patch until I can properly fix it. The issue
17670 is that we have a shared Type space across all namespaces
17671 currently, which is wrong.
17673 Options include making the Namespace a DeclSpace, and merge
17674 current_namespace/current_container in the parser.
17676 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17678 * cs-parser.jay: Improve error reporting when we get a different
17679 kind of expression in local_variable_type and
17680 local_variable_pointer_type.
17682 Propagate this to avoid missleading errors being reported.
17684 * ecore.cs (ImplicitReferenceConversion): treat
17685 TypeManager.value_type as a target just like object_type. As
17690 Is valid, and needs to result in the int 1 being boxed before it
17691 is assigned to the value type v.
17693 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17694 to validate the enumeration name.
17696 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17697 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17698 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17700 * ecore.cs (TryImplicitIntConversion): When doing an
17701 implicit-enumeration-conversion, check if the type is 64-bits and
17702 perform a conversion before passing to EnumConstant.
17704 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17706 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17707 report ambiguous type references. Unlike the MS version, we
17708 report what the ambiguity is. Innovation at work ;-)
17710 (DeclSpace.FindType): Require a location argument to
17711 display when we display an ambiguous error.
17713 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17715 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17717 * expression.cs (EmitDynamicInitializers): Apply patch from
17718 hwang_rob@yahoo.ca that fixes the order in which we emit our
17721 2002-09-21 Martin Baulig <martin@gnome.org>
17723 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17724 delegate takes no arguments.
17726 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17728 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17731 * expression.cs: Extract the underlying type.
17733 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17735 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17737 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17739 * class.cs (TypeContainer.DefineType): We can not use the nice
17740 PackingSize with the size set to 1 DefineType method, because it
17741 will not allow us to define the interfaces that the struct
17744 This completes the fixing of bug 27287
17746 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17747 means also structs. This fixes part of the problem.
17748 (Expresion.ImplicitReferenceConversionExists): ditto.
17750 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17751 error if there were no errors reported during the type lookup
17752 process, to avoid duplicates or redundant errors. Without this
17753 you would get an ambiguous errors plus a type not found. We have
17754 beaten the user enough with the first error.
17756 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17759 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17760 during the resolution process, stop the lookup, this avoids
17761 repeated error reports (same error twice).
17763 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17765 * typemanager.cs (LookupType): Redo the type lookup code to match
17766 the needs of System.Reflection.
17768 The issue is that System.Reflection requires references to nested
17769 types to begin with a "+" sign instead of a dot. So toplevel
17770 types look like: "NameSpace.TopLevelClass", and nested ones look
17771 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17774 2002-09-19 Martin Baulig <martin@gnome.org>
17776 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17777 says that a method always returns or always throws an exception,
17778 don't report the CS0161.
17780 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17781 set `Returns = new_returns'.
17783 2002-09-19 Martin Baulig <martin@gnome.org>
17785 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17786 to an enum constant, check for a CS0176.
17788 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17790 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17791 for operators that must be in pairs and report errors.
17793 * ecore.cs (SimpleName.DoResolveType): During the initial type
17794 resolution process, when we define types recursively, we must
17795 check first for types in our current scope before we perform
17796 lookups in the enclosing scopes.
17798 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17800 (Invocation.VerifyArgumentsCompat): Call
17801 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17802 I thought we were supposed to always call this, but there are a
17803 few places in the code where we dont do it.
17805 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17807 * driver.cs: Add support in -linkres and -resource to specify the
17808 name of the identifier.
17810 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17812 * ecore.cs (StandardConversionExists): Sync with the conversion
17813 code: allow anything-* to void* conversions.
17815 (FindMostSpecificSource): Use an Expression argument
17816 instead of a Type, because we might be handed over a Literal which
17817 gets a few more implicit conversions that plain types do not. So
17818 this information was being lost.
17820 Also, we drop the temporary type-holder expression when not
17823 2002-09-17 Martin Baulig <martin@gnome.org>
17825 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17826 this is an explicit interface implementation.
17828 2002-09-17 Martin Baulig <martin@gnome.org>
17830 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17831 different `IndexerName' attributes.
17833 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17834 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17835 virtual CommonResolve().
17837 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17839 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17840 and convert that to the UnderlyingType.
17842 * statement.cs (Foreach.Resolve): Indexers are just like variables
17843 or PropertyAccesses.
17845 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17846 inside quoted strings, we were not doing this before.
17848 2002-09-16 Martin Baulig <martin@gnome.org>
17850 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17851 resolve it. This is needed for the definite assignment check of the
17852 instance expression, fixes bug #29846.
17853 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17855 2002-09-16 Nick Drochak <ndrochak@gol.com>
17857 * parameter.cs: Fix compile error. Cannot reference static member
17858 from an instance object. Is this an mcs bug?
17860 2002-09-14 Martin Baulig <martin@gnome.org>
17862 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17863 multiple times. Fixes bug #30295, added test-166.cs.
17865 2002-09-14 Martin Baulig <martin@gnome.org>
17867 * statement.cs (Block.Emit): Don't emit unreachable code.
17868 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17869 `break' statements.
17870 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17872 2002-09-14 Martin Baulig <martin@gnome.org>
17874 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17877 2002-09-14 Martin Baulig <martin@gnome.org>
17879 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17880 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17881 be false on the ms runtime.
17883 2002-09-13 Martin Baulig <martin@gnome.org>
17885 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17886 the CS0038 error message.
17888 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17890 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17891 constant inside, return it.
17893 2002-09-12 Martin Baulig <martin@gnome.org>
17895 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17896 implicit conversion can be done between enum types.
17898 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17899 check whether an implicit conversion to the current enum's UnderlyingType
17900 exists and report an error if not.
17902 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17903 without debugging support.
17905 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17906 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
17908 2002-09-12 Martin Baulig <martin@gnome.org>
17910 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17912 * ecore.cs (IMemberExpr.DeclaringType): New property.
17913 (SimpleName.SimpleNameResolve): Check whether we're accessing a
17914 nonstatic member of an outer type (CS0038).
17916 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17918 * driver.cs: Activate the using-error detector at warning level
17919 4 (at least for MS-compatible APIs).
17921 * namespace.cs (VerifyUsing): Small buglett fix.
17923 * pending.cs (PendingImplementation): pass the container pointer.
17925 * interface.cs (GetMethods): Allow for recursive definition. Long
17926 term, I would like to move every type to support recursive
17927 definitions, not the current ordering mechanism that we have right
17930 The situation is this: Attributes are handled before interfaces,
17931 so we can apply attributes to interfaces. But some attributes
17932 implement interfaces, we will now handle the simple cases
17933 (recursive definitions will just get an error).
17935 * parameter.cs: Only invalidate types at the end if we fail to
17938 2002-09-09 Martin Baulig <martin@gnome.org>
17940 * ecore.cs (PropertyExpr.Emit): Also check for
17941 TypeManager.system_int_array_get_length so this'll also work when
17942 compiling corlib. Fixes #30003.
17944 2002-09-09 Martin Baulig <martin@gnome.org>
17946 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17947 and throw an exception if we can't get the type's size. Fixed #30040,
17950 2002-09-09 Martin Baulig <martin@gnome.org>
17952 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17954 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17955 context. Fixes bug #30027.
17957 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17958 virtual functions. Fixes bug #30043, added test-164.cs.
17960 2002-09-08 Ravi Pratap <ravi@ximian.com>
17962 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17964 2002-09-08 Nick Drochak <ndrochak@gol.com>
17966 * driver.cs: Use an object to get the windows codepage since it's not a
17969 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17971 * statement.cs (For.Emit): for infinite loops (test == null)
17972 return whether there is a break inside, not always "true".
17974 * namespace.cs (UsingEntry): New struct to hold the name of the
17975 using definition, the location where it is defined, and whether it
17976 has been used in a successful type lookup.
17978 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17983 2002-09-06 Ravi Pratap <ravi@ximian.com>
17985 * attribute.cs : Fix incorrect code which relied on catching
17986 a NullReferenceException to detect a null being passed in
17987 where an object was expected.
17989 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17991 * statement.cs (Try): flag the catch variable as assigned
17993 * expression.cs (Cast): Simplified by using ResolveType instead of
17994 manually resolving.
17996 * statement.cs (Catch): Fix bug by using ResolveType.
17998 2002-09-06 Ravi Pratap <ravi@ximian.com>
18000 * expression.cs (BetterConversion): Special case for when we have
18001 a NullLiteral as the argument and we have to choose between string
18002 and object types - we choose string the way csc does.
18004 * attribute.cs (Attribute.Resolve): Catch the
18005 NullReferenceException and report error #182 since the Mono
18006 runtime no more has the bug and having this exception raised means
18007 we tried to select a constructor which takes an object and is
18010 2002-09-05 Ravi Pratap <ravi@ximian.com>
18012 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
18013 message (1502, 1503) when we can't locate a method after overload
18014 resolution. This is much more informative and closes the bug
18017 * interface.cs (PopulateMethod): Return if there are no argument
18018 types. Fixes a NullReferenceException bug.
18020 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
18021 expressions too. Previously we were checking only in one place for
18022 positional arguments leaving out named arguments.
18024 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
18025 type to the enum type is not allowed. Remove code corresponding to
18028 (ConvertNumericExplicit): Allow explicit conversions from
18029 the underlying type to enum type. This precisely follows the spec
18030 and closes a bug filed by Gonzalo.
18032 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18035 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
18037 2002-09-03 Miguel de Icaza <miguel@ximian.com>
18039 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
18040 it was important that we stored the right value after the
18041 reduction in `converted'.
18043 2002-09-04 Martin Baulig <martin@gnome.org>
18045 * location.cs (Location.SymbolDocument): Use full pathnames for the
18048 2002-08-30 Miguel de Icaza <miguel@ximian.com>
18050 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
18051 of the expression resolve mechanism, because that will catch the
18052 SimpleName error failures.
18054 (Conditional): If we can not resolve the
18055 expression, return, do not crash.
18057 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18060 (location): display token name instead of its number.
18062 2002-08-28 Martin Baulig <martin@gnome.org>
18064 * expression.cs (Binary.ResolveOperator): Don't silently return
18065 but return an error if an operator cannot be applied between two
18068 2002-08-28 Martin Baulig <martin@gnome.org>
18070 * class.cs (Constructor.Define): Set the permission attributes
18071 correctly instead of making all constructors public.
18073 2002-08-28 Martin Baulig <martin@gnome.org>
18075 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
18076 for private members before reporting a CS0103; if we find anything,
18079 2002-08-28 Martin Baulig <martin@gnome.org>
18081 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
18082 to check whether `closure_start_type == closure_invocation_type',
18083 we also need to check whether `m.DeclaringType == closure_invocation_type'
18084 before bypassing the permission checks. We might be accessing
18085 protected/private members from the base class.
18086 (TypeManager.RealMemberLookup): Only set private_ok if private
18087 members were requested via BindingFlags.NonPublic.
18089 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
18091 * expression.cs (MemberAccess.ResolveMemberAccess): Set
18092 MethodGroupExpr.IsExplicitImpl if appropriate.
18093 (Invocation.DoResolve): Don't report the CS0120 for explicit
18094 interface implementations.
18096 2002-08-27 Martin Baulig <martin@gnome.org>
18098 * expression.cs (Invocation.DoResolve): If this is a static
18099 method and we don't have an InstanceExpression, we must report
18102 2002-08-25 Martin Baulig <martin@gnome.org>
18104 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
18105 `==' between a valuetype and an object.
18107 2002-08-25 Miguel de Icaza <miguel@ximian.com>
18109 * ecore.cs (TypeExpr): Provide a ToString method.
18111 2002-08-24 Martin Baulig <martin@gnome.org>
18113 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
18114 now called proggie.dbg and it's a binary file.
18116 2002-08-23 Martin Baulig <martin@gnome.org>
18118 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
18120 2002-08-23 Martin Baulig <martin@gnome.org>
18122 * struct.cs (MyStructInfo.ctor): Make this work with empty
18123 structs; it's not allowed to use foreach() on null.
18125 2002-08-23 Martin Baulig <martin@gnome.org>
18127 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
18128 writer the full pathname of the generated assembly.
18130 2002-08-23 Martin Baulig <martin@gnome.org>
18132 * statements.cs (FlowBranching.UsageVector.MergeChildren):
18133 A `finally' block never returns or breaks; improved handling of
18136 2002-08-23 Martin Baulig <martin@gnome.org>
18138 * statement.cs (Throw.Resolve): Allow `throw null'.
18140 2002-08-23 Martin Baulig <martin@gnome.org>
18142 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
18143 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
18144 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
18145 MemberLookup would return a wrong event if this is an explicit
18146 interface implementation and the class has an event with the same
18149 2002-08-23 Martin Baulig <martin@gnome.org>
18151 * statement.cs (Block.AddChildVariableNames): New public method.
18152 (Block.AddChildVariableName): Likewise.
18153 (Block.IsVariableNameUsedInChildBlock): Likewise.
18154 (Block.AddVariable): Check whether a variable name has already
18155 been used in a child block.
18157 * cs-parser.jay (declare_local_variables): Mark all variable names
18158 from the current block as being used in a child block in the
18161 2002-08-23 Martin Baulig <martin@gnome.org>
18163 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18164 find the symbol writer.
18166 * driver.cs: csc also allows the arguments to /define being
18167 separated by commas, not only by semicolons.
18169 2002-08-23 Martin Baulig <martin@gnome.org>
18171 * interface.cs (Interface.GetMembers): Added static check for events.
18173 2002-08-15 Martin Baulig <martin@gnome.org>
18175 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18176 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18178 * ecore.cs (Expression.MemberLookup): Added documentation and explained
18179 why the MethodData.EmitDestructor() change was necessary.
18181 2002-08-20 Martin Baulig <martin@gnome.org>
18183 * class.cs (TypeContainer.FindMembers): Added static check for events.
18185 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18187 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18188 use Type.GetEvents(), not Type.FindMembers().
18190 2002-08-20 Martin Baulig <martin@gnome.org>
18192 * decl.cs (MemberCache): Added a special method cache which will
18193 be used for method-only searched. This ensures that a method
18194 search will return a MethodInfo with the correct ReflectedType for
18197 2002-08-20 Martin Baulig <martin@gnome.org>
18199 * decl.cs (DeclSpace.FindMembers): Made this public.
18201 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18203 * delegate.cs: fixed build on windows.
18204 [FIXME: Filed as bug #29150: MCS must report these errors.]
18206 2002-08-19 Ravi Pratap <ravi@ximian.com>
18208 * ecore.cs (StandardConversionExists): Return a false
18209 if we are trying to convert the void type to anything else
18210 since that is not allowed.
18212 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18213 we flag error 70 in the event an event is trying to be accessed
18214 directly from outside the declaring type.
18216 2002-08-20 Martin Baulig <martin@gnome.org>
18218 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18219 MemberCache from typemanager.cs to decl.cs.
18221 2002-08-19 Martin Baulig <martin@gnome.org>
18223 * class.cs (TypeContainer): Implement IMemberContainer.
18224 (TypeContainer.DefineMembers): Create the MemberCache.
18225 (TypeContainer.FindMembers): Do better BindingFlags checking; only
18226 return public members if BindingFlags.Public was given, check
18227 whether members are static.
18229 2002-08-16 Martin Baulig <martin@gnome.org>
18231 * decl.cs (DeclSpace.Define): Splitted this in Define and
18232 DefineMembers. DefineMembers is called first and initializes the
18235 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
18236 DefineMembers() on all our DeclSpaces.
18238 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18239 but call DefineMembers() on all nested interfaces. We call their
18240 Define() in our new Define() function.
18242 * interface.cs (Interface): Implement IMemberContainer.
18243 (Interface.Define): Moved all code except the attribute stuf to
18245 (Interface.DefineMembers): Initialize the member cache.
18247 * typemanager.cs (IMemberFinder): Removed this interface, we don't
18248 need this anymore since we can use MemberCache.FindMembers directly.
18250 2002-08-19 Martin Baulig <martin@gnome.org>
18252 * typemanager.cs (MemberCache): When creating the cache for an
18253 interface type, add all inherited members.
18254 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18255 to `out bool used_cache' and documented it.
18256 (TypeManager.MemberLookup): If we already used the cache in the first
18257 iteration, we don't need to do the interfaces check.
18259 2002-08-19 Martin Baulig <martin@gnome.org>
18261 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
18262 here from IMemberFinder and don't implement this interface anymore.
18263 (DeclSpace.MemberCache): Moved here from IMemberFinder.
18265 * typemanager.cs (IMemberFinder): This interface is now only used by
18266 classes which actually support the member cache.
18267 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18268 since we only put DeclSpaces into this Hashtable.
18269 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18270 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18272 2002-08-16 Martin Baulig <martin@gnome.org>
18274 * typemanager.cs (ICachingMemberFinder): Removed.
18275 (IMemberFinder.MemberCache): New property.
18276 (TypeManager.FindMembers): Merged this with RealFindMembers().
18277 This function will never be called from TypeManager.MemberLookup()
18278 so we can't use the cache here, just the IMemberFinder.
18279 (TypeManager.MemberLookup_FindMembers): Check whether the
18280 IMemberFinder has a MemberCache and call the cache's FindMembers
18282 (MemberCache): Rewrote larger parts of this yet another time and
18283 cleaned it up a bit.
18285 2002-08-15 Miguel de Icaza <miguel@ximian.com>
18287 * driver.cs (LoadArgs): Support quoting.
18289 (Usage): Show the CSC-like command line arguments.
18291 Improved a few error messages.
18293 2002-08-15 Martin Baulig <martin@gnome.org>
18295 * typemanager.cs (IMemberContainer.Type): New property.
18296 (IMemberContainer.IsInterface): New property.
18298 The following changes are conditional to BROKEN_RUNTIME, which is
18299 defined at the top of the file.
18301 * typemanager.cs (MemberCache.MemberCache): Don't add the base
18302 class'es members, but add all members from TypeHandle.ObjectType
18303 if we're an interface.
18304 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18305 is the current type.
18306 (MemberCache.CacheEntry.Container): Removed this field.
18307 (TypeHandle.GetMembers): Include inherited members.
18309 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18311 * typemanager.cs: fixed compilation and added a comment on a field that
18314 2002-08-15 Martin Baulig <martin@gnome.org>
18316 * class.cs (ConstructorInitializer.Resolve): In the
18317 Expression.MemberLookup call, use the queried_type as
18320 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18321 declared' attribute, it's always true.
18322 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18323 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18324 temporary wrapper for FindMembers which tells MemberLookup whether
18325 members from the base classes are included in the return value.
18326 This will go away soon.
18327 (TypeManager.MemberLookup): Use this temporary hack here; once the
18328 new MemberCache is completed, we don't need to do the DeclaredOnly
18329 looping here anymore since the MemberCache will take care of this.
18330 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18331 (MemberCache): When creating the MemberCache for a class, get
18332 members from the current class and all its base classes.
18333 (MemberCache.CacheEntry.Container): New field. This is a
18334 temporary hack until the Mono runtime is fixed to distinguish
18335 between ReflectedType and DeclaringType. It allows us to use MCS
18336 with both the MS runtime and the unfixed Mono runtime without
18337 problems and without accecting performance.
18338 (MemberCache.SearchMembers): The DeclaredOnly looping from
18339 TypeManager.MemberLookup is now done here.
18341 2002-08-14 Martin Baulig <martin@gnome.org>
18343 * statement.cs (MyStructInfo.MyStructInfo): Don't call
18344 Type.GetFields on dynamic types but get the fields from the
18345 corresponding TypeContainer.
18346 (MyStructInfo.GetStructInfo): Added check for enum types.
18348 * typemanager.cs (MemberList.IsSynchronized): Implemented.
18349 (MemberList.SyncRoot): Implemented.
18350 (TypeManager.FilterWithClosure): No need to check permissions if
18351 closure_start_type == closure_invocation_type, don't crash if
18352 closure_invocation_type is null.
18354 2002-08-13 Martin Baulig <martin@gnome.org>
18356 Rewrote TypeContainer.FindMembers to use a member cache. This
18357 gives us a speed increase of about 35% for the self-hosting MCS
18358 build and of about 15-20% for the class libs (both on GNU/Linux).
18360 * report.cs (Timer): New class to get enhanced profiling. This
18361 whole class is "TIMER" conditional since it remarkably slows down
18364 * class.cs (MemberList): New class. This is an IList wrapper
18365 which we're now using instead of passing MemberInfo[]'s around to
18366 avoid copying this array unnecessarily.
18367 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18368 (ICachingMemberFinder, IMemberContainer): New interface.
18369 (TypeManager.FilterWithClosure): If `criteria' is null, the name
18370 has already been checked, otherwise use it for the name comparision.
18371 (TypeManager.FindMembers): Renamed to RealMemberFinder and
18372 provided wrapper which tries to use ICachingMemberFinder.FindMembers
18373 if possible. Returns a MemberList, not a MemberInfo [].
18374 (TypeHandle): New class, implements IMemberContainer. We create
18375 one instance of this class per type, it contains a MemberCache
18376 which is used to do the member lookups.
18377 (MemberCache): New class. Each instance of this class contains
18378 all members of a type and a name-based hash table.
18379 (MemberCache.FindMembers): This is our new member lookup
18380 function. First, it looks up all members of the requested name in
18381 the hash table. Then, it walks this list and sorts out all
18382 applicable members and returns them.
18384 2002-08-13 Martin Baulig <martin@gnome.org>
18386 In addition to a nice code cleanup, this gives us a performance
18387 increase of about 1.4% on GNU/Linux - not much, but it's already
18388 half a second for the self-hosting MCS compilation.
18390 * typemanager.cs (IMemberFinder): New interface. It is used by
18391 TypeManager.FindMembers to call FindMembers on a TypeContainer,
18392 Enum, Delegate or Interface.
18393 (TypeManager.finder_to_member_finder): New PtrHashtable.
18394 (TypeManager.finder_to_container): Removed.
18395 (TypeManager.finder_to_delegate): Removed.
18396 (TypeManager.finder_to_interface): Removed.
18397 (TypeManager.finder_to_enum): Removed.
18399 * interface.cs (Interface): Implement IMemberFinder.
18401 * delegate.cs (Delegate): Implement IMemberFinder.
18403 * enum.cs (Enum): Implement IMemberFinder.
18405 * class.cs (TypeContainer): Implement IMemberFinder.
18407 2002-08-12 Martin Baulig <martin@gnome.org>
18409 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18411 2002-08-12 Martin Baulig <martin@gnome.org>
18413 * ecore.cs (ITypeExpression): New interface for expressions which
18415 (TypeExpression): Renamed to TypeLookupExpression.
18416 (Expression.DoResolve): If we're doing a types-only lookup, the
18417 expression must implement the ITypeExpression interface and we
18418 call DoResolveType() on it.
18419 (SimpleName): Implement the new ITypeExpression interface.
18420 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18421 hack, the situation that we're only looking up types can't happen
18422 anymore when this method is called. Moved the type lookup code to
18423 DoResolveType() and call it.
18424 (SimpleName.DoResolveType): This ITypeExpression interface method
18425 is now doing the types-only lookup.
18426 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18427 (ResolveFlags): Added MaskExprClass.
18429 * expression.cs (MemberAccess): Implement the ITypeExpression
18431 (MemberAccess.DoResolve): Added support for a types-only lookup
18432 when we're called via ITypeExpression.DoResolveType().
18433 (ComposedCast): Implement the ITypeExpression interface.
18435 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
18436 Expression.Resolve() with ResolveFlags.Type instead.
18438 2002-08-12 Martin Baulig <martin@gnome.org>
18440 * interface.cs (Interface.Define): Apply attributes.
18442 * attribute.cs (Attribute.ApplyAttributes): Added support for
18443 interface attributes.
18445 2002-08-11 Martin Baulig <martin@gnome.org>
18447 * statement.cs (Block.Emit): Only check the "this" variable if we
18448 do not always throw an exception.
18450 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18451 whether the property has a set accessor.
18453 2002-08-11 Martin Baulig <martin@gnome.org>
18455 Added control flow analysis support for structs.
18457 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18458 with control flow analysis turned off.
18459 (IVariable): New interface.
18460 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18461 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18462 (FieldExpr.DoResolve): Resolve the instance expression with flow
18463 analysis turned off and do the definite assignment check after the
18464 resolving when we know what the expression will resolve to.
18466 * expression.cs (LocalVariableReference, ParameterReference):
18467 Implement the new IVariable interface, only call the flow analysis
18468 code if ec.DoFlowAnalysis is true.
18469 (This): Added constructor which takes a Block argument. Implement
18470 the new IVariable interface.
18471 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18472 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18473 This does the definite assignment checks for struct members.
18475 * class.cs (Constructor.Emit): If this is a non-static `struct'
18476 constructor which doesn't have any initializer, call
18477 Block.AddThisVariable() to tell the flow analysis code that all
18478 struct elements must be initialized before control returns from
18481 * statement.cs (MyStructInfo): New public class.
18482 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18483 argument to this indexer. If non-zero, check an individual struct
18484 member, not the whole struct.
18485 (FlowBranching.CheckOutParameters): Check struct members.
18486 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18487 overloaded versions of these methods which take an additional
18488 `int field_idx' argument to check struct members.
18489 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18490 overloaded versions of these methods which take an additional
18491 `string field_name' argument to check struct member.s
18492 (VariableInfo): Implement the IVariable interface.
18493 (VariableInfo.StructInfo): New public property. Returns the
18494 MyStructInfo instance of the variable if it's a struct or null.
18495 (Block.AddThisVariable): New public method. This is called from
18496 Constructor.Emit() for non-static `struct' constructor which do
18497 not have any initializer. It creates a special variable for the
18498 "this" instance variable which will be checked by the flow
18499 analysis code to ensure that all of the struct's fields are
18500 initialized before control returns from the constructor.
18501 (UsageVector): Added support for struct members. If a
18502 variable/parameter is a struct with N members, we reserve a slot
18503 in the usage vector for each member. A struct is considered fully
18504 initialized if either the struct itself (slot 0) or all its
18505 members are initialized.
18507 2002-08-08 Martin Baulig <martin@gnome.org>
18509 * driver.cs (Driver.MainDriver): Only report an error CS5001
18510 if there were no compilation errors.
18512 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18513 `UnsafeContext' property to determine whether the parent is in
18514 unsafe context rather than checking the parent's ModFlags:
18515 classes nested in an unsafe class are unsafe as well.
18517 2002-08-08 Martin Baulig <martin@gnome.org>
18519 * statement.cs (UsageVector.MergeChildren): Distinguish between
18520 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18521 we return. Added test17() and test18() to test-154.cs.
18523 2002-08-08 Martin Baulig <martin@gnome.org>
18525 * typemanager.cs (TypeManager.FilterWithClosure): If we have
18526 Family access, make sure the invoking type isn't a subclass of the
18527 queried type (that'd be a CS1540).
18529 * ecore.cs (Expression.MemberLookup): Added overloaded version of
18530 this method which takes an additional `Type invocation_type'.
18532 * expression.cs (BaseAccess.DoResolve): Use the base type as
18533 invocation and query type.
18534 (MemberAccess.DoResolve): If the lookup failed and we're about to
18535 report a CS0122, try a lookup with the ec.ContainerType - if this
18536 succeeds, we must report a CS1540.
18538 2002-08-08 Martin Baulig <martin@gnome.org>
18540 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18541 (MethodGroupExpr): Implement the IMemberExpr interface.
18543 * expression (MemberAccess.ResolveMemberAccess): No need to have
18544 any special code for MethodGroupExprs anymore, they're now
18547 2002-08-08 Martin Baulig <martin@gnome.org>
18549 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18550 Family, FamANDAssem and FamORAssem permissions.
18551 (TypeManager.IsSubclassOrNestedChildOf): New public method.
18553 2002-08-08 Martin Baulig <martin@gnome.org>
18555 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18556 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18559 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18561 * driver.cs: implemented /resource option to embed managed resources.
18563 2002-08-07 Martin Baulig <martin@gnome.org>
18565 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18566 (FieldBase.HasFieldInitializer): New public property.
18567 (FieldBase.GetInitializerExpression): New public method. Resolves and
18568 returns the field initializer and makes sure it is only resolved once.
18569 (TypeContainer.EmitFieldInitializers): Call
18570 FieldBase.GetInitializerExpression to get the initializer, this ensures
18571 that it isn't resolved multiple times.
18573 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
18574 the resolving process (SimpleName/MemberLookup) that we're currently
18575 emitting a field initializer (which must not access any instance members,
18576 this is an error CS0236).
18578 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18579 argument, if the `IsFieldInitializer' flag is set, we must report and
18580 error CS0236 and not an error CS0120.
18582 2002-08-07 Martin Baulig <martin@gnome.org>
18584 * ecore.cs (IMemberExpr): New public interface.
18585 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18586 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18587 if the expression is an IMemberExpr.
18589 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18590 to be null, implicitly default to `this' if we're non-static in
18591 this case. Simplified the code a lot by using the new IMemberExpr
18592 interface. Also fixed bug #28176 here.
18594 2002-08-06 Martin Baulig <martin@gnome.org>
18596 * cs-parser.jay (SimpleLookup): Removed. We need to create
18597 ParameterReferences during semantic analysis so that we can do a
18598 type-only search when resolving Cast, TypeOf and SizeOf.
18599 (block): Pass the `current_local_parameters' to the Block's
18602 * class.cs (ConstructorInitializer): Added `Parameters parameters'
18603 argument to the constructor.
18604 (ConstructorInitializer.Resolve): Create a temporary implicit
18605 block with the parameters.
18607 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18608 references here if we aren't doing a type-only search.
18610 * statement.cs (Block): Added constructor which takes a
18611 `Parameters parameters' argument.
18612 (Block.Parameters): New public property.
18614 * support.cs (InternalParameters.Parameters): Renamed `parameters'
18615 to `Parameters' and made it public readonly.
18617 2002-08-06 Martin Baulig <martin@gnome.org>
18619 * ecore.cs (Expression.Warning): Made this public as well.
18621 * report.cs (Report.Debug): Print the contents of collections.
18623 2002-08-06 Martin Baulig <martin@gnome.org>
18625 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
18626 used to tell Resolve() which kinds of expressions it may return.
18627 (Expression.Resolve): Added overloaded version of this method which
18628 takes a `ResolveFlags flags' argument. This can be used to tell
18629 Resolve() which kinds of expressions it may return. Reports a
18631 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18632 ResolveFlags.SimpleName.
18633 (Expression.Error118): Added overloaded version of this method which
18634 takes a `ResolveFlags flags' argument. It uses the flags to determine
18635 which kinds of expressions are allowed.
18637 * expression.cs (Argument.ResolveMethodGroup): New public method.
18638 Resolves an argument, but allows a MethodGroup to be returned.
18639 This is used when invoking a delegate.
18641 * TODO: Updated a bit.
18643 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18645 Fixed compilation with csc.
18647 * ecore.cs: Expression.Error made public. Is this correct? Should
18648 Warning be made public too?
18650 * expression.cs: use ea.Location instead of ea.loc.
18651 [FIXME: Filed as bug #28607: MCS must report these errors.]
18653 2002-08-06 Martin Baulig <martin@gnome.org>
18655 * ecore.cs (Expression.loc): Moved the location here instead of
18656 duplicating it in all derived classes.
18657 (Expression.Location): New public property.
18658 (Expression.Error, Expression.Warning): Made them non-static and
18659 removed the location argument.
18660 (Expression.Warning): Added overloaded version which takes an
18661 `int level' argument.
18662 (Expression.Error118): Make this non-static and removed the
18663 expression and location arguments.
18664 (TypeExpr): Added location argument to the constructor.
18666 * expression.cs (StaticCallExpr): Added location argument to
18668 (Indirection, PointerArithmetic): Likewise.
18669 (CheckedExpr, UnCheckedExpr): Likewise.
18670 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18671 (StringPtr): Likewise.
18674 2002-08-05 Martin Baulig <martin@gnome.org>
18676 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18678 * assign.cs (Assign.DoResolve): Check whether the source
18679 expression is a value or variable.
18681 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18682 while resolving the corresponding blocks.
18684 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18685 an error, don't silently return null.
18687 * statement.cs (Block.AddVariable): Do the error reporting here
18688 and distinguish between CS0128 and CS0136.
18689 (Block.DoResolve): Report all unused labels (warning CS0164).
18690 (LabeledStatement): Pass the location to the constructor.
18691 (LabeledStatement.HasBeenReferenced): New property.
18692 (LabeledStatement.Resolve): Set it to true here.
18694 * statement.cs (Return.Emit): Return success even after reporting
18695 a type mismatch error (CS0126 or CS0127), this is what csc does and
18696 it avoids confusing the users with any consecutive errors.
18698 2002-08-05 Martin Baulig <martin@gnome.org>
18700 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18702 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18704 * expression.cs (MemberAccess.DoResolve): Silently return if an
18705 error has already been reported.
18707 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18708 error has already been reported.
18710 2002-08-05 Martin Baulig <martin@gnome.org>
18712 * statement.cs (UsageVector): Only initialize the `parameters'
18713 vector if we actually have any "out" parameters.
18715 2002-08-05 Martin Baulig <martin@gnome.org>
18717 * expression.cs (Binary.ResolveOperator): When combining delegates,
18718 they must have the same type.
18720 2002-08-05 Martin Baulig <martin@gnome.org>
18722 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18723 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18724 work with the ms runtime and we also don't need it: if we're a
18725 PropertyBuilder and not in the `indexer_arguments' hash, then we
18726 are a property and not an indexer.
18728 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18729 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18730 since the latter one doesn't work with the ms runtime.
18732 2002-08-03 Martin Baulig <martin@gnome.org>
18734 Fixed bugs #27998 and #22735.
18736 * class.cs (Method.IsOperator): New public field.
18737 (Method.CheckBase): Report CS0111 if there's already a method
18738 with the same parameters in the current class. Report CS0508 when
18739 attempting to change the return type of an inherited method.
18740 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18741 and it's not marked abstract or extern.
18742 (PropertyBase): New abstract base class for Property and Indexer.
18743 (PropertyBase.CheckBase): Moved here from Property and made it work
18745 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18746 the same so we can reuse it there.
18747 (Property, Indexer): Derive from PropertyBase.
18748 (MethodSignature.inheritable_property_signature_filter): New delegate
18749 to find properties and indexers.
18751 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18752 argument and improved error reporting.
18754 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18755 EmptyReadOnlyParameters and made it a property.
18757 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18758 version of this method which takes a `PropertyInfo indexer'.
18759 (TypeManager.RegisterIndexer): New method.
18761 * class.cs: Added myself as author of this file :-)
18763 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18765 * class.cs: fixed compilation on windoze.
18767 2002-08-03 Martin Baulig <martin@gnome.org>
18769 * interface.cs (Interface.GetInterfaceBases): Check whether all
18770 base interfaces are at least as accessible than the current one.
18772 * class.cs (TypeContainer.GetClassBases): Check whether base types
18773 are at least as accessible than the current type.
18774 (TypeContainer.AsAccessible): Implemented and made non-static.
18775 (MemberBase.CheckParameters): Report errors if the accessibility
18778 * delegate.cs (Delegate.Delegate): The default visibility is
18779 internal for top-level types and private for nested types.
18780 (Delegate.Define): Report errors if the accessibility checks fail.
18782 * enum.cs (Enum.Enum): The default visibility is internal for
18783 top-level types and private for nested types.
18784 (Enum.DefineType): Compute the correct visibility.
18786 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18787 function which takes a `bool is_toplevel' instead of a TypeContainer.
18789 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18792 2002-08-02 Martin Baulig <martin@gnome.org>
18794 * expression.cs (LocalVariableReferenc): Added constructor which
18795 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18796 (LocalVariableReference.IsReadOnly): New property.
18797 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18798 variable is readonly, use our own readonly flag to do this; you can
18799 use the new constructor to get a writable reference to a read-only
18802 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18803 reference to the local variable.
18805 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18807 * rootcontext.cs (ResolveCore): Also include System.Exception
18809 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18810 we reach an EmptyStatement.
18812 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18815 * expression.cs (Binary.ResolveOperator): Check error result in
18818 use brtrue/brfalse directly and avoid compares to null.
18820 2002-08-02 Martin Baulig <martin@gnome.org>
18822 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18823 Fixes bug #28407, added test-155.cs.
18825 2002-08-01 Martin Baulig <martin@gnome.org>
18827 * class.cs (Event.EmitDefaultMethod): Make this work with static
18828 events. Fixes #28311, added verify-3.cs.
18830 2002-08-01 Martin Baulig <martin@gnome.org>
18832 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18833 `is_disposable' fields.
18834 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18835 `hm.is_disposable' if we're using the collection pattern.
18836 (Foreach.EmitCollectionForeach): Use the correct type for the
18837 enumerator's local variable, only emit the try/finally block if
18838 necessary (fixes #27713).
18840 2002-08-01 Martin Baulig <martin@gnome.org>
18842 * ecore.cs (Expression.report118): Renamed to Error118 and made
18845 * statement.cs (Throw.Resolve): Check whether the expression is of
18846 the correct type (CS0118) and whether the type derives from
18847 System.Exception (CS0155).
18848 (Catch.Resolve): New method. Do the type lookup here and check
18849 whether it derives from System.Exception (CS0155).
18850 (Catch.CatchType, Catch.IsGeneral): New public properties.
18852 * typemanager.cs (TypeManager.exception_type): Added.
18854 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18856 * driver.cs: Updated About function.
18858 2002-07-31 Martin Baulig <martin@gnome.org>
18860 Implemented Control Flow Analysis.
18862 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18863 (EmitContext.CurrentBranching): Added.
18864 (EmitContext.StartFlowBranching): Added.
18865 (EmitContext.EndFlowBranching): Added.
18866 (EmitContext.KillFlowBranching): Added.
18867 (EmitContext.IsVariableAssigned): Added.
18868 (EmitContext.SetVariableAssigned): Added.
18869 (EmitContext.IsParameterAssigned): Added.
18870 (EmitContext.SetParameterAssigned): Added.
18871 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18872 Added control flow analysis stuff here.
18874 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18875 resolve the expression as lvalue.
18876 (LocalVariableReference.DoResolve): Check whether the variable has
18877 already been assigned.
18878 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18879 the parameter as assigned here.
18880 (ParameterReference.DoResolve): Check whether the parameter has already
18882 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18883 expression as lvalue.
18885 * statement.cs (FlowBranching): New class for the flow analysis code.
18886 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18887 (LabeledStatement.IsDefined): New public property.
18888 (LabeledStatement.AddUsageVector): New public method to tell flow
18889 analyis that the label may be reached via a forward jump.
18890 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18892 (VariableInfo.Number): New public field. This is used by flow analysis
18893 to number all locals of a block.
18894 (Block.CountVariables): New public property. This is the number of
18895 local variables in this block (including the locals from all parent
18897 (Block.EmitMeta): Number all the variables.
18899 * statement.cs: Added flow analysis support to all classes.
18901 2002-07-31 Martin Baulig <martin@gnome.org>
18903 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18904 To get debugging messages, compile mcs with /define:MCS_DEBUG and
18905 then use this argument.
18907 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18909 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18910 use this to specify /define options.
18912 2002-07-29 Martin Baulig <martin@gnome.org>
18914 * statement.cs (Fixed): Moved all code that does variable lookups
18915 and resolvings from Emit to Resolve.
18917 * statement.cs (For): Moved all code that does variable lookups
18918 and resolvings from Emit to Resolve.
18920 * statement.cs (Using): Moved all code that does variable lookups
18921 and resolvings from Emit to Resolve.
18923 2002-07-29 Martin Baulig <martin@gnome.org>
18925 * attribute.cs (Attribute.Resolve): Explicitly catch a
18926 System.NullReferenceException when creating the
18927 CustromAttributeBuilder and report a different warning message.
18929 2002-07-29 Martin Baulig <martin@gnome.org>
18931 * support.cs (ParameterData.ParameterName): Added method to
18932 get the name of a parameter.
18934 * typemanager.cs (TypeManager.IsValueType): New public method.
18936 2002-07-29 Martin Baulig <martin@gnome.org>
18938 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18939 is a flag which specifies that it's either ref or out.
18940 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18941 the out parameter to `out Parameter.Modifier mod', also set the
18942 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18944 * support.cs (InternalParameters.ParameterModifier): Distinguish
18945 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18946 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18948 * expression.cs (Argument.GetParameterModifier): Distinguish
18949 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18950 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18952 2002-07-29 Martin Baulig <martin@gnome.org>
18954 * expression.cs (ParameterReference.ParameterReference): Added
18955 `Location loc' argument to the constructor.
18957 * cs-parser.jay: Pass location to ParameterReference.
18959 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18961 * statement.cs (Try): Initialize the location.
18963 * cs-parser.jay: pass location to Try.
18965 * expression.cs (Unary.Reduce): Change the prototype to return
18966 whether a constant fold could be performed or not. The result is
18967 returned in an out parameters. In the case of Indirection and
18968 AddressOf, we want to perform the full tests.
18970 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18972 * statement.cs (Statement.Emit): Flag dead code.
18974 2002-07-27 Andrew Birkett <andy@nobugs.org>
18976 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18978 2002-07-27 Martin Baulig <martin@gnome.org>
18980 * class.cs (MethodData.Define): Put back call to
18981 TypeManager.AddMethod(), accidentally commented this out.
18983 * report.cs (Debug): New public method to print debugging information,
18984 this is `[Conditional ("DEBUG")]'.
18986 2002-07-26 Martin Baulig <martin@gnome.org>
18988 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18989 (switch_statement): Push the current_block to the switch_stack and
18990 pop it again when we're done with the switch.
18991 (switch_section): The new block is a child of the current_block.
18992 Fixes bug #24007, added test-152.cs.
18994 2002-07-27 Martin Baulig <martin@gnome.org>
18996 * expression.cs (Invocation.EmitArguments): When calling a varargs
18997 function with only its fixed arguments, we need to pass an empty
19000 2002-07-27 Martin Baulig <martin@gnome.org>
19002 Mono 0.13 has been released.
19004 2002-07-25 Miguel de Icaza <miguel@ximian.com>
19006 * driver.cs: Rename --resource to --linkres, because that is what
19007 we do currently, we dont support --resource yet.
19009 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
19011 2002-07-25 Martin Baulig <martin@gnome.org>
19013 * class.cs (MethodData): New public class. This is a `method builder'
19014 class for a method or one accessor of a Property/Indexer/Event.
19015 (MethodData.GetMethodFlags): Moved here from MemberBase.
19016 (MethodData.ApplyAttributes): Likewise.
19017 (MethodData.ApplyObsoleteAttribute): Likewise.
19018 (MethodData.ApplyConditionalAttribute): Likewise.
19019 (MethodData.ApplyDllImportAttribute): Likewise.
19020 (MethodData.CheckAbstractAndExternal): Likewise.
19021 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
19022 (MethodData.Emit): Formerly known as Method.Emit().
19023 (MemberBase): Moved everything which was specific to a single
19024 accessor/method to MethodData.
19025 (Method): Create a new MethodData and call Define() and Emit() on it.
19026 (Property, Indexer, Event): Create a new MethodData objects for each
19027 accessor and call Define() and Emit() on them.
19029 2002-07-25 Martin Baulig <martin@gnome.org>
19031 Made MethodCore derive from MemberBase to reuse the code from there.
19032 MemberBase now also checks for attributes.
19034 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
19035 (MemberBase.GetMethodFlags): Moved here from class Method and marked
19037 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
19038 `CallingConventions cc' and `Attributes opt_attrs' arguments.
19039 (MemberBase.ApplyAttributes): New virtual method; applies the
19040 attributes to a method or accessor.
19041 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
19042 (MemberBase.ApplyConditionalAttribute): Likewise.
19043 (MemberBase.ApplyDllImportAttribute): Likewise.
19044 (MemberBase.CheckAbstractAndExternal): Likewise.
19045 (MethodCore.ParameterTypes): This is now a property instead of a
19046 method, it's initialized from DoDefineParameters().
19047 (MethodCore.ParameterInfo): Removed the set accessor.
19048 (MethodCore.DoDefineParameters): New protected virtual method to
19049 initialize ParameterTypes and ParameterInfo.
19050 (Method.GetReturnType): We can now simply return the MemberType.
19051 (Method.GetMethodFlags): Override the MemberBase version and add
19052 the conditional flags.
19053 (Method.CheckBase): Moved some code from Define() here, call
19054 DoDefineParameters() here.
19055 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
19056 here to avoid some larger code duplication.
19057 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
19058 ensure that abstract and external accessors don't declare a body.
19060 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
19061 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
19062 lookup in the attribute's parent classes, so we need to abort as soon
19063 as we found the first match.
19064 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
19065 the attribute has no arguments.
19067 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
19070 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19072 * cs-parser.jay: reverted previous patch.
19074 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19076 * cs-parser.jay: fixed bug #22119.
19078 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19080 * attribute.cs: fixed compilation. The error was:
19081 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
19082 be assigned to before control leaves the current method."
19083 [FIXME: Filed as bug #28186: MCS must report this error.]
19085 2002-07-25 Martin Baulig <martin@gnome.org>
19087 * attribute.cs (Attribute.Conditional_GetConditionName): New static
19088 method to pull the condition name ouf of a Conditional attribute.
19089 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
19090 the obsolete message and error flag out of an Obsolete attribute.
19092 * class.cs (Method.GetMethodFlags): New public method to get the
19093 TypeManager.MethodFlags for this method.
19094 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
19096 (Method.Define): Get and apply the Obsolete and Conditional attributes;
19097 if we're overriding a virtual function, set the new private variable
19098 `parent_method'; call the new TypeManager.AddMethod().
19100 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
19101 the MethodBuilder and the Method in a PtrHashtable.
19102 (TypeManager.builder_to_method): Added for this purpose.
19103 (TypeManager.MethodFlags): Added IsObsoleteError.
19104 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
19105 Obsolete and Conditional arguments in MethodBuilders. If we discover
19106 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
19107 the message from the attribute.
19109 2002-07-24 Martin Baulig <martin@gnome.org>
19111 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
19112 preprocessor directives, ensure that the argument to #define/#undef is
19113 exactly one identifier and that it's actually an identifier.
19115 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
19118 2002-07-24 Martin Baulig <martin@gnome.org>
19120 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
19121 initialize it to TypeManager.object_type in the constructor.
19122 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
19123 of the `hm.get_current' method if we're using the collection pattern.
19124 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
19125 for the explicit conversion to make it work when we're using the collection
19126 pattern and the `Current' property has a different return type than `object'.
19129 2002-07-24 Martin Baulig <martin@gnome.org>
19131 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
19132 does not match, but don't report any errors. This method is called in
19133 order for all methods in a MethodGroupExpr until a matching method is
19134 found, so we don't want to bail out if the first method doesn't match.
19135 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
19136 matches, report the 123. Fixes #28070.
19138 2002-07-24 Martin Baulig <martin@gnome.org>
19140 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
19141 TypeManager.TypeToCoreType() to the top of the method so the
19142 following equality checks will work. Fixes #28107.
19144 2002-07-24 Martin Baulig <martin@gnome.org>
19146 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
19147 operand is of type uint, and the other operand is of type sbyte,
19148 short or int, the operands are converted to type long." -
19149 Actually do what this comment already told us. Fixes bug #28106,
19152 2002-07-24 Martin Baulig <martin@gnome.org>
19154 * class.cs (MethodBase): New abstract class. This is now a base
19155 class for Property, Indexer and Event to avoid some code duplication
19156 in their Define() and DefineMethods() methods.
19157 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19158 generic methods for Define() and DefineMethods().
19159 (FieldBase): Derive from MemberBase, not MemberCore.
19160 (Property): Derive from MemberBase, not MemberCore.
19161 (Property.DefineMethod): Moved all the code from this method to the
19162 new MethodBase.DefineAccessor(), just call it with appropriate
19164 (Property.Define): Call the new Property.DoDefine(), this does some
19165 sanity checks and we don't need to duplicate the code everywhere.
19166 (Event): Derive from MemberBase, not MemberCore.
19167 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19168 accessors, this will also make them work with interface events.
19169 (Indexer): Derive from MemberBase, not MemberCore.
19170 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19171 (Indexer.Define): Use the new MethodBase functions.
19173 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19174 argument to the constructor.
19175 (Interface.FindMembers): Added support for interface events.
19176 (Interface.PopluateEvent): Implemented.
19178 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
19180 2002-07-22 Miguel de Icaza <miguel@ximian.com>
19182 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19183 but this is required to check for a method name being the same as
19184 the containing class.
19188 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19190 * interface.cs: initialize variable.
19192 2002-07-23 Martin Baulig <martin@gnome.org>
19194 Implemented the IndexerName attribute in interfaces.
19196 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19197 name if this is an explicit interface implementation.
19198 (Indexer.InterfaceIndexerName): New public variable. If we're
19199 implementing an interface indexer, this is the IndexerName in that
19200 interface. Otherwise, it's the IndexerName.
19201 (Indexer.DefineMethod): If we're implementing interface indexer,
19202 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
19203 and Pending.ImplementIndexer methods.
19204 (Indexer.Define): Also define the PropertyBuilder if we're
19205 implementing an interface indexer and this is neither an explicit
19206 interface implementation nor do the IndexerName match the one in
19209 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19210 If a method is defined here, then we always need to create a proxy
19211 for it. This is used when implementing interface indexers.
19212 (Pending.IsInterfaceIndexer): New public method.
19213 (Pending.ImplementIndexer): New public method.
19214 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19215 This is used when implementing interface indexers to define a proxy
19217 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19218 define a proxy if necessary.
19220 * interface.cs (Interface.IndexerName): New public variable.
19221 (Interface.PopulateIndexer): Set the IndexerName.
19222 (Interface.DefineIndexers): New private method. Populate all the
19223 indexers and make sure their IndexerNames match.
19225 * typemanager.cs (IndexerPropertyName): Added support for interface
19228 2002-07-22 Martin Baulig <martin@gnome.org>
19230 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19231 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19232 ret if HasReturnLabel.
19233 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19236 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19237 and set the ec.LoopBeginTryCatchLevel.
19238 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19239 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19240 the current ec.TryCatchLevel, the branch goes out of an exception
19241 block. In this case, we need to use Leave and not Br.
19243 2002-07-22 Martin Baulig <martin@gnome.org>
19245 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19246 block unless the block does not always return or it is contained in
19247 another try { ... } catch { ... } block. Fixes bug #26506.
19248 Added verify-1.cs to the test suite.
19250 2002-07-22 Martin Baulig <martin@gnome.org>
19252 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19253 then we do not always return. Fixes bug #24985.
19255 2002-07-22 Martin Baulig <martin@gnome.org>
19257 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19258 lookup on a per-class level; ie. walk up the class hierarchy until we
19259 found at least one applicable method, then choose the best among them.
19260 Fixes bug #24463 and test-29.cs.
19262 2002-07-22 Martin Baulig <martin@gnome.org>
19264 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19265 return types of the methods. The return type is not part of the
19266 signature and we must not check it to make the `new' modifier work.
19267 Fixes bug #27999, also added test-147.cs.
19268 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19270 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19271 on the method's return type.
19273 2002-07-21 Martin Baulig <martin@gnome.org>
19275 * assign.cs: Make this work if the rightmost source is a constant and
19276 we need to do an implicit type conversion. Also adding a few more tests
19277 to test-38.cs which should have caught this.
19279 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19280 target in the makefile for this. The makefile.gnu is primarily intended
19281 for end-users who don't want to debug the compiler.
19283 2002-07-21 Martin Baulig <martin@gnome.org>
19285 * assign.cs: Improved the Assign class so it can now handle embedded
19286 assignments (X = Y = Z = something). As a side-effect this'll now also
19287 consume less local variables. test-38.cs now passes with MCS, added
19288 a few new test cases to that test.
19290 2002-07-20 Martin Baulig <martin@gnome.org>
19292 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19293 instructions. Fixes bug #27977, also added test-146.cs.
19295 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19297 * cs-tokenizer.cs: fixed getHex ().
19299 2002-07-19 Martin Baulig <martin@gnome.org>
19301 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19302 not Type.GetType() to lookup the array type. This is needed when
19303 we're constructing an array of a user-defined type.
19304 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19305 single-dimensional arrays, but also for single-dimensial arrays of
19308 2002-07-19 Martin Baulig <martin@gnome.org>
19310 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19311 this function is called, it's not allowed to share LocalBuilders
19312 among ILGenerators.
19314 2002-07-19 Martin Baulig <martin@gnome.org>
19316 * expression.cs (Argument.Resolve): Report an error 118 when trying
19317 to pass a type as argument.
19319 2002-07-18 Martin Baulig <martin@gnome.org>
19321 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19322 Conv_R_Un for the signed `long' type.
19324 2002-07-15 Miguel de Icaza <miguel@ximian.com>
19326 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19327 `expr' for the temporary result, as that will fail if we do
19328 multiple resolves on the same expression.
19330 2002-07-05 Miguel de Icaza <miguel@ximian.com>
19332 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19333 ec.TypeContainer for looking up aliases.
19335 * class.cs (TypeContainer): Remove LookupAlias from here.
19337 * decl.cs (DeclSpace); Move here.
19339 2002-07-01 Miguel de Icaza <miguel@ximian.com>
19341 * class.cs (FindMembers): Only call filter if the constructor
19342 bulider is not null.
19344 Also handle delegates in `NestedTypes' now. Now we will perform
19345 type lookups using the standard resolution process. This also
19348 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19349 This uses Expressions (the limited kind that can be parsed by the
19350 tree) instead of strings.
19352 * expression.cs (ComposedCast.ToString): Implement, used to flag
19353 errors since now we have to render expressions.
19355 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
19358 * ecore.cs (SimpleName.ToString): ditto.
19360 * cs-parser.jay: Instead of using strings to assemble types, use
19361 Expressions to assemble the type (using SimpleName, ComposedCast,
19362 MemberAccess). This should fix the type lookups in declarations,
19363 because we were using a different code path for this.
19365 * statement.cs (Block.Resolve): Continue processing statements
19366 even when there is an error.
19368 2002-07-17 Miguel de Icaza <miguel@ximian.com>
19370 * class.cs (Event.Define): Also remove the `remove' method from
19371 the list of pending items.
19373 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19374 generate more compact code.
19376 2002-07-17 Martin Baulig <martin@gnome.org>
19378 * const.cs (Const.LookupConstantValue): Add support for constant
19379 `unchecked' and `checked' expressions.
19380 Also adding test case test-140.cs for this.
19382 2002-07-17 Martin Baulig <martin@gnome.org>
19384 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19385 check whether mi.ReturnType implements the IEnumerator interface; the
19386 `==' and the IsAssignableFrom() will fail in this situation.
19388 2002-07-16 Ravi Pratap <ravi@ximian.com>
19390 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
19393 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19395 * expression.cs: fixed bug #27811.
19397 2002-07-14 Miguel de Icaza <miguel@ximian.com>
19399 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19400 Molaro: when we are a ref, the value already contains a pointer
19401 value, do not take the address of it.
19403 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19404 * removed mb-parser.jay and mb-tokenizer.cs
19406 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19408 * expression.cs: check against the building corlib void type.
19410 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19412 * ecore.cs: fix for valuetype static readonly fields: when
19413 initializing them, we need their address, not the address of a copy.
19415 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19417 * typemanager.cs: register also enum_type in corlib.
19419 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19421 * class.cs: allow calling this (but not base) initializers in structs.
19423 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19425 * ecore.cs: make sure we compare against the building base types
19428 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19430 * typemanager.cs: fix TypeToCoreType() to handle void and object
19431 (corlib gets no more typerefs after this change).
19433 2002-07-12 Miguel de Icaza <miguel@ximian.com>
19435 * expression.cs (ArrayCreation.EmitArrayArguments): use
19436 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19438 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19439 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
19440 array indexes, the runtime actually forbids them.
19442 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19443 for array arguments here.
19445 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19446 instead of the default for ValueTypes.
19448 (New.DoEmit): Use IsValueType instead of
19449 IsSubclassOf (value_type)
19450 (New.DoResolve): ditto.
19451 (Invocation.EmitCall): ditto.
19453 * assign.cs (Assign): ditto.
19455 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19456 Statements *are* currently doing part of their resolution during
19459 Expressions do always resolve during resolve, but statements are
19460 only required to propagate resolution to their children.
19462 2002-07-11 Miguel de Icaza <miguel@ximian.com>
19464 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19466 (LoadAssembly): Do not add the dll if it is already specified
19468 (MainDriver): Add the System directory to the link path at the end,
19469 after all the other -L arguments.
19471 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19472 wrong opcode for loading bytes and bools (ldelem.i1 instead of
19473 ldelem.u1) and using the opposite for sbytes.
19475 This fixes Digger, and we can finally run it.
19477 * driver.cs (UnixParseOption): Move the option parsing here.
19478 (CSCParseOption): Implement CSC-like parsing of options.
19480 We now support both modes of operation, the old Unix way, and the
19481 new CSC-like way. This should help those who wanted to make cross
19482 platform makefiles.
19484 The only thing broken is that /r:, /reference: and /lib: are not
19485 implemented, because I want to make those have the same semantics
19486 as the CSC compiler has, and kill once and for all the confussion
19487 around this. Will be doing this tomorrow.
19489 * statement.cs (Unsafe.Resolve): The state is checked during
19490 resolve, not emit, so we have to set the flags for IsUnsfe here.
19492 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19494 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19495 not catch the Error_ObjectRefRequired in SimpleName (as it is
19496 possible to have a class/instance variable name that later gets
19497 deambiguated), we have to check this here.
19499 2002-07-10 Ravi Pratap <ravi@ximian.com>
19501 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19502 make static and put into Expression.
19504 (Event.Define): Register the private field of the event with the
19505 TypeManager so that GetFieldFromEvent can get at it.
19507 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19508 keep track of the private field associated with an event which
19511 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19514 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19516 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19518 * expression.cs (Binary.EmitBranchable): this routine emits the
19519 Binary expression in a branchable context. This basically means:
19520 we need to branch somewhere, not just get the value on the stack.
19522 This works together with Statement.EmitBoolExpression.
19524 * statement.cs (Statement.EmitBoolExpression): Use
19527 2002-07-09 Miguel de Icaza <miguel@ximian.com>
19529 * statement.cs (For): Reduce the number of jumps in loops.
19531 (For): Implement loop inversion for the For statement.
19533 (Break): We can be breaking out of a Try/Catch controlled section
19534 (foreach might have an implicit try/catch clause), so we need to
19535 use Leave instead of Br.
19537 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19538 now). If the instace expression supports IMemoryLocation, we use
19539 the AddressOf method from the IMemoryLocation to extract the
19540 address instead of emitting the instance.
19542 This showed up with `This', as we were emitting the instance
19543 always (Emit) instead of the Address of This. Particularly
19544 interesting when This is a value type, as we dont want the Emit
19545 effect (which was to load the object).
19547 2002-07-08 Miguel de Icaza <miguel@ximian.com>
19549 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19551 * statement.cs (Checked): Set the CheckedState during the resolve
19552 process too, as the ConvCast operations track the checked state on
19553 the resolve process, and not emit.
19555 * cs-parser.jay (namespace_member_declaration): Flag that we have
19556 found a declaration when we do. This is used to flag error 1529
19558 * driver.cs: Report ok when we display the help only.
19560 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
19562 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19564 2002-07-04 Miguel de Icaza <miguel@ximian.com>
19566 * cs-tokenizer.cs (define): We also have to track locally the
19567 defines. AllDefines is just used for the Conditional Attribute,
19568 but we also need the local defines for the current source code.
19570 2002-07-03 Miguel de Icaza <miguel@ximian.com>
19572 * statement.cs (While, For, Do): These loops can exit through a
19573 Break statement, use this information to tell whether the
19574 statement is the last piece of code.
19576 (Break): Flag that we break.
19578 * codegen.cs (EmitContexts): New `Breaks' state variable.
19580 2002-07-03 Martin Baulig <martin@gnome.org>
19582 * class.cs (TypeContainer.MethodModifiersValid): Allow override
19583 modifiers in method declarations in structs. Otherwise, you won't
19584 be able to override things like Object.Equals().
19586 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19588 * class.cs (Method, Property, Indexer): Do not allow the public
19589 modifier to be used in explicit interface implementations.
19591 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19592 override modifiers in method declarations in structs
19594 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
19596 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19597 integer or real overflow, report an error
19599 2002-07-02 Martin Baulig <martin@gnome.org>
19601 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19602 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19603 to tell the runtime about our newly created System.Object and
19604 System.ValueType types.
19606 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19608 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19609 struct instead of Ldarg/Starg.
19611 2002-07-02 Martin Baulig <martin@gnome.org>
19613 * expression.cs (Indirection.Indirection): Call
19614 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19616 2002-07-02 Martin Baulig <martin@gnome.org>
19618 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19619 ValueType, call TypeManager.TypeToCoreType() on it.
19620 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19621 the OpCodes.Newarr argument.
19623 2002-07-02 Martin Baulig <martin@gnome.org>
19625 * expression.cs (Invocation.EmitCall): When compiling corlib,
19626 replace all calls to the system's System.Array type to calls to
19627 the newly created one.
19629 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19630 System.Array methods.
19631 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19632 from the system's System.Array type which must be replaced.
19634 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19636 * typemanager.cs: load unverifiable_code_ctor so we can build
19637 corlib using the correct type. Avoid using GetTypeCode() with
19639 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19640 TypeManager.object_type to allow building corlib.
19642 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19644 * ecore.cs: handle System.Enum separately in LoadFromPtr().
19646 2002-07-01 Martin Baulig <martin@gnome.org>
19648 * class.cs: Make the last change actually work, we need to check
19649 whether `ifaces != null' to avoid a crash.
19651 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19653 * class.cs: when we build structs without fields that implement
19654 interfaces, we need to add the interfaces separately, since there is
19655 no API to both set the size and add the interfaces at type creation
19658 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19660 * expression.cs: the dimension arguments to the array constructors
19661 need to be converted if they are a long.
19663 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19665 * class.cs: don't emit ldarg.0 if there is no parent constructor
19666 (fixes showstopper for corlib).
19668 2002-06-29 Martin Baulig <martin@gnome.org>
19670 MCS now compiles corlib on GNU/Linux :-)
19672 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19673 ie. check for MethodImplOptions.InternalCall.
19675 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19676 and TypeManager.attribute_type are null, so we must explicitly check
19677 whether parent is not null to find out whether it's an attribute type.
19678 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19679 and SetBuilder, not only if the property is neither abstract nor external.
19680 This is necessary to set the MethodImplOptions on the accessor methods.
19681 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19682 SetBuilder, see Property.Emit().
19684 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19685 populate "System.Object", "System.ValueType" and "System.Attribute" since
19686 they've already been populated from BootCorlib_PopulateCoreTypes().
19688 2002-06-29 Martin Baulig <martin@gnome.org>
19690 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19691 is the NullLiteral, we also need to make sure that target_type is not
19694 2002-06-29 Martin Baulig <martin@gnome.org>
19696 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19697 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19698 before calling BootstrapCorlib_ResolveDelegate ().
19700 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19702 * statement.cs: fixed build-breaker. All tests passed ok.
19704 2002-06-27 Martin Baulig <martin@gnome.org>
19706 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19707 for System.Decimal when compiling corlib.
19709 2002-06-27 Martin Baulig <martin@gnome.org>
19711 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19712 switch blocks which contain nothing but a default clause.
19714 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19716 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19718 2002-06-27 Martin Baulig <martin@gnome.org>
19720 * ecore.cs (PropertyExpr.PropertyExpr): Call
19721 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19723 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19724 is already a TypeBuilder.
19726 2002-06-27 Martin Baulig <martin@gnome.org>
19728 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19729 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19730 the "from an array-type to System.Array" case. This makes it work
19731 when compiling corlib.
19733 2002-06-27 Martin Baulig <martin@gnome.org>
19735 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19736 non-static PropertyExpr, set its InstanceExpression. This makes
19737 the `ICollection.Count' property work in System/Array.cs.
19739 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19741 * driver.cs: Made error handling more consistent. Errors now
19742 tracked by Report class, so many methods which used to return int
19743 now return void. Main() now prints success/failure and
19744 errors/warnings message.
19746 Renamed '--probe' compiler argument to '--expect-error'. Removed
19747 the magic number return values (123 and 124). Now, if the
19748 expected error occurs, the compiler exits with success (exit value
19749 0). If the compilation completes without seeing that particular
19750 error, the compiler exits with failure (exit value 1). The
19751 makefile in mcs/errors has been changed to handle the new behaviour.
19753 * report.cs: Made 'expected error' number a property and renamed
19754 it from 'Probe' to 'ExpectedError'.
19756 * genericparser.cs: Removed error handling support, since it is
19757 now all done by Report class.
19759 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19760 class, so parse() no longer returns an int.
19762 * namespace.cs: Use Report.Error instead of GenericParser.error
19764 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19766 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19767 TypeContainer.AddOperator): At the front of the list put the
19768 explicit implementations, so they get resolved/defined first.
19770 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19772 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19773 interface type is implemented by this TypeContainer. Used during
19774 explicit interface implementation.
19776 (Property.Define, Indexer.Define, Method.Define): Validate that
19777 the given interface in the explicit implementation is one of the
19778 base classes for the containing type.
19780 Also if we are explicitly implementing an interface, but there is
19781 no match in the pending implementation table, report an error.
19783 (Property.Define): Only define the property if we are
19784 not explicitly implementing a property from an interface. Use the
19785 correct name also for those properties (the same CSC uses,
19786 although that is really not needed).
19788 (Property.Emit): Do not emit attributes for explicitly implemented
19789 properties, as there is no TypeBuilder.
19791 (Indexer.Emit): ditto.
19793 Hiding then means that we do not really *implement* a pending
19794 implementation, which makes code fail.
19796 2002-06-22 Martin Baulig <martin@gnome.org>
19798 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19799 the return value of Object.GetType(). [FIXME: we need to do this whenever
19800 we get a type back from the reflection library].
19802 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19804 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19806 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19808 * attribute.cs: Return null if we can not look up the type.
19810 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19811 the interface types found.
19813 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19814 interface types found.
19816 * typemanager.cs (GetInterfaces): Make this routine returns alll
19817 the interfaces and work around the lame differences between
19818 System.Type and System.Reflection.Emit.TypeBuilder in the results
19819 result for GetInterfaces.
19821 (ExpandInterfaces): Given an array of interface types, expand and
19822 eliminate repeated ocurrences of an interface. This expands in
19823 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19826 2002-06-21 Martin Baulig <martin@gnome.org>
19828 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19831 2002-06-21 Martin Baulig <martin@gnome.org>
19833 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19834 and called with one of the core types, return the corresponding typebuilder for
19837 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19840 2002-06-21 Martin Baulig <martin@gnome.org>
19842 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19843 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19844 (Expression.ConvertReferenceExplicit): Likewise.
19846 * expression.cs (ElementAccess.DoResolve): Likewise.
19847 (ElementAccess.DoResolveLValue): Likewise.
19849 2002-06-10 Martin Baulig <martin@gnome.org>
19851 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19852 add the "value" parameter to the parameter list.
19854 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19857 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19859 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19860 the argument to an int, uint, long or ulong, per the spec. Also
19861 catch negative constants in array creation.
19863 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19865 * class.cs: do not allow the same interface to appear twice in
19866 the definition list.
19868 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19870 * ecore.cs: don't use ldlen with System.Array.
19872 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19874 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19876 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19878 * modifiers.cs: produce correct field attributes for protected
19879 internal. Easy fix so miguel can work on ther harder stuff:-)
19881 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19883 * pending.cs: New file. Move the code from class.cs here.
19884 Support clearning the pending flag for all methods (when not doing
19885 explicit interface implementation).
19887 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19889 * rootcontext.cs: added a couple more types needed to bootstrap.
19891 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19893 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19894 constructor in the type, instead of any constructor in the type
19895 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19896 a bug in the Mono runtime when applying the params attribute).
19898 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19899 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19901 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19903 * expression.cs (Unary.ResolveOperator): Use TypeManager
19904 to resolve the type.
19906 2002-06-13 Ravi Pratap <ravi@ximian.com>
19908 * cs-parser.jay (enum_member_declaration): Pass in the attributes
19911 * enum.cs (AddEnumMember): Add support to store the attributes associated
19912 with each member too.
19914 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19915 field builders too - this takes care of the enum member case.
19917 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19919 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19920 address-of operator on both value types and pointers.
19922 2002-06-10 Martin Baulig <martin@gnome.org>
19924 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19925 PropertyBuilder to the `property_builders' list.
19927 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19928 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19929 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19930 find any indexers which are inherited from an interface.
19932 2002-06-09 Martin Baulig <martin@gnome.org>
19934 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19935 the same type as the constant if necessary. There's also a test-130.cs
19938 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19940 * typemanager.cs (TypeManager.ChangeType): Previously known as
19941 Enum.ChangeEnumType().
19943 2002-06-09 Martin Baulig <martin@gnome.org>
19945 * expression.cs (Cast.TryReduce): Added support for consts.
19947 2002-06-08 Ravi Pratap <ravi@ximian.com>
19949 * class.cs (Accessor): Hold attributes information so we can pass
19952 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19953 Modify to pass in attributes attached to the methods.
19955 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19957 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19958 to handle the Accessor kind :-)
19960 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19962 2002-06-08 Martin Baulig <martin@gnome.org>
19964 * expression.cs (Unary.TryReduceNegative): Added support for
19967 2002-06-08 Martin Baulig <martin@gnome.org>
19969 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19970 name can't be found in the `defined_names' - the caller will do a
19971 MemberLookup in this case and thus find methods in System.Enum
19972 such as Enum.IsDefined().
19974 2002-06-08 Martin Baulig <martin@gnome.org>
19976 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19977 Convert.ChangeType() which works with TypeBuilder created types.
19978 (Enum.LookupEnumValue, Enum.Define): Use it here.
19980 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19981 `TypeBuilder.BaseType != null' check.
19982 (TypeContainer.FindMembers): Only lookup parent members if we
19983 actually have a parent.
19984 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19985 (ConstructorInitializer.Resolve): Likewise.
19987 * interface.cs (Interface.FindMembers): Added
19988 `TypeBuilder.BaseType != null' check.
19990 * rootcontext.cs (RootContext.ResolveCore): Added
19991 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19992 classes_second_stage.
19994 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19995 debug_type and trace_type when compiling with --nostdlib.
19997 2002-06-07 Martin Baulig <martin@gnome.org>
19999 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
20000 (AddField): Set it to true when adding a non-static field.
20001 (DefineType): Use `have_nonstatic_fields' to find out whether we
20002 have non-static fields, not `Fields != null'.
20004 2002-06-02 Miguel de Icaza <miguel@ximian.com>
20006 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
20007 dereferencing a null on the static-field code path)
20009 2002-05-30 Martin Baulig <martin@gnome.org>
20011 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
20012 to take command line arguments. Use reflection to call the new
20013 custom `Initialize' function on the symbol writer and pass it the
20014 command line arguments.
20016 * driver.cs (--debug-args): New command line argument to pass command
20017 line arguments to the symbol writer.
20019 2002-05-28 Miguel de Icaza <miguel@ximian.com>
20021 * assign.cs (DoResolve): Forgot to do the implicit conversion to
20022 the target type for indexers and properties. Thanks to Joe for
20025 2002-05-27 Miguel de Icaza <miguel@ximian.com>
20027 * typemanager.cs (MethodFlags): returns the method flags
20028 (Obsolete/ShouldIgnore) that control warning emission and whether
20029 the invocation should be made, or ignored.
20031 * expression.cs (Invocation.Emit): Remove previous hack, we should
20032 not do this on matching a base type, we should do this based on an attribute
20034 Only emit calls to System.Diagnostics.Debug and
20035 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
20036 on the command line.
20038 * rootcontext.cs: Global settings for tracing and debugging.
20040 * cs-tokenizer.cs (define): New utility function to track
20041 defines. Set the global settings for TRACE and DEBUG if found.
20043 2002-05-25 Ravi Pratap <ravi@ximian.com>
20045 * interface.cs (Populate*): Pass in the TypeContainer as well as
20046 the DeclSpace as parameters so that we can create EmitContexts and
20047 then use that to apply attributes etc.
20049 (PopulateMethod, PopulateEvent, PopulateProperty)
20050 (PopulateIndexer): Apply attributes everywhere.
20052 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
20055 (ApplyAttributes): Update accordingly.
20057 We now apply interface attributes for all members too.
20059 2002-05-26 Miguel de Icaza <miguel@ximian.com>
20061 * class.cs (Indexer.Define); Correctly check if we are explicit
20062 implementation (instead of checking the Name for a ".", we
20063 directly look up if the InterfaceType was specified).
20065 Delay the creation of the PropertyBuilder.
20067 Only create the PropertyBuilder if we are not an explicit
20068 interface implementation. This means that explicit interface
20069 implementation members do not participate in regular function
20070 lookups, and hence fixes another major ambiguity problem in
20071 overload resolution (that was the visible effect).
20073 (DefineMethod): Return whether we are doing an interface
20076 * typemanager.cs: Temporary hack until we get attributes in
20077 interfaces (Ravi is working on that) and we get IndexerName
20078 support in interfaces.
20080 * interface.cs: Register the indexers as properties.
20082 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
20083 warning, I have verified that this is a bug in the .NET runtime
20084 (JavaScript suffers of the same problem).
20086 * typemanager.cs (MemberLookup): When looking up members for
20087 interfaces, the parent of an interface is the implicit
20088 System.Object (so we succeed in searches of Object methods in an
20089 interface method invocation. Example: IEnumerable x; x.ToString
20092 2002-05-25 Miguel de Icaza <miguel@ximian.com>
20094 * class.cs (Event): Events should also register if they do
20095 implement the methods that an interface requires.
20097 * typemanager.cs (MemberLookup); use the new GetInterfaces
20100 (GetInterfaces): The code used to lookup interfaces for a type is
20101 used in more than one place, factor it here.
20103 * driver.cs: Track the errors at the bottom of the file, we kept
20106 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
20107 instance if the method we are calling is static!
20109 2002-05-24 Miguel de Icaza <miguel@ximian.com>
20111 * attribute.cs (ApplyAttributes): Make this function filter out
20112 the IndexerName attribute (as that attribute in reality is never
20113 applied) and return the string constant for the IndexerName
20116 * class.cs (TypeContainer.Emit): Validate that all the indexers
20117 have the same IndexerName attribute, and if so, set the
20118 DefaultName attribute on the class.
20120 * typemanager.cs: The return value might contain other stuff (not
20121 only methods). For instance, consider a method with an "Item"
20122 property and an Item method.
20124 * class.cs: If there is a problem with the parameter types,
20127 2002-05-24 Ravi Pratap <ravi@ximian.com>
20129 * ecore.cs (ImplicitConversionExists): Wrapper function which also
20130 looks at user defined conversion after making a call to
20131 StandardConversionExists - we need this for overload resolution.
20133 * expression.cs : Update accordingly the various method calls.
20135 This fixes 2 bugs filed against implicit user defined conversions
20137 2002-05-22 Miguel de Icaza <miguel@ximian.com>
20139 * statement.cs: Track the result of the assignment.
20141 2002-05-21 Miguel de Icaza <miguel@ximian.com>
20143 * expression.cs (MemberAccess): Improved error reporting for
20144 inaccessible members.
20146 2002-05-22 Martin Baulig <martin@gnome.org>
20148 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
20149 itself with debugging support.
20151 2002-05-22 Martin Baulig <martin@gnome.org>
20153 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
20154 Removed, this isn't needed anymore.
20156 2002-05-20 Martin Baulig <martin@gnome.org>
20158 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20159 be underlying type for an enum.
20161 2002-05-20 Miguel de Icaza <miguel@ximian.com>
20163 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20164 that splits out the loading of just the core types.
20166 * rootcontext.cs (ResolveCore): Split the struct resolution in
20167 two, so we can load the enumeration underlying types before any
20170 * expression.cs (Is): Bandaid until we fix properly Switch (see
20171 bug #24985 for details).
20173 * typemanager.cs (ImplementsInterface): The hashtable will contain
20174 a null if there are no interfaces implemented.
20176 2002-05-18 Miguel de Icaza <miguel@ximian.com>
20178 * cs-parser.jay (indexer_declarator): It is fine to have array
20181 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20183 * typemanager.cs: (RegisterBuilder): New function used to register
20184 TypeBuilders that implement interfaces. Since
20185 TypeBuilder.GetInterfaces (as usual) does not work with lame
20187 (AddUserType): register interfaces.
20189 (ImplementsInterface): Use the builder_to_ifaces hash if we are
20190 dealing with TypeBuilder. Also, arrays are showing up as
20191 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20192 methods can not be invoked on them!
20194 * ecore.cs (ExplicitReferenceConversionExists): Made public.
20195 (ImplicitReferenceConversionExists): Split out from
20196 StandardConversionExists.
20198 * expression.cs (As): We were only implementing one of the three
20199 cases for the as operator. We now implement them all.
20200 (Is): Implement the various other cases for Is as well.
20202 * typemanager.cs (CACHE): New define used to control if we want or
20203 not the FindMembers cache. Seems to have a negative impact on
20204 performance currently
20206 (MemberLookup): Nested types have full acess to
20207 enclosing type members
20209 Remove code that coped with instance/static returns for events, we
20210 now catch this in RealFindMembers.
20212 (RealFindMembers): only perform static lookup if the instance
20213 lookup did not return a type or an event.
20215 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20217 * assign.cs (CompoundAssign): We pass more semantic information
20218 now to Compound Assignments than we did before: now we have all
20219 the information at hand, and now we resolve the target *before* we
20220 do the expression expansion, which allows the "CacheValue" method
20221 to have the effect we intended (before, a [x] += 1 would generate
20222 two differen ArrayAccess expressions from the ElementAccess,
20223 during the resolution process).
20225 (CompoundAssign.DoResolve): Resolve target and original_source here.
20227 2002-05-16 Miguel de Icaza <miguel@ximian.com>
20229 * expression.cs (ArrayAccess): dropped debugging information.
20231 * typemanager.cs: Small bug fix: I was always returning i_members,
20232 instead of one of i_members or s_members (depending on which had
20235 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
20236 method is invoked before any code generation takes place, and it
20237 is a mechanism to inform that the expression will be invoked more
20238 than once, and that the method should use temporary values to
20239 avoid having side effects
20241 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20243 * ecore.cs (Expression.CacheTemporaries): Provide empty default
20246 * expression.cs (Indirection, ArrayAccess): Add support for
20247 CacheTemporaries in these two bad boys.
20249 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20250 ldobj or ldind_ref.
20251 (StoreFromPtr): Handle stobj as well.
20253 * expression.cs (UnaryMutator): Share more code.
20255 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20256 down: I was not tracking the Filter function as well, which
20257 was affecting the results of the cache.
20259 2002-05-15 Miguel de Icaza <miguel@ximian.com>
20261 * attribute.cs: Remove the hack to handle the CharSet property on
20264 2002-05-14 Miguel de Icaza <miguel@ximian.com>
20266 * attribute.cs (DoResolve): More uglyness, we now only try to
20267 resolve the attribute partially, to extract the CharSet
20268 information (only if we are a StructLayout attribute). Otherwise
20270 (GetExtraTypeInfo): Add some code to conditionally kill in the
20271 future this. I am more and more convinced that the .NET
20272 framework has special code to handle the attribute setting on
20275 * expression.cs (IsParamsMethodApplicable): Revert my previous
20276 foreach change here, it was wrong.
20278 2002-05-13 Miguel de Icaza <miguel@ximian.com>
20280 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20281 (pp_expr): do not abort on unknown input, just return.
20282 (eval): abort if there are pending chars.
20284 * attribute.cs (Attribute.Resolve): Positional parameters are
20285 optional. Deal with that case.
20287 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20288 the Ansi/Unicode/Auto information for the type.
20290 (TypeContainer.DefineType): instantiate the EmitContext here, as
20291 we will be using it during the type definition (to resolve
20292 attributes) and during the emit phase.
20294 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20295 to pull type information out of the attributes
20297 (Attribute.Resolve): track the constructor builder, and allow for
20298 multiple invocations (structs and classes will use this).
20300 * ecore.cs (MemberLookupFinal): new version with all the
20301 parameters customizable.
20303 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20304 constructors. Return if the result value is null (as the error
20305 would have been flagged already by MemberLookupFinal)
20307 Do not allow instances of abstract classes or interfaces to be
20310 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20311 We have to compare the assembly property here when dealing with
20312 FamANDAssem and Assembly access modifiers, because we might be
20313 creating an assembly from *modules* (that means that we are not
20314 getting TypeBuilders for types defined in other modules that are
20315 part of this assembly).
20317 (Method.Emit): If the method is marked abstract and has a body,
20320 (TypeContainer.DefineMembers): If both the defined member and the
20321 parent name match are methods, then do not emit any warnings: let
20322 the Method.Define routine take care of flagging warnings. But if
20323 there is a mismatch (method overrides something else, or method is
20324 overriwritten by something, then emit warning).
20326 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20327 set to null, this means `do not check for the return type on the
20330 (Method.Define): set the return type for the method signature to
20331 null, so that we get methods with the same name and parameters and
20332 different return types. This is used to flag warning 114 (you are
20333 hiding a method, and you probably want to use the new/override
20336 * typemanager.cs (MemberLookup): Implemented proper access
20337 control, closing a long standing set of bug reports. The problem
20338 was that the Framework only has two bits: Public and NonPublic,
20339 and NonPublic includes private and protected methods, but we need
20340 to enforce the FamANDAssem, FamOrAssem and Family.
20342 2002-05-11 Miguel de Icaza <miguel@ximian.com>
20344 * statement.cs (GotoCase): Return true: Ammounts to giving up
20345 knowledge on whether we return or not, and letting the other case
20346 be responsible for it.
20348 2002-05-10 Miguel de Icaza <miguel@ximian.com>
20350 * driver.cs: Do not load directories for each file processed, only
20351 do it if there is a pattern.
20353 * ecore.cs: Report readonly assigns here as well, as we might have
20354 been resolved only by MemberAccess.
20356 (SimpleName.SimpleNameResolve): Also be useful for LValue
20357 resolution. We need this to propagate assign to local readonly variables
20359 * typemanager.cs: Use a ptrhashtable for the criteria, because we
20360 do not want to reuse potential criteria memory.
20362 * class.cs (MyEventBuilder): Set reflected_type;
20364 * ecore.cs (Constantify): Added support for constifying bools.
20366 (RootContext.LookupType): Added a cache for values looked up in
20367 the declaration space.
20369 * typemanager.cs (FindMembers): Now is a front-end to
20370 RealFindMembers, and provides a two-level hashtable-based cache to
20373 15% performance improvement: from 22.5 to 19.2 seconds.
20375 * expression.cs (IsParamsMethodApplicable): use foreach.
20376 (Invocation.DoResolve): ditto.
20377 (New.DoResolve): ditto.
20378 (ArrayCreation.DoResolve): ditto.
20380 * ecore.cs (FindMostEncompassingType): use foreach.
20382 * delegate.cs (NewDelegate.DoResolve): Use foreach
20384 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20385 (RemoveMethods): use foreach.
20387 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20388 nested foreach statements instead of for, and also break out of
20389 the inner loop once a match is found.
20391 (Invocation.OverloadResolve): Use foreach, simplify the code.
20393 2002-05-08 Miguel de Icaza <miguel@ximian.com>
20395 * cfold.cs (BinaryFold): During an enumeration evaluation context,
20396 we actually unwrap the expression to allow for extra information
20399 * expression.cs: Use Shr_Un on unsigned operations.
20401 2002-05-08 Ravi Pratap <ravi@ximian.com>
20403 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
20404 applicable operators was not being considered correctly. This closes
20405 the bug Miguel reported.
20407 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20409 * attribute.cs: check that the type derives from System.Attribute
20410 and report the correct error in that case (moved the duplicate code to
20411 its own method, too).
20413 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20415 * attribute.cs: lookup attribute type name as the spec says: first the
20416 bare attribute name and then name + "Attribute" (nant compiles with
20417 mcs after this fix).
20419 2002-05-07 Miguel de Icaza <miguel@ximian.com>
20421 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
20422 Because of the way we parse things, we should try to see if a
20423 UIntConstant can fit in an integer.
20425 2002-05-07 Ravi Pratap <ravi@ximian.com>
20427 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20428 when we are in an explicit context.
20430 (ConvertReferenceExplicit): When converting from Iface type S to Class
20431 T make sure the rules are implemented as an OR.
20433 * parameter.cs (ParameterType): Make it a property for now although the
20434 purpose really isn't anything immediate.
20436 * expression.cs (Is*Applicable): Do better checking on the parameter type
20437 of a ref/out parameter. The ones from the system assemblies are already
20438 marked with the correct type so we don't need to do any correction.
20440 * ecore.cs (StandardConversionExists): Conversion from Interface types to
20441 the object type is standard too so include that.
20443 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20445 * ecore.cs (StandardConversionExists): Augment with missing code:
20446 deal with IntConstant, LongConstants and Enumerations.
20448 * assign.cs: Report the error, instead of failing silently
20450 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20451 typecontainer that they are declared, because the
20452 typecontainer/namespace will have the list of using clauses that
20453 need to be applied.
20455 Assembly Attributes were escaping the normal registration
20458 (EmitCode): Apply attributes within an EmitContext that represents
20459 the container they were declared on.
20461 * cs-parser.jay: Track bases for structs. How did I get this wrong?
20463 2002-05-06 Ravi Pratap <ravi@ximian.com>
20465 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20466 Revamp completely - make much cleaner as we now operate only
20469 (FindMostSpecificSource, FindMostSpecificTarget): New methods
20470 to implement the logic detailed in the spec more correctly.
20472 (UserDefinedConversion): Update accordingly.
20474 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20476 * statement.cs: Return flow analysis information up.
20478 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20481 (token): Do not consume an extra character before calling
20484 2002-05-06 Piers Haken <piersh@friskit.com>
20486 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20488 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20490 * class.cs (Constructor.Emit): Set the IsStatic flag in the
20491 EmitContext during the instance constructor initializer
20492 resolution, to stop access to instance variables.
20494 This is mandated by the spec, last paragraph of the `constructor
20495 initializers' section.
20497 2002-05-05 Miguel de Icaza <miguel@ximian.com>
20499 * cs-parser.jay, class.cs (Accessor): new class used to represent
20500 an accessor (get or set). In the past we used `null' to represent
20501 a missing accessor. But this is ambiguous because there was no
20502 way to tell in abstract indexers/properties if one of them was
20505 Now there is a way of addressing that.
20507 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20508 instead of FindMembers.
20510 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20511 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20513 * attribute.cs: Treat indexers and properties as the same in terms
20514 of applying attributes
20516 * ecore.cs (FindMostEncompassedType): Use statically initialized
20517 EmptyExpressions()s like we do elsewhere to avoid creating useless
20518 objects (and we take this out of the tight loop).
20520 (GetConversionOperators): Move the code to extract the actual
20521 operators to a separate routine to clean things up.
20523 2002-05-04 Miguel de Icaza <miguel@ximian.com>
20525 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20526 events are always registered FieldBuilders.
20528 * class.cs (FieldBase): New class shared by Fields
20530 * delegate.cs: If we are a toplevel delegate, use our full name.
20531 If we are a nested delegate, then only use our tail name.
20533 2002-05-02 Ravi Pratap <ravi@ximian.com>
20535 * expression.cs (IsApplicable): Ensure that we add the "&" to
20536 ref/out types before comparing it with the type of the argument.
20538 (IsParamsMethodApplicable): Ditto.
20540 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
20543 * delegate.cs : Handle the case when we have more than one applicable
20544 method. Flag an error only when we finish checking all.
20546 2002-05-02 Miguel de Icaza <miguel@ximian.com>
20548 * expression.cs: Add support for boolean static initializers.
20550 2002-05-01 Miguel de Icaza <miguel@ximian.com>
20552 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20554 * parameter.cs (ComputeParameterTypes,
20555 ComputeAndDefineParameterTypes): Better error handling: now we
20556 clear the `types' cache if we fail during any of the type lookups.
20557 We also return the status code correctly to our caller
20559 * delegate.cs: If we fail to define a delegate, abort the extra
20562 * expression.cs (Binary.ResolveOperator): for
20563 operator==(object,object) and operator !=(object, object) we also
20564 have to verify that there is an implicit conversion from one to
20567 (ArrayAccess.DoResolve): Array Access can operate on
20570 2002-04-30 Miguel de Icaza <miguel@ximian.com>
20572 * assign.cs (CompoundAssign): A new class used as a "flag" that
20573 the assignment actually is happening as part of a compound
20574 assignment operator.
20576 During compound assignment, a few new rules exist to enable things
20583 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20584 to the type of x) if y is implicitly convertible to the type of x,
20585 and the operator is a builtin operator and the return type of the
20586 operator is explicitly convertible to the type of x.
20588 * rootcontext.cs: Reset warning level to 2. 4 catches various
20589 "interesting" features in mcs, we must clean this up at some
20590 point, but currently am trying to kill other bugs ;-)
20592 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20593 in container classes as well.
20595 * expression.cs (Binary.ResolveOperator): Handle string case
20596 before anything else (as operator overloading does emit an error
20597 before doing anything else).
20599 This code could go away when we move to a table driven model, but
20600 i could not come up with a good plan last night.
20602 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
20604 * typemanager.cs (CSharpName): reimplementation using regex.
20605 * class.cs: added null check for fields in Emit
20606 * rootcontext.cs: set warninglevel to 4
20608 2002-04-29 Miguel de Icaza <miguel@ximian.com>
20610 * typemanager.cs (CSharpName): reimplemented with Lupus
20613 2002-04-28 Miguel de Icaza <miguel@ximian.com>
20615 * statement.cs (If): correclty implement Resolve, because we were
20616 not catching sem errors in there. The same process is needed
20618 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20621 (Statement.Warning_DeadCodeFound): Factorize code.
20622 (While): Report dead code here too.
20624 (Statement): Added Resolve virtual method to allow
20625 for resolution split from the emit code.
20627 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20629 * statement.cs (EmitBoolExpression): No longer try to resolve the
20631 (MakeBoolean): New utility function that resolve, implicitly
20632 converts to boolean and tags the expression.
20635 (If, Do): Implement dead code elimination.
20636 (While): Implement loop inversion
20638 (Do, While, For, If): Resolve the expression prior to calling our
20641 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
20644 - added method Report28 (warning: program has more than one entry point)
20645 - added method IsEntryPoint, implements paragraph 10.1 of the spec
20646 - modified method Method.Define, the part at the end of the method
20648 * rootcontext.cs: added static public Location EntryPointLocation;
20650 * ../errors/cs0028.cs : Add test case for the above warning.
20653 - modified method CSharpName to allow arrays of primitive type to
20654 be printed nicely (e.g. instead of System.Int32[][] it now prints
20656 - added method CSharpSignature: returns the signature of a method
20657 in string format to be used in reporting errors, warnings, etc.
20659 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20662 2002-04-26 Ravi Pratap <ravi@ximian.com>
20664 * delegate.cs (Define): Fix extremely silly bug where I was
20665 setting the type of the 'object' parameter of the BeginInvoke
20666 method to System.IAsyncResult instead of System.Object ;-)
20668 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20670 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20673 (Constructor.Emit): return if we fail to initialize the
20674 constructor. Another door closed!
20676 * expression.cs (New.DoResolve): Improve error message (from -6 to
20677 1501). Use DeclaredOnly lookup to find the exact constructor.
20679 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20680 loop. This is useful.
20682 * cs-parser.jay: Adjust the default parameters so that destructors
20683 have the proper signature.
20685 2002-04-26 Martin Baulig <martin@gnome.org>
20687 * driver.cs (LoadAssembly): If `assembly' contains any characters
20688 which are only valid in path names and not in assembly names
20689 (currently slash, backslash and point), use Assembly.LoadFrom ()
20690 instead of Assembly.Load () on the `assembly' (before iteration
20691 over the link_paths).
20693 2002-04-26 Martin Baulig <martin@gnome.org>
20695 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20697 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20699 * class.cs (Property): use the new typemanager.MemberLookup
20701 (TypeContainer.MemberLookup): Implement using the
20702 TypeManager.MemberLookup now.
20704 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20705 and return MemberInfos, so that these can be used without an
20706 EmitContext (what we had before).
20708 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20710 * expression.cs: Fix the case where the argument to params if the
20711 type of the params. I omitted handling this before. Fixed
20713 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20715 * driver.cs: Call BootCorlib_PopulateCoreType
20717 * class.cs (Property.CheckBase): Check for properties only, not
20720 * interface.cs: Temporary hack: try/catch around the
20721 CustomAttributeBuilder, because I am getting an exception that I
20724 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20725 types whose definitions are required to be there (attributes are
20726 defined before standard types).
20728 Compute definitions as we boot the various types, as they are used
20729 immediately (value_type class will need object_type, but if we do
20730 not initialize object_type, we will pass a null, which will let
20731 the runtime pick the System.Object from the existing corlib, which
20732 is not what we want).
20734 2002-04-22 Patrik Torstensson <totte@labs2.com>
20736 * cs-tokenizer.cs: fixed a number of trim() issues.
20738 2002-04-22 Ravi Pratap <ravi@ximian.com>
20740 * expression.cs (Argument.Type): Ensure that we return the correct
20741 type when we have out or ref parameters [in which case we
20744 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20746 * class.cs (Property, Indexer): Allow extern modifier in there.
20748 * typemanager.cs (InitBaseTypes): Initializes object_type and
20749 value_type, since those will be used early on during the bootstrap
20750 process to compile corlib.
20752 (InitCoreTypes): Move code from here to InitBaseTypes.
20754 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20756 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20757 single-dimension arrays as using the ldlen opcode.
20759 Daniel Lewis discovered this optimization.
20761 * typemanager.cs: Add signature for System.Array::get_Length
20763 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20765 * statement.cs: report the error when the foreach does not apply to an
20766 array nor a collection.
20768 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20770 * expression.cs: Add implicit conversions to the operator ~.
20772 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20774 * typemanager.cs: Locate the decimal constructor.
20776 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20778 * attribute.cs: use the new property of TypeOf.
20779 * expression.cs: added 'get' property around typearg.
20781 These changes fix a build breaker reported by NickD. Is this the
20782 correct way to fix? If not, please, revert my changes and make it
20785 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20787 * attribute.cs: Add support for typeof in attribute invocations.
20788 I am not sure that this is right though.
20790 2002-04-14 Duncan Mak <duncan@ximian.com>
20792 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20793 Binary.Operator.Division case.
20795 2002-04-13 Ravi Pratap <ravi@ximian.com>
20797 * class.cs (DefineType): Ensure that we do a proper check on
20798 attribute types and also register it with the TypeManager.
20800 (TypeContainer.Targets): The default for attribute types is
20801 AttributeTargets.All.
20803 * attribute.cs (ApplyAttributes): Registering the attribute type
20804 is done elsewhere, not when we discover we have a Usage attribute.
20806 2002-04-12 Ravi Pratap <ravi@ximian.com>
20808 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20809 and get rid of is_delegate parameter.
20811 * everywhere : update.
20813 2002-04-12 Ravi Pratap <ravi@ximian.com>
20815 * cs-parser.jay (compilation_unit): Revamp completely to use
20816 some new ideas that I got from Rhys' grammar to solve the problems
20817 with assembly level attributes.
20819 (outer_declaration): New grammar production.
20821 (attribute_sections): Add.
20823 (opt_attributes): Base on attribute_sections
20825 (namespace_declaration): Allow opt_attributes to tackle the case
20826 when we have assembly level attributes - we are clever in this
20829 * attribute.cs (ApplyAttributes): Do not worry about assembly
20830 attributes in the non-global context.
20832 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20833 instead of SetGlobalAttributes.
20835 * class.cs, rootcontext.cs : Ensure we define and generate
20836 attribute types before anything else.
20838 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20839 and flag the new error -20 for the case when the attribute type
20840 does not have valid targets specified. csc does not catch this.
20842 * ../errors/errors.txt : update for error # -20
20844 2002-04-11 Ravi Pratap <ravi@ximian.com>
20846 * support.cs (InternalParameters.ParameterModifier): Do some null
20847 checking and return sane values.
20849 * class.cs (Method.Define): If we are a PInvoke method, ensure
20850 that we are static and extern. Report error # 601
20852 * ../errors/cs0601.cs : Add test case for the above error.
20854 2002-04-07 Ravi Pratap <ravi@ximian.com>
20856 * rootcontext.cs (attribute_types): We need to keep type of
20857 all attribute types separately and emit code for them first.
20859 (RegisterAttribute) : Implement.
20861 * class.cs (DefineType): Check if the current Type is a custom
20862 attribute type and register it accordingly.
20864 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20865 adding the first attribute twice and rename to
20867 (SetGlobalAttributes): this.
20869 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20872 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20873 if we are processing global arguments. Hmm, I am unsure of this.
20875 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20877 * expression.cs: added static array of strings to avoid calling
20878 Enum.ToString () for Operator in Binary. Significant recover of
20881 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20883 * class.cs (FindMembers): Allow the Builders of the various
20884 members to be null. If they are skip them. This only happens
20885 during the PInvoke declaration.
20887 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20889 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20890 failure, so we do not keep going afterwards.
20892 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20893 wanted to pass `false' as the `is_delegate' argument. If this is
20894 the case, why not use delegate_type == null to mean `is_delegate =
20895 false' and anything else as is_delegate = true.
20897 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20899 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20900 code for the section, not the beginning of the tests.
20902 2002-04-08 Miguel de Icaza <miguel@ximian.com>
20904 * cfold.cs: Handle operator + (Enum x, Underlying x)
20906 * expression.cs (Binary): same. Warn about errors where we have
20907 Enum/Enum in operator + as well.
20909 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
20912 - added support for switch(bool)
20913 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20914 - add TableSwitchEmit() to handle table-based switch statements
20916 2002-04-05 Ravi Pratap <ravi@ximian.com>
20918 * expression.cs (Invocation.OverloadResolve): Factor out code which
20919 does parameter compatibility checking with arguments so that we can
20920 re-use the code even from Delegate.VerifyApplicability
20922 (VerifyArgumentsCompat): Move above code here.
20924 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20925 and instead make a call to the above method.
20927 2002-03-31 Ravi Pratap <ravi@ximian.com>
20929 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20930 We use it to keep track of classes which are attribute types.
20932 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20934 * delegate.cs (Delegate.Define): Correctly define the types in the
20935 presence of fixed and array parameters.
20937 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20940 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20941 include NonPublic after the first iteration.
20943 * class.cs (Indexer.CheckBase): Only check if both parents are
20946 * cs-parser.jay (accessor_body): If empty, set to null.
20948 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20949 same code path here to resolve constants names that we did have in
20950 MemberAccess.DoResolve. There is too much code duplicated here.
20952 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20954 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20956 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20959 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20960 tokens, numbers and strings.
20962 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20965 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20966 asyncronous parameters and the regular parameters.
20968 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20969 specify the target directory.
20971 * expression.cs: (This.DoResolve): Simplify
20972 (As.Emit): Optimize, do not generate IsInst if the expression is
20973 always of the given type.
20975 (Is.DoResolve): Bug fix, we were reporting both always/never for
20978 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20979 creating too many unnecessary arrays.
20981 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20983 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20984 fields instead of rolling our own initializer. Takes care of all
20985 implicit conversions, and drops unnecessary static checks/argument.
20987 2002-03-31 Dick Porter <dick@ximian.com>
20989 * driver.cs: use the GetDirectories() return values properly, and
20990 use "/" as path separator.
20992 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20994 * expression.cs (Unary): Optimize - - expr into expr.
20995 (Binary): Optimize a + (-b) into a -b.
20997 * codegen.cs (CodeGen): Made all methods static.
20999 2002-03-29 Miguel de Icaza <miguel@ximian.com>
21003 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
21004 TypeBuilder property.
21006 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
21009 * tree.cs: Removed the various RecordXXXX, and replaced with a
21010 single RecordDecl. Removed all the accessor methods, and just
21011 left a single access point Type
21013 * enum.cs: Rename DefineEnum to DefineType.
21015 * decl.cs: New abstract method `DefineType' used to unify the
21016 Defines for Enumerations, Interfaces, TypeContainers and
21019 (FindType): Moved LookupInterfaceOrClass here. Moved the
21020 LookupBaseClasses method that used to live in class.cs and
21021 interface.cs here, and renamed to FindType.
21023 * delegate.cs: Implement DefineType. Take advantage of the
21024 refactored pattern for locating the parent builder without taking
21025 the parent_builder argument (which we know does not work if we are
21026 nested, and triggering a toplevel definition).
21028 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21030 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
21031 accessibility of a member has changed during override and report
21034 * class.cs (Method.Define, Property.Define): Only complain on
21035 overrides if the method is private, any other accessibility is
21036 fine (and since we just checked the permission is the same, we are
21039 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
21040 and elif are processed always. The other pre-processing
21041 directives are only processed if we are "taking" the path
21043 2002-03-29 Martin Baulig <martin@gnome.org>
21045 * class.cs (Method.Emit): Only emit symbolic debugging info if the
21046 current location is not Null.
21048 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
21049 a separate method so we can profile it.
21051 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
21052 `span.Seconds' are just seconds, but no minutes or hours.
21053 (MainDriver): Profile the CodeGen.SaveSymbols calls.
21055 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21057 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
21058 Remove the gratuitous set of Final:
21060 // If an interface implementation, then we can set Final.
21061 if (((flags & MethodAttributes.Abstract) == 0) &&
21062 implementing.DeclaringType.IsInterface)
21063 flags |= MethodAttributes.Final;
21065 I do not know what I was smoking when I used that.
21068 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
21069 step into fixing the name resolution issues for delegates and
21070 unifying the toplevel name resolution.
21072 2002-03-28 Martin Baulig <martin@gnome.org>
21074 * class.cs (Method.Emit): If we have a symbol writer, call its
21075 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
21076 tell it about the current method.
21078 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
21079 writer that we're going to emit the first byte of IL code for a new
21080 statement (a new source line).
21081 (EmitContext.EmitTopBlock): If we have a symbol writer, call
21082 EmitContext.Mark() before emitting any code.
21084 * location.cs (SymbolDocument): Return null when we're Null.
21086 * statement.cs (Statement): Moved the `Location loc' variable here.
21087 (Statement.EmitBoolExpression): If we have a symbol writer, call
21088 ec.Mark() before emitting any code to tell it that we're at the
21089 beginning of a new statement.
21090 (StatementExpression): Added `Location' argument to the constructor.
21091 (Block): Added public readonly variable `StartLocation' and public
21092 variable `EndLocation'. The latter is to be set using SetEndLocation().
21093 (Block): Added constructor which takes a start and end location.
21094 (Block.SetEndLocation): New method. This sets the end location.
21095 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
21096 local variables we create.
21097 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
21098 each statement and do also mark the begin and end of the block.
21100 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
21101 tell it the current lexer.Location, use Location.Null for the end of the
21103 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
21104 current block, set its end location using SetEndLocation().
21105 (statement_expression): StatementExpression constructor now takes the
21106 lexer.Location as additional argument.
21107 (for_statement, declare_local_variables): Likewise.
21108 (declare_local_variables): When creating a new implicit block, use the
21109 new Block constructor and pass it the lexer.Location.
21111 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21113 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
21114 members also on the parent interfaces recursively.
21116 2002-03-27 Miguel de Icaza <miguel@ximian.com>
21118 * report.cs: Use new formats, since Gonzalo finished the missing
21121 * expression.cs (Binary.ResolveOperator): added missing operator|
21122 operator& and operator^ for bool/bool.
21124 * cs-parser.jay: CheckDef now takes a Location argument that is
21125 used to report errors more precisly (instead of reporting the end
21126 of a definition, we try to track something which is a lot closer
21127 to the source of the problem).
21129 * cs-tokenizer.cs: Track global token use, so we can properly flag
21130 the use of #define/#undef after the first token has been seen.
21132 Also, rename the reportXXXX to Error_DescriptiveName
21134 * decl.cs (DeclSpace.IsTopLevel): Move property here from
21135 TypeContainer, so that Enum and Interface can use this too.
21137 * class.cs (TypeContainer.LookupInterfaceOrClass,
21138 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
21139 `builder' argument. Typically this was used to pass the parent
21140 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
21143 The problem is that a nested class could trigger the definition of
21144 a toplevel class, and the builder would be obviously wrong in that
21147 So we drop this argument, and we compute dynamically the
21148 TypeBuilder/ModuleBuilder (the correct information was available
21149 to us anyways from DeclSpace.Parent)
21151 * interface.cs (Interface.DefineInterface): Drop builder
21152 parameter cleanup like class.cs
21154 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
21157 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21160 (Try.Emit): Propagate the returns value from the statement.
21162 (Return.Emit): Even if we are leavning
21164 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21166 * modifiers.cs: Fix the computation of MethodAttributes flags.
21168 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21170 * driver.cs: allow compilation of files that start with '/'.
21171 Add a default case when checking the argument of --target.
21173 2002-03-25 Miguel de Icaza <miguel@ximian.com>
21175 * interface.cs: Implement the same search algorithm for types in
21176 the interface code.
21178 * delegate.cs: Do not allow multiple definition.
21180 * Recovered ChangeLog that got accidentally amputated
21182 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21184 * rootcontext.cs: Load manually enum to allow core classes to
21185 contain enumerations.
21187 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21188 Update to new static methods in TypeManager.
21190 * typemanager.cs (GetMethod, GetConstructor): Use our
21191 implementation of FindMembers to find the members, since during
21192 corlib compilation, the types are TypeBuilders and GetMethod and
21193 GetConstructor do not work.
21195 Make all methods in TypeManager static.
21197 (InitCodeHelpers): Split the functionality from
21198 the InitCodeTypes function.
21200 * driver.cs: Call InitCodeHelpers after we have populated the
21203 * cs-parser.jay (delegate_declaration): we did not used to compute
21204 the delegate name correctly for void delegates.
21206 2002-03-24 Miguel de Icaza <miguel@ximian.com>
21208 * rootcontext.cs (RootContext): Init the interface_resolve_order
21209 and type_container_resolve_order always.
21211 (ResolveCore, BootstrapCorlib_ResolveClass,
21212 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21213 compiler when compiling with --nostdlib
21215 * class.cs (TypeContainer.DefineType): Check that our parent is
21216 not null. This test is most important when we are bootstraping
21219 * codegen.cs: Split out the symbol writing code.
21221 2002-03-25 Martin Baulig <martin@gnome.org>
21223 * driver.cs (-g): Made -g an alias for --debug.
21225 2002-03-24 Martin Baulig <martin@gnome.org>
21227 * codegen.cs (SymbolWriter): New public variable. Returns the
21228 current symbol writer.
21229 (CodeGen): Added `bool want_debugging_support' argument to the
21230 constructor. If true, tell the ModuleBuild that we want debugging
21231 support and ask it for the ISymbolWriter.
21232 (Save): If we have a symbol writer, call it's Close() method after
21233 saving the assembly.
21235 * driver.c (--debug): New command line argument to create a
21236 debugger information file.
21238 * location.cs (SymbolDocument): New public property. Returns an
21239 ISymbolDocumentWriter object for the current source file or null
21240 if we don't have a symbol writer.
21242 2002-03-21 Miguel de Icaza <miguel@ximian.com>
21244 * driver.cs (LoadAssembly): Correctly return when all the paths
21245 have been tried and not before.
21247 * statement.cs (Switch.Emit): return the actual coverage for this
21248 statement (returns/not-returns)
21250 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21251 switch of the statement if we are the last switch section. That
21252 kills two problems: try/catch problems (we used to emit an empty
21253 nop at the end) and switch statements where all branches would
21256 2002-03-19 Miguel de Icaza <miguel@ximian.com>
21258 * driver.cs: Add default assemblies (the equivalent to the
21259 Microsoft CSC.RSP file)
21261 * cs-tokenizer.cs: When updating `cols and setting it to zero,
21262 also update tokens_seen and set it to false.
21264 * driver.cs: Implement --recurse for Mike.
21266 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21267 correctly splitting out the paths.
21269 2002-03-18 Miguel de Icaza <miguel@ximian.com>
21271 * interface.cs (Interface.PopulateProperty): Instead of using
21272 `parent' as the declaration space for the set parameters, use
21275 * support.cs (InternalParameters): InternalParameters constructor
21276 takes a DeclSpace instead of a TypeContainer.
21278 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21279 types are being initialized, load the address of it before calling
21282 (New): Provide a mechanism to disable the generation of local
21283 value type temporaries when the caller will be providing us with
21284 an address to store it.
21286 (ArrayCreation.EmitDynamicInitializers): Use it.
21288 2002-03-17 Miguel de Icaza <miguel@ximian.com>
21290 * expression.cs (Invocation.EmitArguments): Only probe for array
21291 property if there is more than one argument. Sorry about that.
21293 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21294 empty param arrays.
21296 * class.cs (Method.LabelParameters): Fix incorrect code path that
21297 prevented the `ParamArrayAttribute' from being applied to the
21300 2002-03-16 Miguel de Icaza <miguel@ximian.com>
21302 * support.cs (ReflectionParameters): Correctly compute whether the
21303 last argument is a params array. Fixes the problem with
21306 * typemanager.cs: Make the assemblies array always be non-null
21307 (empty, but non-null)
21309 * tree.cs (RecordDecl): New function that abstracts the recording
21310 of names. This reports error 101, and provides a pointer to the
21311 previous declaration. Fixes a crash in the compiler.
21313 * cs-parser.jay (constructor_declaration): Update to new grammar,
21314 and provide a constructor_body that can be empty.
21316 2002-03-15 Miguel de Icaza <miguel@ximian.com>
21318 * driver.cs: Add support for --resources.
21320 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21321 Make all types for the various array helper methods be integer.
21323 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21324 CheckState to ConvCast.
21326 (ConvCast): Now it takes a `checked' state argument, to avoid
21327 depending on the emit context for the conversion, and just using
21328 the resolve time setting.
21330 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21331 instead of Invocation.EmitArguments. We do not emit the original
21332 arguments, instead we emit those which have been converted to
21333 unsigned int expressions.
21335 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21337 * codegen.cs: ditto.
21339 * expression.cs (LocalVariableReference): Drop the use of the
21340 Store function that depended on the variable index.
21342 * statement.cs (VariableInfo): Drop the `Idx' property from this
21343 class, as this is not taking into account the indexes for
21344 temporaries tat we generate during the execution, getting the
21347 * class.cs: First emit class initializers, then call the parent
21350 * expression.cs (Binary): Fix opcode emision.
21351 (UnaryMutator.EmitCode): Support checked code generation
21353 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21354 matches for events for both the Static and Instance scans,
21355 pointing to the same element. Fix that.
21357 2002-03-14 Miguel de Icaza <miguel@ximian.com>
21359 * rootcontext.cs (ResolveTree): Always set the
21360 interface_resolve_order, because nested interfaces will be calling
21363 * class.cs (GetInterfaceOrClass): Track the same resolution
21364 process used by TypeManager.LookupType. This fixes the nested
21365 type lookups in class declarations (separate path from
21368 (TypeContainer.DefineType): Also define nested interfaces.
21369 (TypeContainer.RegisterOrder): New public function used to
21370 register the order in which child interfaces need to be closed.
21372 Nested interfaces need to be closed after their parents have been
21375 * interface.cs (InterfaceAttr): Put all the logic for computing
21376 the interface attribute here.
21378 (DefineInterface): Register our interface order with the
21379 RootContext or with the TypeContainer depending on the case.
21381 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21383 * cs-parser.jay: rework foreach statement to work with the new
21384 changes to the policy on SimpleNames.
21386 * report.cs: support Stacktrace on warnings as well.
21388 * makefile: drop --unsafe and /unsafe from the compile.
21390 2002-03-13 Ravi Pratap <ravi@ximian.com>
21392 * ecore.cs (StandardConversionExists): Modify to take an Expression
21393 as the first parameter. Ensure we do null -> reference type conversion
21396 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21397 temporary Expression objects.
21399 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21401 * interface.cs: workaround bug in method overloading resolution
21402 (there is already a bugzilla bug for it).
21404 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21406 We could also solve this problem by having a separate path for
21407 performing type lookups, instead of DoResolve, we could have a
21408 ResolveType entry point, and only participating pieces of the
21409 production (simplename, deref, array) would implement this.
21411 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21412 signal SimpleName to only resolve type names and not attempt to
21413 resolve anything else.
21415 * expression.cs (Cast): Set the flag.
21417 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21419 * class.cs: Only report 108 if there is no `new' modifier.
21421 * cs-parser.jay: rework foreach statement to work with the new
21422 changes to the policy on SimpleNames.
21424 * report.cs: support Stacktrace on warnings as well.
21426 * makefile: drop --unsafe and /unsafe from the compile.
21428 2002-03-11 Miguel de Icaza <miguel@ximian.com>
21430 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21431 lookups here, instead of doing that at parse time. This means
21432 that our grammar will not introduce `LocalVariableReferences' as
21433 expressions at this point. That solves the problem of code like
21437 static void Main ()
21441 This is only half the fix. The full fix requires parameters to
21442 also be handled in this way.
21444 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21445 makes the use more obvious of the DeclSpace. The
21446 ec.TypeContainer.TypeBuilder is now only used to pull the
21447 TypeBuilder for it.
21449 My theory is that I can get rid of the TypeBuilder completely from
21450 the EmitContext, and have typecasts where it is used (from
21451 DeclSpace to where it matters).
21453 The only pending problem is that the code that implements Aliases
21454 is on TypeContainer, and probably should go in DeclSpace.
21456 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21457 lookups here, instead of doing that at parse time. This means
21458 that our grammar will not introduce `LocalVariableReferences' as
21459 expressions at this point. That solves the problem of code like
21463 static void Main ()
21467 This is only half the fix. The full fix requires parameters to
21468 also be handled in this way.
21470 * class.cs (Property.DefineMethod): When implementing an interface
21471 method, set newslot, when implementing an abstract method, do not
21472 set the flag (before we tried never setting it, or always setting
21473 it, which is the difference).
21474 (Indexer.DefineMethod): same.
21475 (Method.DefineMethod): same.
21477 * ecore.cs: Only set the status used flag if we get back a Field.
21479 * attribute.cs: Temporary hack, so Paolo can keep working.
21481 2002-03-08 Ravi Pratap <ravi@ximian.com>
21483 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21484 the unmanaged type in the case we have a MarshalAs attribute.
21486 (Resolve): Handle the case when we are parsing the special MarshalAs
21487 attribute [we need to store the unmanaged type to use later]
21489 * typemanager.cs (marshal_as_attr_type): Built in type for the
21490 MarshalAs Attribute.
21492 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
21493 on parameters and accordingly set the marshalling info.
21495 2002-03-09 Miguel de Icaza <miguel@ximian.com>
21497 * class.cs: Optimizing slightly by removing redundant code after
21498 we switched to the `NoTypes' return value.
21499 (Property.DefineMethod): use NoTypes here too.
21501 This fixes the bug I introduced in my last batch of changes.
21503 2002-03-05 Ravi Pratap <ravi@ximian.com>
21505 * tree.cs (RecordEnum): Add. We now keep track of enums too.
21507 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21508 Enums since those are types too.
21510 * cs-parser.jay (enum_declaration): Record enums as we parse them.
21512 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
21513 thanks to a call during the lookup process.
21515 2002-03-07 Miguel de Icaza <miguel@ximian.com>
21517 * statement.cs (Foreach): Lots of work to accomodate a particular
21518 kind of foreach statement that I had not kept in mind. It is
21519 possible to have foreachs on classes that provide a GetEnumerator
21520 method that return objects that implement the "pattern" for using
21521 a foreach, there is no need to support GetEnumerator
21524 This is needed to compile nant.
21526 * decl.cs: Only report 114 if the member is not `Finalize' and if
21527 the warning level is at least 2.
21529 * class.cs: Moved the compare function from Method to
21532 (MethodSignature.InheritableMemberSignatureCompare): Add new
21533 filter function that is used to extract inheritable methods from a
21536 (Method.Define): Use the new `inheritable_method_signature_filter'
21539 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21542 2002-03-06 Miguel de Icaza <miguel@ximian.com>
21544 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21546 * cs-parser.jay: Add opt_semicolon to the interface declaration.
21548 * expression.cs: Pass location information to
21549 ConvertImplicitStandard.
21551 * class.cs: Added debugging code to track return values from
21554 2002-03-05 Miguel de Icaza <miguel@ximian.com>
21556 * expression.cs (Is.DoResolve): If either side of the `is' is an
21557 interface, do not flag the warning.
21559 * ecore.cs (ImplicitReferenceConversion): We need a separate test
21562 * report.cs: Allow for --fatal to be used with --probe.
21564 * typemanager.cs (NoTypes): Move the definition for the empty Type
21567 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21569 (TypeContainer.DefineProxy): New function used to proxy to parent
21570 implementations when implementing interfaces.
21571 (TypeContainer.ParentImplements): used to lookup if our parent
21572 implements a public function that is required by an interface.
21573 (TypeContainer.VerifyPendingMethods): Hook this up.
21575 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21576 `modules' and `assemblies' arraylists into arrays. We only grow
21577 these are the very early start up of the program, so this improves
21578 the speedof LookupType (nicely measured).
21580 * expression.cs (MakeByteBlob): Replaced unsafe code with
21581 BitConverter, as suggested by Paolo.
21583 * cfold.cs (ConstantFold.Binary): Special case: perform constant
21584 folding of string concatenation, but if either side is a string,
21585 and the other is not, then return null, and let the runtime use
21586 the concatenation on the string plus the object (using
21587 `Object.ToString').
21589 2002-03-04 Miguel de Icaza <miguel@ximian.com>
21591 Constant Folding has been implemented now.
21593 * expression.cs (Unary.Reduce): Do not throw an exception, catch
21594 the error instead on types that are not supported in one's
21597 * constant.cs (Constant and all children): New set of functions to
21598 perform implict and explicit conversions.
21600 * ecore.cs (EnumConstant): Implement the new functions to perform
21601 conversion by proxying to the child expression.
21603 * codegen.cs: (ConstantCheckState): Constant evaluation has its
21604 own separate setting that can not be turned off from the command
21605 line using --unchecked or --checked and is only controlled using
21606 the checked/unchecked statements and expressions. This setting is
21607 used by the constant folder to flag errors.
21609 * expression.cs (CheckedExpr, UncheckedExpr): Set the
21610 ConstantCheckState as well.
21612 During Resolve, they also have to flag the state, because the
21613 constant folder runs completely in the Resolve phase.
21615 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21618 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21620 * cfold.cs: New file, this file contains the constant folder.
21622 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21623 argument to track whether we are using the resulting address to
21624 load or store a value and provide better error messages.
21626 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21627 new AddressOf arguments.
21629 * statement.cs (Foreach.EmitCollectionForeach): Update
21631 * expression.cs (Argument.Emit): Call AddressOf with proper
21632 arguments to track usage.
21634 (New.DoEmit): Call AddressOf with new arguments.
21636 (Unary.Emit): Adjust AddressOf call.
21638 2002-03-01 Ravi Pratap <ravi@ximian.com>
21640 * cs-parser.jay (member_access): Change the case for pre-defined types
21641 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
21644 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21647 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21648 essentially like methods and apply attributes like MethodImplOptions to them too.
21650 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21653 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21654 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21657 * Update code everywhere accordingly.
21659 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21661 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21663 2002-02-28 Ravi Pratap <ravi@ximian.com>
21665 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21666 try performing lookups against those instead of jumping straight into using
21667 the 'using' clauses.
21669 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21671 (LookupType): Perform lookups in implicit parents too.
21673 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21674 sequence as RootContext.LookupType.
21676 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21677 the various cases of namespace lookups into this method.
21679 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21681 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21682 in positional arguments)
21684 * class.cs (Operator): Update the AllowedModifiers to contain
21687 * cs-parser.jay: Update operator declaration to allow for the
21688 operator body to be empty.
21690 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21693 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21695 * class.cs (Method.Emit): Label parameters.
21697 * driver.cs: Return 1 or 0 as the program exit code.
21699 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21701 * expression.cs: Special case the `null' object when trying to
21702 auto-compute the type, as anything can be explicitly converted to
21705 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21706 spotting this Paolo.
21708 (Expression.ImplicitNumericConversion): Perform comparissions of
21709 the type using the underlying type in the case of an enumeration
21710 rather than using the enumeration type for the compare.
21712 Cope with the underlying == type case, which is not possible to
21715 (Expression.ConvertNumericExplicit): Perform comparissions of
21716 the type using the underlying type in the case of an enumeration
21717 rather than using the enumeration type for the compare.
21719 * driver.cs: If the user does not supply an extension, assume .exe
21721 * cs-parser.jay (if_statement): Rewrote so that we can track the
21722 location for the if statement.
21724 * expression.cs (Binary.ConstantFold): Only concat strings when
21725 the operation is "+", not everything ;-)
21727 * statement.cs (Statement.EmitBoolExpression): Take a location
21729 (If, While, Do): Track location.
21731 * expression.cs (Binary.ResolveOperator): In the object + string
21732 case, I was missing a call to ConvertImplicit
21734 2002-02-25 Ravi Pratap <ravi@ximian.com>
21736 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21737 Location arguments. Ensure we use RootContext.LookupType to do our work
21738 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21740 * interface.cs (PopulateMethod): Handle the type of the parameter being
21743 * expression.cs (Invocation.BetterFunction): Handle the case when we
21744 have a params method with no fixed arguments and a call is made with no
21747 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21749 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21750 the verbatim-string-literal
21752 * support.cs (InternalParameters.ParameterModifier): handle null
21754 (InternalParameters.ParameterType): ditto.
21756 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21757 duplicating the name of the variable parameter.
21758 (GetParameterByName): Fix bug where we were not looking up array
21759 paramters if they were the only present (thanks Paolo!).
21760 (GetParameterInfo): We only have an empty set of types if both
21761 fixed and array are set to null.
21762 (GetParameterInfo-idx): Handle FixedParameter == null
21764 * cs-parser.jay: Handle the case where there is no catch
21765 statements (missing null test).
21767 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21769 * driver.cs (MainDriver): Be conservative on our command line
21772 Catch DirectoryNotFoundException when calling GetFiles.
21774 (SplitPathAndPattern): Used to split the input specification into
21775 a path and a pattern that we can feed to Directory.GetFiles.
21777 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21779 * statement.cs (Fixed): Implement the last case of the Fixed
21780 statement (string handling).
21782 * expression.cs (StringPtr): New class used to return a char * to
21783 a string; Used by the Fixed statement.
21785 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21787 * expression.cs (Binary.ResolveOperator): Remove redundant
21788 MemberLookup pn parent type.
21789 Optimize union call, we do not need a union if the types are the same.
21790 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21793 Specialize the use of MemberLookup everywhere, instead of using
21794 the default settings.
21796 (StackAlloc): Implement stackalloc keyword.
21798 * cs-parser.jay: Add rule to parse stackalloc.
21800 * driver.cs: Handle /h, /help, /?
21802 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21803 before we supported unsafe code.
21805 * makefile: add --unsafe to the self compilation of mcs.
21807 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21809 * expression.cs (PointerArithmetic): New class that is used to
21810 perform pointer arithmetic.
21811 (Binary.Resolve): Handle pointer arithmetic
21812 Handle pointer comparission.
21813 (ArrayPtr): Utility expression class that is used to take the
21814 address of an array.
21816 (ElementAccess): Implement array access for pointers
21818 * statement.cs (Fixed): Implement fixed statement for arrays, we
21819 are missing one more case before we are done.
21821 * expression.cs (Indirection): Implement EmitAssign and set the
21822 ExprClass to Variable. This allows pointer dereferences to be
21823 treated as variables, and to have values assigned to them.
21825 * ecore.cs (Expression.StoreFromPtr): New utility function to
21826 store values dereferencing.
21828 2002-02-20 Ravi Pratap <ravi@ximian.com>
21830 * expression.cs (Binary.ResolveOperator): Ensure that we are
21831 not trying to operate on a void type - this fixes the reported
21834 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21835 the parent implementation is sealed.
21837 * ../errors/cs0239.cs : Add.
21839 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21841 * typemanager.cs (unverifiable_code_type): Corresponds to
21842 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21843 which have unsafe code in them.
21845 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21848 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21850 * cs-tokenizer.cs: Add support for @"litreal strings"
21852 Make tokenizer accept pre-processor directives
21853 on any column (remove the old C-like limitation).
21855 * rootcontext.cs (EmitCode): Emit any global attributes.
21856 (AddGlobalAttributes): Used to keep track of assembly attributes.
21858 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21860 * cs-parser.jay: Add support for global attributes.
21862 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21864 * expression.cs (Indirection): New helper class. Unary will
21865 create Indirection classes to be able to implement the
21866 IMemoryLocation interface on it.
21868 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21870 * cs-parser.jay (fixed_statement): reference the right statement.
21872 * statement.cs (Fixed.Emit): Finish implementing the fixed
21873 statement for the &x case.
21875 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21877 * class.cs (Property.Define, Method.Define): Remove newslot when
21880 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21881 wrong. NewSlot should only be used if the `new' keyword is present.
21883 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21884 locating our system dir. Sorry about this.
21886 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21888 * driver.cs (GetSystemDir): Compute correctly the location of our
21889 system assemblies. I was using the compiler directory instead of
21890 the library directory.
21892 2002-02-13 Ravi Pratap <ravi@ximian.com>
21894 * expression.cs (BetterFunction): Put back in what Miguel commented out
21895 since it is the correct fix. The problem is elsewhere ;-)
21897 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21898 parameters of the parms method are themselves compatible or not !
21900 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21901 to check that a class implements an interface before saying that an implicit
21902 conversion was allowed. Use ImplementsInterface to do the checking.
21904 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21906 * class.cs (Method.Define): Track whether we are an explicit
21907 implementation or not. And only call DefineMethodOverride if we
21908 are an explicit implementation.
21910 (Property.DefineMethod): Ditto.
21912 2002-02-11 Ravi Pratap <ravi@ximian.com>
21914 * expression.cs (BetterFunction): Catch hideous bug which was
21915 preventing us from detecting ambiguous calls due to implicit casts i.e
21918 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21920 * support.cs (Pair): Remove un-needed method. I figured why I was
21921 getting the error in cs-parser.jay, the variable in a foreach loop
21922 is readonly, and the compiler does not really treat this as a variable.
21924 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21925 instead of EQUALS in grammar.
21927 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21929 * expression.cs (Unary.DoResolve): Check whether the argument is
21932 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21934 * support.cs: Api for Pair to set a value. Despite the fact that
21935 the variables are public the MS C# compiler refuses to compile
21936 code that accesses the field if the variable is part of a foreach
21939 * statement.cs (Fixed): Begin implementation of the fixed
21942 (Block.AddVariable): Return the VariableInfo on success and null
21943 on failure instead of true/false.
21945 * cs-parser.jay (foreach): Catch errors on variables already
21946 defined (we were ignoring this value before) and properly unwind
21947 the block hierarchy
21949 (fixed_statement): grammar for the fixed statement.
21951 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21953 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21954 pointer types to be incretemented.
21956 (SizeOf): Implement.
21958 * cs-parser.jay (pointer_member_access): Implement
21959 expr->IDENTIFIER production.
21961 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21962 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21965 (Unary): Implement indirection.
21967 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21968 use in non-unsafe context).
21970 (SimpleName.DoResolve): Check for pointers in field access on safe
21973 (Expression.LoadFromPtr): Factor the load-indirect code in this
21974 function. This was duplicated in UnboxCast and ParameterReference
21976 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21978 * expression.cs (ComposedCast): report an error if a pointer cast
21979 is used in a safe region.
21981 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21982 pointer type casts in unsafe context.
21984 * codegen.cs (EmitContext): Set up IsUnsafe.
21986 * cs-parser.jay (non_expression_type): Add productions for pointer
21989 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21990 code. We should not use force into static mode if the method is
21991 not virtual. Fixes bug in MIS
21993 * statement.cs (Do.Emit, While.Emit, For.Emit,
21994 Statement.EmitBoolExpression): Add support to Do and While to
21995 propagate infinite loop as `I do return' semantics.
21997 Improve the For case to also test for boolean constants.
21999 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
22000 to the list of attributes we can add.
22002 Remove `EmitContext' argument.
22004 * class.cs (Method.Define): Apply parameter attributes.
22005 (Constructor.Define): Apply parameter attributes.
22006 (MethodCore.LabelParameters): Move here the core of labeling
22009 * support.cs (ReflectionParameters.ParameterModifier,
22010 InternalParameters.ParameterModifier): Use IsByRef on the type and
22011 only return the OUT bit for these parameters instead of in/out/ref
22014 This is because I miss-understood things. The ParameterInfo.IsIn
22015 and IsOut represent whether the parameter has the [In] and [Out]
22018 2002-01-22 Miguel de Icaza <miguel@ximian.com>
22020 * ecore.cs (FieldExpr.Emit): Release temporaries.
22022 * assign.cs (LocalTemporary.Release): new function.
22024 * codegen.cs (EmitContext.GetTemporaryStorage,
22025 EmitContext.FreeTemporaryStorage): Rework the way we deal with
22026 temporary storage. Now we can "put back" localbuilders when we
22029 2002-01-21 Miguel de Icaza <miguel@ximian.com>
22031 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
22032 need to make a copy of the variable to generate verifiable code.
22034 2002-01-19 Miguel de Icaza <miguel@ximian.com>
22036 * driver.cs: Compute dynamically the system directory.
22038 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
22039 Slower, but more generally useful. Used by the abstract
22040 registering implementation.
22042 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
22043 the rules for the special rule on Type/instances. First check if
22044 we have the same name, and if so, try that special static path
22045 rather than the instance path.
22047 2002-01-18 Miguel de Icaza <miguel@ximian.com>
22049 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
22052 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
22053 Enum, ValueType, Delegate or Array for non-corlib compiles.
22055 * cs-tokenizer.cs: Catch long identifiers (645)
22057 * typemanager.cs (IndexerPropetyName): Ravi never tested this
22060 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
22061 fix, we were returning too early, so we were not registering
22062 pending methods from abstract classes.
22064 Do not register pending methods if the class is abstract.
22066 * expression.cs (Conditional.DoResolve): Report circular implicit
22067 conversions when we neecd to compute it for conditional
22070 (Is.DoResolve): If the expression is always of the provided type,
22071 flag warning 183. If the expression can not ever be of the
22072 provided type flag warning 184.
22074 * class.cs: Catch 169 as well.
22076 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
22079 2002-01-18 Nick Drochak <ndrochak@gol.com>
22081 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
22083 2002-01-17 Miguel de Icaza <miguel@ximian.com>
22085 * interface.cs: (PopulateMethod): Check for pointers being defined
22086 only if the unsafe context is active.
22087 (PopulateProperty): ditto.
22088 (PopulateIndexer): ditto.
22090 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
22091 specified. If pointers are present, make sure that they are
22092 present in an unsafe context.
22093 (Constructor, Constructor.Define): ditto.
22094 (Field, Field.Define): ditto.
22095 (Property, Property.Define): ditto.
22096 (Event, Event.Define): ditto.
22098 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
22099 hashtable if there are classes or structs defined.
22101 * expression.cs (LocalVariableReference.DoResolve): Simplify this
22102 code, as the constant resolution moved.
22104 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
22105 the metadata, so we can flag error 133.
22107 * decl.cs (MemberCore.UnsafeOK): New function to test that a
22108 pointer is being declared in an unsafe context.
22110 2002-01-16 Miguel de Icaza <miguel@ximian.com>
22112 * modifiers.cs (Modifiers.Check): Require a Location argument.
22113 Report error 227 for Unsafe use.
22115 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
22117 * statement.cs (For.Emit): If the test is null, then report that
22118 we do `return', as we wont reach anything afterwards.
22120 (Switch.SwitchGoverningType): Track the expression that matched
22123 * driver.cs: Allow negative numbers as an error code to flag.
22125 * cs-parser.jay: Handle 1551.
22127 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
22129 2002-01-15 Miguel de Icaza <miguel@ximian.com>
22131 * cs-parser.jay: Report 1518 (type declaration can only contain
22132 class, struct, interface, enum or delegate)
22134 (switch_label): Report 1523 (keywords `case' or `default' must
22137 (opt_switch_sections): Report 1522 (empty switch)
22139 * driver.cs: Report 1515 (response file specified multiple times)
22140 Report 1516 (Source file specified multiple times).
22142 * expression.cs (Argument.Resolve): Signal 1510
22144 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
22145 access not allowed in static code)
22147 2002-01-11 Ravi Pratap <ravi@ximian.com>
22149 * typemanager.cs (IsPointerType): Utility method which we are going
22152 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
22153 the object type, so we take care of that.
22155 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22157 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22158 added to non-params parameters :-)
22160 * typemanager.cs (CSharpName): Include 'void' type too.
22162 (void_ptr_type): Include in the set of core types.
22164 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
22167 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
22170 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
22171 completely forgotten about it.
22173 2002-01-10 Ravi Pratap <ravi@ximian.com>
22175 * cs-parser.jay (pointer_type): Add. This begins our implementation
22176 of parsing rules for unsafe code.
22178 (unsafe_statement): Implement.
22180 (embedded_statement): Modify to include the above.
22182 * statement.cs (Unsafe): Implement new class for unsafe blocks.
22184 * codegen.cs (EmitContext.InUnsafe): Add. This determines
22185 if the current context is an unsafe one.
22187 * cs-parser.jay (local_variable_pointer_type): Since local variable types
22188 are handled differently, we need separate rules for them.
22190 (local_variable_declaration): Update to use local_variable_pointer_type
22191 to allow variable declarations of unmanaged pointer types.
22193 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22194 in unsafe contexts.
22196 * ../errors/cs0214.cs : Add.
22198 2002-01-16 Nick Drochak <ndrochak@gol.com>
22200 * makefile: remove 'response' file when cleaning.
22202 2002-01-15 Miguel de Icaza <miguel@ximian.com>
22204 * cs-parser.jay: Report 1524.
22206 2002-01-14 Miguel de Icaza <miguel@ximian.com>
22208 * typemanager.cs (RegisterMethod): drop checking if we have
22209 registered this from here
22211 2002-01-12 Miguel de Icaza <miguel@ximian.com>
22213 * class.cs (Method.EmitDestructor): Implement calling our base
22216 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22217 value of InFinally.
22219 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22220 this routine and will wrap the call in a try/catch block. Deal
22223 2002-01-11 Miguel de Icaza <miguel@ximian.com>
22225 * ecore.cs (Expression.MemberLookup): instead of taking a
22226 parameter `same_type' that was used to tell whether we could
22227 access private members we compute our containing type from the
22230 (FieldExpr): Added partial support for volatile fields. This does
22231 not work for volatile fields exposed from assemblies, as I can not
22232 figure out how to extract the modreq from it.
22234 Updated all the source files to use this.
22236 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22237 because it is referenced by MemberLookup very often.
22239 2002-01-09 Ravi Pratap <ravi@ximian.com>
22241 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22242 TypeBuilder.GetCustomAttributes to retrieve what we need.
22244 Get rid of redundant default_member_attr_type as this is the same as
22245 default_member_type which already exists.
22247 * interface.cs, attribute.cs : Update accordingly.
22249 2002-01-08 Miguel de Icaza <miguel@ximian.com>
22251 * typemanager.cs: Enable IndexerPropertyName again. It does not
22252 work for TYpeBuilders though. Ravi, can you please fix this?
22254 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22256 * expression.cs (Argument.Emit): Handle the case of ref objects
22257 being passed to ref functions;
22259 (ParameterReference.EmitLoad): Loads the content of the pointer
22260 without dereferencing.
22262 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22264 * cs-tokenizer.cs: Implemented the pre-processing expressions.
22266 2002-01-08 Ravi Pratap <ravi@ximian.com>
22268 * class.cs (Indexer.DefineMethod): Incorporate the interface
22269 type in the name of the method if we are doing explicit interface
22272 * expression.cs (ConversionExists): Remove as it is completely obsolete.
22274 (BetterConversion): Fix extremely trivial bug where we were referring to
22275 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22278 * ../errors/bug16.cs : Add although we have fixed it.
22280 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22282 * expression.cs (BaseIndexer): Begin implementation.
22284 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22286 * cs-parser.jay (indexer_declarator): Use qualified_identifier
22287 production directly to remove a shift/reduce, and implement
22288 explicit interface implementation.
22290 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22291 after a floating point suffix.
22293 * expression.cs (DoNumericPromotions): Improved the conversion for
22294 uint/uint. If we have a constant, we avoid doing a typecast to a
22297 * class.cs (Indexer): Implement explicit interface implementation
22300 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22302 * class.cs: make the default instance constructor public and hidebysig.
22304 2001-01-03 Ravi Pratap <ravi@ximian.com>
22306 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22307 so we can call it from elsewhere.
22309 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22310 we emit it internally if the class has a defined indexer; otherwise the user
22311 emits it by decorating the class definition with the DefaultMemberAttribute.
22313 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22314 attribute is not used on a type which defines an indexer.
22316 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22317 character when we skip whitespace.
22319 * ../errors/cs0646.cs : Add.
22321 2002-01-03 Miguel de Icaza <miguel@ximian.com>
22323 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22326 * makefile: Add practical target `mcs3.exe' which builds the third
22327 generation compiler.
22329 * expression.cs (New): Fix structures constructor calling.
22331 * class.cs (Property, Method, Indexer): Emit Final flag on the
22332 method if we are an interface implementation and we are not
22335 * ecore.cs (PropertyExpr): New public field `IsBase', tells
22336 whether this property is referencing a `base' method.
22338 * expression.cs (Invocation.EmitCall): take an extra argument:
22339 is_base, this is used to determine whether the `call' or
22340 `callvirt' opcode should be used.
22343 * delegate.cs: update EmitCall.
22345 * class.cs (Method.Define): Set NewSlot for the cases where we are
22346 not implementing an interface method.
22348 (Property.Define): ditto.
22350 2002-01-02 Miguel de Icaza <miguel@ximian.com>
22352 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22353 'r'. Allows mcs to parse itself fully.
22355 2002-01-02 Ravi Pratap <ravi@ximian.com>
22357 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22358 of the number of initializers that require the InitializeArray method.
22360 (CheckIndices): Store the Expression in all cases - not the plain value. Also
22361 update the above field where necessary.
22363 (MakeByteBlob): Update accordingly.
22365 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
22368 (EmitDynamicInitializers): Update in accordance with the new optimization.
22370 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22371 same OpCode applies.
22373 * cs-parser.jay : Fix some glaring errors I introduced.
22375 2002-01-01 Ravi Pratap <ravi@ximian.com>
22377 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22378 so that we can check for name clashes there too.
22380 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22381 for interface indexers.
22383 * interfaces.cs (Define): Emit the default member attribute.
22385 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22386 variable was being referred to while setting the value ;-)
22388 2002-01-01 Miguel de Icaza <miguel@ximian.com>
22390 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22391 byte-by-byte information when we know the data is zero.
22393 Make the block always a multiple of 4, because
22394 DefineInitializedData has a bug.
22396 * assign.cs: Fix, we should assign from the temporary, not from
22399 * expression.cs (MakeByteBlob): Fix my incorrect code.
22401 2001-12-31 Miguel de Icaza <miguel@ximian.com>
22403 * typemanager.cs (EnumToUnderlying): This function is used to get
22404 the underlying type from an enumeration, because it does not
22407 * constant.cs: Use the I4_S form for values between -128 and 127.
22409 * statement.cs (Block.LookupLabel): Looks up a label.
22410 (Block): Drop support for labeled blocks.
22412 (LabeledStatement): New kind of statement that represents a label
22415 (Goto): Finally implement this bad boy.
22417 * cs-parser.jay: Update to reflect new mechanism to implement
22420 2001-12-30 Miguel de Icaza <miguel@ximian.com>
22422 * codegen.cs (EmitContext.This): a codegen property that keeps the
22423 a single instance of this instead of creating many different this
22426 * delegate.cs (Delegate.DoResolve): Update to use the property;
22428 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22430 * expression.cs (BaseAccess.DoResolve): Ditto.
22432 2001-12-29 Ravi Pratap <ravi@ximian.com>
22434 * typemanager.cs (methodimpl_attr_type): Add to hold the type
22435 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22437 (InitCoreTypes): Update accordingly.
22439 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22440 so we can quickly store the state.
22442 (ApplyAttributes): Set the correct implementation flags
22443 for InternalCall methods.
22445 2001-12-29 Miguel de Icaza <miguel@ximian.com>
22447 * expression.cs (EmitCall): if a method is not virtual, then do
22448 not use callvirt on it.
22450 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22451 user defined stuff) requires the use of stobj, which takes an
22452 address on the stack instead of an array and an index. So emit
22453 the Ldelema operation for it.
22455 (EmitStoreOpcode): Use stobj for valuetypes.
22457 (UnaryMutator.EmitCode): Use the right 1 value depending on
22458 whether we are dealing with int64/uint64, float or doubles.
22460 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22461 constructors that I implemented last night.
22463 (Constructor.IsDefault): Fix to work properly for static
22466 * cs-parser.jay (CheckDef): report method signature errors.
22467 Update error number 103 to be 132.
22469 * decl.cs: New AdditionResult enumeration value: MethodExists.
22470 Although we do this check for methods later on in the semantic
22471 analysis, catching repeated default constructors is so easy that
22472 we catch these here.
22474 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22477 (ParameterReference.EmitAssign, Emit): handle
22480 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22481 (ArrayAccess.EmitStoreOpcode): ditto.
22483 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22485 * expression.cs (MakeByteBlob): Complete all the missing types
22486 (uint, short, ushort, byte, sbyte)
22488 * class.cs: Only init instance field initializers on instance
22491 Rename `constructors' to instance_constructors.
22493 (TypeContainer.AddConstructor): Only add constructors to the list
22494 if it is not static.
22496 Make sure that we handle default_static_constructor independently
22497 everywhere where we handle instance_constructors
22499 2001-12-28 Miguel de Icaza <miguel@ximian.com>
22501 * class.cs: Do not lookup or create a base initializer for a
22502 static constructor.
22504 (ConstructorInitializer.Resolve): use the proper type to lookup
22507 * cs-parser.jay: Report error 1585 (modifiers between type and name).
22509 * enum.cs, interface.cs: Remove CloseType, this is taken care by
22512 * decl.cs: CloseType is now an virtual method, the default
22513 implementation just closes this type.
22515 2001-12-28 Ravi Pratap <ravi@ximian.com>
22517 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22518 to PreserveSig by default. Also emit HideBySig on such methods.
22520 Basically, set the defaults to standard values.
22522 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22523 argument, if candidate is better, it can't be worse than the best !
22525 (Invocation): Re-write bits to differentiate between methods being
22526 applicable in their expanded form and their normal form - for params
22529 Get rid of use_standard everywhere as only standard conversions are allowed
22530 in overload resolution.
22532 More spec conformance.
22534 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22536 * driver.cs: Add --timestamp, to see where the compiler spends
22539 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22540 `this' in static code.
22542 (SimpleName.DoResolve): Implement in terms of a helper function
22543 that allows static-references to be passed upstream to
22546 (Expression.ResolveWithSimpleName): Resolve specially simple
22547 names when called by MemberAccess to implement the special
22550 (Expression.ImplicitReferenceConversion): Handle conversions from
22551 Null to reference types before others, as Null's type is
22554 * expression.cs (Invocation.EmitCall): Handle the special case of
22555 calling methods declared on a reference type from a ValueType
22556 (Base classes System.Object and System.Enum)
22558 (MemberAccess.Resolve): Only perform lookups on Enumerations if
22559 the left hand side is a TypeExpr, not on every enumeration.
22561 (Binary.Resolve): If types are reference types, then do a cast to
22562 object on operators != and == of both arguments.
22564 * typemanager.cs (FindMembers): Extract instance and static
22565 members if requested.
22567 * interface.cs (PopulateProperty): Use void_type instead of null
22568 as the return type for the setter method.
22570 (PopulateIndexer): ditto.
22572 2001-12-27 Ravi Pratap <ravi@ximian.com>
22574 * support.cs (ReflectionParameters): Fix minor bug where we
22575 were examining the wrong parameter for the ParamArray attribute.
22577 Cope with requests for the type of the parameter at position
22578 greater than the params parameter's. We now return the element
22579 type of the params array as that makes more sense.
22581 * expression.cs (Invocation.IsParamsMethodApplicable): Update
22582 accordingly as we no longer have to extract the element type
22585 (Invocation.OverloadResolve): Update.
22587 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22589 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22590 against IEnumerator, test whether the return value is a descendant
22591 of the IEnumerator interface.
22593 * class.cs (Indexer.Define): Use an auxiliary method to implement
22594 the other bits of the method definition. Begin support for
22595 explicit interface implementation.
22597 (Property.DefineMethod): Use TypeManager.void_type instead of null
22598 for an empty return value.
22600 2001-12-26 Miguel de Icaza <miguel@ximian.com>
22602 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22603 dealing with a FieldExpr which is composed of a FieldBuilder, in
22604 the code path we did extract the constant, but we should have
22605 obtained the underlying value to be able to cast it (otherwise we
22606 end up in an infinite loop, this is what Ravi was running into).
22608 (ArrayCreation.UpdateIndices): Arrays might be empty.
22610 (MemberAccess.ResolveMemberAccess): Add support for section
22611 14.5.4.1 that deals with the special case of E.I when E is a type
22612 and something else, that I can be a reference to a static member.
22614 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22615 handle a particular array type to create byte blobs, it is just
22616 something we dont generate byteblobs for.
22618 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22621 * location.cs (Push): remove the key from the hashtable that we
22622 are about to add. This happens for empty files.
22624 * driver.cs: Dispose files after we have parsed them.
22626 (tokenize): new function that only runs the tokenizer on its
22627 input, for speed testing.
22629 2001-12-26 Ravi Pratap <ravi@ximian.com>
22631 * class.cs (Event.Define): Define the private field only if there
22632 are no accessors defined.
22634 * expression.cs (ResolveMemberAccess): If there is no associated
22635 field with the event, that means we have an event defined with its
22636 own accessors and we should flag error cs0070 since transforming
22637 ourselves into a field is not valid in that case.
22639 * ecore.cs (SimpleName.DoResolve): Same as above.
22641 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22642 and charset to sane values.
22644 2001-12-25 Ravi Pratap <ravi@ximian.com>
22646 * assign.cs (DoResolve): Perform check on events only if they
22647 are being accessed outside the declaring type.
22649 * cs-parser.jay (event_declarations): Update rules to correctly
22650 set the type of the implicit parameter etc.
22652 (add_accessor, remove_accessor): Set current local parameters.
22654 * expression.cs (Binary): For delegate addition and subtraction,
22655 cast the return value from the method into the appropriate delegate
22658 2001-12-24 Ravi Pratap <ravi@ximian.com>
22660 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22661 of these as the workaround is unnecessary.
22663 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22664 delegate data - none of that is needed at all.
22666 Re-write bits to extract the instance expression and the delegate method
22669 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22672 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22673 of attaching attributes instead of duplicating code everywhere.
22675 * everywhere : Update code to do attribute emission using the above method.
22677 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22679 * expression.cs (IsParamsMethodApplicable): if there are not
22680 parameters, return immediately.
22682 * ecore.cs: The 0 literal can be implicity converted to an enum
22685 (SimpleName.DoResolve): First lookup the type, then lookup the
22688 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22689 want to get its address. If the InstanceExpression is not
22690 addressable, store the result in a temporary variable, then get
22693 * codegen.cs: Only display 219 errors on warning level or above.
22695 * expression.cs (ArrayAccess): Make it implement the
22696 IMemoryLocation interface.
22698 (Binary.DoResolve): handle the operator == (object a, object b)
22699 and operator != (object a, object b) without incurring into a
22700 BoxedCast (because 5 != o should never be performed).
22702 Handle binary enumerator operators.
22704 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22705 value type, otherwise use Ldelem_ref.
22707 Use precomputed names;
22709 (AddressOf): Implement address of
22711 * cs-parser.jay (labeled_statement): Fix recursive block
22712 addition by reworking the production.
22714 * expression.cs (New.DoEmit): New has a special case:
22716 If we are dealing with a ValueType, we have a few
22717 situations to deal with:
22719 * The target of New is a ValueType variable, that is
22720 easy, we just pass this as the variable reference
22722 * The target of New is being passed as an argument,
22723 to a boxing operation or a function that takes a
22726 In this case, we need to create a temporary variable
22727 that is the argument of New.
22730 2001-12-23 Ravi Pratap <ravi@ximian.com>
22732 * rootcontext.cs (LookupType): Check that current_type is not null before
22733 going about looking at nested types.
22735 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22736 not implement the IAssignMethod interface any more.
22738 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22739 where we tranform them into FieldExprs if they are being resolved from within
22740 the declaring type.
22742 * ecore.cs (SimpleName.DoResolve): Do the same here.
22744 * assign.cs (DoResolve, Emit): Clean up code considerably.
22746 * ../errors/bug10.cs : Add.
22748 * ../errors/cs0070.cs : Add.
22750 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22752 * assign.cs : Get rid of EventIsLocal everywhere.
22754 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22756 * ecore.cs (ConvertIntLiteral): finished the implementation.
22758 * statement.cs (SwitchLabel): Convert the value we are using as a
22759 key before looking up the table.
22761 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22763 * codegen.cs (EmitTopBlock): Require a Location argument now.
22765 * cs-parser.jay (constructor_declarator): We need to setup
22766 current_local_parameters before we parse the
22767 opt_constructor_initializer, to allow the variables to be bound
22768 to the constructor arguments.
22770 * rootcontext.cs (LookupType): First lookup nested classes in our
22771 class and our parents before we go looking outside our class.
22773 * expression.cs (ConstantFold): Extract/debox the values at the
22776 * rootcontext.cs (EmitCode): Resolve the constants first before we
22777 resolve the types. This is not really needed, but it helps debugging.
22779 * statement.cs: report location.
22781 * cs-parser.jay: pass location to throw statement.
22783 * driver.cs: Small bug fix.
22785 * report.cs: Updated format to be 4-zero filled digits.
22787 2001-12-22 Ravi Pratap <ravi@ximian.com>
22789 * expression.cs (CheckIndices): Fix minor bug where the wrong
22790 variable was being referred to ;-)
22792 (DoEmit): Do not call EmitStaticInitializers when the
22793 underlying type is System.Object.
22795 2001-12-21 Ravi Pratap <ravi@ximian.com>
22797 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22798 and do the usual workaround for SRE.
22800 * class.cs (MyEventBuilder.EventType): New member to get at the type
22801 of the event, quickly.
22803 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22805 * assign.cs (Assign.DoResolve): Handle the case when the target
22806 is an EventExpr and perform the necessary checks.
22808 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22811 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22813 (EventExpr): Set the type in the constructor itself since we
22814 are meant to be born fully resolved.
22816 (EventExpr.Define): Revert code I wrote earlier.
22818 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22819 instance expression is null. The instance expression is a This in that case
22820 or a null, depending on whether it is a static method or not.
22822 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22823 refers to more than one method.
22825 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22826 and accordingly flag errors.
22828 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22830 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22832 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22834 * location.cs (ToString): Provide useful rutine.
22836 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22838 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22839 objects, return the actual integral boxed.
22841 * statement.cs (SwitchLabel): define an ILLabel for each
22844 (Switch.CheckSwitch): If the value is a Literal, extract
22845 the underlying literal.
22847 Also in the unused hashtable we had, add the SwitchLabel so we can
22848 quickly look this value up.
22850 * constant.cs: Implement a bunch of new constants. Rewrite
22851 Literal based on this. Made changes everywhere to adapt to this.
22853 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22854 dereferencing array only once, and also copes with enumrations.
22856 bytes are two bytes wide, not one.
22858 (Cast): Perform constant conversions.
22860 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22861 wrappers to the literals here.
22863 * expression.cs (DoNumericPromotions): long literals can converted
22864 to ulong implicity (this is taken care of elsewhere, but I was
22865 missing this spot).
22867 * ecore.cs (Expression.Literalize): Make the return type Literal,
22868 to improve type checking.
22870 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22872 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22874 * literal.cs: Revert code from ravi that checked the bounds. The
22875 bounds are sane by the definition of the type itself.
22877 * typemanager.cs: Fix implementation of ImplementsInterface. We
22878 need to actually look up in our parent hierarchy for interfaces
22881 * const.cs: Use the underlying type for enumerations
22883 * delegate.cs: Compute the basename for the delegate creation,
22884 that should fix the delegate test case, and restore the correct
22885 Type Lookup semantics in rootcontext
22887 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22888 referencing a nested type with the Reflection API is using the "+"
22891 * cs-parser.jay: Do not require EOF token at the end.
22893 2001-12-20 Ravi Pratap <ravi@ximian.com>
22895 * rootcontext.cs (LookupType): Concatenate type names with
22896 a '.' instead of a '+' The test suite passes again.
22898 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22899 field of the enumeration.
22901 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22902 the case when the member is an EventExpr.
22904 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22905 static has an associated instance expression.
22907 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22909 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22911 * class.cs (Event.Define): Register event and perform appropriate checks
22914 We define the Add and Remove methods even if the use provides none because
22915 in that case, we provide default implementations ourselves.
22917 Define a private field of the type of the event. This is done by the CSC compiler
22918 and we should be doing it too ;-)
22920 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22921 More methods we use in code we generate.
22923 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22926 (InitCoreTypes): Update accordingly for the above.
22928 * class.cs (Event.Emit): Generate code for default accessors that we provide
22930 (EmitDefaultMethod): Do the job in the above.
22932 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22935 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22937 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22938 builders even if we were missing one.
22940 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22941 pass the Basename as our class name instead of the Name. The
22942 basename will be correctly composed for us.
22944 * parameter.cs (Paramters): Now takes a Location argument.
22946 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22947 make all the code call directly LookupType in RootContext and take
22948 this chance to pass the Location information everywhere.
22950 * Everywhere: pass Location information.
22952 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22954 * class.cs (Constructor.Define): Updated way of detecting the
22955 length of the parameters.
22957 (TypeContainer.DefineType): Use basename as the type name for
22960 (TypeContainer.Define): Do not recursively define types here, as
22961 definition is taken care in order by the RootContext.
22963 * tree.cs: Keep track of namespaces in a per-file basis.
22965 * parameter.cs (Parameter.ComputeSignature): Update to use
22968 (Parameters.GetSignature): ditto.
22970 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22971 instead of a TypeContainer.
22973 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22974 resolve names. Because we need to be resolve in our context, not
22977 * driver.cs: Implement response files.
22979 * class.cs (TypeContainer.DefineType): If we are defined, do not
22980 redefine ourselves.
22982 (Event.Emit): Emit the code for add/remove handlers.
22983 (Event.Define): Save the MethodBuilders for add/remove.
22985 * typemanager.cs: Use pair here too.
22987 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22988 DictionaryEntry requires the first argument to be non-null.
22990 (enum_declaration): Compute full name for registering the
22993 (delegate_declaration): Instead of using
22994 formal_parameter_list, use opt_formal_parameter_list as the list
22997 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22998 (EventParsing): New property that controls whether `add' and
22999 `remove' are returned as tokens or identifiers (for events);
23001 2001-12-19 Ravi Pratap <ravi@ximian.com>
23003 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
23004 use MyEventBuilder only and let it wrap the real builder for us.
23006 (MyEventBuilder): Revamp constructor etc.
23008 Implement all operations that we perform on EventBuilder in precisely the same
23011 (FindMembers): Update to use the EventBuilder member.
23013 (Event.Emit): Update accordingly.
23015 2001-12-18 Ravi Pratap <ravi@ximian.com>
23017 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
23018 by calling the appropriate methods.
23020 (GetCustomAttributes): Make stubs as they cannot possibly do anything
23023 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
23025 2001-12-17 Ravi Pratap <ravi@ximian.com>
23027 * delegate.cs (Delegate.Populate): Check that the return type
23028 and various parameters types are indeed accessible.
23030 * class.cs (Constructor.Define): Same here.
23032 (Field.Define): Ditto.
23034 (Event.Define): Ditto.
23036 (Operator.Define): Check that the underlying Method defined itself
23037 correctly - so it's MethodBuilder should not be null.
23039 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
23040 expression happens to be null.
23042 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
23043 members but as of now we don't seem to be able to do anything really useful with it.
23045 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
23046 not the EventBuilder.
23048 2001-12-18 Miguel de Icaza <miguel@ximian.com>
23050 * cs-tokenizer.cs: Add support for defines.
23051 Add support for #if, #elif, #else, #endif
23053 (eval_var): evaluates a variable.
23054 (eval): stubbed for evaluating functions.
23056 * cs-parser.jay: Pass the defines information
23058 * driver.cs: Add --define command line option.
23060 * decl.cs: Move MemberCore here.
23062 Make it the base class for DeclSpace. This allows us to catch and
23063 report 108 and 109 for everything now.
23065 * class.cs (TypeContainer.Define): Extract all the members
23066 before populating and emit the warning 108 (new keyword required
23067 to override) instead of having each member implement this.
23069 (MemberCore.Define): New abstract method, we will be using this in
23070 the warning reporting engine in Populate.
23072 (Operator.Define): Adjust to new MemberCore protocol.
23074 * const.cs (Const): This does not derive from Expression, it is a
23075 temporary object we use to create fields, it is a MemberCore.
23077 * class.cs (Method.Define): Allow the entry point to be in a
23080 * driver.cs: Rewrite the argument handler to clean it up a bit.
23082 * rootcontext.cs: Made it just an auxiliary namespace feature by
23083 making everything static.
23085 * driver.cs: Adapt code to use RootContext type name instead of
23088 * delegate.cs: Remove RootContext argument.
23090 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
23093 * class.cs (Event.Define): The lookup can fail.
23095 * cs-tokenizer.cs: Begin implementation of pre-procesor.
23097 * expression.cs: Resolve the this instance before invoking the code.
23099 2001-12-17 Miguel de Icaza <miguel@ximian.com>
23101 * cs-parser.jay: Add a production in element_access that allows
23102 the thing to become a "type" reference. This way we can parse
23103 things like "(string [])" as a type.
23105 Note that this still does not handle the more complex rules of
23109 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
23111 * ecore.cs: (CopyNewMethods): new utility function used to
23112 assemble the list of methods from running FindMembers.
23114 (MemberLookup): Rework FindMembers so that
23116 2001-12-16 Miguel de Icaza <miguel@ximian.com>
23118 * class.cs (TypeContainer): Remove Delegates who fail to be
23121 * delegate.cs (Populate): Verify that we dont get null return
23122 values. TODO: Check for AsAccessible.
23124 * cs-parser.jay: Use basename to emit error 574 (destructor should
23125 have the same name as container class), not the full name.
23127 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
23128 possible representation.
23130 Also implements integer type suffixes U and L.
23132 2001-12-15 Miguel de Icaza <miguel@ximian.com>
23134 * expression.cs (ArrayCreation.DoResolve): We need to do the
23135 argument resolution *always*.
23137 * decl.cs: Make this hold the namespace. Hold the root context as
23139 (LookupType): Move here.
23141 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
23143 * location.cs (Row, Name): Fixed the code, it was always returning
23144 references to the first file.
23146 * interface.cs: Register properties defined through interfaces.
23148 * driver.cs: Add support for globbing on the command line
23150 * class.cs (Field): Make it derive from MemberCore as well.
23153 2001-12-15 Ravi Pratap <ravi@ximian.com>
23155 * class.cs (Event::Define): Check that the type of the event is a delegate
23156 type else flag error #66.
23158 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23161 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23162 values of EntryPoint, CharSet etc etc.
23164 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23166 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23167 be null and we should ignore this. I am not sure if this is really clean. Apparently,
23168 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23169 which needs this to do its work.
23171 * ../errors/cs0066.cs : Add.
23173 2001-12-14 Miguel de Icaza <miguel@ximian.com>
23175 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23178 * class.cs: (MethodSignature.MethodSignature): Removed hack that
23179 clears out the parameters field.
23180 (MemberSignatureCompare): Cleanup
23182 (MemberCore): New base class used to share code between MethodCore
23185 (RegisterRequiredImplementations) BindingFlags.Public requires
23186 either BindingFlags.Instace or Static. Use instance here.
23188 (Property): Refactored code to cope better with the full spec.
23190 * parameter.cs (GetParameterInfo): Return an empty array instead
23193 * class.cs (Property): Abstract or extern properties have no bodies.
23195 * parameter.cs (GetParameterInfo): return a zero-sized array.
23197 * class.cs (TypeContainer.MethodModifiersValid): Move all the
23198 method modifier validation to the typecontainer so we can reuse
23199 this on properties.
23201 (MethodCore.ParameterTypes): return an empty sized array of types.
23203 (Property.Define): Test property modifier validity.
23205 Add tests for sealed/override too.
23207 (Method.Emit): abstract or extern methods have no bodies.
23209 2001-12-14 Ravi Pratap <ravi@ximian.com>
23211 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23214 (Method::Define, ::Emit): Modify accordingly.
23216 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23218 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23220 * makefile: Pass in /unsafe.
23222 2001-12-13 Miguel de Icaza <miguel@ximian.com>
23224 * class.cs (MakeKey): Kill routine.
23226 * class.cs (TypeContainer.Define): Correctly define explicit
23227 method implementations (they require the full interface name plus
23230 * typemanager.cs: Deply the PtrHashtable here and stop using the
23231 lame keys. Things work so much better.
23233 This of course broke everyone who depended on `RegisterMethod' to
23234 do the `test for existance' test. This has to be done elsewhere.
23236 * support.cs (PtrHashtable): A hashtable that avoid comparing with
23237 the object stupid Equals method (because, that like fails all over
23238 the place). We still do not use it.
23240 * class.cs (TypeContainer.SetRequiredInterface,
23241 TypeContainer.RequireMethods): Killed these two routines and moved
23242 all the functionality to RegisterRequiredImplementations.
23244 (TypeContainer.RegisterRequiredImplementations): This routine now
23245 registers all the implementations required in an array for the
23246 interfaces and abstract methods. We use an array of structures
23247 which can be computed ahead of time to reduce memory usage and we
23248 also assume that lookups are cheap as most classes will not
23249 implement too many interfaces.
23251 We also avoid creating too many MethodSignatures.
23253 (TypeContainer.IsInterfaceMethod): Update and optionally does not
23254 clear the "pending" bit if we find that there are problems with
23257 (TypeContainer.VerifyPendingMethods): Update to report errors of
23258 methods that look like implementations but are not.
23260 (TypeContainer.Define): Add support for explicit interface method
23263 2001-12-12 Miguel de Icaza <miguel@ximian.com>
23265 * typemanager.cs: Keep track of the parameters here instead of
23266 being a feature of the TypeContainer.
23268 * class.cs: Drop the registration of parameters here, as
23269 InterfaceMethods are also interface declarations.
23271 * delegate.cs: Register methods with the TypeManager not only with
23272 the TypeContainer. This code was buggy.
23274 * interface.cs: Full registation here.
23276 2001-12-11 Miguel de Icaza <miguel@ximian.com>
23278 * expression.cs: Remove reducer for binary expressions, it can not
23281 * const.cs: Put here the code that used to go into constant.cs
23283 * constant.cs: Put here the code for constants, this is a new base
23284 class for Literals.
23286 * literal.cs: Make Literal derive from Constant.
23288 2001-12-09 Miguel de Icaza <miguel@ximian.com>
23290 * statement.cs (Return.Emit): Report error 157 if the user
23291 attempts to return from a finally block.
23293 (Return.Emit): Instead of emitting a return, jump to the end of
23296 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23297 LocalBuilder to store the result of the function. ReturnLabel is
23298 the target where we jump.
23301 2001-12-09 Radek Doulik <rodo@ximian.com>
23303 * cs-parser.jay: remember alias in current namespace
23305 * ecore.cs (SimpleName::DoResolve): use aliases for types or
23308 * class.cs (LookupAlias): lookup alias in my_namespace
23310 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23312 (LookupAlias): lookup alias in this and if needed in parent
23315 2001-12-08 Miguel de Icaza <miguel@ximian.com>
23319 * rootcontext.cs: (ModuleBuilder) Made static, first step into
23320 making things static. I need this to avoid passing the
23321 TypeContainer when calling ParameterType.
23323 * support.cs (InternalParameters.ParameterType): Remove ugly hack
23324 that did string manipulation to compute the type and then call
23325 GetType. Use Parameter.ParameterType instead.
23327 * cs-tokenizer.cs: Consume the suffix for floating values.
23329 * expression.cs (ParameterReference): figure out whether this is a
23330 reference parameter or not. Kill an extra variable by computing
23331 the arg_idx during emission.
23333 * parameter.cs (Parameters.GetParameterInfo): New overloaded
23334 function that returns whether a parameter is an out/ref value or not.
23336 (Parameter.ParameterType): The type of the parameter (base,
23337 without ref/out applied).
23339 (Parameter.Resolve): Perform resolution here.
23340 (Parameter.ExternalType): The full type (with ref/out applied).
23342 * statement.cs (Using.Emit, Using.EmitExpression): Implement
23343 support for expressions on the using statement.
23345 2001-12-07 Miguel de Icaza <miguel@ximian.com>
23347 * statement.cs (Using.EmitLocalVariableDecls): Split the
23348 localvariable handling of the using statement.
23350 (Block.EmitMeta): Keep track of variable count across blocks. We
23351 were reusing slots on separate branches of blocks.
23353 (Try.Emit): Emit the general code block, we were not emitting it.
23355 Check the type of the declaration to be an IDisposable or
23356 something that can be implicity converted to it.
23358 Emit conversions if required.
23360 * ecore.cs (EmptyExpression): New utility class.
23361 (Expression.ImplicitConversionExists): New utility function.
23363 2001-12-06 Miguel de Icaza <miguel@ximian.com>
23365 * statement.cs (Using): Implement.
23367 * expression.cs (LocalVariableReference): Support read only variables.
23369 * statement.cs: Remove the explicit emit for the Leave opcode.
23370 (VariableInfo): Add a readonly field.
23372 2001-12-05 Miguel de Icaza <miguel@ximian.com>
23374 * ecore.cs (ConvCast): new class used to encapsulate the various
23375 explicit integer conversions that works in both checked and
23376 unchecked contexts.
23378 (Expression.ConvertNumericExplicit): Use new ConvCast class to
23379 properly generate the overflow opcodes.
23381 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23383 * statement.cs: The correct type for the EmptyExpression is the
23384 element_type, not the variable type. Ravi pointed this out.
23386 2001-12-04 Ravi Pratap <ravi@ximian.com>
23388 * class.cs (Method::Define): Handle PInvoke methods specially
23389 by using DefinePInvokeMethod instead of the usual one.
23391 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23392 above to do the task of extracting information and defining the method.
23394 2001-12-04 Ravi Pratap <ravi@ximian.com>
23396 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23397 of the condition for string type.
23399 (Emit): Move that here.
23401 (ArrayCreation::CheckIndices): Keep string literals in their expression
23404 (EmitDynamicInitializers): Handle strings appropriately.
23406 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23408 * codegen.cs (EmitContext): Replace multiple variables with a
23409 single pointer to the current Switch statement.
23411 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23414 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23418 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23421 (Foreach.Emit): Foreach on arrays was not setting
23422 up the loop variables (for break/continue).
23424 (GotoCase): Semi-implented.
23426 2001-12-03 Ravi Pratap <ravi@ximian.com>
23428 * attribute.cs (CheckAttribute): Handle system attributes by using
23429 Attribute.GetAttributes to examine information we need.
23431 (GetValidPlaces): Same here.
23433 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23435 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23437 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23439 (Method::Define): Set appropriate flags if we have a DllImport attribute.
23441 (Method::Emit): Handle the case when we are a PInvoke method.
23443 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23445 * expression.cs: Use ResolveWithSimpleName on compound names.
23447 2001-12-02 Ravi Pratap <ravi@ximian.com>
23449 * constant.cs (EmitConstant): Make sure we resolve the associated expression
23450 before trying to reduce it.
23452 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23454 * constant.cs (LookupConstantValue): Implement.
23456 (EmitConstant): Use the above in emitting the constant.
23458 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23459 that are user-defined by doing a LookupConstantValue on them.
23461 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23464 2001-11-29 Miguel de Icaza <miguel@ximian.com>
23466 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23468 (BaseAccess.DoResolve): Implement.
23470 (MemberAccess.DoResolve): Split this routine into a
23471 ResolveMemberAccess routine that can be used independently
23473 2001-11-28 Miguel de Icaza <miguel@ximian.com>
23475 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23476 As that share bits of the implementation. Is returns a boolean,
23477 while As returns the Type that is being probed.
23479 2001-12-01 Ravi Pratap <ravi@ximian.com>
23481 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23482 instead of a Literal - much easier.
23484 (EnumInTransit): Remove - utterly useless :-)
23486 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23488 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23490 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23491 chain when we have no associated expression.
23493 2001-11-30 Ravi Pratap <ravi@ximian.com>
23495 * constant.cs (Define): Use Location while reporting the errror.
23497 Also emit a warning when 'new' is used and there is no inherited
23500 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
23503 (LookupEnumValue): Implement to lookup an enum member's value and define it
23506 (Populate): Re-write accordingly to use the above routine.
23508 2001-11-27 Miguel de Icaza <miguel@ximian.com>
23510 * expression.cs (This): Fix prototype for DoResolveLValue to
23511 override the base class DoResolveLValue.
23513 * cs-parser.cs: Report errors cs574 and cs575 (destructor
23516 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23517 (we need to load the address of the field here). This fixes
23520 (FieldExpr.DoResolveLValue): Call the DoResolve
23521 function to initialize the Instance expression.
23523 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23524 correctly the GetEnumerator operation on a value type.
23526 * cs-parser.jay: Add more simple parsing error catches.
23528 * statement.cs (Switch): Add support for string switches.
23529 Handle null specially.
23531 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
23533 2001-11-28 Ravi Pratap <ravi@ximian.com>
23535 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23537 (declare_local_constant): New helper function.
23539 * statement.cs (AddConstant): Keep a separate record of constants
23541 (IsConstant): Implement to determine if a variable is a constant.
23543 (GetConstantExpression): Implement.
23545 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23547 * statement.cs (IsVariableDefined): Re-write.
23549 2001-11-27 Ravi Pratap <ravi@ximian.com>
23551 * class.cs (TypeContainer::FindMembers): Look for constants
23552 in the case when we are looking for MemberTypes.Field
23554 * expression.cs (MemberAccess::DoResolve): Check that in the
23555 case we are a FieldExpr and a Literal, we are not being accessed
23556 by an instance reference.
23558 * cs-parser.jay (local_constant_declaration): Implement.
23560 (declaration_statement): Implement for constant declarations.
23562 2001-11-26 Miguel de Icaza <miguel@ximian.com>
23564 * statement.cs (Switch): Catch double defaults.
23566 (Switch): More work on the switch() statement
23567 implementation. It works for integral values now, need to finish
23571 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23573 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23574 integer literals into other integer literals. To be used by
23577 2001-11-24 Ravi Pratap <ravi@ximian.com>
23579 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23582 (EmitDynamicInitializers): Cope with the above since we extract data
23583 directly from ArrayData now.
23585 (ExpectInitializers): Keep track of whether initializers are mandatory
23588 (Bounds): Make it a hashtable to prevent the same dimension being
23589 recorded for every element in that dimension.
23591 (EmitDynamicInitializers): Fix bug which prevented the Set array method
23594 Also fix bug which was causing the indices to be emitted in the reverse
23597 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23599 * expression.cs (ArrayCreation): Implement the bits that Ravi left
23600 unfinished. They do not work, because the underlying code is
23603 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23605 * cs-parser.jay: Remove bogus fixme.
23607 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23608 on Switch statement.
23610 2001-11-23 Ravi Pratap <ravi@ximian.com>
23612 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23615 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23616 parameter. Apparently, any expression is allowed.
23618 (ValidateInitializers): Update accordingly.
23620 (CheckIndices): Fix some tricky bugs thanks to recursion.
23622 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
23623 I was being completely brain-dead.
23625 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23626 and re-write acordingly.
23628 (DelegateInvocation): Re-write accordingly.
23630 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23632 (MakeByteBlob): Handle types more correctly.
23634 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23635 initialization from expressions but it is incomplete because I am a complete
23638 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23640 * statement.cs (If.Emit): Fix a bug that generated incorrect code
23641 on If. Basically, we have to return `true' (ie, we do return to
23642 our caller) only if both branches of the if return.
23644 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23645 short-circuit operators, handle them as short circuit operators.
23647 (Cast.DoResolve): Resolve type.
23648 (Cast.Cast): Take an expression as the target type.
23650 * cs-parser.jay (cast_expression): Remove old hack that only
23651 allowed a limited set of types to be handled. Now we take a
23652 unary_expression and we resolve to a type during semantic
23655 Use the grammar productions from Rhys to handle casts (this is
23656 not complete like Rhys syntax yet, we fail to handle that corner
23657 case that C# has regarding (-x), but we will get there.
23659 2001-11-22 Ravi Pratap <ravi@ximian.com>
23661 * class.cs (EmitFieldInitializer): Take care of the case when we have a
23662 field which is an array type.
23664 * cs-parser.jay (declare_local_variables): Support array initialization too.
23666 * typemanager.cs (MakeKey): Implement.
23668 (everywhere): Use the above appropriately.
23670 * cs-parser.jay (for_statement): Update for array initialization while
23671 declaring variables.
23673 * ecore.cs : The error message was correct, it's the variable's names that
23674 were misleading ;-) Make the code more readable.
23676 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23677 the correct type etc.
23679 (ConvertExplicit): Handle Enum types by examining the underlying type.
23681 2001-11-21 Ravi Pratap <ravi@ximian.com>
23683 * parameter.cs (GetCallingConvention): Always return
23684 CallingConventions.Standard for now.
23686 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23688 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23689 and `r' after calling DoNumericPromotions.
23691 * ecore.cs: Fix error message (the types were in the wrong order).
23693 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23694 BindingFlags.Instance as well
23696 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23697 implicit int literal conversion in an empty cast so that we
23698 propagate the right type upstream.
23700 (UnboxCast): new class used to unbox value types.
23701 (Expression.ConvertExplicit): Add explicit type conversions done
23704 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23705 the target type before applying the implicit LongLiterals to ULong
23708 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23710 * cs-parser.jay (for_statement): Reworked the way For works: now
23711 we declare manually any variables that are introduced in
23712 for_initializer to solve the problem of having out-of-band code
23713 emition (that is what got for broken).
23715 (declaration_statement): Perform the actual variable declaration
23716 that used to be done in local_variable_declaration here.
23718 (local_variable_declaration): Do not declare anything, just pass
23719 the information on a DictionaryEntry
23721 2001-11-20 Ravi Pratap <ravi@ximian.com>
23723 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23724 re-write of the logic to now make it recursive.
23726 (UpdateIndices): Re-write accordingly.
23728 Store element data in a separate ArrayData list in the above methods.
23730 (MakeByteBlob): Implement to dump the array data into a byte array.
23732 2001-11-19 Ravi Pratap <ravi@ximian.com>
23734 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23737 * constant.cs (Define): Implement.
23739 (EmitConstant): Re-write fully.
23741 Pass in location info.
23743 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23746 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23747 DictionaryEntry since we need location info too.
23749 (constant_declaration): Update accordingly.
23751 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23752 code into another method : UpdateIndices.
23754 2001-11-18 Ravi Pratap <ravi@ximian.com>
23756 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23757 some type checking etc.
23759 2001-11-17 Ravi Pratap <ravi@ximian.com>
23761 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23762 bits to provide dimension info if the user skips doing that.
23764 Update second constructor to store the rank correctly.
23766 2001-11-16 Ravi Pratap <ravi@ximian.com>
23768 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23769 and try to implement.
23771 * ../errors/cs0150.cs : Add.
23773 * ../errors/cs0178.cs : Add.
23775 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23777 * statement.cs: Implement foreach on multi-dimensional arrays.
23779 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23780 name of the params argument.
23782 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23783 initializing the array.
23785 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23786 we can use this elsewhere.
23788 * statement.cs: Finish implementation of foreach for single
23791 * cs-parser.jay: Use an out-of-band stack to pass information
23792 around, I wonder why I need this.
23794 foreach_block: Make the new foreach_block the current_block.
23796 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23797 function used to return a static Parameters structure. Used for
23798 empty parameters, as those are created very frequently.
23800 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23802 2001-11-15 Ravi Pratap <ravi@ximian.com>
23804 * interface.cs : Default modifier is private, not public. The
23805 make verify test passes again.
23807 2001-11-15 Ravi Pratap <ravi@ximian.com>
23809 * support.cs (ReflectionParameters): Fix logic to determine
23810 whether the last parameter is a params one. Test 9 passes again.
23812 * delegate.cs (Populate): Register the builders we define with
23813 RegisterParameterForBuilder. Test 19 passes again.
23815 * cs-parser.jay (property_declaration): Reference $6 instead
23816 of $$ to get at the location.
23818 (indexer_declaration): Similar stuff.
23820 (attribute): Ditto.
23822 * class.cs (Property): Register parameters for the Get and Set methods
23823 if they exist. Test 23 passes again.
23825 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23826 call to EmitArguments as we are sure there aren't any params arguments.
23827 Test 32 passes again.
23829 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23830 IndexOutOfRangeException.
23832 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23833 Test 33 now passes again.
23835 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23837 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23838 broke a bunch of things. Will have to come up with a better way
23839 of tracking locations.
23841 * statement.cs: Implemented foreach for single dimension arrays.
23843 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23845 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23846 an error. This removes the lookup from the critical path.
23848 * cs-parser.jay: Removed use of temporary_loc, which is completely
23851 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23853 * support.cs (ReflectionParameters.ParameterModifier): Report
23854 whether the argument is a PARAMS argument or not.
23856 * class.cs: Set the attribute `ParamArrayAttribute' on the
23857 parameter argument.
23859 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23860 and cons_param_array_attribute (ConstructorInfo for
23861 ParamArrayAttribute).,
23863 * codegen.cs: Emit the return using the `Return' statement, that
23864 way we can report the error correctly for missing return values.
23866 * class.cs (Method.Emit): Clean up.
23868 * expression.cs (Argument.Resolve): Take another argument: the
23869 location where this argument is used. Notice that this is not
23870 part of the "Argument" class as to reduce the size of the
23871 structure (we know the approximate location anyways).
23873 Test if the argument is a variable-reference, if not, then
23874 complain with a 206.
23876 (Argument.Emit): Emit addresses of variables.
23878 (Argument.FullDesc): Simplify.
23880 (Invocation.DoResolve): Update for Argument.Resolve.
23882 (ElementAccess.DoResolve): ditto.
23884 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23885 method should be virtual, as this method is always virtual.
23887 (NewDelegate.DoResolve): Update for Argument.Resolve.
23889 * class.cs (ConstructorInitializer.DoResolve): ditto.
23891 * attribute.cs (Attribute.Resolve): ditto.
23893 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23895 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23897 * expression.cs (ParameterReference): Drop IStackStorage and implement
23898 IAssignMethod instead.
23900 (LocalVariableReference): ditto.
23902 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23903 IAssignMethod instead.
23905 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23907 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23908 enumerations that are used in heavily used structures derive from
23909 byte in a laughable and pathetic attempt to reduce memory usage.
23910 This is the kind of pre-optimzations that you should not do at
23911 home without adult supervision.
23913 * expression.cs (UnaryMutator): New class, used to handle ++ and
23914 -- separatedly from the other unary operators. Cleans up the
23915 code, and kills the ExpressionStatement dependency in Unary.
23917 (Unary): Removed `method' and `Arguments' from this class, making
23918 it smaller, and moving it all to SimpleCall, so I can reuse this
23919 code in other locations and avoid creating a lot of transient data
23920 strucutres when not required.
23922 * cs-parser.jay: Adjust for new changes.
23924 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23926 * enum.cs (Enum.Populate): If there is a failure during
23929 * cs-parser.jay (opt_enum_base): we used to catch type errors
23930 here, but this is really incorrect. The type error should be
23931 catched during semantic analysis.
23933 2001-12-11 Ravi Pratap <ravi@ximian.com>
23935 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23936 current_local_parameters as expected since I, in my stupidity, had forgotten
23939 * attribute.cs (GetValidPlaces): Fix stupid bug.
23941 * class.cs (Method::Emit): Perform check on applicability of attributes.
23943 (Constructor::Emit): Ditto.
23945 (Field::Emit): Ditto.
23947 (Field.Location): Store location information.
23949 (Property, Event, Indexer, Operator): Ditto.
23951 * cs-parser.jay (field_declaration): Pass in location for each field.
23953 * ../errors/cs0592.cs : Add.
23955 2001-11-12 Ravi Pratap <ravi@ximian.com>
23957 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23959 (InitCoreTypes): Update accordingly.
23961 (RegisterAttrType, LookupAttr): Implement.
23963 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23964 info about the same.
23966 (Resolve): Update to populate the above as necessary.
23968 (Error592): Helper.
23970 (GetValidPlaces): Helper to the above.
23972 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23974 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23976 2001-11-12 Ravi Pratap <ravi@ximian.com>
23978 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23980 * ../errors/cs0617.cs : Add.
23982 2001-11-11 Ravi Pratap <ravi@ximian.com>
23984 * enum.cs (Emit): Rename to Populate to be more consistent with what
23985 we expect it to do and when exactly it is called.
23987 * class.cs, rootcontext.cs : Update accordingly.
23989 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23990 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23992 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23994 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23995 of a fieldinfo using the above, when dealing with a FieldBuilder.
23997 2001-11-10 Ravi Pratap <ravi@ximian.com>
23999 * ../errors/cs0031.cs : Add.
24001 * ../errors/cs1008.cs : Add.
24003 * ../errrors/cs0543.cs : Add.
24005 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
24008 (FindMembers): Implement.
24010 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
24011 enums and delegates too.
24013 (enum_types): Rename to builder_to_enum.
24015 (delegate_types): Rename to builder_to_delegate.
24017 * delegate.cs (FindMembers): Implement.
24019 2001-11-09 Ravi Pratap <ravi@ximian.com>
24021 * typemanager.cs (IsEnumType): Implement.
24023 * enum.cs (Emit): Re-write parts to account for the underlying type
24024 better and perform checking etc.
24026 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
24027 of the underlying type.
24029 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
24032 * enum.cs (error31): Helper to report error #31.
24034 * cs-parser.jay (enum_declaration): Store location of each member too.
24036 * enum.cs (member_to_location): New hashtable.
24038 (AddEnumMember): Update location hashtable.
24040 (Emit): Use the location of each member while reporting errors.
24042 2001-11-09 Miguel de Icaza <miguel@ximian.com>
24044 * cs-parser.jay: A for_initializer if is a
24045 local_variable_declaration really ammount to have an implicit
24046 block with the variable declaration and no initializer for for.
24048 * statement.cs (For.Emit): Cope with null initializers.
24050 This fixes the infinite loop on for initializers.
24052 2001-11-08 Miguel de Icaza <miguel@ximian.com>
24054 * enum.cs: More cleanup.
24056 * ecore.cs: Remove dead code.
24058 * class.cs (Property.Emit): More simplification.
24059 (Event.Emit): ditto.
24061 Reworked to have less levels of indentation.
24063 2001-11-08 Ravi Pratap <ravi@ximian.com>
24065 * class.cs (Property): Emit attributes.
24075 * enum.cs (Emit): Ditto.
24077 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
24080 * class.cs (Field, Event, etc.): Move attribute generation into the
24081 Emit method everywhere.
24083 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
24084 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
24085 as we had no way of defining nested enums !
24087 * rootcontext.cs : Adjust code accordingly.
24089 * typemanager.cs (AddEnumType): To keep track of enum types separately.
24091 2001-11-07 Ravi Pratap <ravi@ximian.com>
24093 * expression.cs (EvalConstantExpression): Move into ecore.cs
24095 * enum.cs (Enum): Rename some members and make them public and readonly
24096 according to our convention.
24098 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
24101 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
24103 (Enum::Emit): Write a simple version for now which doesn't try to compute
24104 expressions. I shall modify this to be more robust in just a while.
24106 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
24108 (TypeContainer::CloseType): Create the Enum types too.
24110 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
24112 * expression.cs (EvalConstantExpression): Get rid of completely.
24114 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
24115 user-defined values and other cases.
24117 (IsValidEnumLiteral): Helper function.
24119 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
24120 out there in the case we had a literal FieldExpr.
24122 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
24124 (Literalize): Revamp a bit to take two arguments.
24126 (EnumLiteral): New class which derives from Literal to wrap enum literals.
24128 2001-11-06 Ravi Pratap <ravi@ximian.com>
24130 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
24132 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
24134 (Resolve): Use the above to ensure we have proper initializers.
24136 2001-11-05 Ravi Pratap <ravi@ximian.com>
24138 * expression.cs (Expression::EvalConstantExpression): New method to
24139 evaluate constant expressions.
24141 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
24143 2001-11-07 Miguel de Icaza <miguel@ximian.com>
24145 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
24148 (Binary.ResolveOperator): Handle operator != (object a, object b)
24149 and operator == (object a, object b);
24151 (Binary.DoNumericPromotions): Indicate whether the numeric
24152 promotion was possible.
24154 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
24157 Made the ArrayAccess implement interface IAssignMethod instead of
24158 IStackStore as the order in which arguments are passed reflects
24161 * assign.cs: Instead of using expr.ExprClass to select the way of
24162 assinging, probe for the IStackStore/IAssignMethod interfaces.
24164 * typemanager.cs: Load InitializeArray definition.
24166 * rootcontext.cs (RootContext.MakeStaticData): Used to define
24167 static data that can be used to initialize arrays.
24169 2001-11-05 Miguel de Icaza <miguel@ximian.com>
24171 * expression.cs: Handle operator== and operator!= for booleans.
24173 (Conditioal.Reduce): Implement reducer for the ?: operator.
24175 (Conditional.Resolve): Implement dead code elimination.
24177 (Binary.Resolve): Catch string literals and return a new
24178 concatenated string.
24180 (Unary.Reduce): Implement reduction of unary expressions.
24182 * ecore.cs: Split out the expression core handling here.
24184 (Expression.Reduce): New method used to perform constant folding
24185 and CSE. This is needed to support constant-expressions.
24187 * statement.cs (Statement.EmitBoolExpression): Pass true and false
24188 targets, and optimize for !x.
24190 2001-11-04 Ravi Pratap <ravi@ximian.com>
24192 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24193 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24194 set custom atttributes.
24196 * literal.cs (Literal::GetValue): New abstract method to return the actual
24197 value of the literal, cast as an object.
24199 (*Literal): Implement GetValue method.
24201 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24202 expressions to the arraylist but objects of type Argument.
24204 * class.cs (TypeContainer::Emit): Emit our attributes too.
24206 (Method::Emit, Constructor::Emit): Ditto.
24208 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24209 to be ignoring earlier.
24211 2001-11-03 Ravi Pratap <ravi@ximian.com>
24213 * attribute.cs (AttributeSection::Define): Implement to do the business
24214 of constructing a CustomAttributeBuilder.
24216 (Attribute): New trivial class. Increases readability of code.
24218 * cs-parser.jay : Update accordingly.
24220 (positional_argument_list, named_argument_list, named_argument): New rules
24222 (attribute_arguments): Use the above so that we are more correct.
24224 2001-11-02 Ravi Pratap <ravi@ximian.com>
24226 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24227 to perform all checks for a method with a params parameter.
24229 (Invocation::OverloadResolve): Update to use the above method and therefore
24230 cope correctly with params method invocations.
24232 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
24235 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24236 constructors in our parent too because we can't afford to miss out on
24239 * attribute.cs (AttributeSection): New name for the class Attribute
24241 Other trivial changes to improve readability.
24243 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24244 use the new class names.
24246 2001-11-01 Ravi Pratap <ravi@ximian.com>
24248 * class.cs (Method::Define): Complete definition for params types too
24250 (Indexer::Define): Ditto.
24252 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24253 Cope everywhere with a request for info about the array parameter.
24255 2001-11-01 Ravi Pratap <ravi@ximian.com>
24257 * tree.cs (RecordNamespace): Fix up to check for the correct key.
24259 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
24260 local_variable_type to extract the string corresponding to the type.
24262 (local_variable_type): Fixup the action to use the new helper method.
24264 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
24267 * expression.cs : Clean out code which uses the above.
24269 2001-10-31 Ravi Pratap <ravi@ximian.com>
24271 * typemanager.cs (RegisterMethod): Check if we already have an existing key
24272 and bale out if necessary by returning a false.
24274 (RegisterProperty): Ditto.
24276 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24277 and print out appropriate error messages.
24279 * interface.cs (everywhere): Ditto.
24281 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24282 location to constructor.
24284 * class.cs (Property, Event, Indexer): Update accordingly.
24286 * ../errors/cs111.cs : Added.
24288 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24289 of a method, as laid down by the spec.
24291 (Invocation::OverloadResolve): Use the above method.
24293 2001-10-31 Ravi Pratap <ravi@ximian.com>
24295 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24296 now take a TypeContainer and a Parameters object.
24298 (ParameterData): Modify return type of ParameterModifier method to be
24299 Parameter.Modifier and not a string.
24301 (ReflectionParameters, InternalParameters): Update accordingly.
24303 * expression.cs (Argument::GetParameterModifier): Same here.
24305 * support.cs (InternalParameters::ParameterType): Find a better way of determining
24306 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24307 symbol in it at all so maybe this is only for now.
24309 2001-10-30 Ravi Pratap <ravi@ximian.com>
24311 * support.cs (InternalParameters): Constructor now takes an extra argument
24312 which is the actual Parameters class.
24314 (ParameterDesc): Update to provide info on ref/out modifiers.
24316 * class.cs (everywhere): Update call to InternalParameters to pass in
24317 the second argument too.
24319 * support.cs (ParameterData): Add ParameterModifier, which is a method
24320 to return the modifier info [ref/out etc]
24322 (InternalParameters, ReflectionParameters): Implement the above.
24324 * expression.cs (Argument::ParameterModifier): Similar function to return
24325 info about the argument's modifiers.
24327 (Invocation::OverloadResolve): Update to take into account matching modifiers
24330 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24331 a new SetFormalParameters object which we pass to InternalParameters.
24333 2001-10-30 Ravi Pratap <ravi@ximian.com>
24335 * expression.cs (NewArray): Merge into the ArrayCreation class.
24337 2001-10-29 Ravi Pratap <ravi@ximian.com>
24339 * expression.cs (NewArray): Merge classes NewBuiltinArray and
24340 NewUserdefinedArray into one as there wasn't much of a use in having
24343 * expression.cs (Argument): Change field's name to ArgType from Type.
24345 (Type): New readonly property which returns the proper type, taking into
24346 account ref/out modifiers.
24348 (everywhere): Adjust code accordingly for the above.
24350 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24351 whether we are emitting for a ref or out parameter.
24353 * expression.cs (Argument::Emit): Use the above field to set the state.
24355 (LocalVariableReference::Emit): Update to honour the flag and emit the
24358 * parameter.cs (Attributes): Set the correct flags for ref parameters.
24360 * expression.cs (Argument::FullDesc): New function to provide a full desc.
24362 * support.cs (ParameterData): Add method ParameterDesc to the interface.
24364 (ReflectionParameters, InternalParameters): Implement the above method.
24366 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24369 (Invocation::FullMethodDesc): Ditto.
24371 2001-10-29 Miguel de Icaza <miguel@ximian.com>
24373 * cs-parser.jay: Add extra production for the second form of array
24376 * expression.cs (ArrayCreation): Update to reflect the above
24379 * Small changes to prepare for Array initialization.
24381 2001-10-28 Miguel de Icaza <miguel@ximian.com>
24383 * typemanager.cs (ImplementsInterface): interface might be null;
24384 Deal with this problem;
24386 Also, we do store negative hits on the cache (null values), so use
24387 this instead of calling t.GetInterfaces on the type everytime.
24389 2001-10-28 Ravi Pratap <ravi@ximian.com>
24391 * typemanager.cs (IsBuiltinType): New method to help determine the same.
24393 * expression.cs (New::DoResolve): Get rid of array creation code and instead
24394 split functionality out into different classes.
24396 (New::FormArrayType): Move into NewBuiltinArray.
24398 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24401 (NewBuiltinArray): New class to handle creation of built-in arrays.
24403 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24404 account creation of one-dimensional arrays.
24406 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24408 (NewUserdefinedArray::DoResolve): Implement.
24410 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24412 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24413 we maintain inside the TypeManager. This is necessary to perform lookups on the
24416 (LookupType): Update to perform GetType on the module builders too.
24418 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24420 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24422 2001-10-23 Ravi Pratap <ravi@ximian.com>
24424 * expression.cs (New::DoResolve): Implement guts of array creation.
24426 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24428 2001-10-27 Miguel de Icaza <miguel@ximian.com>
24430 * expression.cs: Fix bug I introduced lsat night that broke
24433 (Expression.Resolve): Report a 246 error (can not resolve name)
24434 if we find a SimpleName in the stream.
24436 (Expression.ResolveLValue): Ditto.
24438 (Expression.ResolveWithSimpleName): This function is a variant of
24439 ResolveName, this one allows SimpleNames to be returned without a
24440 warning. The only consumer of SimpleNames is MemberAccess
24442 2001-10-26 Miguel de Icaza <miguel@ximian.com>
24444 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24445 might arrive here. I have my doubts that this is correct.
24447 * statement.cs (Lock): Implement lock statement.
24449 * cs-parser.jay: Small fixes to support `lock' and `using'
24451 * cs-tokenizer.cs: Remove extra space
24453 * driver.cs: New flag --checked, allows to turn on integer math
24456 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24457 Threading.Monitor.Exit
24459 2001-10-23 Miguel de Icaza <miguel@ximian.com>
24461 * expression.cs (IndexerAccess::DoResolveLValue): Set the
24462 Expression Class to be IndexerAccess.
24464 Notice that Indexer::DoResolve sets the eclass to Value.
24466 2001-10-22 Miguel de Icaza <miguel@ximian.com>
24468 * class.cs (TypeContainer::Emit): Emit code for indexers.
24470 * assign.cs (IAssignMethod): New interface implemented by Indexers
24471 and Properties for handling assignment.
24473 (Assign::Emit): Simplify and reuse code.
24475 * expression.cs (IndexerAccess, PropertyExpr): Implement
24476 IAssignMethod, clean up old code.
24478 2001-10-22 Ravi Pratap <ravi@ximian.com>
24480 * typemanager.cs (ImplementsInterface): New method to determine if a type
24481 implements a given interface. Provides a nice cache too.
24483 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24486 (ConvertReferenceExplicit): Ditto.
24488 * delegate.cs (Delegate::Populate): Update to define the parameters on the
24489 various methods, with correct names etc.
24491 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
24492 Operator.UnaryNegation.
24494 * cs-parser.jay (operator_declarator): Be a little clever in the case where
24495 we have a unary plus or minus operator.
24497 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
24500 * everywhere : update accordingly.
24502 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24505 * class.cs (Method::Define): For the case where we are implementing a method
24506 inherited from an interface, we need to set the MethodAttributes.Final flag too.
24507 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24509 2001-10-21 Ravi Pratap <ravi@ximian.com>
24511 * interface.cs (FindMembers): Implement to work around S.R.E
24514 * typemanager.cs (IsInterfaceType): Implement.
24516 (FindMembers): Update to handle interface types too.
24518 * expression.cs (ImplicitReferenceConversion): Re-write bits which
24519 use IsAssignableFrom as that is not correct - it doesn't work.
24521 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24522 and accordingly override EmitStatement.
24524 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24525 using the correct logic :-)
24527 2001-10-19 Ravi Pratap <ravi@ximian.com>
24529 * ../errors/cs-11.cs : Add to demonstrate error -11
24531 2001-10-17 Miguel de Icaza <miguel@ximian.com>
24533 * assign.cs (Assign::Resolve): Resolve right hand side first, and
24534 then pass this as a hint to ResolveLValue.
24536 * expression.cs (FieldExpr): Add Location information
24538 (FieldExpr::LValueResolve): Report assignment to readonly
24541 (Expression::ExprClassFromMemberInfo): Pass location information.
24543 (Expression::ResolveLValue): Add new method that resolves an
24546 (Expression::DoResolveLValue): Default invocation calls
24549 (Indexers): New class used to keep track of indexers in a given
24552 (IStackStore): Renamed from LValue, as it did not really describe
24553 what this did. Also ResolveLValue is gone from this interface and
24554 now is part of Expression.
24556 (ElementAccess): Depending on the element access type
24558 * typemanager.cs: Add `indexer_name_type' as a Core type
24559 (System.Runtime.CompilerServices.IndexerNameAttribute)
24561 * statement.cs (Goto): Take a location.
24563 2001-10-18 Ravi Pratap <ravi@ximian.com>
24565 * delegate.cs (Delegate::VerifyDelegate): New method to verify
24566 if two delegates are compatible.
24568 (NewDelegate::DoResolve): Update to take care of the case when
24569 we instantiate a delegate from another delegate.
24571 * typemanager.cs (FindMembers): Don't even try to look up members
24572 of Delegate types for now.
24574 2001-10-18 Ravi Pratap <ravi@ximian.com>
24576 * delegate.cs (NewDelegate): New class to take care of delegate
24579 * expression.cs (New): Split the delegate related code out into
24580 the NewDelegate class.
24582 * delegate.cs (DelegateInvocation): New class to handle delegate
24585 * expression.cs (Invocation): Split out delegate related code into
24586 the DelegateInvocation class.
24588 2001-10-17 Ravi Pratap <ravi@ximian.com>
24590 * expression.cs (New::DoResolve): Implement delegate creation fully
24591 and according to the spec.
24593 (New::DoEmit): Update to handle delegates differently.
24595 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24596 because of which we were printing out arguments in reverse order !
24598 * delegate.cs (VerifyMethod): Implement to check if the given method
24599 matches the delegate.
24601 (FullDelegateDesc): Implement.
24603 (VerifyApplicability): Implement.
24605 * expression.cs (Invocation::DoResolve): Update to accordingly handle
24606 delegate invocations too.
24608 (Invocation::Emit): Ditto.
24610 * ../errors/cs1593.cs : Added.
24612 * ../errors/cs1594.cs : Added.
24614 * delegate.cs (InstanceExpression, TargetMethod): New properties.
24616 2001-10-16 Ravi Pratap <ravi@ximian.com>
24618 * typemanager.cs (intptr_type): Core type for System.IntPtr
24620 (InitCoreTypes): Update for the same.
24622 (iasyncresult_type, asynccallback_type): Ditto.
24624 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24627 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24630 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24631 the builders for the 4 members of a delegate type :-)
24633 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24636 * expression.cs (New::DoResolve): Implement guts for delegate creation.
24638 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24640 2001-10-15 Miguel de Icaza <miguel@ximian.com>
24642 * statement.cs (Break::Emit): Implement.
24643 (Continue::Emit): Implement.
24645 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
24646 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
24647 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
24648 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
24651 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24652 properties that track the label for the current loop (begin of the
24653 loop and end of the loop).
24655 2001-10-15 Ravi Pratap <ravi@ximian.com>
24657 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24658 use of emitting anything at all.
24660 * class.cs, rootcontext.cs : Get rid of calls to the same.
24662 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24664 (Populate): Define the constructor correctly and set the implementation
24667 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24670 (AddDelegateType): Implement.
24672 (IsDelegateType): Implement helper method.
24674 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24676 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24677 and accordingly handle it.
24679 * delegate.cs (Populate): Take TypeContainer argument.
24680 Implement bits to define the Invoke method. However, I still haven't figured out
24681 how to take care of the native int bit :-(
24683 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24684 Qualify the name of the delegate, not its return type !
24686 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24689 (StandardConversionExists): Checking for array types turns out to be recursive.
24691 (ConvertReferenceExplicit): Implement array conversion.
24693 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24695 2001-10-12 Ravi Pratap <ravi@ximian.com>
24697 * cs-parser.jay (delegate_declaration): Store the fully qualified
24698 name as it is a type declaration.
24700 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24703 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24704 as TypeContainer::DefineType.
24706 (Populate): Method in which all the definition of the various methods (Invoke)
24709 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24712 (CloseDelegate): Finally creates the delegate.
24714 * class.cs (TypeContainer::DefineType): Update to define delegates.
24715 (Populate, Emit and CloseType): Do the same thing here too.
24717 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24718 delegates in all these operations.
24720 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24722 * expression.cs: LocalTemporary: a new expression used to
24723 reference a temporary that has been created.
24725 * assign.cs: Handle PropertyAccess back here, so that we can
24726 provide the proper semantic access to properties.
24728 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24729 a few more explicit conversions.
24731 * modifiers.cs: `NEW' modifier maps to HideBySig.
24733 * expression.cs (PropertyExpr): Make this into an
24734 ExpressionStatement, and support the EmitStatement code path.
24736 Perform get/set error checking, clean up the interface.
24738 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24739 them into toplevel access objects.
24741 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24743 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24746 * typemanager.cs: Keep track here of our PropertyBuilders again to
24747 work around lameness in SRE.
24749 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24751 * expression.cs (LValue::LValueResolve): New method in the
24752 interface, used to perform a second resolution pass for LValues.
24754 (This::DoResolve): Catch the use of this in static methods.
24756 (This::LValueResolve): Implement.
24758 (This::Store): Remove warning, assigning to `this' in structures
24761 (Invocation::Emit): Deal with invocation of
24762 methods on value types. We need to pass the address to structure
24763 methods rather than the object itself. (The equivalent code to
24764 emit "this" for structures leaves the entire structure on the
24765 stack instead of a pointer to it).
24767 (ParameterReference::DoResolve): Compute the real index for the
24768 argument based on whether the method takes or not a `this' pointer
24769 (ie, the method is static).
24771 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24772 value types returned from functions when we need to invoke a
24773 method on the sturcture.
24776 2001-10-11 Ravi Pratap <ravi@ximian.com>
24778 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24779 defining the type in the Modulebuilder or Typebuilder. This is to take
24780 care of nested types which need to be defined on the TypeBuilder using
24781 DefineNestedMethod.
24783 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24784 methods in RootContext, only ported to be part of TypeContainer.
24786 (TypeContainer::GetInterfaceOrClass): Ditto.
24788 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24790 * interface.cs (Interface::DefineInterface): New method. Does exactly
24791 what RootContext.CreateInterface did earlier, only it takes care of nested types
24794 (Interface::GetInterfaces): Move from RootContext here and port.
24796 (Interface::GetInterfaceByName): Same here.
24798 * rootcontext.cs (ResolveTree): Re-write.
24800 (PopulateTypes): Re-write.
24802 * class.cs (TypeContainer::Populate): Populate nested types too.
24803 (TypeContainer::Emit): Emit nested members too.
24805 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24806 instead just use the name argument passed in as it is already fully
24809 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24810 to TypeContainer mapping to see if a type is user-defined.
24812 * class.cs (TypeContainer::CloseType): Implement.
24814 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24815 the default constructor.
24817 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24820 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24822 * interface.cs (CloseType): Create the type here.
24824 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24827 Remove all the methods which are now in TypeContainer.
24829 2001-10-10 Ravi Pratap <ravi@ximian.com>
24831 * delegate.cs (Define): Re-write bits to define the delegate
24834 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24836 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24838 * expression.cs (ImplicitReferenceConversion): handle null as well
24839 as a source to convert to any reference type.
24841 * statement.cs (Return): Perform any implicit conversions to
24842 expected return type.
24844 Validate use of return statement.
24846 * codegen.cs (EmitContext): Pass the expected return type here.
24848 * class.cs (Method, Constructor, Property): Pass expected return
24849 type to EmitContext.
24851 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24853 * expression.cs: Make DoResolve take an EmitContext instead of a
24856 Replaced `l' and `location' for `loc', for consistency.
24858 (Error, Warning): Remove unneeded Tc argument.
24860 * assign.cs, literal.cs, constant.cs: Update to new calling
24863 * codegen.cs: EmitContext now contains a flag indicating whether
24864 code is being generated in a static method or not.
24866 * cs-parser.jay: DecomposeQI, new function that replaces the old
24867 QualifiedIdentifier. Now we always decompose the assembled
24868 strings from qualified_identifier productions into a group of
24871 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24873 * rootcontext.cs: Deal with field-less struct types correctly now
24874 by passing the size option to Define Type.
24876 * class.cs: Removed hack that created one static field.
24878 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24880 * statement.cs: Moved most of the code generation here.
24882 2001-10-09 Ravi Pratap <ravi@ximian.com>
24884 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24887 (ElementAccess): Remove useless bits for now - keep checks as the spec
24890 2001-10-08 Ravi Pratap <ravi@ximian.com>
24892 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24893 and start performing checks according to the spec.
24895 2001-10-07 Ravi Pratap <ravi@ximian.com>
24897 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24898 rank_specifiers instead.
24900 (rank_specifiers): Change the order in which the rank specifiers are stored
24902 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24904 * expression.cs (ElementAccess): Implement the LValue interface too.
24906 2001-10-06 Ravi Pratap <ravi@ximian.com>
24908 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24909 except that user defined conversions are not included.
24911 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
24912 perform the conversion of the return type, if necessary.
24914 (New::DoResolve): Check whether we are creating an array or an object
24915 and accordingly do the needful.
24917 (New::Emit): Same here.
24919 (New::DoResolve): Implement guts of array creation.
24921 (New::FormLookupType): Helper function.
24923 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24925 * codegen.cs: Removed most of the code generation here, and move the
24926 corresponding code generation bits to the statement classes.
24928 Added support for try/catch/finalize and throw.
24930 * cs-parser.jay: Added support for try/catch/finalize.
24932 * class.cs: Catch static methods having the flags override,
24933 virtual or abstract.
24935 * expression.cs (UserCast): This user cast was not really doing
24936 what it was supposed to do. Which is to be born in fully resolved
24937 state. Parts of the resolution were being performed at Emit time!
24941 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24943 * expression.cs: Implicity convert the result from UserCast.
24945 2001-10-05 Ravi Pratap <ravi@ximian.com>
24947 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24948 prevented it from working correctly.
24950 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24951 merely ConvertImplicit.
24953 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24955 * typemanager.cs: Make the LookupTypeContainer function static,
24956 and not per-instance.
24958 * class.cs: Make static FindMembers (the one that takes a Type
24961 * codegen.cs: Add EmitForeach here.
24963 * cs-parser.jay: Make foreach a toplevel object instead of the
24964 inline expansion, as we need to perform semantic analysis on it.
24966 2001-10-05 Ravi Pratap <ravi@ximian.com>
24968 * expression.cs (Expression::ImplicitUserConversion): Rename to
24969 UserDefinedConversion.
24971 (Expression::UserDefinedConversion): Take an extra argument specifying
24972 whether we look for explicit user conversions too.
24974 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24976 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24978 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24979 with the appropriate arguments.
24981 * cs-parser.jay (cast_expression): Record location too.
24983 * expression.cs (Cast): Record location info.
24985 (Expression::ConvertExplicit): Take location argument.
24987 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24988 to determine if we are doing explicit conversions.
24990 (UserCast::Emit): Update accordingly.
24992 (Expression::ConvertExplicit): Report an error if everything fails.
24994 * ../errors/cs0030.cs : Add.
24996 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24998 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24999 virtual and newslot bits.
25001 * class.cs (TypeContainer::RegisterRequiredImplementations):
25002 Record methods we need.
25004 (TypeContainer::MakeKey): Helper function to make keys for
25005 MethodBases, since the Methodbase key is useless.
25007 (TypeContainer::Populate): Call RegisterRequiredImplementations
25008 before defining the methods.
25010 Create a mapping for method_builders_to_methods ahead of time
25011 instead of inside a tight loop.
25013 (::RequireMethods): Accept an object as the data to set into the
25014 hashtable so we can report interface vs abstract method mismatch.
25016 2001-10-03 Miguel de Icaza <miguel@ximian.com>
25018 * report.cs: Make all of it static.
25020 * rootcontext.cs: Drop object_type and value_type computations, as
25021 we have those in the TypeManager anyways.
25023 Drop report instance variable too, now it is a global.
25025 * driver.cs: Use try/catch on command line handling.
25027 Add --probe option to debug the error reporting system with a test
25030 * report.cs: Add support for exiting program when a probe
25031 condition is reached.
25033 2001-10-03 Ravi Pratap <ravi@ximian.com>
25035 * expression.cs (Binary::DoNumericPromotions): Fix the case when
25036 we do a forcible conversion regardless of type, to check if
25037 ForceConversion returns a null.
25039 (Binary::error19): Use location to report error.
25041 (Unary::error23): Use location here too.
25043 * ../errors/cs0019.cs : Check in.
25045 * ../errors/cs0023.cs : Check in.
25047 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
25048 case of a non-null MethodInfo object with a length of 0 !
25050 (Binary::ResolveOperator): Flag error if overload resolution fails to find
25051 an applicable member - according to the spec :-)
25052 Also fix logic to find members in base types.
25054 (Unary::ResolveOperator): Same here.
25056 (Unary::report23): Change name to error23 and make first argument a TypeContainer
25057 as I was getting thoroughly confused between this and error19 :-)
25059 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
25060 (::FindMostEncompassedType): Implement.
25061 (::FindMostEncompassingType): Implement.
25062 (::StandardConversionExists): Implement.
25064 (UserImplicitCast): Re-vamp. We now need info about most specific
25065 source and target types so that we can do the necessary conversions.
25067 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
25068 mathematical union with no duplicates.
25070 2001-10-03 Miguel de Icaza <miguel@ximian.com>
25072 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
25073 in order from base classes to child classes, so that we can in
25074 child classes look up in our parent for method names and
25075 attributes (required for handling abstract, virtual, new, override
25076 constructs: we need to instrospect our base class, and if we dont
25077 populate the classes in order, the introspection might be
25078 incorrect. For example, a method could query its parent before
25079 the parent has any methods and would determine that the parent has
25080 no abstract methods (while it could have had them)).
25082 (RootContext::CreateType): Record the order in which we define the
25085 2001-10-02 Miguel de Icaza <miguel@ximian.com>
25087 * class.cs (TypeContainer::Populate): Also method definitions can
25088 fail now, keep track of this.
25090 (TypeContainer::FindMembers): Implement support for
25091 DeclaredOnly/noDeclaredOnly flag.
25093 (Constructor::Emit) Return the ConstructorBuilder.
25095 (Method::Emit) Return the MethodBuilder.
25096 Check for abstract or virtual methods to be public.
25098 * rootcontext.cs (RootContext::CreateType): Register all the
25099 abstract methods required for the class to be complete and the
25100 interface methods that must be implemented.
25102 * cs-parser.jay: Report error 501 (method requires body if it is
25103 not marked abstract or extern).
25105 * expression.cs (TypeOf::Emit): Implement.
25107 * typemanager.cs: runtime_handle_type, new global type.
25109 * class.cs (Property::Emit): Generate code for properties.
25111 2001-10-02 Ravi Pratap <ravi@ximian.com>
25113 * expression.cs (Unary::ResolveOperator): Find operators on base type
25114 too - we now conform exactly to the spec.
25116 (Binary::ResolveOperator): Same here.
25118 * class.cs (Operator::Define): Fix minor quirk in the tests.
25120 * ../errors/cs0215.cs : Added.
25122 * ../errors/cs0556.cs : Added.
25124 * ../errors/cs0555.cs : Added.
25126 2001-10-01 Miguel de Icaza <miguel@ximian.com>
25128 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
25129 single integer which is really efficient
25131 2001-10-01 Ravi Pratap <ravi@ximian.com>
25133 * expression.cs (Expression::ImplicitUserConversion): Use location
25134 even in the case when we are examining True operators.
25136 * class.cs (Operator::Define): Perform extensive checks to conform
25137 with the rules for operator overloading in the spec.
25139 * expression.cs (Expression::ImplicitReferenceConversion): Implement
25140 some of the other conversions mentioned in the spec.
25142 * typemanager.cs (array_type): New static member for the System.Array built-in
25145 (cloneable_interface): For System.ICloneable interface.
25147 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
25148 we start resolving the tree and populating types.
25150 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
25152 2001-10-01 Miguel de Icaza <miguel@ximian.com>
25154 * expression.cs (Expression::ExprClassFromMemberInfo,
25155 Expression::Literalize): Create literal expressions from
25156 FieldInfos which are literals.
25158 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25159 type casts, because they were wrong. The test suite in tests
25162 (ImplicitNumericConversion): ushort to ulong requires a widening
25165 Int32 constant to long requires widening cast as well.
25167 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25168 for integers because the type on the stack is not i4.
25170 2001-09-30 Miguel de Icaza <miguel@ximian.com>
25172 * expression.cs (report118): require location argument.
25174 * parameter.cs: Do not dereference potential null value.
25176 * class.cs: Catch methods that lack the `new' keyword when
25177 overriding a name. Report warnings when `new' is used without
25178 anything being there to override.
25180 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25182 * class.cs: Only add constructor to hashtable if it is non-null
25183 (as now constructors can fail on define).
25185 (TypeManager, Class, Struct): Take location arguments.
25187 Catch field instance initialization in structs as errors.
25189 accepting_filter: a new filter for FindMembers that is static so
25190 that we dont create an instance per invocation.
25192 (Constructor::Define): Catch errors where a struct constructor is
25195 * cs-parser.jay: Pass location information for various new
25198 * delegate.cs (Delegate): take a location argument.
25200 * driver.cs: Do not call EmitCode if there were problesm in the
25201 Definition of the types, as many Builders wont be there.
25203 * decl.cs (Decl::Decl): Require a location argument.
25205 * cs-tokenizer.cs: Handle properly hex constants that can not fit
25206 into integers, and find the most appropiate integer for it.
25208 * literal.cs: Implement ULongLiteral.
25210 * rootcontext.cs: Provide better information about the location of
25211 failure when CreateType fails.
25213 2001-09-29 Miguel de Icaza <miguel@ximian.com>
25215 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25218 * expression.cs (Binary::CheckShiftArguments): Add missing type
25220 (Binary::ResolveOperator): Add type to the logical and and logical
25221 or, Bitwise And/Or and Exclusive Or code paths, it was missing
25224 (Binary::DoNumericPromotions): In the case where either argument
25225 is ulong (and most signed types combined with ulong cause an
25226 error) perform implicit integer constant conversions as well.
25228 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25230 * expression.cs (UserImplicitCast): Method should always be
25232 (Invocation::BetterConversion): Simplified test for IntLiteral.
25234 (Expression::ImplicitNumericConversion): Split this routine out.
25235 Put the code that performs implicit constant integer conversions
25238 (Expression::Resolve): Become a wrapper around DoResolve so we can
25239 check eclass and type being set after resolve.
25241 (Invocation::Badness): Remove this dead function
25243 (Binary::ResolveOperator): Do not compute the expensive argumnets
25244 unless we have a union for it.
25246 (Probe::Emit): Is needs to do an isinst and then
25247 compare against null.
25249 (::CanConvert): Added Location argument. If the Location argument
25250 is null (Location.Null), then we do not report errors. This is
25251 used by the `probe' mechanism of the Explicit conversion. We do
25252 not want to generate an error for something that the user
25253 explicitly requested to be casted. But the pipeline for an
25254 explicit cast first tests for potential implicit casts.
25256 So for now, if the Location is null, it means `Probe only' to
25257 avoid adding another argument. Might have to revise this
25260 (ClassCast): New class used to type cast objects into arbitrary
25261 classes (used in Explicit Reference Conversions).
25263 Implement `as' as well.
25265 Reverted all the patches from Ravi below: they were broken:
25267 * The use of `level' as a mechanism to stop recursive
25268 invocations is wrong. That was there just to catch the
25269 bug with a strack trace but not as a way of addressing
25272 To fix the problem we have to *understand* what is going
25273 on and the interactions and come up with a plan, not
25274 just get things going.
25276 * The use of the type conversion cache that I proposed
25277 last night had an open topic: How does this work across
25278 protection domains. A user defined conversion might not
25279 be public in the location where we are applying the
25280 conversion, a different conversion might be selected
25281 (ie, private A->B (better) but public B->A (worse),
25282 inside A, A->B applies, but outside it, B->A will
25285 * On top of that (ie, even if the above is solved),
25286 conversions in a cache need to be abstract. Ie, `To
25287 convert from an Int to a Short use an OpcodeCast', not
25288 `To convert from an Int to a Short use the OpcodeCast on
25289 the variable 5' (which is what this patch was doing).
25291 2001-09-28 Ravi Pratap <ravi@ximian.com>
25293 * expression.cs (Invocation::ConversionExists): Re-write to use
25294 the conversion cache
25296 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25297 cache all conversions done, not just user-defined ones.
25299 (Invocation::BetterConversion): The real culprit. Use ConversionExists
25300 to determine if a conversion exists instead of acutually trying to
25301 perform the conversion. It's faster too.
25303 (Expression::ConvertExplicit): Modify to use ConversionExists to check
25304 and only then attempt the implicit conversion.
25306 2001-09-28 Ravi Pratap <ravi@ximian.com>
25308 * expression.cs (ConvertImplicit): Use a cache for conversions
25309 already found. Check level of recursion and bail out if necessary.
25311 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25313 * typemanager.cs (string_concat_string_string, string_concat_object_object):
25314 Export standard methods that we expect for string operations.
25316 * statement.cs (Block::UsageWarning): Track usage of variables and
25317 report the errors for not used variables.
25319 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25322 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25324 * codegen.cs: remove unnneded code
25326 * expression.cs: Removed BuiltinTypeAccess class
25328 Fix the order in which implicit conversions are
25331 The previous fixed dropped support for boxed conversions (adding a
25332 test to the test suite now)
25334 (UserImplicitCast::CanConvert): Remove test for source being null,
25335 that code is broken. We should not feed a null to begin with, if
25336 we do, then we should track the bug where the problem originates
25337 and not try to cover it up here.
25339 Return a resolved expression of type UserImplicitCast on success
25340 rather than true/false. Ravi: this is what I was talking about,
25341 the pattern is to use a static method as a "constructor" for
25344 Also, do not create arguments until the very last minute,
25345 otherwise we always create the arguments even for lookups that
25346 will never be performed.
25348 (UserImplicitCast::Resolve): Eliminate, objects of type
25349 UserImplicitCast are born in a fully resolved state.
25351 * typemanager.cs (InitCoreTypes): Init also value_type
25352 (System.ValueType).
25354 * expression.cs (Cast::Resolve): First resolve the child expression.
25356 (LValue): Add new method AddressOf to be used by
25359 Change the argument of Store to take an EmitContext instead of an
25360 ILGenerator, because things like FieldExpr need to be able to call
25361 their children expression to generate the instance code.
25363 (Expression::Error, Expression::Warning): Sugar functions for
25366 (Expression::MemberLookup): Accept a TypeContainer instead of a
25367 Report as the first argument.
25369 (Expression::ResolvePrimary): Killed. I still want to improve
25370 this as currently the code is just not right.
25372 (Expression::ResolveMemberAccess): Simplify, but it is still
25375 (Unary::Resolve): Catch errors in AddressOf operators.
25377 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25378 index to a byte for the short-version, or the compiler will choose
25379 the wrong Emit call, which generates the wrong data.
25381 (ParameterReference::Emit, ::Store): same.
25383 (FieldExpr::AddressOf): Implement.
25385 * typemanager.cs: TypeManager: made public variable instead of
25388 * driver.cs: document --fatal.
25390 * report.cs (ErrorMessage, WarningMessage): new names for the old
25391 Error and Warning classes.
25393 * cs-parser.jay (member_access): Turn built-in access to types
25394 into a normal simplename
25396 2001-09-27 Ravi Pratap <ravi@ximian.com>
25398 * expression.cs (Invocation::BetterConversion): Fix to cope
25399 with q being null, since this was introducing a bug.
25401 * expression.cs (ConvertImplicit): Do built-in conversions first.
25403 2001-09-27 Ravi Pratap <ravi@ximian.com>
25405 * expression.cs (UserImplicitCast::Resolve): Fix bug.
25407 2001-09-27 Ravi Pratap <ravi@ximian.com>
25409 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25410 I had introduced long ago (what's new ?).
25412 * expression.cs (UserImplicitCast::CanConvert): Static method to do
25413 the work of all the checking.
25414 (ConvertImplicit): Call CanConvert and only then create object if necessary.
25415 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25417 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25418 that is the right way.
25420 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
25421 overloading resolution. Use everywhere instead of cutting and pasting code.
25423 (Binary::ResolveOperator): Use MakeUnionSet.
25425 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
25426 we have to convert to bool types. Not complete yet.
25428 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25430 * typemanager.cs (TypeManager::CSharpName): support ushort.
25432 * expression.cs (Expression::TryImplicitIntConversion): Attempts
25433 to provide an expression that performsn an implicit constant int
25434 conversion (section 6.1.6).
25435 (Expression::ConvertImplicitRequired): Reworked to include
25436 implicit constant expression conversions.
25438 (Expression::ConvertNumericExplicit): Finished.
25440 (Invocation::Emit): If InstanceExpression is null, then it means
25441 that we perform a call on this.
25443 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25445 * expression.cs (Unary::Emit): Remove some dead code.
25446 (Probe): Implement Resolve and Emit for `is'.
25447 (Expression::ConvertImplicitRequired): Attempt to do constant
25448 expression conversions here. Maybe should be moved to
25449 ConvertImplicit, but I am not sure.
25450 (Expression::ImplicitLongConstantConversionPossible,
25451 Expression::ImplicitIntConstantConversionPossible): New functions
25452 that tell whether is it possible to apply an implicit constant
25453 expression conversion.
25455 (ConvertNumericExplicit): Started work on explicit numeric
25458 * cs-parser.jay: Update operator constants.
25460 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25461 (Parameters::GetSignature): Hook up VerifyArgs here.
25462 (Parameters::VerifyArgs): Verifies that no two arguments have the
25465 * class.cs (Operator): Update the operator names to reflect the
25466 ones that the spec expects (as we are just stringizing the
25469 * expression.cs (Unary::ResolveOperator): Fix bug: Use
25470 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25471 previous usage did only work for our methods.
25472 (Expression::ConvertImplicit): Handle decimal implicit numeric
25473 conversions as well.
25474 (Expression::InternalTypeConstructor): Used to invoke constructors
25475 on internal types for default promotions.
25477 (Unary::Emit): Implement special handling for the pre/post
25478 increment/decrement for overloaded operators, as they need to have
25479 the same semantics as the other operators.
25481 (Binary::ResolveOperator): ditto.
25482 (Invocation::ConversionExists): ditto.
25483 (UserImplicitCast::Resolve): ditto.
25485 2001-09-26 Ravi Pratap <ravi@ximian.com>
25487 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25488 operator, return after emitting body. Regression tests pass again !
25490 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25491 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25492 (Invocation::OverloadResolve): Ditto.
25493 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25495 * everywhere : update calls to the above methods accordingly.
25497 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25499 * assign.cs (Assign): Make it inherit from ExpressionStatement.
25501 * expression.cs (ExpressionStatement): New base class used for
25502 expressions that can appear in statements, so that we can provide
25503 an alternate path to generate expression that do not leave a value
25506 (Expression::Emit, and all the derivatives): We no longer return
25507 whether a value is left on the stack or not. Every expression
25508 after being emitted leaves a single value on the stack.
25510 * codegen.cs (EmitContext::EmitStatementExpression): Use the
25511 facilties of ExpressionStatement if possible.
25513 * cs-parser.jay: Update statement_expression.
25515 2001-09-25 Miguel de Icaza <miguel@ximian.com>
25517 * driver.cs: Change the wording of message
25519 2001-09-25 Ravi Pratap <ravi@ximian.com>
25521 * expression.cs (Binary::ResolveOperator): Had forgottten to set
25522 the type of the expression to the return type of the method if
25523 we have an overloaded operator match ! The regression tests pass again !
25524 (Unary::ResolveOperator): Ditto.
25526 * expression.cs (Invocation::ConversionExists): Correct the member lookup
25527 to find "op_Implicit", not "implicit" ;-)
25528 (UserImplicitCast): New class to take care of user-defined implicit conversions.
25529 (ConvertImplicit, ForceConversion): Take TypeContainer argument
25531 * everywhere : Correct calls to the above accordingly.
25533 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25534 (ConvertImplicit): Do user-defined conversion if it exists.
25536 2001-09-24 Miguel de Icaza <miguel@ximian.com>
25538 * assign.cs: track location.
25539 (Resolve): Use implicit conversions on assignment.
25541 * literal.cs: Oops. Not good, Emit of short access values should
25542 pass (Bytes) or the wrong argument will be selected.
25544 * expression.cs (Unary::Emit): Emit code for -expr.
25546 (Unary::ResolveOperator): Handle `Substract' for non-constants
25547 (substract from zero from the non-constants).
25548 Deal with Doubles as well.
25550 (Expression::ConvertImplicitRequired): New routine that reports an
25551 error if no implicit conversion exists.
25553 (Invocation::OverloadResolve): Store the converted implicit
25554 expressions if we make them
25556 2001-09-24 Ravi Pratap <ravi@ximian.com>
25558 * class.cs (ConstructorInitializer): Take a Location argument.
25559 (ConstructorBaseInitializer): Same here.
25560 (ConstructorThisInitializer): Same here.
25562 * cs-parser.jay : Update all calls accordingly.
25564 * expression.cs (Unary, Binary, New): Take location argument.
25565 Update accordingly everywhere.
25567 * cs-parser.jay : Update all calls to the above to take a location
25570 * class.cs : Ditto.
25572 2001-09-24 Ravi Pratap <ravi@ximian.com>
25574 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25575 (Invocation::BetterConversion): Same here
25576 (Invocation::ConversionExists): Ditto.
25578 (Invocation::ConversionExists): Implement.
25580 2001-09-22 Ravi Pratap <ravi@ximian.com>
25582 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25583 Also take an additional TypeContainer argument.
25585 * All over : Pass in TypeContainer as argument to OverloadResolve.
25587 * typemanager.cs (CSharpName): Update to check for the string type and return
25590 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25593 2001-09-21 Ravi Pratap <ravi@ximian.com>
25595 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25596 (Invocation::BetterFunction): Implement.
25597 (Invocation::BetterConversion): Implement.
25598 (Invocation::ConversionExists): Skeleton, no implementation yet.
25600 Okay, things work fine !
25602 2001-09-21 Miguel de Icaza <miguel@ximian.com>
25604 * typemanager.cs: declare and load enum_type, delegate_type and
25607 * expression.cs (Expression::Emit): Now emit returns a value that
25608 tells whether a value is left on the stack or not. This strategy
25609 might be reveted tomorrow with a mechanism that would address
25610 multiple assignments.
25611 (Expression::report118): Utility routine to report mismatches on
25614 (Unary::Report23): Report impossible type/operator combination
25617 (Unary::IsIncrementableNumber): Whether the type can be
25618 incremented or decremented with add.
25619 (Unary::ResolveOperator): Also allow enumerations to be bitwise
25621 (Unary::ResolveOperator): Implement ++, !, ~,
25623 (Invocation::Emit): Deal with new Emit convetion.
25625 * All Expression derivatives: Updated their Emit method to return
25626 whether they leave values on the stack or not.
25628 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25629 stack for expressions that are statements.
25631 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25633 * expression.cs (LValue): New interface. Must be implemented by
25635 (LocalVariableReference, ParameterReference, FieldExpr): Implement
25638 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25639 interface for generating code, simplifies the code.
25641 2001-09-20 Ravi Pratap <ravi@ximian.com>
25643 * expression.cs (everywhere): Comment out return statements in ::Resolve
25644 methods to avoid the warnings.
25646 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25648 * driver.cs (parse): Report error 2001 if we can not open the
25651 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25654 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25657 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25658 otherwise nested blocks end up with the same index.
25660 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25662 * expression.cs: Instead of having FIXMEs in the Resolve
25663 functions, throw exceptions so it is obvious that we are facing a
25666 * cs-parser.jay (invocation_expression): Pass Location information.
25668 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25669 Use a basename for those routines because .NET does not like paths
25672 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25675 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25677 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25678 are loading the correct data types (throws an exception if not).
25679 (TypeManager::InitCoreTypes): Use CoreLookupType
25681 * expression.cs (Unary::ResolveOperator): return the child
25682 expression for expressions which are just +expr.
25683 (Unary::ResolveOperator): Return negative literals for -LITERAL
25684 expressions (otherwise they are Unary {Literal}).
25685 (Invocation::Badness): Take into account `Implicit constant
25686 expression conversions'.
25688 * literal.cs (LongLiteral): Implement long literal class.
25689 (IntLiteral): export the `Value' of the intliteral.
25691 2001-09-19 Ravi Pratap <ravi@ximian.com>
25693 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25695 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25696 instead of 'Operator'
25698 * expression.cs (Binary::ResolveOperator): Update accordingly.
25699 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25702 * cs-parser.jay (unary_expression): Update to use the new names.
25704 * gen-treedump.cs (GetUnary): Same here.
25706 * expression.cs (Unary::Resolve): Implement.
25707 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25708 operators are found instead of making noise ;-)
25709 (Unary::ResolveOperator): New method to do precisely the same thing which
25710 Binary::ResolveOperator does for Binary expressions.
25711 (Unary.method, .Arguments): Add.
25712 (Unary::OperName): Implement.
25713 (Unary::ForceConversion): Copy and Paste !
25715 * class.cs (Operator::Define): Fix a small bug for the case when we have
25718 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25719 for the inbuilt operators. Only overloading works for now ;-)
25721 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25723 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25724 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25726 * expression.cs (This::Emit): Implement.
25727 (This::Resolve): Implement.
25728 (TypeOf:Resolve): Implement.
25729 (Expression::ResolveSimpleName): Add an implicit this to instance
25731 (MemberAccess::Resolve): Deal with Parameters and Fields.
25732 Bind instance variable to Field expressions.
25733 (FieldExpr::Instance): New field used to track the expression that
25734 represents the object instance.
25735 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25737 (FieldExpr::Emit): Implement.
25739 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25740 the last instruction contains a return opcode to avoid generating
25741 the last `ret' instruction (this generates correct code, and it is
25742 nice to pass the peverify output).
25744 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25745 initializer for static and instance variables.
25746 (Constructor::Emit): Allow initializer to be null in the case of
25747 static constructors. Only emit initializer for instance
25750 (TypeContainer::FindMembers): Return a null array if there are no
25753 Also fix the code for the MemberTypes.Method branch, as it was not
25754 scanning that for operators (or tried to access null variables before).
25756 * assign.cs (Assign::Emit): Handle instance and static fields.
25760 * driver.cs: Stop compilation if there are parse errors.
25762 * cs-parser.jay (constructor_declaration): Provide default base
25763 initializer for non-static constructors.
25764 (constructor_declarator): Do not provide a default base
25765 initializers if none was specified.
25766 Catch the fact that constructors should not have parameters.
25768 * class.cs: Do not emit parent class initializers for static
25769 constructors, that should be flagged as an error.
25771 2001-09-18 Ravi Pratap <ravi@ximian.com>
25773 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25774 Move back code into TypeContainer::Populate.
25776 2001-09-18 Ravi Pratap <ravi@ximian.com>
25778 * class.cs (TypeContainer::AddConstructor): Fix the check to
25779 compare against Name, not Basename.
25780 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25782 * cs-parser.jay : Update accordingly.
25784 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25785 for methods, don't forget to look into the operators too.
25786 (RegisterMethodBuilder): Helper method to take care of this for
25787 methods, constructors and operators.
25788 (Operator::Define): Completely revamp.
25789 (Operator.OperatorMethod, MethodName): New fields.
25790 (TypeContainer::Populate): Move the registering of builders into
25791 RegisterMethodBuilder.
25792 (Operator::Emit): Re-write.
25794 * expression.cs (Binary::Emit): Comment out code path to emit method
25795 invocation stuff for the case when we have a user defined operator. I am
25796 just not able to get it right !
25798 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25800 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25803 (Expression::MemberLookup): Provide a version that allows to
25804 specify the MemberTypes and BindingFlags.
25806 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25807 so it was not fetching variable information from outer blocks.
25809 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25810 Beforefieldinit as it was buggy.
25812 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25813 that Ravi put here.
25815 * class.cs (Constructor::Emit): Only emit if block is not null.
25816 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25817 deal with this by semantically definining it as if the user had
25820 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25821 constructors as we now "emit" them at a higher level.
25823 (TypeContainer::DefineDefaultConstructor): Used to define the
25824 default constructors if none was provided.
25826 (ConstructorInitializer): Add methods Resolve and Emit.
25828 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25830 2001-09-17 Ravi Pratap <ravi@ximian.com>
25832 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25833 the default constructor builder with our hashtable for methodbuilders
25836 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25837 and argument_count is 0 in which case we have a match.
25838 (Binary::ResolveOperator): More null checking and miscellaneous coding
25841 2001-09-17 Ravi Pratap <ravi@ximian.com>
25843 * rootcontext.cs (IsNameSpace): Compare against null.
25845 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25847 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25848 and Unary::Operator.
25850 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25853 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25854 we have overloaded operators.
25855 (Binary::ResolveOperator): Implement the part which does the operator overload
25858 * class.cs (Operator::Emit): Implement.
25859 (TypeContainer::Emit): Emit the operators we have too.
25861 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25862 the case when we have a user-defined operator.
25864 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25866 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25868 2001-09-16 Ravi Pratap <ravi@ximian.com>
25870 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25871 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25872 (Constructor::Emit): Implement.
25873 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25874 if we have no work to do.
25875 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25878 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25879 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25881 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25884 2001-09-15 Ravi Pratap <ravi@ximian.com>
25886 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25888 (Tree::RecordNamespace): Method to do what the name says ;-)
25889 (Tree::Namespaces): Property to get at the namespaces hashtable.
25891 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25894 * rootcontext.cs (IsNamespace): Fixed it :-)
25896 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25898 * class.cs (TypeContainer::FindMembers): Add support for
25900 (MethodCore): New class that encapsulates both the shared aspects
25901 of a Constructor and a Method.
25902 (Method, Constructor): Factored pieces into MethodCore.
25904 * driver.cs: Added --fatal which makes errors throw exceptions.
25905 Load System assembly as well as part of the standard library.
25907 * report.cs: Allow throwing exceptions on errors for debugging.
25909 * modifiers.cs: Do not use `parent', instead use the real type
25910 container to evaluate permission settings.
25912 * class.cs: Put Ravi's patch back in. He is right, and we will
25913 have to cope with the
25915 2001-09-14 Ravi Pratap <ravi@ximian.com>
25917 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25918 FamORAssem, not FamANDAssem.
25920 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25922 * driver.cs: Added --parse option that only parses its input files
25925 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25926 incorrect. IsTopLevel is not used to tell whether an object is
25927 root_types or not (that can be achieved by testing this ==
25928 root_types). But to see if this is a top-level *class* (not
25929 necessarly our "toplevel" container).
25931 2001-09-14 Ravi Pratap <ravi@ximian.com>
25933 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25934 parent instead of a direct call to GetType.
25936 2001-09-14 Ravi Pratap <ravi@ximian.com>
25938 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25939 Modifiers.TypeAttr. This should just be a call to that method.
25941 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25942 object so that we can determine if we are top-level or not.
25944 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25947 * enum.cs (Enum::Define): Ditto.
25949 * modifiers.cs (FieldAttr): Re-write.
25951 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25952 (TypeContainer::HaveStaticConstructor): New property to provide access
25953 to precisely that info.
25955 * modifiers.cs (MethodAttr): Re-write.
25956 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25958 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25959 of top-level types as claimed.
25961 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25963 * expression.cs (MemberLookup): Fruitless attempt to lookup
25964 constructors. Maybe I need to emit default constructors? That
25965 might be it (currently .NET emits this for me automatically).
25966 (Invocation::OverloadResolve): Cope with Arguments == null.
25967 (Invocation::EmitArguments): new function, shared by the new
25968 constructor and us.
25969 (Invocation::Emit): Handle static and instance methods. Emit
25970 proper call instruction for virtual or non-virtual invocations.
25971 (New::Emit): Implement.
25972 (New::Resolve): Implement.
25973 (MemberAccess:Resolve): Implement.
25974 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25975 to track instances.
25976 (FieldExpr::Resolve): Set type.
25978 * support.cs: Handle empty arguments.
25980 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25981 SimpleLookup): Auxiliary routines to help parse a qualifier
25984 Update qualifier_identifier rule.
25986 * codegen.cs: Removed debugging messages.
25988 * class.cs: Make this a global thing, this acts just as a "key" to
25989 objects that we might have around.
25991 (Populate): Only initialize method_builders_to_methods once.
25993 * expression.cs (PropertyExpr): Initialize type from the
25996 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25997 Resolve pattern. Attempt to implicitly convert value to boolean.
26000 * expression.cs: Set the type for the int32/int32 argument case.
26001 (Binary::ResolveOperator): Set the return type to boolean for
26002 comparission operators
26004 * typemanager.cs: Remove debugging print code.
26006 (Invocation::Resolve): resolve type.
26008 * class.cs: Allocate a MemberInfo of the correct size, as the code
26009 elsewhere depends on the test to reflect the correct contents.
26011 (Method::) Keep track of parameters, due to System.Reflection holes
26013 (TypeContainer::Populate): Keep track of MethodBuilders to Method
26016 (TypeContainer::FindMembers): Use ArrayList and then copy an array
26017 of the exact size and return that.
26019 (Class::LookupMethodByBuilder): New function that maps
26020 MethodBuilders to its methods. Required to locate the information
26021 on methods because System.Reflection bit us again.
26023 * support.cs: New file, contains an interface ParameterData and
26024 two implementations: ReflectionParameters and InternalParameters
26025 used to access Parameter information. We will need to grow this
26028 * expression.cs (Invocation::GetParameterData): implement a cache
26029 and a wrapper around the ParameterData creation for methods.
26030 (Invocation::OverloadResolve): Use new code.
26032 2001-09-13 Ravi Pratap <ravi@ximian.com>
26034 * class.cs (TypeContainer::EmitField): Remove and move into
26035 (Field::Define): here and modify accordingly.
26036 (Field.FieldBuilder): New member.
26037 (TypeContainer::Populate): Update accordingly.
26038 (TypeContainer::FindMembers): Implement.
26040 2001-09-13 Miguel de Icaza <miguel@ximian.com>
26042 * statement.cs: (VariableInfo::VariableType): New field to be
26043 initialized with the full type once it is resolved.
26045 2001-09-12 Miguel de Icaza <miguel@ximian.com>
26047 * parameter.cs (GetParameterInfo): Use a type cache to compute
26048 things only once, and to reuse this information
26050 * expression.cs (LocalVariableReference::Emit): Implement.
26051 (OpcodeCast::Emit): fix.
26053 (ParameterReference::Resolve): Implement.
26054 (ParameterReference::Emit): Implement.
26056 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
26057 that are expressions need to stay as Expressions.
26059 * typemanager.cs (CSharpName): Returns the C# name of a type if
26062 * expression.cs (Expression::ConvertImplicit): New function that
26063 implements implicit type conversions.
26065 (Expression::ImplicitReferenceConversion): Implements implicit
26066 reference conversions.
26068 (EmptyCast): New type for transparent casts.
26070 (OpcodeCast): New type for casts of types that are performed with
26071 a sequence of bytecodes.
26073 (BoxedCast): New type used for casting value types into reference
26074 types. Emits a box opcode.
26076 (Binary::DoNumericPromotions): Implements numeric promotions of
26077 and computation of the Binary::Type.
26079 (Binary::EmitBranchable): Optimization.
26081 (Binary::Emit): Implement code emission for expressions.
26083 * typemanager.cs (TypeManager): Added two new core types: sbyte
26086 2001-09-12 Ravi Pratap <ravi@ximian.com>
26088 * class.cs (TypeContainer::FindMembers): Method which does exactly
26089 what Type.FindMembers does, only we don't have to use reflection. No
26090 implementation yet.
26092 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
26093 typecontainer objects as we need to get at them.
26094 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
26096 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
26097 typecontainer object.
26099 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
26100 of just a Report object.
26102 2001-09-11 Ravi Pratap <ravi@ximian.com>
26104 * class.cs (Event::Define): Go back to using the prefixes "add_" and
26106 (TypeContainer::Populate): Now define the delegates of the type too.
26107 (TypeContainer.Delegates): Property to access the list of delegates defined
26110 * delegates.cs (Delegate::Define): Implement partially.
26112 * modifiers.cs (TypeAttr): Handle more flags.
26114 2001-09-11 Ravi Pratap <ravi@ximian.com>
26116 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
26118 (Operator::Define): Re-write logic to get types by using the LookupType method
26119 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
26120 (Indexer::Define): Ditto.
26121 (Event::Define): Ditto.
26122 (Property::Define): Ditto.
26124 2001-09-10 Ravi Pratap <ravi@ximian.com>
26126 * class.cs (TypeContainer::Populate): Now define operators too.
26127 (TypeContainer.Operators): New property to access the list of operators
26129 (Operator.OperatorMethodBuilder): New member to hold the method builder
26130 for the operator we are defining.
26131 (Operator::Define): Implement.
26133 2001-09-10 Ravi Pratap <ravi@ximian.com>
26135 * class.cs (Event::Define): Make the prefixes of the accessor methods
26136 addOn_ and removeOn_
26138 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
26139 of the location being passed in too. Ideally, this should go later since all
26140 error reporting should be done through the Report object.
26142 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
26143 (Populate): Iterate thru the indexers we have and define them too.
26144 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
26145 for the get and set accessors.
26146 (Indexer::Define): Implement.
26148 2001-09-09 Miguel de Icaza <miguel@ximian.com>
26150 * expression.cs (Binary::Resolve): Beginning of it. I scratched
26151 my previous implementation, did not work.
26153 * typemanager.cs: Add a couple of missing types (the longs).
26155 * literal.cs: Use TypeManager.bool_type instead of getting it.
26157 * expression.cs (EventExpr): New kind of expressions.
26158 (Expressio::ExprClassFromMemberInfo): finish
26160 2001-09-08 Miguel de Icaza <miguel@ximian.com>
26162 * assign.cs: Emit stores to static fields differently.
26164 2001-09-08 Ravi Pratap <ravi@ximian.com>
26166 * Merge in changes and adjust code to tackle conflicts. Backed out my
26167 code in Assign::Resolve ;-)
26169 2001-09-08 Ravi Pratap <ravi@ximian.com>
26171 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26172 instead Report.Error and also pass in the location.
26173 (CSharpParser::Lexer): New readonly property to return the reference
26174 to the Tokenizer object.
26175 (declare_local_variables): Use Report.Error with location instead of plain
26179 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26180 (Operator.CheckBinaryOperator): Ditto.
26182 * cs-parser.jay (operator_declarator): Update accordingly.
26184 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26185 (CheckBinaryOperator): Same here.
26187 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26188 on the name without any prefixes of namespace names etc. This is because we
26189 already might have something already fully qualified like
26190 'System.Console.WriteLine'
26192 * assign.cs (Resolve): Begin implementation. Stuck ;-)
26194 2001-09-07 Ravi Pratap <ravi@ximian.com>
26196 * cs-tokenizer.cs (location): Return a string which also contains
26199 * expression.cs (ElementAccess): New class for expressions of the
26200 type 'element access.'
26201 (BaseAccess): New class for expressions of the type 'base access.'
26202 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26205 * cs-parser.jay (element_access): Implement action.
26206 (base_access): Implement actions.
26207 (checked_expression, unchecked_expression): Implement.
26209 * cs-parser.jay (local_variable_type): Correct and implement.
26210 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26212 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26214 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26215 name and the specifiers.
26217 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26219 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
26220 making them all public ;-)
26222 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26225 2001-09-07 Miguel de Icaza <miguel@ximian.com>
26227 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26229 (FieldExpr, PropertyExprs): New resolved expressions.
26230 (SimpleName::MemberStaticCheck): Perform static checks for access
26231 to non-static fields on static methods. Maybe this should be
26232 generalized for MemberAccesses.
26233 (SimpleName::ResolveSimpleName): More work on simple name
26236 * cs-parser.jay (primary_expression/qualified_identifier): track
26237 the parameter index.
26239 * codegen.cs (CodeGen::Save): Catch save exception, report error.
26240 (EmitContext::EmitBoolExpression): Chain to expression generation
26241 instead of temporary hack.
26242 (::EmitStatementExpression): Put generic expression code generation.
26244 * assign.cs (Assign::Emit): Implement variable assignments to
26245 local variables, parameters and fields.
26247 2001-09-06 Miguel de Icaza <miguel@ximian.com>
26249 * statement.cs (Block::GetVariableInfo): New method, returns the
26250 VariableInfo for a variable name in a block.
26251 (Block::GetVariableType): Implement in terms of GetVariableInfo
26253 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26254 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26256 2001-09-06 Ravi Pratap <ravi@ximian.com>
26258 * cs-parser.jay (operator_declaration): Continue on my quest : update
26259 to take attributes argument.
26260 (event_declaration): Ditto.
26261 (enum_declaration): Ditto.
26262 (indexer_declaration): Ditto.
26264 * class.cs (Operator::Operator): Update constructor accordingly.
26265 (Event::Event): Ditto.
26267 * delegate.cs (Delegate::Delegate): Same here.
26269 * enum.cs (Enum::Enum): Same here.
26271 2001-09-05 Ravi Pratap <ravi@ximian.com>
26273 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26275 * ../tests/cs0658.cs : New file to demonstrate error 0658.
26277 * attribute.cs (Attributes): New class to encapsulate all attributes which were
26278 being passed around as an arraylist.
26279 (Attributes::AddAttribute): Method to add attribute sections.
26281 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26282 (struct_declaration): Update accordingly.
26283 (constant_declaration): Update.
26284 (field_declaration): Update.
26285 (method_header): Update.
26286 (fixed_parameter): Update.
26287 (parameter_array): Ditto.
26288 (property_declaration): Ditto.
26289 (destructor_declaration): Ditto.
26291 * class.cs (Struct::Struct): Update constructors accordingly.
26292 (Class::Class): Ditto.
26293 (Field::Field): Ditto.
26294 (Method::Method): Ditto.
26295 (Property::Property): Ditto.
26296 (TypeContainer::OptAttribute): update property's return type.
26298 * interface.cs (Interface.opt_attributes): New member.
26299 (Interface::Interface): Update to take the extra Attributes argument.
26301 * parameter.cs (Parameter::Parameter): Ditto.
26303 * constant.cs (Constant::Constant): Ditto.
26305 * interface.cs (InterfaceMemberBase): New OptAttributes field.
26306 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
26307 the attributes as a parameter.
26308 (InterfaceProperty): Update constructor call.
26309 (InterfaceEvent): Ditto.
26310 (InterfaceMethod): Ditto.
26311 (InterfaceIndexer): Ditto.
26313 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
26314 pass the attributes too.
26315 (interface_event_declaration): Ditto.
26316 (interface_property_declaration): Ditto.
26317 (interface_method_declaration): Ditto.
26318 (interface_declaration): Ditto.
26320 2001-09-05 Miguel de Icaza <miguel@ximian.com>
26322 * class.cs (Method::Define): Track the "static Main" definition to
26323 create an entry point.
26325 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26326 EntryPoint if we find it.
26328 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26329 (EmitContext::ig): Make this variable public.
26331 * driver.cs: Make the default output file be the first file name
26332 with the .exe extension.
26334 Detect empty compilations
26336 Handle various kinds of output targets. Handle --target and
26337 rename -t to --dumper.
26339 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26340 methods inherited from Expression return now an Expression. This
26341 will is used during the tree rewriting as we resolve them during
26344 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26345 the spec. Missing entirely is the information about
26346 accessability of elements of it.
26348 (Expression::ExprClassFromMemberInfo): New constructor for
26349 Expressions that creates a fully initialized Expression based on
26350 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26353 (Invocation::Resolve): Begin implementing resolution of invocations.
26355 * literal.cs (StringLiteral): Implement Emit.
26357 2001-09-05 Ravi Pratap <ravi@ximian.com>
26359 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26362 2001-09-04 Ravi Pratap <ravi@ximian.com>
26364 * cs-parser.jay (attribute_arguments): Implement actions.
26365 (attribute): Fix bug in production. Implement action.
26366 (attribute_list): Implement.
26367 (attribute_target): Implement.
26368 (attribute_target_specifier, opt_target_specifier): Implement
26369 (CheckAttributeTarget): New method to check if the attribute target
26371 (attribute_section): Implement.
26372 (opt_attributes): Implement.
26374 * attribute.cs : New file to handle attributes.
26375 (Attribute): Class to hold attribute info.
26377 * cs-parser.jay (opt_attribute_target_specifier): Remove production
26378 (attribute_section): Modify production to use 2 different rules to
26379 achieve the same thing. 1 s/r conflict down !
26380 Clean out commented, useless, non-reducing dimension_separator rules.
26382 * class.cs (TypeContainer.attributes): New member to hold list
26383 of attributes for a type.
26384 (Struct::Struct): Modify to take one more argument, the attribute list.
26385 (Class::Class): Ditto.
26386 (Field::Field): Ditto.
26387 (Method::Method): Ditto.
26388 (Property::Property): Ditto.
26390 * cs-parser.jay (struct_declaration): Update constructor call to
26391 pass in the attributes too.
26392 (class_declaration): Ditto.
26393 (constant_declaration): Ditto.
26394 (field_declaration): Ditto.
26395 (method_header): Ditto.
26396 (fixed_parameter): Ditto.
26397 (parameter_array): Ditto.
26398 (property_declaration): Ditto.
26400 * constant.cs (Constant::Constant): Update constructor similarly.
26401 Use System.Collections.
26403 * parameter.cs (Parameter::Parameter): Update as above.
26405 2001-09-02 Ravi Pratap <ravi@ximian.com>
26407 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26408 (TypeContainer.delegates): New member to hold list of delegates.
26410 * cs-parser.jay (delegate_declaration): Implement the action correctly
26411 this time as I seem to be on crack ;-)
26413 2001-09-02 Miguel de Icaza <miguel@ximian.com>
26415 * rootcontext.cs (RootContext::IsNamespace): new function, used to
26416 tell whether an identifier represents a namespace.
26418 * expression.cs (NamespaceExpr): A namespace expression, used only
26419 temporarly during expression resolution.
26420 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26421 utility functions to resolve names on expressions.
26423 2001-09-01 Miguel de Icaza <miguel@ximian.com>
26425 * codegen.cs: Add hook for StatementExpressions.
26427 * class.cs: Fix inverted test for static flag in methods.
26429 2001-09-02 Ravi Pratap <ravi@ximian.com>
26431 * class.cs (Operator::CheckUnaryOperator): Correct error number used
26432 to make it coincide with MS' number.
26433 (Operator::CheckBinaryOperator): Ditto.
26435 * ../errors/errors.txt : Remove error numbers added earlier.
26437 * ../errors/cs1019.cs : Test case for error # 1019
26439 * ../errros/cs1020.cs : Test case for error # 1020
26441 * cs-parser.jay : Clean out commented cruft.
26442 (dimension_separators, dimension_separator): Comment out. Ostensibly not
26443 used anywhere - non-reducing rule.
26444 (namespace_declarations): Non-reducing rule - comment out.
26446 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26447 with TypeContainer::AddEnum.
26449 * delegate.cs : New file for delegate handling classes.
26450 (Delegate): Class for declaring delegates.
26452 * makefile : Update.
26454 * cs-parser.jay (delegate_declaration): Implement.
26456 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
26458 * class.cs (Event::Define): Implement.
26459 (Event.EventBuilder): New member.
26461 * class.cs (TypeContainer::Populate): Update to define all enums and events
26463 (Events): New property for the events arraylist we hold. Shouldn't we move to using
26464 readonly fields for all these cases ?
26466 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26468 * class.cs (Property): Revamp to use the convention of making fields readonly.
26469 Accordingly modify code elsewhere.
26471 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26472 the Define method of the Property class.
26474 * class.cs : Clean up applied patch and update references to variables etc. Fix
26476 (TypeContainer::Populate): Update to define all the properties we have. Also
26477 define all enumerations.
26479 * enum.cs (Define): Implement.
26481 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26483 * cs-parser.jay (overloadable_operator): The semantic value is an
26484 enum of the Operator class.
26485 (operator_declarator): Implement actions.
26486 (operator_declaration): Implement.
26488 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26489 validity of definitions.
26490 (Operator::CheckBinaryOperator): Static method to check for binary operators
26491 (TypeContainer::AddOperator): New method to add an operator to a type.
26493 * cs-parser.jay (indexer_declaration): Added line to actually call the
26494 AddIndexer method so it gets added ;-)
26496 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
26497 already taken care of by the MS compiler ?
26499 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26501 * class.cs (Operator): New class for operator declarations.
26502 (Operator::OpType): Enum for the various operators.
26504 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26506 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26507 ostensibly handle this in semantic analysis.
26509 * cs-parser.jay (general_catch_clause): Comment out
26510 (specific_catch_clauses, specific_catch_clause): Ditto.
26511 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26512 (catch_args, opt_catch_args): New productions.
26513 (catch_clause): Rewrite to use the new productions above
26514 (catch_clauses): Modify accordingly.
26515 (opt_catch_clauses): New production to use in try_statement
26516 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26517 and re-write the code in the actions to extract the specific and
26518 general catch clauses by being a little smart ;-)
26520 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26521 Hooray, try and catch statements parse fine !
26523 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26525 * statement.cs (Block::GetVariableType): Fix logic to extract the type
26526 string from the hashtable of variables.
26528 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26529 I end up making that mistake ;-)
26530 (catch_clauses): Fixed gross error which made Key and Value of the
26531 DictionaryEntry the same : $1 !!
26533 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26535 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26537 * cs-parser.jay (event_declaration): Correct to remove the semicolon
26538 when the add and remove accessors are specified.
26540 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26542 * cs-parser.jay (IndexerDeclaration): New helper class to hold
26543 information about indexer_declarator.
26544 (indexer_declarator): Implement actions.
26545 (parsing_indexer): New local boolean used to keep track of whether
26546 we are parsing indexers or properties. This is necessary because
26547 implicit_parameters come into picture even for the get accessor in the
26548 case of an indexer.
26549 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26551 * class.cs (Indexer): New class for indexer declarations.
26552 (TypeContainer::AddIndexer): New method to add an indexer to a type.
26553 (TypeContainer::indexers): New member to hold list of indexers for the
26556 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26558 * cs-parser.jay (add_accessor_declaration): Implement action.
26559 (remove_accessor_declaration): Implement action.
26560 (event_accessors_declaration): Implement
26561 (variable_declarators): swap statements for first rule - trivial.
26563 * class.cs (Event): New class to hold information about event
26565 (TypeContainer::AddEvent): New method to add an event to a type
26566 (TypeContainer::events): New member to hold list of events.
26568 * cs-parser.jay (event_declaration): Implement actions.
26570 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26572 * cs-parser.jay (dim_separators): Implement. Make it a string
26573 concatenating all the commas together, just as they appear.
26574 (opt_dim_separators): Modify accordingly
26575 (rank_specifiers): Update accordingly. Basically do the same
26576 thing - instead, collect the brackets here.
26577 (opt_rank_sepcifiers): Modify accordingly.
26578 (array_type): Modify to actually return the complete type string
26579 instead of ignoring the rank_specifiers.
26580 (expression_list): Implement to collect the expressions
26581 (variable_initializer): Implement. We make it a list of expressions
26582 essentially so that we can handle the array_initializer case neatly too.
26583 (variable_initializer_list): Implement.
26584 (array_initializer): Make it a list of variable_initializers
26585 (opt_array_initializer): Modify accordingly.
26587 * expression.cs (New::NType): Add enumeration to help us
26588 keep track of whether we have an object/delegate creation
26589 or an array creation.
26590 (New:NewType, New::Rank, New::Indices, New::Initializers): New
26591 members to hold data about array creation.
26592 (New:New): Modify to update NewType
26593 (New:New): New Overloaded contructor for the array creation
26596 * cs-parser.jay (array_creation_expression): Implement to call
26597 the overloaded New constructor.
26599 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
26601 * class.cs (TypeContainer::Constructors): Return member
26602 constructors instead of returning null.
26604 2001-08-26 Miguel de Icaza <miguel@ximian.com>
26606 * typemanager.cs (InitCoreTypes): Initialize the various core
26607 types after we have populated the type manager with the user
26608 defined types (this distinction will be important later while
26609 compiling corlib.dll)
26611 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26612 on Expression Classification. Now all expressions have a method
26613 `Resolve' and a method `Emit'.
26615 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26616 generation from working. Also add some temporary debugging
26619 2001-08-24 Miguel de Icaza <miguel@ximian.com>
26621 * codegen.cs: Lots of code generation pieces. This is only the
26622 beginning, will continue tomorrow with more touches of polish. We
26623 handle the fundamentals of if, while, do, for, return. Others are
26624 trickier and I need to start working on invocations soon.
26626 * gen-treedump.cs: Bug fix, use s.Increment here instead of
26629 * codegen.cs (EmitContext): New struct, used during code
26630 emission to keep a context. Most of the code generation will be
26633 * cs-parser.jay: Add embedded blocks to the list of statements of
26634 this block. So code generation proceeds in a top down fashion.
26636 2001-08-23 Miguel de Icaza <miguel@ximian.com>
26638 * statement.cs: Add support for multiple child blocks.
26640 2001-08-22 Miguel de Icaza <miguel@ximian.com>
26642 * codegen.cs (EmitCode): New function, will emit the code for a
26643 Block of code given a TypeContainer and its ILGenerator.
26645 * statement.cs (Block): Standard public readonly optimization.
26646 (Block::Block constructors): Link children.
26647 (Block::Child): Child Linker.
26648 (Block::EmitVariables): Emits IL variable declarations.
26650 * class.cs: Drop support for MethodGroups here, delay until
26652 (Method::): Applied the same simplification that I did before, and
26653 move from Properties to public readonly fields.
26654 (Method::ParameterTypes): Returns the parameter types for the
26655 function, and implements a cache that will be useful later when I
26656 do error checking and the semantic analysis on the methods is
26658 (Constructor::GetCallingConvention): Renamed from CallingConvetion
26659 and made a method, optional argument tells whether this is a class
26660 or a structure to apply the `has-this' bit.
26661 (Method::GetCallingConvention): Implement, returns the calling
26663 (Method::Define): Defines the type, a second pass is performed
26664 later to populate the methods.
26666 (Constructor::ParameterTypes): implement a cache similar to the
26667 one on Method::ParameterTypes, useful later when we do semantic
26670 (TypeContainer::EmitMethod): New method. Emits methods.
26672 * expression.cs: Removed MethodGroup class from here.
26674 * parameter.cs (Parameters::GetCallingConvention): new method.
26676 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26678 * class.cs (TypeContainer::Populate): Drop RootContext from the
26681 (Constructor::CallingConvention): Returns the calling convention.
26682 (Constructor::ParameterTypes): Returns the constructor parameter
26685 (TypeContainer::AddConstructor): Keep track of default constructor
26686 and the default static constructor.
26688 (Constructor::) Another class that starts using `public readonly'
26689 instead of properties.
26691 (Constructor::IsDefault): Whether this is a default constructor.
26693 (Field::) use readonly public fields instead of properties also.
26695 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26696 track of static constructors; If none is used, turn on
26697 BeforeFieldInit in the TypeAttributes.
26699 * cs-parser.jay (opt_argument_list): now the return can be null
26700 for the cases where there are no arguments.
26702 (constructor_declarator): If there is no implicit `base' or
26703 `this', then invoke the default parent constructor.
26705 * modifiers.cs (MethodAttr): New static function maps a set of
26706 modifiers flags into a MethodAttributes enum
26707 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26708 MethodAttr, TypeAttr to represent the various mappings where the
26709 modifiers are used.
26710 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26712 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26714 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26717 * interface.cs (PopulateIndexer): Implemented the code generator
26718 for interface indexers.
26720 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26722 * interface.cs (InterfaceMemberBase): Now we track the new status
26725 (PopulateProperty): Implement property population. Woohoo! Got
26726 Methods and Properties going today.
26728 Removed all the properties for interfaces, and replaced them with
26729 `public readonly' fields.
26731 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26733 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26734 initialize their hashtables/arraylists only when they are needed
26735 instead of doing this always.
26737 * parameter.cs: Handle refs and out parameters.
26739 * cs-parser.jay: Use an ArrayList to construct the arguments
26740 instead of the ParameterCollection, and then cast that to a
26743 * parameter.cs: Drop the use of ParameterCollection and use
26744 instead arrays of Parameters.
26746 (GetParameterInfo): Use the Type, not the Name when resolving
26749 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26751 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26752 and instead use public readonly fields.
26754 * class.cs: Put back walking code for type containers.
26756 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26758 * class.cs (MakeConstant): Code to define constants.
26760 * rootcontext.cs (LookupType): New function. Used to locate types
26763 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26765 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26766 this System.Reflection code is. Kudos to Microsoft
26768 * typemanager.cs: Implement a type cache and avoid loading all
26769 types at boot time. Wrap in LookupType the internals. This made
26770 the compiler so much faster. Wow. I rule!
26772 * driver.cs: Make sure we always load mscorlib first (for
26773 debugging purposes, nothing really important).
26775 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26776 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26778 * rootcontext.cs: Lookup types on their namespace; Lookup types
26779 on namespaces that have been imported using the `using' keyword.
26781 * class.cs (TypeContainer::TypeAttr): Virtualize.
26782 (Class::TypeAttr): Return attributes suitable for this bad boy.
26783 (Struct::TypeAttr): ditto.
26784 Handle nested classes.
26785 (TypeContainer::) Remove all the type visiting code, it is now
26786 replaced with the rootcontext.cs code
26788 * rootcontext.cs (GetClassBases): Added support for structs.
26790 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26792 * interface.cs, statement.cs, class.cs, parameter.cs,
26793 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26794 Drop use of TypeRefs, and use strings instead.
26796 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26800 * class.cs (Struct::Struct): set the SEALED flags after
26801 checking the modifiers.
26802 (TypeContainer::TypeAttr): new property, returns the
26803 TypeAttributes for a class.
26805 * cs-parser.jay (type_list): Oops, list production was creating a
26806 new list of base types.
26808 * rootcontext.cs (StdLib): New property.
26809 (GetInterfaceTypeByName): returns an interface by type name, and
26810 encapsulates error handling here.
26811 (GetInterfaces): simplified.
26812 (ResolveTree): Encapsulated all the tree resolution here.
26813 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26816 * driver.cs: Add support for --nostdlib, to avoid loading the
26817 default assemblies.
26818 (Main): Do not put tree resolution here.
26820 * rootcontext.cs: Beginning of the class resolution.
26822 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26824 * rootcontext.cs: Provide better error reporting.
26826 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26828 * rootcontext.cs (CreateInterface): Handle the case where there
26829 are no parent interfaces.
26831 (CloseTypes): Routine to flush types at the end.
26832 (CreateInterface): Track types.
26833 (GetInterfaces): Returns an array of Types from the list of
26834 defined interfaces.
26836 * typemanager.c (AddUserType): Mechanism to track user types (puts
26837 the type on the global type hash, and allows us to close it at the
26840 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26842 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26843 RecordInterface instead.
26845 * cs-parser.jay: Updated to reflect changes above.
26847 * decl.cs (Definition): Keep track of the TypeBuilder type that
26848 represents this type here. Not sure we will use it in the long
26849 run, but wont hurt for now.
26851 * driver.cs: Smaller changes to accomodate the new code.
26853 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26856 * rootcontext.cs (CreateInterface): New method, used to create
26857 the System.TypeBuilder type for interfaces.
26858 (ResolveInterfaces): new entry point to resolve the interface
26860 (CodeGen): Property, used to keep track of the code generator.
26862 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26864 * cs-parser.jay: Add a second production for delegate_declaration
26867 (enum_body): Put an opt_comma here instead of putting it on
26868 enum_body or enum_member_declarations so we can handle trailing
26869 commas on enumeration members. Gets rid of a shift/reduce.
26871 (type_list): Need a COMMA in the middle.
26873 (indexer_declaration): Tell tokenizer to recognize get/set
26875 * Remove old targets.
26877 * Re-add the parser target.
26879 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26881 * cs-parser.jay: Add precendence rules for a number of operators
26882 ot reduce the number of shift/reduce conflicts in the grammar.
26884 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26886 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26889 Get rid of old crufty code.
26891 * rootcontext.cs: Use this to keep track of the parsed
26892 representation and the defined types available to the program.
26894 * gen-treedump.cs: adjust for new convention.
26896 * type.cs: Split out the type manager, and the assembly builder
26899 * typemanager.cs: the type manager will live here now.
26901 * cil-codegen.cs: And the code generator here.
26903 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
26905 * makefile: Fixed up for easy making.
26907 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26909 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26912 (unary_expression): Expand pre_increment_expression and
26913 post_decrement_expression to reduce a shift/reduce.
26915 2001-07-11 Simon Cozens
26917 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26919 Improve allow_keyword_as_indent name.
26921 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26923 * Adjustments for Beta2.
26925 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26927 * decl.cs: Added `Define' abstract method.
26928 (InTransit): new property, used to catch recursive definitions.
26930 * interface.cs: Implement `Define'.
26932 * modifiers.cs: Map Modifiers.constants to
26933 System.Reflection.TypeAttribute flags.
26935 * class.cs: Keep track of types and user-defined types.
26936 (BuilderInit): New method for creating an assembly
26937 (ResolveType): New function to launch the resolution process, only
26938 used by interfaces for now.
26940 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26941 that are inserted into the name space.
26943 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26945 * ARGH. I have screwed up my tree so many times due to the use of
26946 rsync rather than using CVS. Going to fix this at once.
26948 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26951 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26953 * Experiment successful: Use System.Type rather that our own
26956 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26958 * cs-parser.jay: Removed nsAliases from here.
26960 Use new namespaces, handle `using XXX;'
26962 * namespace.cs: Reimplemented namespace handling, use a recursive
26963 definition of the class. Now we can keep track of using clauses
26964 and catch invalid using clauses.
26966 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26968 * gen-treedump.cs: Adapted for all the renaming.
26970 * expression.cs (Expression): this class now has a Type property
26971 which returns an expression Type.
26973 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26974 `Type', as this has a different meaning now in the base
26976 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26978 * interface.cs, class.cs: Removed from all the sources the
26979 references to signature computation, as we can not do method
26980 signature computation during the parsing time, as we are not
26981 trying to solve at that point distinguishing:
26985 void a (NS.Blah x) {}
26988 Which depending on the context might be valid or not, as we do not
26989 know if Blah is the same thing as NS.Blah at that point.
26991 * Redid everything so the code uses TypeRefs now instead of
26992 Types. TypeRefs are just temporary type placeholders, that need
26993 to be resolved. They initially have a pointer to a string and the
26994 current scope in which they are used. This is used later by the
26995 compiler to resolve the reference to an actual Type.
26997 * DeclSpace is no longer a CIR.Type, and neither are
26998 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26999 are all DeclSpaces, but no Types.
27001 * type.cs (TypeRefManager): This implements the TypeRef manager,
27002 which keeps track of all the types that need to be resolved after
27003 the parsing has finished.
27005 2001-05-13 Miguel de Icaza <miguel@ximian.com>
27007 * ARGH. We are going to have to store `foreach' as a class rather
27008 than resolving it, as we need to verify error 1579 after name
27009 resolution. *OR* we could keep a flag that says `This request to
27010 IEnumerator comes from a foreach statement' which we can then use
27011 to generate the error.
27013 2001-05-10 Miguel de Icaza <miguel@ximian.com>
27015 * class.cs (TypeContainer.AddMethod): we now add methods to the
27016 MethodGroup instead of the method hashtable.
27018 * expression.cs: Add MethodGroup abstraction, which gets us one
27019 step closer to the specification in the way we handle method
27022 * cs-parser.jay (primary_expression): qualified_identifier now
27023 tried to match up an identifier to a local variable reference or
27024 to a parameter reference.
27026 current_local_parameters is now a parser global variable that
27027 points to the current parameters for the block, used during name
27030 (property_declaration): Now creates an implicit `value' argument to
27033 2001-05-09 Miguel de Icaza <miguel@ximian.com>
27035 * parameter.cs: Do not use `param' arguments as part of the
27036 signature, per the spec.
27038 2001-05-08 Miguel de Icaza <miguel@ximian.com>
27040 * decl.cs: Base class for classes, structs and interfaces. This
27041 is the "Declaration Space"
27043 * cs-parser.jay: Use CheckDef for checking declaration errors
27044 instead of having one on each function.
27046 * class.cs: Factor out some code for handling error handling in
27047 accordance to the "Declarations" section in the "Basic Concepts"
27048 chapter in the ECMA C# spec.
27050 * interface.cs: Make all interface member classes derive from
27051 InterfaceMemberBase.
27053 2001-05-07 Miguel de Icaza <miguel@ximian.com>
27055 * Many things: all interfaces are parsed and generated in
27056 gen-treedump. Support for member variables, constructors,
27057 destructors, properties, constants is there.
27059 Beginning of the IL backend, but very little done, just there for
27062 2001-04-29 Miguel de Icaza <miguel@ximian.com>
27064 * cs-parser.jay: Fix labeled statement.
27066 * cs-tokenizer.cs (escape): Escape " and ' always.
27067 ref_line, ref_name: keep track of the line/filename as instructed
27068 by #line by the compiler.
27071 2001-04-27 Miguel de Icaza <miguel@ximian.com>
27073 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
27074 to match the values in System.CodeDOM.
27076 Divid renamed to Divide.
27078 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
27080 (Statements.set): remove.
27082 * System.CodeDOM/CodeCatchClause.cs: always have a valid
27085 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
27086 falseStatements always have valid values.
27088 * cs-parser.jay: Use System.CodeDOM now.